Merge
diff --git a/.hgtags b/.hgtags
index 67e484c..8107aee 100644
--- a/.hgtags
+++ b/.hgtags
@@ -163,3 +163,4 @@
 b6f52911752110a2889681923992c7a0baa52ccc jdk8-b39
 b88fc3359dc7edabfa8a228855d8cebf8843c055 jdk8-b40
 4eac56f073ea8179b1a35fcd2af9b48b0088be9f jdk8-b41
+cf5c1f6fbc5ba14163fe0ef8eb8601b33f951372 jdk8-b42
diff --git a/make/com/oracle/Makefile b/make/com/oracle/Makefile
index a657750..6371886 100644
--- a/make/com/oracle/Makefile
+++ b/make/com/oracle/Makefile
@@ -30,6 +30,22 @@
 #SUBDIRS_MAKEFLAGS += JAVAC_LINT_OPTIONS=-Xlint:all,-deprecation,-path
 include $(BUILDDIR)/common/Defs.gmk
 
+JFR_SRCDIRS_EXIST := $(shell \
+  if [ -d $(CLOSED_SHARE_SRC)/native/oracle/jfr ] ; then \
+    echo true; \
+  else \
+    echo false; \
+  fi)
+
+JFR =
+ifndef OPENJDK
+  ifndef JAVASE_EMBEDDED
+    ifeq ($(JFR_SRCDIRS_EXIST), true)
+      JFR = jfr
+    endif
+  endif
+endif
+
 # build com/oracle/security/ucrypto on Solaris platform for non-OpenJDK builds
 UCRYPTO =
 ifndef OPENJDK
@@ -38,13 +54,6 @@
   endif
 endif
 
-JFR =
-ifndef OPENJDK
-ifndef JAVASE_EMBEDDED
-	JFR = jfr
-endif
-endif
-
 SUBDIRS = $(JFR) net nio util $(UCRYPTO)
 
 include $(BUILDDIR)/common/Subdirs.gmk
diff --git a/make/common/Defs-solaris.gmk b/make/common/Defs-solaris.gmk
index 5c272be..b08488f 100644
--- a/make/common/Defs-solaris.gmk
+++ b/make/common/Defs-solaris.gmk
@@ -99,6 +99,9 @@
 # variable names because the incoming option value can be overridden
 # in some situations, e.g., a VARIANT != OPT build.
 
+ADD_GNU_DEBUGLINK = $(ABS_BUILDTOOLBINDIR)/add_gnu_debuglink
+FIX_EMPTY_SEC_HDR_FLAGS = $(ABS_BUILDTOOLBINDIR)/fix_empty_sec_hdr_flags
+
 ifeq ($(VARIANT), OPT)
   FULL_DEBUG_SYMBOLS ?= 1
   ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
@@ -113,26 +116,11 @@
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
   # Default OBJCOPY comes from the SUNWbinutils package:
   DEF_OBJCOPY=/usr/sfw/bin/gobjcopy
-  ifeq ($(PLATFORM)-$(LIBARCH), solaris-amd64)
-    # On Solaris AMD64/X64, gobjcopy is not happy and fails:
-    #
-    # usr/sfw/bin/gobjcopy --add-gnu-debuglink=<lib>.debuginfo <lib>.so
-    # BFD: stKPaiop: Not enough room for program headers, try linking with -N
-    # /usr/sfw/bin/gobjcopy: stKPaiop: Bad value
-    # BFD: stKPaiop: Not enough room for program headers, try linking with -N
-    # /usr/sfw/bin/gobjcopy: libsaproc.debuginfo: Bad value
-    # BFD: stKPaiop: Not enough room for program headers, try linking with -N
-    # /usr/sfw/bin/gobjcopy: stKPaiop: Bad value
-    _JUNK_ := $(shell \
-      echo >&2 "INFO: $(DEF_OBJCOPY) is not working on Solaris AMD64/X64")
-    OBJCOPY=
-  else
-    OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
-    ifneq ($(ALT_OBJCOPY),)
-      _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
-      # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path
-      OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
-    endif
+  OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
+  ifneq ($(ALT_OBJCOPY),)
+    _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
+    # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path
+    OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
   endif
 
   # Setting ENABLE_FULL_DEBUG_SYMBOLS=1 (and OBJCOPY) above enables the
@@ -243,18 +231,21 @@
 # optimization flags as used by FASTDEBUG. We also want all the
 # debug info in one place (-xs).
 #
+CFLAGS_COMMON=
+CXXFLAGS_COMMON=
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
   ifeq ($(LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS),1)
     ifeq ($(VARIANT), OPT)
-      CC_OPT   = -g  -xs $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
-      CXX_OPT  = -g0 -xs $(CXX_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
+      OPTIMIZATION_LEVEL = $(FASTDEBUG_OPTIMIZATION_LEVEL)
+      CFLAGS_COMMON += -g  -xs
+      CXXFLAGS_COMMON += -g0 -xs
     endif
     CFLAGS_DEBUG_OPTION    += -xs
     CXXFLAGS_DEBUG_OPTION  += -xs
   endif
 endif
 
-CFLAGS_COMMON   = -L$(OBJDIR)
+CFLAGS_COMMON  += -L$(OBJDIR)
 
 # Do not allow C99 language features like declarations in code etc.
 CFLAGS_COMMON  += -xc99=%none
diff --git a/make/common/Defs.gmk b/make/common/Defs.gmk
index e92eed9..70ce778 100644
--- a/make/common/Defs.gmk
+++ b/make/common/Defs.gmk
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -297,6 +297,7 @@
 ABS_BUILDTOOLJARDIR = $(ABS_OUTPUTDIR)/btjars
 # for generated tool class files
 BUILDTOOLBINDIR     = $(OUTPUTDIR)/btbins
+ABS_BUILDTOOLBINDIR = $(ABS_OUTPUTDIR)/btbins
 # for generated java source files
 GENSRCDIR           = $(OUTPUTDIR)/gensrc
 # for generated C source files (not javah)
diff --git a/make/common/Library.gmk b/make/common/Library.gmk
index 2583e83..7b47adf 100644
--- a/make/common/Library.gmk
+++ b/make/common/Library.gmk
@@ -245,6 +245,12 @@
   ARFLAGS = -r
 endif
 
+ifeq ($(PLATFORM), solaris)
+  ifeq ($(LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS),1)
+$(ACTUAL_LIBRARY):: $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS)
+  endif
+endif
+
 $(ACTUAL_LIBRARY):: $(COMPILE_FILES_o) $(FILES_m) $(FILES_reorder)
 	@$(prep-target)
 	@$(ECHO) "STATS: LIBRARY=$(LIBRARY), PRODUCT=$(PRODUCT), OPTIMIZATION_LEVEL=$(OPTIMIZATION_LEVEL)"
@@ -260,11 +266,29 @@
   ifneq ($(PLATFORM), macosx)
     ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
       ifeq ($(LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS),1)
+        ifeq ($(PLATFORM), solaris)
+# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
+# Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
+# empty section headers until a fixed $(OBJCOPY) is available.
+# An empty section header has sh_addr == 0 and sh_size == 0.
+# This problem has only been seen on Solaris X64, but we call this tool
+# on all Solaris builds just in case.
+#
+# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
+# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
 	(set -e ; \
 	 $(CD) $(@D) ; \
-	 $(OBJCOPY) --only-keep-debug $(@F) $(LIBRARY).debuginfo ; \
-	 $(OBJCOPY) --add-gnu-debuglink=$(LIBRARY).debuginfo $(@F) ; \
+	 $(FIX_EMPTY_SEC_HDR_FLAGS) $(@F) ; \
+	 $(OBJCOPY) --only-keep-debug $(@F) $(LIB_PREFIX)$(LIBRARY).debuginfo ; \
+         $(ADD_GNU_DEBUGLINK) $(LIB_PREFIX)$(LIBRARY).debuginfo $(@F) ; \
 	)
+        else # PLATFORM != solaris
+	(set -e ; \
+	 $(CD) $(@D) ; \
+	 $(OBJCOPY) --only-keep-debug $(@F) $(LIB_PREFIX)$(LIBRARY).debuginfo ; \
+	 $(OBJCOPY) --add-gnu-debuglink=$(LIB_PREFIX)$(LIBRARY).debuginfo $(@F) ; \
+	)
+        endif # PLATFORM == solaris
         ifeq ($(STRIP_POLICY),all_strip)
 	  $(STRIP) $@
         else
@@ -281,8 +305,8 @@
         ifeq ($(ZIP_DEBUGINFO_FILES),1)
 	  (set -e ; \
 	   $(CD) $(@D) ; \
-	   $(ZIPEXE) -q $(LIBRARY).diz $(LIBRARY).debuginfo ; \
-	   $(RM) $(LIBRARY).debuginfo ; \
+	   $(ZIPEXE) -q $(LIB_PREFIX)$(LIBRARY).diz $(LIB_PREFIX)$(LIBRARY).debuginfo ; \
+	   $(RM) $(LIB_PREFIX)$(LIBRARY).debuginfo ; \
 	  )
         endif
       endif # LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS
diff --git a/make/common/Program.gmk b/make/common/Program.gmk
index 4e211d8..f6228d4 100644
--- a/make/common/Program.gmk
+++ b/make/common/Program.gmk
@@ -230,6 +230,13 @@
   #
   # This rule only applies on unix.  It supports quantify and its ilk.
   #
+
+  ifeq ($(PLATFORM), solaris)
+    ifeq ($(PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS),1)
+  $(ACTUAL_PROGRAM):: $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS)
+    endif
+  endif
+
   $(ACTUAL_PROGRAM):: $(FILES_o)
 	@$(prep-target)
 	@set -- $?; \
@@ -244,11 +251,29 @@
   ifneq ($(PLATFORM), macosx)
     ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
       ifeq ($(PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS),1)
+        ifeq ($(PLATFORM), solaris)
+# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
+# Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
+# empty section headers until a fixed $(OBJCOPY) is available.
+# An empty section header has sh_addr == 0 and sh_size == 0.
+# This problem has only been seen on Solaris X64, but we call this tool
+# on all Solaris builds just in case.
+#
+# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
+# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
+	(set -e ; \
+	 $(CD) $(@D) ; \
+	 $(FIX_EMPTY_SEC_HDR_FLAGS) $(@F) ; \
+	 $(OBJCOPY) --only-keep-debug $(@F) $(@F).debuginfo ; \
+         $(ADD_GNU_DEBUGLINK) $(@F).debuginfo $(@F) ; \
+	)
+        else # PLATFORM != solaris
 	(set -e ; \
 	 $(CD) $(@D) ; \
 	 $(OBJCOPY) --only-keep-debug $(@F) $(@F).debuginfo ; \
 	 $(OBJCOPY) --add-gnu-debuglink=$(@F).debuginfo $(@F) ; \
 	)
+        endif # PLATFORM == solaris
         ifeq ($(STRIP_POLICY),all_strip)
 	  $(STRIP) $@
         else
diff --git a/make/java/java/FILES_c.gmk b/make/java/java/FILES_c.gmk
index a8256b7..2fa706b 100644
--- a/make/java/java/FILES_c.gmk
+++ b/make/java/java/FILES_c.gmk
@@ -69,7 +69,6 @@
 	jdk_util_md.c \
 	check_version.c \
 	java_props_md.c \
-	DriverManager.c \
 	ConstantPool.c \
 	MessageUtils.c \
 	GC.c \
diff --git a/make/java/java/FILES_java.gmk b/make/java/java/FILES_java.gmk
index 01529b4..ddcc92e 100644
--- a/make/java/java/FILES_java.gmk
+++ b/make/java/java/FILES_java.gmk
@@ -482,6 +482,7 @@
     sun/misc/JavaNioAccess.java \
     sun/misc/Perf.java \
     sun/misc/PerfCounter.java \
+    sun/misc/Hashing.java \
     sun/net/www/protocol/jar/Handler.java \
     sun/net/www/protocol/jar/JarURLConnection.java \
     sun/net/www/protocol/file/Handler.java \
diff --git a/make/java/java/mapfile-vers b/make/java/java/mapfile-vers
index 8517e71..23cca53 100644
--- a/make/java/java/mapfile-vers
+++ b/make/java/java/mapfile-vers
@@ -232,7 +232,6 @@
 		Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2Ljava_security_AccessControlContext_2;
 		Java_java_security_AccessController_getStackAccessControlContext;
 		Java_java_security_AccessController_getInheritedAccessControlContext;
-		Java_java_sql_DriverManager_getCallerClassLoader;
 		Java_java_util_ResourceBundle_getClassContext;
 		Java_java_util_TimeZone_getSystemTimeZoneID;
 		Java_java_util_TimeZone_getSystemGMTOffsetID;
diff --git a/make/java/nio/Makefile b/make/java/nio/Makefile
index 76f746c..9b9ef88 100644
--- a/make/java/nio/Makefile
+++ b/make/java/nio/Makefile
@@ -55,6 +55,9 @@
 	sun/nio/ch/DevPollArrayWrapper.java \
 	sun/nio/ch/DevPollSelectorImpl.java \
         sun/nio/ch/DevPollSelectorProvider.java \
+	sun/nio/ch/EventPortSelectorImpl.java \
+	sun/nio/ch/EventPortSelectorProvider.java \
+	sun/nio/ch/EventPortWrapper.java \
 	sun/nio/ch/InheritedChannel.java \
         sun/nio/ch/PollSelectorProvider.java \
         sun/nio/ch/PollSelectorImpl.java \
diff --git a/make/java/nio/mapfile-linux b/make/java/nio/mapfile-linux
index d722441..6115310 100644
--- a/make/java/nio/mapfile-linux
+++ b/make/java/nio/mapfile-linux
@@ -39,7 +39,6 @@
                 Java_sun_nio_ch_EPollArrayWrapper_epollCreate;
                 Java_sun_nio_ch_EPollArrayWrapper_epollCtl;
                 Java_sun_nio_ch_EPollArrayWrapper_epollWait;
-		Java_sun_nio_ch_EPollArrayWrapper_fdLimit;
 		Java_sun_nio_ch_EPollArrayWrapper_init;
 		Java_sun_nio_ch_EPollArrayWrapper_interrupt;
 		Java_sun_nio_ch_EPollArrayWrapper_offsetofData;
@@ -87,6 +86,7 @@
                 Java_sun_nio_ch_IOUtil_configureBlocking;
                 Java_sun_nio_ch_IOUtil_drain;
                 Java_sun_nio_ch_IOUtil_fdVal;
+		Java_sun_nio_ch_IOUtil_fdLimit;
                 Java_sun_nio_ch_IOUtil_initIDs;
                 Java_sun_nio_ch_IOUtil_makePipe;
                 Java_sun_nio_ch_IOUtil_randomBytes;
diff --git a/make/java/nio/mapfile-solaris b/make/java/nio/mapfile-solaris
index 4d86f28..7767d13 100644
--- a/make/java/nio/mapfile-solaris
+++ b/make/java/nio/mapfile-solaris
@@ -36,7 +36,6 @@
                 Java_sun_nio_ch_DatagramDispatcher_readv0;
                 Java_sun_nio_ch_DatagramDispatcher_write0;
                 Java_sun_nio_ch_DatagramDispatcher_writev0;
-                Java_sun_nio_ch_DevPollArrayWrapper_fdLimit;
                 Java_sun_nio_ch_DevPollArrayWrapper_init;
                 Java_sun_nio_ch_DevPollArrayWrapper_interrupt;
                 Java_sun_nio_ch_DevPollArrayWrapper_poll0;
@@ -74,6 +73,7 @@
 		Java_sun_nio_ch_InheritedChannel_soType0;
                 Java_sun_nio_ch_IOUtil_configureBlocking;
                 Java_sun_nio_ch_IOUtil_drain;
+		Java_sun_nio_ch_IOUtil_fdLimit;
                 Java_sun_nio_ch_IOUtil_fdVal;
                 Java_sun_nio_ch_IOUtil_initIDs;
                 Java_sun_nio_ch_IOUtil_makePipe;
@@ -112,13 +112,13 @@
 		Java_sun_nio_ch_UnixAsynchronousServerSocketChannelImpl_accept0;
 		Java_sun_nio_ch_UnixAsynchronousServerSocketChannelImpl_initIDs;
 		Java_sun_nio_ch_UnixAsynchronousSocketChannelImpl_checkConnect;
-		Java_sun_nio_ch_SolarisEventPort_init;
-		Java_sun_nio_ch_SolarisEventPort_portCreate;
-		Java_sun_nio_ch_SolarisEventPort_portClose;
-		Java_sun_nio_ch_SolarisEventPort_portAssociate;
-		Java_sun_nio_ch_SolarisEventPort_portGet;
-		Java_sun_nio_ch_SolarisEventPort_portGetn;
-		Java_sun_nio_ch_SolarisEventPort_portSend;
+		Java_sun_nio_ch_SolarisEventPort_port_1create;
+		Java_sun_nio_ch_SolarisEventPort_port_1close;
+		Java_sun_nio_ch_SolarisEventPort_port_1associate;
+		Java_sun_nio_ch_SolarisEventPort_port_1dissociate;
+		Java_sun_nio_ch_SolarisEventPort_port_1get;
+		Java_sun_nio_ch_SolarisEventPort_port_1getn;
+		Java_sun_nio_ch_SolarisEventPort_port_1send;
 		Java_sun_nio_fs_GnomeFileTypeDetector_initializeGio;
 		Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGio;
 		Java_sun_nio_fs_GnomeFileTypeDetector_initializeGnomeVfs;
diff --git a/make/jprt.properties b/make/jprt.properties
index 2e4e0fb..f41a227 100644
--- a/make/jprt.properties
+++ b/make/jprt.properties
@@ -89,6 +89,7 @@
     ${jprt.my.test.target.set:TESTNAME=jdk_text},               \
     ${jprt.my.test.target.set:TESTNAME=jdk_tools1},             \
     ${jprt.my.test.target.set:TESTNAME=jdk_tools2},             \
+    ${jprt.my.test.target.set:TESTNAME=jdk_jfr},                \
     ${jprt.my.test.target.set:TESTNAME=jdk_misc}
 
 # All vm test targets (testset=all)
diff --git a/make/netbeans/jconsole/build.xml b/make/netbeans/jconsole/build.xml
index a696067..9c1fc95 100644
--- a/make/netbeans/jconsole/build.xml
+++ b/make/netbeans/jconsole/build.xml
@@ -50,6 +50,7 @@
             <fileset dir="${classes.dir}">
                 <include name="sun/tools/jconsole/**/*.class"/>
                 <include name="com/sun/tools/jconsole/**/*.class"/>
+                <include name="sun/tools/jconsole/resources/*.properties"/>
                 <include name="sun/tools/jconsole/resources/*.gif"/>
                 <include name="sun/tools/jconsole/resources/*.png"/>
             </fileset>
diff --git a/make/sun/font/Makefile b/make/sun/font/Makefile
index 5dd35dd..b449b5a 100644
--- a/make/sun/font/Makefile
+++ b/make/sun/font/Makefile
@@ -90,6 +90,12 @@
 
 endif # PLATFORM
 
+# Turn off aliasing with GCC for ExtensionSubtables.cpp
+ifeq ($(PLATFORM), linux)
+  CXXFLAGS += $(CXXFLAGS_$(@F))
+  CXXFLAGS_ExtensionSubtables.o = -fno-strict-aliasing
+endif
+
 #In the non-OpenJDK mode we need to build T2K
 ifndef OPENJDK
 t2k:
diff --git a/make/sun/jconsole/FILES.gmk b/make/sun/jconsole/FILES.gmk
index 61085e6..8fc34ac 100644
--- a/make/sun/jconsole/FILES.gmk
+++ b/make/sun/jconsole/FILES.gmk
@@ -30,17 +30,22 @@
 MANIFEST = sun/tools/jconsole/manifest
 
 PNG_FILES = \
-	sun/tools/jconsole/resources/brandlogo.png \
-	sun/tools/jconsole/resources/collapse-winlf.png \
-	sun/tools/jconsole/resources/connected16.png \
-	sun/tools/jconsole/resources/connected24.png \
-	sun/tools/jconsole/resources/disconnected16.png \
-	sun/tools/jconsole/resources/disconnected24.png \
-	sun/tools/jconsole/resources/expand-winlf.png \
-	sun/tools/jconsole/resources/masthead-left.png \
-	sun/tools/jconsole/resources/masthead-right.png
+  sun/tools/jconsole/resources/brandlogo.png \
+  sun/tools/jconsole/resources/collapse-winlf.png \
+  sun/tools/jconsole/resources/connected16.png \
+  sun/tools/jconsole/resources/connected24.png \
+  sun/tools/jconsole/resources/disconnected16.png \
+  sun/tools/jconsole/resources/disconnected24.png \
+  sun/tools/jconsole/resources/expand-winlf.png \
+  sun/tools/jconsole/resources/masthead-left.png \
+  sun/tools/jconsole/resources/masthead-right.png
 
 GIF_FILES = \
-	sun/tools/jconsole/resources/mbean.gif \
-	sun/tools/jconsole/resources/mbeanserverdelegate.gif \
-	sun/tools/jconsole/resources/xobject.gif
+  sun/tools/jconsole/resources/mbean.gif \
+  sun/tools/jconsole/resources/mbeanserverdelegate.gif \
+  sun/tools/jconsole/resources/xobject.gif
+
+PROP_FILES = \
+  sun/tools/jconsole/resources/messages.properties \
+  sun/tools/jconsole/resources/messages_ja.properties \
+  sun/tools/jconsole/resources/messages_zh_CN.properties
diff --git a/make/sun/jconsole/Makefile b/make/sun/jconsole/Makefile
index da0200d..c2651ce 100644
--- a/make/sun/jconsole/Makefile
+++ b/make/sun/jconsole/Makefile
@@ -53,21 +53,21 @@
 
 FILES_png = $(PNG_FILES:%.png=$(CLASSBINDIR)/%.png)
 FILES_gif = $(GIF_FILES:%.gif=$(CLASSBINDIR)/%.gif)
-
+FILES_prop = $(PROP_FILES:%.properties=$(CLASSBINDIR)/%.properties)
 build: $(GENSRCDIR)/sun/tools/jconsole/Version.java
 
 #
 # Resources
 #
 LOCALE_SET_DEFINITION = jdk
-RESOURCE_BUNDLES_JAVA = $(PKGDIR)/resources/JConsoleResources.java
+RESOURCE_BUNDLES_UNCOMPILED_PROPERTIES = $(PKGDIR)/resources/messages.properties
 
 #
 # Rules.
 #
 include $(BUILDDIR)/common/Classes.gmk
 
-build: $(FILES_png) $(FILES_gif) $(TEMPDIR)/manifest $(JARFILE)
+build: $(FILES_png) $(FILES_gif) $(FILES_prop) $(TEMPDIR)/manifest $(JARFILE)
 
 $(GENSRCDIR)/sun/tools/jconsole/Version.java: \
                 $(SHARE_SRC)/classes/sun/tools/jconsole/Version.java.template
@@ -85,7 +85,7 @@
 # Extra rule to build jconsole.jar
 #
 
-$(JARFILE): $(LIBDIR) $(FILES_class) $(FILES_png) $(FILES_gif) $(TEMPDIR)/manifest
+$(JARFILE): $(LIBDIR) $(FILES_class) $(FILES_png) $(FILES_gif) $(FILES_prop) $(TEMPDIR)/manifest
 	$(BOOT_JAR_CMD) -cfm $(JARFILE) $(TEMPDIR)/manifest \
                -C $(CLASSBINDIR) sun/tools/jconsole \
                -C $(CLASSBINDIR) com/sun/tools/jconsole \
diff --git a/make/tools/CharsetMapping/GBK.map b/make/tools/CharsetMapping/GBK.map
index 153f238..edef587 100644
--- a/make/tools/CharsetMapping/GBK.map
+++ b/make/tools/CharsetMapping/GBK.map
@@ -3,6 +3,10 @@
 # (1)sorted
 # (2)added the singlebyte entries
 #
+# (3)updated 0xA140-0xA7A0 mappings to follow GB18030/MS936
+# (4)added euro sign entry A2E3 20AC (instead of 0xA2E3  0xE76C)
+#    this is what gb18030 does.
+#
 0x00	0x0000
 0x01	0x0001
 0x02	0x0002
@@ -6508,12 +6512,12 @@
 0xA2A8	0x2177
 0xA2A9	0x2178
 0xA2AA	0x2179
-0xA2AB	0xE586
-0xA2AC	0xE587
-0xA2AD	0xE588
-0xA2AE	0xE589
-0xA2AF	0xE58A
-0xA2B0	0xE58B
+0xA2AB	0xE766
+0xA2AC	0xE767
+0xA2AD	0xE768
+0xA2AE	0xE769
+0xA2AF	0xE76A
+0xA2B0	0xE76B
 0xA2B1	0x2488
 0xA2B2	0x2489
 0xA2B3	0x248A
@@ -6564,8 +6568,8 @@
 0xA2E0	0x2467
 0xA2E1	0x2468
 0xA2E2	0x2469
-0xA2E3	0xE58C
-0xA2E4	0xE58D
+0xA2E3	0x20AC
+0xA2E4	0xE76D
 0xA2E5	0x3220
 0xA2E6	0x3221
 0xA2E7	0x3222
@@ -6576,8 +6580,8 @@
 0xA2EC	0x3227
 0xA2ED	0x3228
 0xA2EE	0x3229
-0xA2EF	0xE58E
-0xA2F0	0xE58F
+0xA2EF	0xE76E
+0xA2F0	0xE76F
 0xA2F1	0x2160
 0xA2F2	0x2161
 0xA2F3	0x2162
@@ -6590,104 +6594,104 @@
 0xA2FA	0x2169
 0xA2FB	0x216A
 0xA2FC	0x216B
-0xA2FD	0xE590
-0xA2FE	0xE591
-0xA340	0xE592
-0xA341	0xE593
-0xA342	0xE594
-0xA343	0xE595
-0xA344	0xE596
-0xA345	0xE597
-0xA346	0xE598
-0xA347	0xE599
-0xA348	0xE59A
-0xA349	0xE59B
-0xA34A	0xE59C
-0xA34B	0xE59D
-0xA34C	0xE59E
-0xA34D	0xE59F
-0xA34E	0xE5A0
-0xA34F	0xE5A1
-0xA350	0xE5A2
-0xA351	0xE5A3
-0xA352	0xE5A4
-0xA353	0xE5A5
-0xA354	0xE5A6
-0xA355	0xE5A7
-0xA356	0xE5A8
-0xA357	0xE5A9
-0xA358	0xE5AA
-0xA359	0xE5AB
-0xA35A	0xE5AC
-0xA35B	0xE5AD
-0xA35C	0xE5AE
-0xA35D	0xE5AF
-0xA35E	0xE5B0
-0xA35F	0xE5B1
-0xA360	0xE5B2
-0xA361	0xE5B3
-0xA362	0xE5B4
-0xA363	0xE5B5
-0xA364	0xE5B6
-0xA365	0xE5B7
-0xA366	0xE5B8
-0xA367	0xE5B9
-0xA368	0xE5BA
-0xA369	0xE5BB
-0xA36A	0xE5BC
-0xA36B	0xE5BD
-0xA36C	0xE5BE
-0xA36D	0xE5BF
-0xA36E	0xE5C0
-0xA36F	0xE5C1
-0xA370	0xE5C2
-0xA371	0xE5C3
-0xA372	0xE5C4
-0xA373	0xE5C5
-0xA374	0xE5C6
-0xA375	0xE5C7
-0xA376	0xE5C8
-0xA377	0xE5C9
-0xA378	0xE5CA
-0xA379	0xE5CB
-0xA37A	0xE5CC
-0xA37B	0xE5CD
-0xA37C	0xE5CE
-0xA37D	0xE5CF
-0xA37E	0xE5D0
-0xA380	0xE5D1
-0xA381	0xE5D2
-0xA382	0xE5D3
-0xA383	0xE5D4
-0xA384	0xE5D5
-0xA385	0xE5D6
-0xA386	0xE5D7
-0xA387	0xE5D8
-0xA388	0xE5D9
-0xA389	0xE5DA
-0xA38A	0xE5DB
-0xA38B	0xE5DC
-0xA38C	0xE5DD
-0xA38D	0xE5DE
-0xA38E	0xE5DF
-0xA38F	0xE5E0
-0xA390	0xE5E1
-0xA391	0xE5E2
-0xA392	0xE5E3
-0xA393	0xE5E4
-0xA394	0xE5E5
-0xA395	0xE5E6
-0xA396	0xE5E7
-0xA397	0xE5E8
-0xA398	0xE5E9
-0xA399	0xE5EA
-0xA39A	0xE5EB
-0xA39B	0xE5EC
-0xA39C	0xE5ED
-0xA39D	0xE5EE
-0xA39E	0xE5EF
-0xA39F	0xE5F0
-0xA3A0	0xE5F1
+0xA2FD	0xE770
+0xA2FE	0xE771
+0xA340	0xE586
+0xA341	0xE587
+0xA342	0xE588
+0xA343	0xE589
+0xA344	0xE58A
+0xA345	0xE58B
+0xA346	0xE58C
+0xA347	0xE58D
+0xA348	0xE58E
+0xA349	0xE58F
+0xA34A	0xE590
+0xA34B	0xE591
+0xA34C	0xE592
+0xA34D	0xE593
+0xA34E	0xE594
+0xA34F	0xE595
+0xA350	0xE596
+0xA351	0xE597
+0xA352	0xE598
+0xA353	0xE599
+0xA354	0xE59A
+0xA355	0xE59B
+0xA356	0xE59C
+0xA357	0xE59D
+0xA358	0xE59E
+0xA359	0xE59F
+0xA35A	0xE5A0
+0xA35B	0xE5A1
+0xA35C	0xE5A2
+0xA35D	0xE5A3
+0xA35E	0xE5A4
+0xA35F	0xE5A5
+0xA360	0xE5A6
+0xA361	0xE5A7
+0xA362	0xE5A8
+0xA363	0xE5A9
+0xA364	0xE5AA
+0xA365	0xE5AB
+0xA366	0xE5AC
+0xA367	0xE5AD
+0xA368	0xE5AE
+0xA369	0xE5AF
+0xA36A	0xE5B0
+0xA36B	0xE5B1
+0xA36C	0xE5B2
+0xA36D	0xE5B3
+0xA36E	0xE5B4
+0xA36F	0xE5B5
+0xA370	0xE5B6
+0xA371	0xE5B7
+0xA372	0xE5B8
+0xA373	0xE5B9
+0xA374	0xE5BA
+0xA375	0xE5BB
+0xA376	0xE5BC
+0xA377	0xE5BD
+0xA378	0xE5BE
+0xA379	0xE5BF
+0xA37A	0xE5C0
+0xA37B	0xE5C1
+0xA37C	0xE5C2
+0xA37D	0xE5C3
+0xA37E	0xE5C4
+0xA380	0xE5C5
+0xA381	0xE5C6
+0xA382	0xE5C7
+0xA383	0xE5C8
+0xA384	0xE5C9
+0xA385	0xE5CA
+0xA386	0xE5CB
+0xA387	0xE5CC
+0xA388	0xE5CD
+0xA389	0xE5CE
+0xA38A	0xE5CF
+0xA38B	0xE5D0
+0xA38C	0xE5D1
+0xA38D	0xE5D2
+0xA38E	0xE5D3
+0xA38F	0xE5D4
+0xA390	0xE5D5
+0xA391	0xE5D6
+0xA392	0xE5D7
+0xA393	0xE5D8
+0xA394	0xE5D9
+0xA395	0xE5DA
+0xA396	0xE5DB
+0xA397	0xE5DC
+0xA398	0xE5DD
+0xA399	0xE5DE
+0xA39A	0xE5DF
+0xA39B	0xE5E0
+0xA39C	0xE5E1
+0xA39D	0xE5E2
+0xA39E	0xE5E3
+0xA39F	0xE5E4
+0xA3A0	0xE5E5
 0xA3A1	0xFF01
 0xA3A2	0xFF02
 0xA3A3	0xFF03
@@ -6782,102 +6786,102 @@
 0xA3FC	0xFF5C
 0xA3FD	0xFF5D
 0xA3FE	0xFFE3
-0xA440	0xE5F2
-0xA441	0xE5F3
-0xA442	0xE5F4
-0xA443	0xE5F5
-0xA444	0xE5F6
-0xA445	0xE5F7
-0xA446	0xE5F8
-0xA447	0xE5F9
-0xA448	0xE5FA
-0xA449	0xE5FB
-0xA44A	0xE5FC
-0xA44B	0xE5FD
-0xA44C	0xE5FE
-0xA44D	0xE5FF
-0xA44E	0xE600
-0xA44F	0xE601
-0xA450	0xE602
-0xA451	0xE603
-0xA452	0xE604
-0xA453	0xE605
-0xA454	0xE606
-0xA455	0xE607
-0xA456	0xE608
-0xA457	0xE609
-0xA458	0xE60A
-0xA459	0xE60B
-0xA45A	0xE60C
-0xA45B	0xE60D
-0xA45C	0xE60E
-0xA45D	0xE60F
-0xA45E	0xE610
-0xA45F	0xE611
-0xA460	0xE612
-0xA461	0xE613
-0xA462	0xE614
-0xA463	0xE615
-0xA464	0xE616
-0xA465	0xE617
-0xA466	0xE618
-0xA467	0xE619
-0xA468	0xE61A
-0xA469	0xE61B
-0xA46A	0xE61C
-0xA46B	0xE61D
-0xA46C	0xE61E
-0xA46D	0xE61F
-0xA46E	0xE620
-0xA46F	0xE621
-0xA470	0xE622
-0xA471	0xE623
-0xA472	0xE624
-0xA473	0xE625
-0xA474	0xE626
-0xA475	0xE627
-0xA476	0xE628
-0xA477	0xE629
-0xA478	0xE62A
-0xA479	0xE62B
-0xA47A	0xE62C
-0xA47B	0xE62D
-0xA47C	0xE62E
-0xA47D	0xE62F
-0xA47E	0xE630
-0xA480	0xE631
-0xA481	0xE632
-0xA482	0xE633
-0xA483	0xE634
-0xA484	0xE635
-0xA485	0xE636
-0xA486	0xE637
-0xA487	0xE638
-0xA488	0xE639
-0xA489	0xE63A
-0xA48A	0xE63B
-0xA48B	0xE63C
-0xA48C	0xE63D
-0xA48D	0xE63E
-0xA48E	0xE63F
-0xA48F	0xE640
-0xA490	0xE641
-0xA491	0xE642
-0xA492	0xE643
-0xA493	0xE644
-0xA494	0xE645
-0xA495	0xE646
-0xA496	0xE647
-0xA497	0xE648
-0xA498	0xE649
-0xA499	0xE64A
-0xA49A	0xE64B
-0xA49B	0xE64C
-0xA49C	0xE64D
-0xA49D	0xE64E
-0xA49E	0xE64F
-0xA49F	0xE650
-0xA4A0	0xE651
+0xA440	0xE5E6
+0xA441	0xE5E7
+0xA442	0xE5E8
+0xA443	0xE5E9
+0xA444	0xE5EA
+0xA445	0xE5EB
+0xA446	0xE5EC
+0xA447	0xE5ED
+0xA448	0xE5EE
+0xA449	0xE5EF
+0xA44A	0xE5F0
+0xA44B	0xE5F1
+0xA44C	0xE5F2
+0xA44D	0xE5F3
+0xA44E	0xE5F4
+0xA44F	0xE5F5
+0xA450	0xE5F6
+0xA451	0xE5F7
+0xA452	0xE5F8
+0xA453	0xE5F9
+0xA454	0xE5FA
+0xA455	0xE5FB
+0xA456	0xE5FC
+0xA457	0xE5FD
+0xA458	0xE5FE
+0xA459	0xE5FF
+0xA45A	0xE600
+0xA45B	0xE601
+0xA45C	0xE602
+0xA45D	0xE603
+0xA45E	0xE604
+0xA45F	0xE605
+0xA460	0xE606
+0xA461	0xE607
+0xA462	0xE608
+0xA463	0xE609
+0xA464	0xE60A
+0xA465	0xE60B
+0xA466	0xE60C
+0xA467	0xE60D
+0xA468	0xE60E
+0xA469	0xE60F
+0xA46A	0xE610
+0xA46B	0xE611
+0xA46C	0xE612
+0xA46D	0xE613
+0xA46E	0xE614
+0xA46F	0xE615
+0xA470	0xE616
+0xA471	0xE617
+0xA472	0xE618
+0xA473	0xE619
+0xA474	0xE61A
+0xA475	0xE61B
+0xA476	0xE61C
+0xA477	0xE61D
+0xA478	0xE61E
+0xA479	0xE61F
+0xA47A	0xE620
+0xA47B	0xE621
+0xA47C	0xE622
+0xA47D	0xE623
+0xA47E	0xE624
+0xA480	0xE625
+0xA481	0xE626
+0xA482	0xE627
+0xA483	0xE628
+0xA484	0xE629
+0xA485	0xE62A
+0xA486	0xE62B
+0xA487	0xE62C
+0xA488	0xE62D
+0xA489	0xE62E
+0xA48A	0xE62F
+0xA48B	0xE630
+0xA48C	0xE631
+0xA48D	0xE632
+0xA48E	0xE633
+0xA48F	0xE634
+0xA490	0xE635
+0xA491	0xE636
+0xA492	0xE637
+0xA493	0xE638
+0xA494	0xE639
+0xA495	0xE63A
+0xA496	0xE63B
+0xA497	0xE63C
+0xA498	0xE63D
+0xA499	0xE63E
+0xA49A	0xE63F
+0xA49B	0xE640
+0xA49C	0xE641
+0xA49D	0xE642
+0xA49E	0xE643
+0xA49F	0xE644
+0xA4A0	0xE645
 0xA4A1	0x3041
 0xA4A2	0x3042
 0xA4A3	0x3043
@@ -6961,113 +6965,113 @@
 0xA4F1	0x3091
 0xA4F2	0x3092
 0xA4F3	0x3093
-0xA4F4	0xE652
-0xA4F5	0xE653
-0xA4F6	0xE654
-0xA4F7	0xE655
-0xA4F8	0xE656
-0xA4F9	0xE657
-0xA4FA	0xE658
-0xA4FB	0xE659
-0xA4FC	0xE65A
-0xA4FD	0xE65B
-0xA4FE	0xE65C
-0xA540	0xE65D
-0xA541	0xE65E
-0xA542	0xE65F
-0xA543	0xE660
-0xA544	0xE661
-0xA545	0xE662
-0xA546	0xE663
-0xA547	0xE664
-0xA548	0xE665
-0xA549	0xE666
-0xA54A	0xE667
-0xA54B	0xE668
-0xA54C	0xE669
-0xA54D	0xE66A
-0xA54E	0xE66B
-0xA54F	0xE66C
-0xA550	0xE66D
-0xA551	0xE66E
-0xA552	0xE66F
-0xA553	0xE670
-0xA554	0xE671
-0xA555	0xE672
-0xA556	0xE673
-0xA557	0xE674
-0xA558	0xE675
-0xA559	0xE676
-0xA55A	0xE677
-0xA55B	0xE678
-0xA55C	0xE679
-0xA55D	0xE67A
-0xA55E	0xE67B
-0xA55F	0xE67C
-0xA560	0xE67D
-0xA561	0xE67E
-0xA562	0xE67F
-0xA563	0xE680
-0xA564	0xE681
-0xA565	0xE682
-0xA566	0xE683
-0xA567	0xE684
-0xA568	0xE685
-0xA569	0xE686
-0xA56A	0xE687
-0xA56B	0xE688
-0xA56C	0xE689
-0xA56D	0xE68A
-0xA56E	0xE68B
-0xA56F	0xE68C
-0xA570	0xE68D
-0xA571	0xE68E
-0xA572	0xE68F
-0xA573	0xE690
-0xA574	0xE691
-0xA575	0xE692
-0xA576	0xE693
-0xA577	0xE694
-0xA578	0xE695
-0xA579	0xE696
-0xA57A	0xE697
-0xA57B	0xE698
-0xA57C	0xE699
-0xA57D	0xE69A
-0xA57E	0xE69B
-0xA580	0xE69C
-0xA581	0xE69D
-0xA582	0xE69E
-0xA583	0xE69F
-0xA584	0xE6A0
-0xA585	0xE6A1
-0xA586	0xE6A2
-0xA587	0xE6A3
-0xA588	0xE6A4
-0xA589	0xE6A5
-0xA58A	0xE6A6
-0xA58B	0xE6A7
-0xA58C	0xE6A8
-0xA58D	0xE6A9
-0xA58E	0xE6AA
-0xA58F	0xE6AB
-0xA590	0xE6AC
-0xA591	0xE6AD
-0xA592	0xE6AE
-0xA593	0xE6AF
-0xA594	0xE6B0
-0xA595	0xE6B1
-0xA596	0xE6B2
-0xA597	0xE6B3
-0xA598	0xE6B4
-0xA599	0xE6B5
-0xA59A	0xE6B6
-0xA59B	0xE6B7
-0xA59C	0xE6B8
-0xA59D	0xE6B9
-0xA59E	0xE6BA
-0xA59F	0xE6BB
-0xA5A0	0xE6BC
+0xA4F4	0xE772
+0xA4F5	0xE773
+0xA4F6	0xE774
+0xA4F7	0xE775
+0xA4F8	0xE776
+0xA4F9	0xE777
+0xA4FA	0xE778
+0xA4FB	0xE779
+0xA4FC	0xE77A
+0xA4FD	0xE77B
+0xA4FE	0xE77C
+0xA540	0xE646
+0xA541	0xE647
+0xA542	0xE648
+0xA543	0xE649
+0xA544	0xE64A
+0xA545	0xE64B
+0xA546	0xE64C
+0xA547	0xE64D
+0xA548	0xE64E
+0xA549	0xE64F
+0xA54A	0xE650
+0xA54B	0xE651
+0xA54C	0xE652
+0xA54D	0xE653
+0xA54E	0xE654
+0xA54F	0xE655
+0xA550	0xE656
+0xA551	0xE657
+0xA552	0xE658
+0xA553	0xE659
+0xA554	0xE65A
+0xA555	0xE65B
+0xA556	0xE65C
+0xA557	0xE65D
+0xA558	0xE65E
+0xA559	0xE65F
+0xA55A	0xE660
+0xA55B	0xE661
+0xA55C	0xE662
+0xA55D	0xE663
+0xA55E	0xE664
+0xA55F	0xE665
+0xA560	0xE666
+0xA561	0xE667
+0xA562	0xE668
+0xA563	0xE669
+0xA564	0xE66A
+0xA565	0xE66B
+0xA566	0xE66C
+0xA567	0xE66D
+0xA568	0xE66E
+0xA569	0xE66F
+0xA56A	0xE670
+0xA56B	0xE671
+0xA56C	0xE672
+0xA56D	0xE673
+0xA56E	0xE674
+0xA56F	0xE675
+0xA570	0xE676
+0xA571	0xE677
+0xA572	0xE678
+0xA573	0xE679
+0xA574	0xE67A
+0xA575	0xE67B
+0xA576	0xE67C
+0xA577	0xE67D
+0xA578	0xE67E
+0xA579	0xE67F
+0xA57A	0xE680
+0xA57B	0xE681
+0xA57C	0xE682
+0xA57D	0xE683
+0xA57E	0xE684
+0xA580	0xE685
+0xA581	0xE686
+0xA582	0xE687
+0xA583	0xE688
+0xA584	0xE689
+0xA585	0xE68A
+0xA586	0xE68B
+0xA587	0xE68C
+0xA588	0xE68D
+0xA589	0xE68E
+0xA58A	0xE68F
+0xA58B	0xE690
+0xA58C	0xE691
+0xA58D	0xE692
+0xA58E	0xE693
+0xA58F	0xE694
+0xA590	0xE695
+0xA591	0xE696
+0xA592	0xE697
+0xA593	0xE698
+0xA594	0xE699
+0xA595	0xE69A
+0xA596	0xE69B
+0xA597	0xE69C
+0xA598	0xE69D
+0xA599	0xE69E
+0xA59A	0xE69F
+0xA59B	0xE6A0
+0xA59C	0xE6A1
+0xA59D	0xE6A2
+0xA59E	0xE6A3
+0xA59F	0xE6A4
+0xA5A0	0xE6A5
 0xA5A1	0x30A1
 0xA5A2	0x30A2
 0xA5A3	0x30A3
@@ -7154,110 +7158,110 @@
 0xA5F4	0x30F4
 0xA5F5	0x30F5
 0xA5F6	0x30F6
-0xA5F7	0xE6BD
-0xA5F8	0xE6BE
-0xA5F9	0xE6BF
-0xA5FA	0xE6C0
-0xA5FB	0xE6C1
-0xA5FC	0xE6C2
-0xA5FD	0xE6C3
-0xA5FE	0xE6C4
-0xA640	0xE6C5
-0xA641	0xE6C6
-0xA642	0xE6C7
-0xA643	0xE6C8
-0xA644	0xE6C9
-0xA645	0xE6CA
-0xA646	0xE6CB
-0xA647	0xE6CC
-0xA648	0xE6CD
-0xA649	0xE6CE
-0xA64A	0xE6CF
-0xA64B	0xE6D0
-0xA64C	0xE6D1
-0xA64D	0xE6D2
-0xA64E	0xE6D3
-0xA64F	0xE6D4
-0xA650	0xE6D5
-0xA651	0xE6D6
-0xA652	0xE6D7
-0xA653	0xE6D8
-0xA654	0xE6D9
-0xA655	0xE6DA
-0xA656	0xE6DB
-0xA657	0xE6DC
-0xA658	0xE6DD
-0xA659	0xE6DE
-0xA65A	0xE6DF
-0xA65B	0xE6E0
-0xA65C	0xE6E1
-0xA65D	0xE6E2
-0xA65E	0xE6E3
-0xA65F	0xE6E4
-0xA660	0xE6E5
-0xA661	0xE6E6
-0xA662	0xE6E7
-0xA663	0xE6E8
-0xA664	0xE6E9
-0xA665	0xE6EA
-0xA666	0xE6EB
-0xA667	0xE6EC
-0xA668	0xE6ED
-0xA669	0xE6EE
-0xA66A	0xE6EF
-0xA66B	0xE6F0
-0xA66C	0xE6F1
-0xA66D	0xE6F2
-0xA66E	0xE6F3
-0xA66F	0xE6F4
-0xA670	0xE6F5
-0xA671	0xE6F6
-0xA672	0xE6F7
-0xA673	0xE6F8
-0xA674	0xE6F9
-0xA675	0xE6FA
-0xA676	0xE6FB
-0xA677	0xE6FC
-0xA678	0xE6FD
-0xA679	0xE6FE
-0xA67A	0xE6FF
-0xA67B	0xE700
-0xA67C	0xE701
-0xA67D	0xE702
-0xA67E	0xE703
-0xA680	0xE704
-0xA681	0xE705
-0xA682	0xE706
-0xA683	0xE707
-0xA684	0xE708
-0xA685	0xE709
-0xA686	0xE70A
-0xA687	0xE70B
-0xA688	0xE70C
-0xA689	0xE70D
-0xA68A	0xE70E
-0xA68B	0xE70F
-0xA68C	0xE710
-0xA68D	0xE711
-0xA68E	0xE712
-0xA68F	0xE713
-0xA690	0xE714
-0xA691	0xE715
-0xA692	0xE716
-0xA693	0xE717
-0xA694	0xE718
-0xA695	0xE719
-0xA696	0xE71A
-0xA697	0xE71B
-0xA698	0xE71C
-0xA699	0xE71D
-0xA69A	0xE71E
-0xA69B	0xE71F
-0xA69C	0xE720
-0xA69D	0xE721
-0xA69E	0xE722
-0xA69F	0xE723
-0xA6A0	0xE724
+0xA5F7	0xE77D
+0xA5F8	0xE77E
+0xA5F9	0xE77F
+0xA5FA	0xE780
+0xA5FB	0xE781
+0xA5FC	0xE782
+0xA5FD	0xE783
+0xA5FE	0xE784
+0xA640	0xE6A6
+0xA641	0xE6A7
+0xA642	0xE6A8
+0xA643	0xE6A9
+0xA644	0xE6AA
+0xA645	0xE6AB
+0xA646	0xE6AC
+0xA647	0xE6AD
+0xA648	0xE6AE
+0xA649	0xE6AF
+0xA64A	0xE6B0
+0xA64B	0xE6B1
+0xA64C	0xE6B2
+0xA64D	0xE6B3
+0xA64E	0xE6B4
+0xA64F	0xE6B5
+0xA650	0xE6B6
+0xA651	0xE6B7
+0xA652	0xE6B8
+0xA653	0xE6B9
+0xA654	0xE6BA
+0xA655	0xE6BB
+0xA656	0xE6BC
+0xA657	0xE6BD
+0xA658	0xE6BE
+0xA659	0xE6BF
+0xA65A	0xE6C0
+0xA65B	0xE6C1
+0xA65C	0xE6C2
+0xA65D	0xE6C3
+0xA65E	0xE6C4
+0xA65F	0xE6C5
+0xA660	0xE6C6
+0xA661	0xE6C7
+0xA662	0xE6C8
+0xA663	0xE6C9
+0xA664	0xE6CA
+0xA665	0xE6CB
+0xA666	0xE6CC
+0xA667	0xE6CD
+0xA668	0xE6CE
+0xA669	0xE6CF
+0xA66A	0xE6D0
+0xA66B	0xE6D1
+0xA66C	0xE6D2
+0xA66D	0xE6D3
+0xA66E	0xE6D4
+0xA66F	0xE6D5
+0xA670	0xE6D6
+0xA671	0xE6D7
+0xA672	0xE6D8
+0xA673	0xE6D9
+0xA674	0xE6DA
+0xA675	0xE6DB
+0xA676	0xE6DC
+0xA677	0xE6DD
+0xA678	0xE6DE
+0xA679	0xE6DF
+0xA67A	0xE6E0
+0xA67B	0xE6E1
+0xA67C	0xE6E2
+0xA67D	0xE6E3
+0xA67E	0xE6E4
+0xA680	0xE6E5
+0xA681	0xE6E6
+0xA682	0xE6E7
+0xA683	0xE6E8
+0xA684	0xE6E9
+0xA685	0xE6EA
+0xA686	0xE6EB
+0xA687	0xE6EC
+0xA688	0xE6ED
+0xA689	0xE6EE
+0xA68A	0xE6EF
+0xA68B	0xE6F0
+0xA68C	0xE6F1
+0xA68D	0xE6F2
+0xA68E	0xE6F3
+0xA68F	0xE6F4
+0xA690	0xE6F5
+0xA691	0xE6F6
+0xA692	0xE6F7
+0xA693	0xE6F8
+0xA694	0xE6F9
+0xA695	0xE6FA
+0xA696	0xE6FB
+0xA697	0xE6FC
+0xA698	0xE6FD
+0xA699	0xE6FE
+0xA69A	0xE6FF
+0xA69B	0xE700
+0xA69C	0xE701
+0xA69D	0xE702
+0xA69E	0xE703
+0xA69F	0xE704
+0xA6A0	0xE705
 0xA6A1	0x0391
 0xA6A2	0x0392
 0xA6A3	0x0393
@@ -7282,14 +7286,14 @@
 0xA6B6	0x03A7
 0xA6B7	0x03A8
 0xA6B8	0x03A9
-0xA6B9	0xE725
-0xA6BA	0xE726
-0xA6BB	0xE727
-0xA6BC	0xE728
-0xA6BD	0xE729
-0xA6BE	0xE72A
-0xA6BF	0xE72B
-0xA6C0	0xE72C
+0xA6B9	0xE785
+0xA6BA	0xE786
+0xA6BB	0xE787
+0xA6BC	0xE788
+0xA6BD	0xE789
+0xA6BE	0xE78A
+0xA6BF	0xE78B
+0xA6C0	0xE78C
 0xA6C1	0x03B1
 0xA6C2	0x03B2
 0xA6C3	0x03B3
@@ -7314,13 +7318,13 @@
 0xA6D6	0x03C7
 0xA6D7	0x03C8
 0xA6D8	0x03C9
-0xA6D9	0xE72D
-0xA6DA	0xE72E
-0xA6DB	0xE72F
-0xA6DC	0xE730
-0xA6DD	0xE731
-0xA6DE	0xE732
-0xA6DF	0xE733
+0xA6D9	0xE78D
+0xA6DA	0xE78E
+0xA6DB	0xE78F
+0xA6DC	0xE790
+0xA6DD	0xE791
+0xA6DE	0xE792
+0xA6DF	0xE793
 0xA6E0	0xFE35
 0xA6E1	0xFE36
 0xA6E2	0xFE39
@@ -7333,121 +7337,121 @@
 0xA6E9	0xFE42
 0xA6EA	0xFE43
 0xA6EB	0xFE44
-0xA6EC	0xE734
-0xA6ED	0xE735
+0xA6EC	0xE794
+0xA6ED	0xE795
 0xA6EE	0xFE3B
 0xA6EF	0xFE3C
 0xA6F0	0xFE37
 0xA6F1	0xFE38
 0xA6F2	0xFE31
-0xA6F3	0xE736
+0xA6F3	0xE796
 0xA6F4	0xFE33
 0xA6F5	0xFE34
-0xA6F6	0xE737
-0xA6F7	0xE738
-0xA6F8	0xE739
-0xA6F9	0xE73A
-0xA6FA	0xE73B
-0xA6FB	0xE73C
-0xA6FC	0xE73D
-0xA6FD	0xE73E
-0xA6FE	0xE73F
-0xA740	0xE740
-0xA741	0xE741
-0xA742	0xE742
-0xA743	0xE743
-0xA744	0xE744
-0xA745	0xE745
-0xA746	0xE746
-0xA747	0xE747
-0xA748	0xE748
-0xA749	0xE749
-0xA74A	0xE74A
-0xA74B	0xE74B
-0xA74C	0xE74C
-0xA74D	0xE74D
-0xA74E	0xE74E
-0xA74F	0xE74F
-0xA750	0xE750
-0xA751	0xE751
-0xA752	0xE752
-0xA753	0xE753
-0xA754	0xE754
-0xA755	0xE755
-0xA756	0xE756
-0xA757	0xE757
-0xA758	0xE758
-0xA759	0xE759
-0xA75A	0xE75A
-0xA75B	0xE75B
-0xA75C	0xE75C
-0xA75D	0xE75D
-0xA75E	0xE75E
-0xA75F	0xE75F
-0xA760	0xE760
-0xA761	0xE761
-0xA762	0xE762
-0xA763	0xE763
-0xA764	0xE764
-0xA765	0xE765
-0xA766	0xE766
-0xA767	0xE767
-0xA768	0xE768
-0xA769	0xE769
-0xA76A	0xE76A
-0xA76B	0xE76B
-0xA76C	0xE76C
-0xA76D	0xE76D
-0xA76E	0xE76E
-0xA76F	0xE76F
-0xA770	0xE770
-0xA771	0xE771
-0xA772	0xE772
-0xA773	0xE773
-0xA774	0xE774
-0xA775	0xE775
-0xA776	0xE776
-0xA777	0xE777
-0xA778	0xE778
-0xA779	0xE779
-0xA77A	0xE77A
-0xA77B	0xE77B
-0xA77C	0xE77C
-0xA77D	0xE77D
-0xA77E	0xE77E
-0xA780	0xE77F
-0xA781	0xE780
-0xA782	0xE781
-0xA783	0xE782
-0xA784	0xE783
-0xA785	0xE784
-0xA786	0xE785
-0xA787	0xE786
-0xA788	0xE787
-0xA789	0xE788
-0xA78A	0xE789
-0xA78B	0xE78A
-0xA78C	0xE78B
-0xA78D	0xE78C
-0xA78E	0xE78D
-0xA78F	0xE78E
-0xA790	0xE78F
-0xA791	0xE790
-0xA792	0xE791
-0xA793	0xE792
-0xA794	0xE793
-0xA795	0xE794
-0xA796	0xE795
-0xA797	0xE796
-0xA798	0xE797
-0xA799	0xE798
-0xA79A	0xE799
-0xA79B	0xE79A
-0xA79C	0xE79B
-0xA79D	0xE79C
-0xA79E	0xE79D
-0xA79F	0xE79E
-0xA7A0	0xE79F
+0xA6F6	0xE797
+0xA6F7	0xE798
+0xA6F8	0xE799
+0xA6F9	0xE79A
+0xA6FA	0xE79B
+0xA6FB	0xE79C
+0xA6FC	0xE79D
+0xA6FD	0xE79E
+0xA6FE	0xE79F
+0xA740	0xE706
+0xA741	0xE707
+0xA742	0xE708
+0xA743	0xE709
+0xA744	0xE70A
+0xA745	0xE70B
+0xA746	0xE70C
+0xA747	0xE70D
+0xA748	0xE70E
+0xA749	0xE70F
+0xA74A	0xE710
+0xA74B	0xE711
+0xA74C	0xE712
+0xA74D	0xE713
+0xA74E	0xE714
+0xA74F	0xE715
+0xA750	0xE716
+0xA751	0xE717
+0xA752	0xE718
+0xA753	0xE719
+0xA754	0xE71A
+0xA755	0xE71B
+0xA756	0xE71C
+0xA757	0xE71D
+0xA758	0xE71E
+0xA759	0xE71F
+0xA75A	0xE720
+0xA75B	0xE721
+0xA75C	0xE722
+0xA75D	0xE723
+0xA75E	0xE724
+0xA75F	0xE725
+0xA760	0xE726
+0xA761	0xE727
+0xA762	0xE728
+0xA763	0xE729
+0xA764	0xE72A
+0xA765	0xE72B
+0xA766	0xE72C
+0xA767	0xE72D
+0xA768	0xE72E
+0xA769	0xE72F
+0xA76A	0xE730
+0xA76B	0xE731
+0xA76C	0xE732
+0xA76D	0xE733
+0xA76E	0xE734
+0xA76F	0xE735
+0xA770	0xE736
+0xA771	0xE737
+0xA772	0xE738
+0xA773	0xE739
+0xA774	0xE73A
+0xA775	0xE73B
+0xA776	0xE73C
+0xA777	0xE73D
+0xA778	0xE73E
+0xA779	0xE73F
+0xA77A	0xE740
+0xA77B	0xE741
+0xA77C	0xE742
+0xA77D	0xE743
+0xA77E	0xE744
+0xA780	0xE745
+0xA781	0xE746
+0xA782	0xE747
+0xA783	0xE748
+0xA784	0xE749
+0xA785	0xE74A
+0xA786	0xE74B
+0xA787	0xE74C
+0xA788	0xE74D
+0xA789	0xE74E
+0xA78A	0xE74F
+0xA78B	0xE750
+0xA78C	0xE751
+0xA78D	0xE752
+0xA78E	0xE753
+0xA78F	0xE754
+0xA790	0xE755
+0xA791	0xE756
+0xA792	0xE757
+0xA793	0xE758
+0xA794	0xE759
+0xA795	0xE75A
+0xA796	0xE75B
+0xA797	0xE75C
+0xA798	0xE75D
+0xA799	0xE75E
+0xA79A	0xE75F
+0xA79B	0xE760
+0xA79C	0xE761
+0xA79D	0xE762
+0xA79E	0xE763
+0xA79F	0xE764
+0xA7A0	0xE765
 0xA7A1	0x0410
 0xA7A2	0x0411
 0xA7A3	0x0412
diff --git a/make/tools/CharsetMapping/MS936.map b/make/tools/CharsetMapping/MS936.map
index f5df8d5..b37fd9d 100644
--- a/make/tools/CharsetMapping/MS936.map
+++ b/make/tools/CharsetMapping/MS936.map
@@ -1,31 +1,8 @@
-# Copy/pasted from MS936.b2c
 #
-# This table comes from MS CP936 table posted on unicode.org webpage
-# with the modifications of 
+# This table comes from MultiByteToWideChar, the only entry
+# not included is
 #
-# (1)added Euro sign
-#      0x80 - 0x20ac
-# (2)removed DBCS lead byte entries 
-#      0x80 - 0xff  
-# (3)added GBK UDC block (1894)
-#      0xAAA1 - 0xAFFE  U+E000 - U+E233
-#      0xF8A1 - 0xFEFE  U+E234 - U+E4C5
-#      0xA140 - 0xA7A0  U+E4C6 - U+E79F
-# (4)added Microsoft defined "not GBK" EUDC
-#     a:  u+E586 - u+E591
-#     b:  u+E652 - u+E65C 
-#     c:  u+E6BD - u+E6C4
-#     d:  u+E725 - u+E73F
-#     e:  u+E7A0 - u+E864
-# 
-#    Mapping of (3) and (4) comes from Masayuki Fuse at FUSE@jp.ibm.com
-#
-#    Format: Three tab-separated columns
-#        Column #1 is the cp936 code (in hex)
-#        Column #2 is the Unicode (in hex as 0xXXXX)
-#        Column #3 is the Unicode name (follows a comment sign, '#')
-#
-#    The entries are in unicode order
+# 0xFF	0xF8F5
 #
 0x00	0x0000
 0x01	0x0001
@@ -6533,12 +6510,12 @@
 0xA2A8	0x2177  #SMALL ROMAN NUMERAL EIGHT
 0xA2A9	0x2178  #SMALL ROMAN NUMERAL NINE
 0xA2AA	0x2179  #SMALL ROMAN NUMERAL TEN
-0xA2AB  0xE586  #PRIVATE USE AREA-E586
-0xA2AC  0xE587  #PRIVATE USE AREA-E587
-0xA2AD  0xE588  #PRIVATE USE AREA-E588
-0xA2AE  0xE589  #PRIVATE USE AREA-E589
-0xA2AF  0xE58A  #PRIVATE USE AREA-E58A
-0xA2B0  0xE58B  #PRIVATE USE AREA-E58B
+0xA2AB  0xE766  #PRIVATE USE AREA-E766
+0xA2AC  0xE767  #PRIVATE USE AREA-E767
+0xA2AD  0xE768  #PRIVATE USE AREA-E768
+0xA2AE  0xE769  #PRIVATE USE AREA-E769
+0xA2AF  0xE76A  #PRIVATE USE AREA-E76A
+0xA2B0  0xE76B  #PRIVATE USE AREA-E76B
 0xA2B1	0x2488  #DIGIT ONE FULL STOP
 0xA2B2	0x2489  #DIGIT TWO FULL STOP
 0xA2B3	0x248A  #DIGIT THREE FULL STOP
@@ -6589,8 +6566,8 @@
 0xA2E0	0x2467  #CIRCLED DIGIT EIGHT
 0xA2E1	0x2468  #CIRCLED DIGIT NINE
 0xA2E2	0x2469  #CIRCLED NUMBER TEN
-0xA2E3  0xE58C  #PRIVATE USE AREA-E58C
-0xA2E4  0xE58D  #PRIVATE USE AREA-E58D
+0xA2E3  0xE76C  #PRIVATE USE AREA-E76C
+0xA2E4  0xE76D  #PRIVATE USE AREA-E76D
 0xA2E5	0x3220  #PARENTHESIZED IDEOGRAPH ONE
 0xA2E6	0x3221  #PARENTHESIZED IDEOGRAPH TWO
 0xA2E7	0x3222  #PARENTHESIZED IDEOGRAPH THREE
@@ -6601,8 +6578,8 @@
 0xA2EC	0x3227  #PARENTHESIZED IDEOGRAPH EIGHT
 0xA2ED	0x3228  #PARENTHESIZED IDEOGRAPH NINE
 0xA2EE	0x3229  #PARENTHESIZED IDEOGRAPH TEN
-0xA2EF  0xE58E  #PRIVATE USE AREA-E58E
-0xA2F0  0xE58F  #PRIVATE USE AREA-E58F
+0xA2EF  0xE76E  #PRIVATE USE AREA-E76E
+0xA2F0  0xE76F  #PRIVATE USE AREA-E76F
 0xA2F1	0x2160  #ROMAN NUMERAL ONE
 0xA2F2	0x2161  #ROMAN NUMERAL TWO
 0xA2F3	0x2162  #ROMAN NUMERAL THREE
@@ -6615,104 +6592,104 @@
 0xA2FA	0x2169  #ROMAN NUMERAL TEN
 0xA2FB	0x216A  #ROMAN NUMERAL ELEVEN
 0xA2FC	0x216B  #ROMAN NUMERAL TWELVE
-0xA2FD  0xE590  #PRIVATE USE AREA-E590
-0xA2FE  0xE591  #PRIVATE USE AREA-E591
-0xA340  0xE592  #PRIVATE USE AREA-E592
-0xA341  0xE593  #PRIVATE USE AREA-E593
-0xA342  0xE594  #PRIVATE USE AREA-E594
-0xA343  0xE595  #PRIVATE USE AREA-E595
-0xA344  0xE596  #PRIVATE USE AREA-E596
-0xA345  0xE597  #PRIVATE USE AREA-E597
-0xA346  0xE598  #PRIVATE USE AREA-E598
-0xA347  0xE599  #PRIVATE USE AREA-E599
-0xA348  0xE59A  #PRIVATE USE AREA-E59A
-0xA349  0xE59B  #PRIVATE USE AREA-E59B
-0xA34A  0xE59C  #PRIVATE USE AREA-E59C
-0xA34B  0xE59D  #PRIVATE USE AREA-E59D
-0xA34C  0xE59E  #PRIVATE USE AREA-E59E
-0xA34D  0xE59F  #PRIVATE USE AREA-E59F
-0xA34E  0xE5A0  #PRIVATE USE AREA-E5A0
-0xA34F  0xE5A1  #PRIVATE USE AREA-E5A1
-0xA350  0xE5A2  #PRIVATE USE AREA-E5A2
-0xA351  0xE5A3  #PRIVATE USE AREA-E5A3
-0xA352  0xE5A4  #PRIVATE USE AREA-E5A4
-0xA353  0xE5A5  #PRIVATE USE AREA-E5A5
-0xA354  0xE5A6  #PRIVATE USE AREA-E5A6
-0xA355  0xE5A7  #PRIVATE USE AREA-E5A7
-0xA356  0xE5A8  #PRIVATE USE AREA-E5A8
-0xA357  0xE5A9  #PRIVATE USE AREA-E5A9
-0xA358  0xE5AA  #PRIVATE USE AREA-E5AA
-0xA359  0xE5AB  #PRIVATE USE AREA-E5AB
-0xA35A  0xE5AC  #PRIVATE USE AREA-E5AC
-0xA35B  0xE5AD  #PRIVATE USE AREA-E5AD
-0xA35C  0xE5AE  #PRIVATE USE AREA-E5AE
-0xA35D  0xE5AF  #PRIVATE USE AREA-E5AF
-0xA35E  0xE5B0  #PRIVATE USE AREA-E5B0
-0xA35F  0xE5B1  #PRIVATE USE AREA-E5B1
-0xA360  0xE5B2  #PRIVATE USE AREA-E5B2
-0xA361  0xE5B3  #PRIVATE USE AREA-E5B3
-0xA362  0xE5B4  #PRIVATE USE AREA-E5B4
-0xA363  0xE5B5  #PRIVATE USE AREA-E5B5
-0xA364  0xE5B6  #PRIVATE USE AREA-E5B6
-0xA365  0xE5B7  #PRIVATE USE AREA-E5B7
-0xA366  0xE5B8  #PRIVATE USE AREA-E5B8
-0xA367  0xE5B9  #PRIVATE USE AREA-E5B9
-0xA368  0xE5BA  #PRIVATE USE AREA-E5BA
-0xA369  0xE5BB  #PRIVATE USE AREA-E5BB
-0xA36A  0xE5BC  #PRIVATE USE AREA-E5BC
-0xA36B  0xE5BD  #PRIVATE USE AREA-E5BD
-0xA36C  0xE5BE  #PRIVATE USE AREA-E5BE
-0xA36D  0xE5BF  #PRIVATE USE AREA-E5BF
-0xA36E  0xE5C0  #PRIVATE USE AREA-E5C0
-0xA36F  0xE5C1  #PRIVATE USE AREA-E5C1
-0xA370  0xE5C2  #PRIVATE USE AREA-E5C2
-0xA371  0xE5C3  #PRIVATE USE AREA-E5C3
-0xA372  0xE5C4  #PRIVATE USE AREA-E5C4
-0xA373  0xE5C5  #PRIVATE USE AREA-E5C5
-0xA374  0xE5C6  #PRIVATE USE AREA-E5C6
-0xA375  0xE5C7  #PRIVATE USE AREA-E5C7
-0xA376  0xE5C8  #PRIVATE USE AREA-E5C8
-0xA377  0xE5C9  #PRIVATE USE AREA-E5C9
-0xA378  0xE5CA  #PRIVATE USE AREA-E5CA
-0xA379  0xE5CB  #PRIVATE USE AREA-E5CB
-0xA37A  0xE5CC  #PRIVATE USE AREA-E5CC
-0xA37B  0xE5CD  #PRIVATE USE AREA-E5CD
-0xA37C  0xE5CE  #PRIVATE USE AREA-E5CE
-0xA37D  0xE5CF  #PRIVATE USE AREA-E5CF
-0xA37E  0xE5D0  #PRIVATE USE AREA-E5D0
-0xA380  0xE5D1  #PRIVATE USE AREA-E5D1
-0xA381  0xE5D2  #PRIVATE USE AREA-E5D2
-0xA382  0xE5D3  #PRIVATE USE AREA-E5D3
-0xA383  0xE5D4  #PRIVATE USE AREA-E5D4
-0xA384  0xE5D5  #PRIVATE USE AREA-E5D5
-0xA385  0xE5D6  #PRIVATE USE AREA-E5D6
-0xA386  0xE5D7  #PRIVATE USE AREA-E5D7
-0xA387  0xE5D8  #PRIVATE USE AREA-E5D8
-0xA388  0xE5D9  #PRIVATE USE AREA-E5D9
-0xA389  0xE5DA  #PRIVATE USE AREA-E5DA
-0xA38A  0xE5DB  #PRIVATE USE AREA-E5DB
-0xA38B  0xE5DC  #PRIVATE USE AREA-E5DC
-0xA38C  0xE5DD  #PRIVATE USE AREA-E5DD
-0xA38D  0xE5DE  #PRIVATE USE AREA-E5DE
-0xA38E  0xE5DF  #PRIVATE USE AREA-E5DF
-0xA38F  0xE5E0  #PRIVATE USE AREA-E5E0
-0xA390  0xE5E1  #PRIVATE USE AREA-E5E1
-0xA391  0xE5E2  #PRIVATE USE AREA-E5E2
-0xA392  0xE5E3  #PRIVATE USE AREA-E5E3
-0xA393  0xE5E4  #PRIVATE USE AREA-E5E4
-0xA394  0xE5E5  #PRIVATE USE AREA-E5E5
-0xA395  0xE5E6  #PRIVATE USE AREA-E5E6
-0xA396  0xE5E7  #PRIVATE USE AREA-E5E7
-0xA397  0xE5E8  #PRIVATE USE AREA-E5E8
-0xA398  0xE5E9  #PRIVATE USE AREA-E5E9
-0xA399  0xE5EA  #PRIVATE USE AREA-E5EA
-0xA39A  0xE5EB  #PRIVATE USE AREA-E5EB
-0xA39B  0xE5EC  #PRIVATE USE AREA-E5EC
-0xA39C  0xE5ED  #PRIVATE USE AREA-E5ED
-0xA39D  0xE5EE  #PRIVATE USE AREA-E5EE
-0xA39E  0xE5EF  #PRIVATE USE AREA-E5EF
-0xA39F  0xE5F0  #PRIVATE USE AREA-E5F0
-0xA3A0  0xE5F1  #PRIVATE USE AREA-E5F1
+0xA2FD  0xE770  #PRIVATE USE AREA-E770
+0xA2FE  0xE771  #PRIVATE USE AREA-E771
+0xA340  0xE586  #PRIVATE USE AREA-E586
+0xA341  0xE587  #PRIVATE USE AREA-E587
+0xA342  0xE588  #PRIVATE USE AREA-E588
+0xA343  0xE589  #PRIVATE USE AREA-E589
+0xA344  0xE58A  #PRIVATE USE AREA-E58A
+0xA345  0xE58B  #PRIVATE USE AREA-E58B
+0xA346  0xE58C  #PRIVATE USE AREA-E58C
+0xA347  0xE58D  #PRIVATE USE AREA-E58D
+0xA348  0xE58E  #PRIVATE USE AREA-E58E
+0xA349  0xE58F  #PRIVATE USE AREA-E58F
+0xA34A  0xE590  #PRIVATE USE AREA-E590
+0xA34B  0xE591  #PRIVATE USE AREA-E591
+0xA34C  0xE592  #PRIVATE USE AREA-E592
+0xA34D  0xE593  #PRIVATE USE AREA-E593
+0xA34E  0xE594  #PRIVATE USE AREA-E594
+0xA34F  0xE595  #PRIVATE USE AREA-E595
+0xA350  0xE596  #PRIVATE USE AREA-E596
+0xA351  0xE597  #PRIVATE USE AREA-E597
+0xA352  0xE598  #PRIVATE USE AREA-E598
+0xA353  0xE599  #PRIVATE USE AREA-E599
+0xA354  0xE59A  #PRIVATE USE AREA-E59A
+0xA355  0xE59B  #PRIVATE USE AREA-E59B
+0xA356  0xE59C  #PRIVATE USE AREA-E59C
+0xA357  0xE59D  #PRIVATE USE AREA-E59D
+0xA358  0xE59E  #PRIVATE USE AREA-E59E
+0xA359  0xE59F  #PRIVATE USE AREA-E59F
+0xA35A  0xE5A0  #PRIVATE USE AREA-E5A0
+0xA35B  0xE5A1  #PRIVATE USE AREA-E5A1
+0xA35C  0xE5A2  #PRIVATE USE AREA-E5A2
+0xA35D  0xE5A3  #PRIVATE USE AREA-E5A3
+0xA35E  0xE5A4  #PRIVATE USE AREA-E5A4
+0xA35F  0xE5A5  #PRIVATE USE AREA-E5A5
+0xA360  0xE5A6  #PRIVATE USE AREA-E5A6
+0xA361  0xE5A7  #PRIVATE USE AREA-E5A7
+0xA362  0xE5A8  #PRIVATE USE AREA-E5A8
+0xA363  0xE5A9  #PRIVATE USE AREA-E5A9
+0xA364  0xE5AA  #PRIVATE USE AREA-E5AA
+0xA365  0xE5AB  #PRIVATE USE AREA-E5AB
+0xA366  0xE5AC  #PRIVATE USE AREA-E5AC
+0xA367  0xE5AD  #PRIVATE USE AREA-E5AD
+0xA368  0xE5AE  #PRIVATE USE AREA-E5AE
+0xA369  0xE5AF  #PRIVATE USE AREA-E5AF
+0xA36A  0xE5B0  #PRIVATE USE AREA-E5B0
+0xA36B  0xE5B1  #PRIVATE USE AREA-E5B1
+0xA36C  0xE5B2  #PRIVATE USE AREA-E5B2
+0xA36D  0xE5B3  #PRIVATE USE AREA-E5B3
+0xA36E  0xE5B4  #PRIVATE USE AREA-E5B4
+0xA36F  0xE5B5  #PRIVATE USE AREA-E5B5
+0xA370  0xE5B6  #PRIVATE USE AREA-E5B6
+0xA371  0xE5B7  #PRIVATE USE AREA-E5B7
+0xA372  0xE5B8  #PRIVATE USE AREA-E5B8
+0xA373  0xE5B9  #PRIVATE USE AREA-E5B9
+0xA374  0xE5BA  #PRIVATE USE AREA-E5BA
+0xA375  0xE5BB  #PRIVATE USE AREA-E5BB
+0xA376  0xE5BC  #PRIVATE USE AREA-E5BC
+0xA377  0xE5BD  #PRIVATE USE AREA-E5BD
+0xA378  0xE5BE  #PRIVATE USE AREA-E5BE
+0xA379  0xE5BF  #PRIVATE USE AREA-E5BF
+0xA37A  0xE5C0  #PRIVATE USE AREA-E5C0
+0xA37B  0xE5C1  #PRIVATE USE AREA-E5C1
+0xA37C  0xE5C2  #PRIVATE USE AREA-E5C2
+0xA37D  0xE5C3  #PRIVATE USE AREA-E5C3
+0xA37E  0xE5C4  #PRIVATE USE AREA-E5C4
+0xA380  0xE5C5  #PRIVATE USE AREA-E5C5
+0xA381  0xE5C6  #PRIVATE USE AREA-E5C6
+0xA382  0xE5C7  #PRIVATE USE AREA-E5C7
+0xA383  0xE5C8  #PRIVATE USE AREA-E5C8
+0xA384  0xE5C9  #PRIVATE USE AREA-E5C9
+0xA385  0xE5CA  #PRIVATE USE AREA-E5CA
+0xA386  0xE5CB  #PRIVATE USE AREA-E5CB
+0xA387  0xE5CC  #PRIVATE USE AREA-E5CC
+0xA388  0xE5CD  #PRIVATE USE AREA-E5CD
+0xA389  0xE5CE  #PRIVATE USE AREA-E5CE
+0xA38A  0xE5CF  #PRIVATE USE AREA-E5CF
+0xA38B  0xE5D0  #PRIVATE USE AREA-E5D0
+0xA38C  0xE5D1  #PRIVATE USE AREA-E5D1
+0xA38D  0xE5D2  #PRIVATE USE AREA-E5D2
+0xA38E  0xE5D3  #PRIVATE USE AREA-E5D3
+0xA38F  0xE5D4  #PRIVATE USE AREA-E5D4
+0xA390  0xE5D5  #PRIVATE USE AREA-E5D5
+0xA391  0xE5D6  #PRIVATE USE AREA-E5D6
+0xA392  0xE5D7  #PRIVATE USE AREA-E5D7
+0xA393  0xE5D8  #PRIVATE USE AREA-E5D8
+0xA394  0xE5D9  #PRIVATE USE AREA-E5D9
+0xA395  0xE5DA  #PRIVATE USE AREA-E5DA
+0xA396  0xE5DB  #PRIVATE USE AREA-E5DB
+0xA397  0xE5DC  #PRIVATE USE AREA-E5DC
+0xA398  0xE5DD  #PRIVATE USE AREA-E5DD
+0xA399  0xE5DE  #PRIVATE USE AREA-E5DE
+0xA39A  0xE5DF  #PRIVATE USE AREA-E5DF
+0xA39B  0xE5E0  #PRIVATE USE AREA-E5E0
+0xA39C  0xE5E1  #PRIVATE USE AREA-E5E1
+0xA39D  0xE5E2  #PRIVATE USE AREA-E5E2
+0xA39E  0xE5E3  #PRIVATE USE AREA-E5E3
+0xA39F  0xE5E4  #PRIVATE USE AREA-E5E4
+0xA3A0  0xE5E5  #PRIVATE USE AREA-E5E5
 0xA3A1	0xFF01  #FULLWIDTH EXCLAMATION MARK
 0xA3A2	0xFF02  #FULLWIDTH QUOTATION MARK
 0xA3A3	0xFF03  #FULLWIDTH NUMBER SIGN
@@ -6807,102 +6784,102 @@
 0xA3FC	0xFF5C  #FULLWIDTH VERTICAL LINE
 0xA3FD	0xFF5D  #FULLWIDTH RIGHT CURLY BRACKET
 0xA3FE	0xFFE3  #FULLWIDTH MACRON
-0xA440  0xE5F2  #PRIVATE USE AREA-E5F2
-0xA441  0xE5F3  #PRIVATE USE AREA-E5F3
-0xA442  0xE5F4  #PRIVATE USE AREA-E5F4
-0xA443  0xE5F5  #PRIVATE USE AREA-E5F5
-0xA444  0xE5F6  #PRIVATE USE AREA-E5F6
-0xA445  0xE5F7  #PRIVATE USE AREA-E5F7
-0xA446  0xE5F8  #PRIVATE USE AREA-E5F8
-0xA447  0xE5F9  #PRIVATE USE AREA-E5F9
-0xA448  0xE5FA  #PRIVATE USE AREA-E5FA
-0xA449  0xE5FB  #PRIVATE USE AREA-E5FB
-0xA44A  0xE5FC  #PRIVATE USE AREA-E5FC
-0xA44B  0xE5FD  #PRIVATE USE AREA-E5FD
-0xA44C  0xE5FE  #PRIVATE USE AREA-E5FE
-0xA44D  0xE5FF  #PRIVATE USE AREA-E5FF
-0xA44E  0xE600  #PRIVATE USE AREA-E600
-0xA44F  0xE601  #PRIVATE USE AREA-E601
-0xA450  0xE602  #PRIVATE USE AREA-E602
-0xA451  0xE603  #PRIVATE USE AREA-E603
-0xA452  0xE604  #PRIVATE USE AREA-E604
-0xA453  0xE605  #PRIVATE USE AREA-E605
-0xA454  0xE606  #PRIVATE USE AREA-E606
-0xA455  0xE607  #PRIVATE USE AREA-E607
-0xA456  0xE608  #PRIVATE USE AREA-E608
-0xA457  0xE609  #PRIVATE USE AREA-E609
-0xA458  0xE60A  #PRIVATE USE AREA-E60A
-0xA459  0xE60B  #PRIVATE USE AREA-E60B
-0xA45A  0xE60C  #PRIVATE USE AREA-E60C
-0xA45B  0xE60D  #PRIVATE USE AREA-E60D
-0xA45C  0xE60E  #PRIVATE USE AREA-E60E
-0xA45D  0xE60F  #PRIVATE USE AREA-E60F
-0xA45E  0xE610  #PRIVATE USE AREA-E610
-0xA45F  0xE611  #PRIVATE USE AREA-E611
-0xA460  0xE612  #PRIVATE USE AREA-E612
-0xA461  0xE613  #PRIVATE USE AREA-E613
-0xA462  0xE614  #PRIVATE USE AREA-E614
-0xA463  0xE615  #PRIVATE USE AREA-E615
-0xA464  0xE616  #PRIVATE USE AREA-E616
-0xA465  0xE617  #PRIVATE USE AREA-E617
-0xA466  0xE618  #PRIVATE USE AREA-E618
-0xA467  0xE619  #PRIVATE USE AREA-E619
-0xA468  0xE61A  #PRIVATE USE AREA-E61A
-0xA469  0xE61B  #PRIVATE USE AREA-E61B
-0xA46A  0xE61C  #PRIVATE USE AREA-E61C
-0xA46B  0xE61D  #PRIVATE USE AREA-E61D
-0xA46C  0xE61E  #PRIVATE USE AREA-E61E
-0xA46D  0xE61F  #PRIVATE USE AREA-E61F
-0xA46E  0xE620  #PRIVATE USE AREA-E620
-0xA46F  0xE621  #PRIVATE USE AREA-E621
-0xA470  0xE622  #PRIVATE USE AREA-E622
-0xA471  0xE623  #PRIVATE USE AREA-E623
-0xA472  0xE624  #PRIVATE USE AREA-E624
-0xA473  0xE625  #PRIVATE USE AREA-E625
-0xA474  0xE626  #PRIVATE USE AREA-E626
-0xA475  0xE627  #PRIVATE USE AREA-E627
-0xA476  0xE628  #PRIVATE USE AREA-E628
-0xA477  0xE629  #PRIVATE USE AREA-E629
-0xA478  0xE62A  #PRIVATE USE AREA-E62A
-0xA479  0xE62B  #PRIVATE USE AREA-E62B
-0xA47A  0xE62C  #PRIVATE USE AREA-E62C
-0xA47B  0xE62D  #PRIVATE USE AREA-E62D
-0xA47C  0xE62E  #PRIVATE USE AREA-E62E
-0xA47D  0xE62F  #PRIVATE USE AREA-E62F
-0xA47E  0xE630  #PRIVATE USE AREA-E630
-0xA480  0xE631  #PRIVATE USE AREA-E631
-0xA481  0xE632  #PRIVATE USE AREA-E632
-0xA482  0xE633  #PRIVATE USE AREA-E633
-0xA483  0xE634  #PRIVATE USE AREA-E634
-0xA484  0xE635  #PRIVATE USE AREA-E635
-0xA485  0xE636  #PRIVATE USE AREA-E636
-0xA486  0xE637  #PRIVATE USE AREA-E637
-0xA487  0xE638  #PRIVATE USE AREA-E638
-0xA488  0xE639  #PRIVATE USE AREA-E639
-0xA489  0xE63A  #PRIVATE USE AREA-E63A
-0xA48A  0xE63B  #PRIVATE USE AREA-E63B
-0xA48B  0xE63C  #PRIVATE USE AREA-E63C
-0xA48C  0xE63D  #PRIVATE USE AREA-E63D
-0xA48D  0xE63E  #PRIVATE USE AREA-E63E
-0xA48E  0xE63F  #PRIVATE USE AREA-E63F
-0xA48F  0xE640  #PRIVATE USE AREA-E640
-0xA490  0xE641  #PRIVATE USE AREA-E641
-0xA491  0xE642  #PRIVATE USE AREA-E642
-0xA492  0xE643  #PRIVATE USE AREA-E643
-0xA493  0xE644  #PRIVATE USE AREA-E644
-0xA494  0xE645  #PRIVATE USE AREA-E645
-0xA495  0xE646  #PRIVATE USE AREA-E646
-0xA496  0xE647  #PRIVATE USE AREA-E647
-0xA497  0xE648  #PRIVATE USE AREA-E648
-0xA498  0xE649  #PRIVATE USE AREA-E649
-0xA499  0xE64A  #PRIVATE USE AREA-E64A
-0xA49A  0xE64B  #PRIVATE USE AREA-E64B
-0xA49B  0xE64C  #PRIVATE USE AREA-E64C
-0xA49C  0xE64D  #PRIVATE USE AREA-E64D
-0xA49D  0xE64E  #PRIVATE USE AREA-E64E
-0xA49E  0xE64F  #PRIVATE USE AREA-E64F
-0xA49F  0xE650  #PRIVATE USE AREA-E650
-0xA4A0  0xE651  #PRIVATE USE AREA-E651
+0xA440  0xE5E6  #PRIVATE USE AREA-E5E6
+0xA441  0xE5E7  #PRIVATE USE AREA-E5E7
+0xA442  0xE5E8  #PRIVATE USE AREA-E5E8
+0xA443  0xE5E9  #PRIVATE USE AREA-E5E9
+0xA444  0xE5EA  #PRIVATE USE AREA-E5EA
+0xA445  0xE5EB  #PRIVATE USE AREA-E5EB
+0xA446  0xE5EC  #PRIVATE USE AREA-E5EC
+0xA447  0xE5ED  #PRIVATE USE AREA-E5ED
+0xA448  0xE5EE  #PRIVATE USE AREA-E5EE
+0xA449  0xE5EF  #PRIVATE USE AREA-E5EF
+0xA44A  0xE5F0  #PRIVATE USE AREA-E5F0
+0xA44B  0xE5F1  #PRIVATE USE AREA-E5F1
+0xA44C  0xE5F2  #PRIVATE USE AREA-E5F2
+0xA44D  0xE5F3  #PRIVATE USE AREA-E5F3
+0xA44E  0xE5F4  #PRIVATE USE AREA-E5F4
+0xA44F  0xE5F5  #PRIVATE USE AREA-E5F5
+0xA450  0xE5F6  #PRIVATE USE AREA-E5F6
+0xA451  0xE5F7  #PRIVATE USE AREA-E5F7
+0xA452  0xE5F8  #PRIVATE USE AREA-E5F8
+0xA453  0xE5F9  #PRIVATE USE AREA-E5F9
+0xA454  0xE5FA  #PRIVATE USE AREA-E5FA
+0xA455  0xE5FB  #PRIVATE USE AREA-E5FB
+0xA456  0xE5FC  #PRIVATE USE AREA-E5FC
+0xA457  0xE5FD  #PRIVATE USE AREA-E5FD
+0xA458  0xE5FE  #PRIVATE USE AREA-E5FE
+0xA459  0xE5FF  #PRIVATE USE AREA-E5FF
+0xA45A  0xE600  #PRIVATE USE AREA-E600
+0xA45B  0xE601  #PRIVATE USE AREA-E601
+0xA45C  0xE602  #PRIVATE USE AREA-E602
+0xA45D  0xE603  #PRIVATE USE AREA-E603
+0xA45E  0xE604  #PRIVATE USE AREA-E604
+0xA45F  0xE605  #PRIVATE USE AREA-E605
+0xA460  0xE606  #PRIVATE USE AREA-E606
+0xA461  0xE607  #PRIVATE USE AREA-E607
+0xA462  0xE608  #PRIVATE USE AREA-E608
+0xA463  0xE609  #PRIVATE USE AREA-E609
+0xA464  0xE60A  #PRIVATE USE AREA-E60A
+0xA465  0xE60B  #PRIVATE USE AREA-E60B
+0xA466  0xE60C  #PRIVATE USE AREA-E60C
+0xA467  0xE60D  #PRIVATE USE AREA-E60D
+0xA468  0xE60E  #PRIVATE USE AREA-E60E
+0xA469  0xE60F  #PRIVATE USE AREA-E60F
+0xA46A  0xE610  #PRIVATE USE AREA-E610
+0xA46B  0xE611  #PRIVATE USE AREA-E611
+0xA46C  0xE612  #PRIVATE USE AREA-E612
+0xA46D  0xE613  #PRIVATE USE AREA-E613
+0xA46E  0xE614  #PRIVATE USE AREA-E614
+0xA46F  0xE615  #PRIVATE USE AREA-E615
+0xA470  0xE616  #PRIVATE USE AREA-E616
+0xA471  0xE617  #PRIVATE USE AREA-E617
+0xA472  0xE618  #PRIVATE USE AREA-E618
+0xA473  0xE619  #PRIVATE USE AREA-E619
+0xA474  0xE61A  #PRIVATE USE AREA-E61A
+0xA475  0xE61B  #PRIVATE USE AREA-E61B
+0xA476  0xE61C  #PRIVATE USE AREA-E61C
+0xA477  0xE61D  #PRIVATE USE AREA-E61D
+0xA478  0xE61E  #PRIVATE USE AREA-E61E
+0xA479  0xE61F  #PRIVATE USE AREA-E61F
+0xA47A  0xE620  #PRIVATE USE AREA-E620
+0xA47B  0xE621  #PRIVATE USE AREA-E621
+0xA47C  0xE622  #PRIVATE USE AREA-E622
+0xA47D  0xE623  #PRIVATE USE AREA-E623
+0xA47E  0xE624  #PRIVATE USE AREA-E624
+0xA480  0xE625  #PRIVATE USE AREA-E625
+0xA481  0xE626  #PRIVATE USE AREA-E626
+0xA482  0xE627  #PRIVATE USE AREA-E627
+0xA483  0xE628  #PRIVATE USE AREA-E628
+0xA484  0xE629  #PRIVATE USE AREA-E629
+0xA485  0xE62A  #PRIVATE USE AREA-E62A
+0xA486  0xE62B  #PRIVATE USE AREA-E62B
+0xA487  0xE62C  #PRIVATE USE AREA-E62C
+0xA488  0xE62D  #PRIVATE USE AREA-E62D
+0xA489  0xE62E  #PRIVATE USE AREA-E62E
+0xA48A  0xE62F  #PRIVATE USE AREA-E62F
+0xA48B  0xE630  #PRIVATE USE AREA-E630
+0xA48C  0xE631  #PRIVATE USE AREA-E631
+0xA48D  0xE632  #PRIVATE USE AREA-E632
+0xA48E  0xE633  #PRIVATE USE AREA-E633
+0xA48F  0xE634  #PRIVATE USE AREA-E634
+0xA490  0xE635  #PRIVATE USE AREA-E635
+0xA491  0xE636  #PRIVATE USE AREA-E636
+0xA492  0xE637  #PRIVATE USE AREA-E637
+0xA493  0xE638  #PRIVATE USE AREA-E638
+0xA494  0xE639  #PRIVATE USE AREA-E639
+0xA495  0xE63A  #PRIVATE USE AREA-E63A
+0xA496  0xE63B  #PRIVATE USE AREA-E63B
+0xA497  0xE63C  #PRIVATE USE AREA-E63C
+0xA498  0xE63D  #PRIVATE USE AREA-E63D
+0xA499  0xE63E  #PRIVATE USE AREA-E63E
+0xA49A  0xE63F  #PRIVATE USE AREA-E63F
+0xA49B  0xE640  #PRIVATE USE AREA-E640
+0xA49C  0xE641  #PRIVATE USE AREA-E641
+0xA49D  0xE642  #PRIVATE USE AREA-E642
+0xA49E  0xE643  #PRIVATE USE AREA-E643
+0xA49F  0xE644  #PRIVATE USE AREA-E644
+0xA4A0  0xE645  #PRIVATE USE AREA-E645
 0xA4A1	0x3041  #HIRAGANA LETTER SMALL A
 0xA4A2	0x3042  #HIRAGANA LETTER A
 0xA4A3	0x3043  #HIRAGANA LETTER SMALL I
@@ -6986,113 +6963,113 @@
 0xA4F1	0x3091  #HIRAGANA LETTER WE
 0xA4F2	0x3092  #HIRAGANA LETTER WO
 0xA4F3	0x3093  #HIRAGANA LETTER N
-0xA4F4  0xE652  #PRIVATE USE AREA-E652
-0xA4F5  0xE653  #PRIVATE USE AREA-E653
-0xA4F6  0xE654  #PRIVATE USE AREA-E654
-0xA4F7  0xE655  #PRIVATE USE AREA-E655
-0xA4F8  0xE656  #PRIVATE USE AREA-E656
-0xA4F9  0xE657  #PRIVATE USE AREA-E657
-0xA4FA  0xE658  #PRIVATE USE AREA-E658
-0xA4FB  0xE659  #PRIVATE USE AREA-E659
-0xA4FC  0xE65A  #PRIVATE USE AREA-E65A
-0xA4FD  0xE65B  #PRIVATE USE AREA-E65B
-0xA4FE  0xE65C  #PRIVATE USE AREA-E65C
-0xA540  0xE65D  #PRIVATE USE AREA-E65D
-0xA541  0xE65E  #PRIVATE USE AREA-E65E
-0xA542  0xE65F  #PRIVATE USE AREA-E65F
-0xA543  0xE660  #PRIVATE USE AREA-E660
-0xA544  0xE661  #PRIVATE USE AREA-E661
-0xA545  0xE662  #PRIVATE USE AREA-E662
-0xA546  0xE663  #PRIVATE USE AREA-E663
-0xA547  0xE664  #PRIVATE USE AREA-E664
-0xA548  0xE665  #PRIVATE USE AREA-E665
-0xA549  0xE666  #PRIVATE USE AREA-E666
-0xA54A  0xE667  #PRIVATE USE AREA-E667
-0xA54B  0xE668  #PRIVATE USE AREA-E668
-0xA54C  0xE669  #PRIVATE USE AREA-E669
-0xA54D  0xE66A  #PRIVATE USE AREA-E66A
-0xA54E  0xE66B  #PRIVATE USE AREA-E66B
-0xA54F  0xE66C  #PRIVATE USE AREA-E66C
-0xA550  0xE66D  #PRIVATE USE AREA-E66D
-0xA551  0xE66E  #PRIVATE USE AREA-E66E
-0xA552  0xE66F  #PRIVATE USE AREA-E66F
-0xA553  0xE670  #PRIVATE USE AREA-E670
-0xA554  0xE671  #PRIVATE USE AREA-E671
-0xA555  0xE672  #PRIVATE USE AREA-E672
-0xA556  0xE673  #PRIVATE USE AREA-E673
-0xA557  0xE674  #PRIVATE USE AREA-E674
-0xA558  0xE675  #PRIVATE USE AREA-E675
-0xA559  0xE676  #PRIVATE USE AREA-E676
-0xA55A  0xE677  #PRIVATE USE AREA-E677
-0xA55B  0xE678  #PRIVATE USE AREA-E678
-0xA55C  0xE679  #PRIVATE USE AREA-E679
-0xA55D  0xE67A  #PRIVATE USE AREA-E67A
-0xA55E  0xE67B  #PRIVATE USE AREA-E67B
-0xA55F  0xE67C  #PRIVATE USE AREA-E67C
-0xA560  0xE67D  #PRIVATE USE AREA-E67D
-0xA561  0xE67E  #PRIVATE USE AREA-E67E
-0xA562  0xE67F  #PRIVATE USE AREA-E67F
-0xA563  0xE680  #PRIVATE USE AREA-E680
-0xA564  0xE681  #PRIVATE USE AREA-E681
-0xA565  0xE682  #PRIVATE USE AREA-E682
-0xA566  0xE683  #PRIVATE USE AREA-E683
-0xA567  0xE684  #PRIVATE USE AREA-E684
-0xA568  0xE685  #PRIVATE USE AREA-E685
-0xA569  0xE686  #PRIVATE USE AREA-E686
-0xA56A  0xE687  #PRIVATE USE AREA-E687
-0xA56B  0xE688  #PRIVATE USE AREA-E688
-0xA56C  0xE689  #PRIVATE USE AREA-E689
-0xA56D  0xE68A  #PRIVATE USE AREA-E68A
-0xA56E  0xE68B  #PRIVATE USE AREA-E68B
-0xA56F  0xE68C  #PRIVATE USE AREA-E68C
-0xA570  0xE68D  #PRIVATE USE AREA-E68D
-0xA571  0xE68E  #PRIVATE USE AREA-E68E
-0xA572  0xE68F  #PRIVATE USE AREA-E68F
-0xA573  0xE690  #PRIVATE USE AREA-E690
-0xA574  0xE691  #PRIVATE USE AREA-E691
-0xA575  0xE692  #PRIVATE USE AREA-E692
-0xA576  0xE693  #PRIVATE USE AREA-E693
-0xA577  0xE694  #PRIVATE USE AREA-E694
-0xA578  0xE695  #PRIVATE USE AREA-E695
-0xA579  0xE696  #PRIVATE USE AREA-E696
-0xA57A  0xE697  #PRIVATE USE AREA-E697
-0xA57B  0xE698  #PRIVATE USE AREA-E698
-0xA57C  0xE699  #PRIVATE USE AREA-E699
-0xA57D  0xE69A  #PRIVATE USE AREA-E69A
-0xA57E  0xE69B  #PRIVATE USE AREA-E69B
-0xA580  0xE69C  #PRIVATE USE AREA-E69C
-0xA581  0xE69D  #PRIVATE USE AREA-E69D
-0xA582  0xE69E  #PRIVATE USE AREA-E69E
-0xA583  0xE69F  #PRIVATE USE AREA-E69F
-0xA584  0xE6A0  #PRIVATE USE AREA-E6A0
-0xA585  0xE6A1  #PRIVATE USE AREA-E6A1
-0xA586  0xE6A2  #PRIVATE USE AREA-E6A2
-0xA587  0xE6A3  #PRIVATE USE AREA-E6A3
-0xA588  0xE6A4  #PRIVATE USE AREA-E6A4
-0xA589  0xE6A5  #PRIVATE USE AREA-E6A5
-0xA58A  0xE6A6  #PRIVATE USE AREA-E6A6
-0xA58B  0xE6A7  #PRIVATE USE AREA-E6A7
-0xA58C  0xE6A8  #PRIVATE USE AREA-E6A8
-0xA58D  0xE6A9  #PRIVATE USE AREA-E6A9
-0xA58E  0xE6AA  #PRIVATE USE AREA-E6AA
-0xA58F  0xE6AB  #PRIVATE USE AREA-E6AB
-0xA590  0xE6AC  #PRIVATE USE AREA-E6AC
-0xA591  0xE6AD  #PRIVATE USE AREA-E6AD
-0xA592  0xE6AE  #PRIVATE USE AREA-E6AE
-0xA593  0xE6AF  #PRIVATE USE AREA-E6AF
-0xA594  0xE6B0  #PRIVATE USE AREA-E6B0
-0xA595  0xE6B1  #PRIVATE USE AREA-E6B1
-0xA596  0xE6B2  #PRIVATE USE AREA-E6B2
-0xA597  0xE6B3  #PRIVATE USE AREA-E6B3
-0xA598  0xE6B4  #PRIVATE USE AREA-E6B4
-0xA599  0xE6B5  #PRIVATE USE AREA-E6B5
-0xA59A  0xE6B6  #PRIVATE USE AREA-E6B6
-0xA59B  0xE6B7  #PRIVATE USE AREA-E6B7
-0xA59C  0xE6B8  #PRIVATE USE AREA-E6B8
-0xA59D  0xE6B9  #PRIVATE USE AREA-E6B9
-0xA59E  0xE6BA  #PRIVATE USE AREA-E6BA
-0xA59F  0xE6BB  #PRIVATE USE AREA-E6BB
-0xA5A0  0xE6BC  #PRIVATE USE AREA-E6BC
+0xA4F4  0xE772  #PRIVATE USE AREA-E772
+0xA4F5  0xE773  #PRIVATE USE AREA-E773
+0xA4F6  0xE774  #PRIVATE USE AREA-E774
+0xA4F7  0xE775  #PRIVATE USE AREA-E775
+0xA4F8  0xE776  #PRIVATE USE AREA-E776
+0xA4F9  0xE777  #PRIVATE USE AREA-E777
+0xA4FA  0xE778  #PRIVATE USE AREA-E778
+0xA4FB  0xE779  #PRIVATE USE AREA-E779
+0xA4FC  0xE77A  #PRIVATE USE AREA-E77A
+0xA4FD  0xE77B  #PRIVATE USE AREA-E77B
+0xA4FE  0xE77C  #PRIVATE USE AREA-E77C
+0xA540  0xE646  #PRIVATE USE AREA-E646
+0xA541  0xE647  #PRIVATE USE AREA-E647
+0xA542  0xE648  #PRIVATE USE AREA-E648
+0xA543  0xE649  #PRIVATE USE AREA-E649
+0xA544  0xE64A  #PRIVATE USE AREA-E64A
+0xA545  0xE64B  #PRIVATE USE AREA-E64B
+0xA546  0xE64C  #PRIVATE USE AREA-E64C
+0xA547  0xE64D  #PRIVATE USE AREA-E64D
+0xA548  0xE64E  #PRIVATE USE AREA-E64E
+0xA549  0xE64F  #PRIVATE USE AREA-E64F
+0xA54A  0xE650  #PRIVATE USE AREA-E650
+0xA54B  0xE651  #PRIVATE USE AREA-E651
+0xA54C  0xE652  #PRIVATE USE AREA-E652
+0xA54D  0xE653  #PRIVATE USE AREA-E653
+0xA54E  0xE654  #PRIVATE USE AREA-E654
+0xA54F  0xE655  #PRIVATE USE AREA-E655
+0xA550  0xE656  #PRIVATE USE AREA-E656
+0xA551  0xE657  #PRIVATE USE AREA-E657
+0xA552  0xE658  #PRIVATE USE AREA-E658
+0xA553  0xE659  #PRIVATE USE AREA-E659
+0xA554  0xE65A  #PRIVATE USE AREA-E65A
+0xA555  0xE65B  #PRIVATE USE AREA-E65B
+0xA556  0xE65C  #PRIVATE USE AREA-E65C
+0xA557  0xE65D  #PRIVATE USE AREA-E65D
+0xA558  0xE65E  #PRIVATE USE AREA-E65E
+0xA559  0xE65F  #PRIVATE USE AREA-E65F
+0xA55A  0xE660  #PRIVATE USE AREA-E660
+0xA55B  0xE661  #PRIVATE USE AREA-E661
+0xA55C  0xE662  #PRIVATE USE AREA-E662
+0xA55D  0xE663  #PRIVATE USE AREA-E663
+0xA55E  0xE664  #PRIVATE USE AREA-E664
+0xA55F  0xE665  #PRIVATE USE AREA-E665
+0xA560  0xE666  #PRIVATE USE AREA-E666
+0xA561  0xE667  #PRIVATE USE AREA-E667
+0xA562  0xE668  #PRIVATE USE AREA-E668
+0xA563  0xE669  #PRIVATE USE AREA-E669
+0xA564  0xE66A  #PRIVATE USE AREA-E66A
+0xA565  0xE66B  #PRIVATE USE AREA-E66B
+0xA566  0xE66C  #PRIVATE USE AREA-E66C
+0xA567  0xE66D  #PRIVATE USE AREA-E66D
+0xA568  0xE66E  #PRIVATE USE AREA-E66E
+0xA569  0xE66F  #PRIVATE USE AREA-E66F
+0xA56A  0xE670  #PRIVATE USE AREA-E670
+0xA56B  0xE671  #PRIVATE USE AREA-E671
+0xA56C  0xE672  #PRIVATE USE AREA-E672
+0xA56D  0xE673  #PRIVATE USE AREA-E673
+0xA56E  0xE674  #PRIVATE USE AREA-E674
+0xA56F  0xE675  #PRIVATE USE AREA-E675
+0xA570  0xE676  #PRIVATE USE AREA-E676
+0xA571  0xE677  #PRIVATE USE AREA-E677
+0xA572  0xE678  #PRIVATE USE AREA-E678
+0xA573  0xE679  #PRIVATE USE AREA-E679
+0xA574  0xE67A  #PRIVATE USE AREA-E67A
+0xA575  0xE67B  #PRIVATE USE AREA-E67B
+0xA576  0xE67C  #PRIVATE USE AREA-E67C
+0xA577  0xE67D  #PRIVATE USE AREA-E67D
+0xA578  0xE67E  #PRIVATE USE AREA-E67E
+0xA579  0xE67F  #PRIVATE USE AREA-E67F
+0xA57A  0xE680  #PRIVATE USE AREA-E680
+0xA57B  0xE681  #PRIVATE USE AREA-E681
+0xA57C  0xE682  #PRIVATE USE AREA-E682
+0xA57D  0xE683  #PRIVATE USE AREA-E683
+0xA57E  0xE684  #PRIVATE USE AREA-E684
+0xA580  0xE685  #PRIVATE USE AREA-E685
+0xA581  0xE686  #PRIVATE USE AREA-E686
+0xA582  0xE687  #PRIVATE USE AREA-E687
+0xA583  0xE688  #PRIVATE USE AREA-E688
+0xA584  0xE689  #PRIVATE USE AREA-E689
+0xA585  0xE68A  #PRIVATE USE AREA-E68A
+0xA586  0xE68B  #PRIVATE USE AREA-E68B
+0xA587  0xE68C  #PRIVATE USE AREA-E68C
+0xA588  0xE68D  #PRIVATE USE AREA-E68D
+0xA589  0xE68E  #PRIVATE USE AREA-E68E
+0xA58A  0xE68F  #PRIVATE USE AREA-E68F
+0xA58B  0xE690  #PRIVATE USE AREA-E690
+0xA58C  0xE691  #PRIVATE USE AREA-E691
+0xA58D  0xE692  #PRIVATE USE AREA-E692
+0xA58E  0xE693  #PRIVATE USE AREA-E693
+0xA58F  0xE694  #PRIVATE USE AREA-E694
+0xA590  0xE695  #PRIVATE USE AREA-E695
+0xA591  0xE696  #PRIVATE USE AREA-E696
+0xA592  0xE697  #PRIVATE USE AREA-E697
+0xA593  0xE698  #PRIVATE USE AREA-E698
+0xA594  0xE699  #PRIVATE USE AREA-E699
+0xA595  0xE69A  #PRIVATE USE AREA-E69A
+0xA596  0xE69B  #PRIVATE USE AREA-E69B
+0xA597  0xE69C  #PRIVATE USE AREA-E69C
+0xA598  0xE69D  #PRIVATE USE AREA-E69D
+0xA599  0xE69E  #PRIVATE USE AREA-E69E
+0xA59A  0xE69F  #PRIVATE USE AREA-E69F
+0xA59B  0xE6A0  #PRIVATE USE AREA-E6A0
+0xA59C  0xE6A1  #PRIVATE USE AREA-E6A1
+0xA59D  0xE6A2  #PRIVATE USE AREA-E6A2
+0xA59E  0xE6A3  #PRIVATE USE AREA-E6A3
+0xA59F  0xE6A4  #PRIVATE USE AREA-E6A4
+0xA5A0  0xE6A5  #PRIVATE USE AREA-E6A5
 0xA5A1	0x30A1  #KATAKANA LETTER SMALL A
 0xA5A2	0x30A2  #KATAKANA LETTER A
 0xA5A3	0x30A3  #KATAKANA LETTER SMALL I
@@ -7179,110 +7156,110 @@
 0xA5F4	0x30F4  #KATAKANA LETTER VU
 0xA5F5	0x30F5  #KATAKANA LETTER SMALL KA
 0xA5F6	0x30F6  #KATAKANA LETTER SMALL KE
-0xA5F7  0xE6BD  #PRIVATE USE AREA-E6BD
-0xA5F8  0xE6BE  #PRIVATE USE AREA-E6BE
-0xA5F9  0xE6BF  #PRIVATE USE AREA-E6BF
-0xA5FA  0xE6C0  #PRIVATE USE AREA-E6C0
-0xA5FB  0xE6C1  #PRIVATE USE AREA-E6C1
-0xA5FC  0xE6C2  #PRIVATE USE AREA-E6C2
-0xA5FD  0xE6C3  #PRIVATE USE AREA-E6C3
-0xA5FE  0xE6C4  #PRIVATE USE AREA-E6C4
-0xA640  0xE6C5  #PRIVATE USE AREA-E6C5
-0xA641  0xE6C6  #PRIVATE USE AREA-E6C6
-0xA642  0xE6C7  #PRIVATE USE AREA-E6C7
-0xA643  0xE6C8  #PRIVATE USE AREA-E6C8
-0xA644  0xE6C9  #PRIVATE USE AREA-E6C9
-0xA645  0xE6CA  #PRIVATE USE AREA-E6CA
-0xA646  0xE6CB  #PRIVATE USE AREA-E6CB
-0xA647  0xE6CC  #PRIVATE USE AREA-E6CC
-0xA648  0xE6CD  #PRIVATE USE AREA-E6CD
-0xA649  0xE6CE  #PRIVATE USE AREA-E6CE
-0xA64A  0xE6CF  #PRIVATE USE AREA-E6CF
-0xA64B  0xE6D0  #PRIVATE USE AREA-E6D0
-0xA64C  0xE6D1  #PRIVATE USE AREA-E6D1
-0xA64D  0xE6D2  #PRIVATE USE AREA-E6D2
-0xA64E  0xE6D3  #PRIVATE USE AREA-E6D3
-0xA64F  0xE6D4  #PRIVATE USE AREA-E6D4
-0xA650  0xE6D5  #PRIVATE USE AREA-E6D5
-0xA651  0xE6D6  #PRIVATE USE AREA-E6D6
-0xA652  0xE6D7  #PRIVATE USE AREA-E6D7
-0xA653  0xE6D8  #PRIVATE USE AREA-E6D8
-0xA654  0xE6D9  #PRIVATE USE AREA-E6D9
-0xA655  0xE6DA  #PRIVATE USE AREA-E6DA
-0xA656  0xE6DB  #PRIVATE USE AREA-E6DB
-0xA657  0xE6DC  #PRIVATE USE AREA-E6DC
-0xA658  0xE6DD  #PRIVATE USE AREA-E6DD
-0xA659  0xE6DE  #PRIVATE USE AREA-E6DE
-0xA65A  0xE6DF  #PRIVATE USE AREA-E6DF
-0xA65B  0xE6E0  #PRIVATE USE AREA-E6E0
-0xA65C  0xE6E1  #PRIVATE USE AREA-E6E1
-0xA65D  0xE6E2  #PRIVATE USE AREA-E6E2
-0xA65E  0xE6E3  #PRIVATE USE AREA-E6E3
-0xA65F  0xE6E4  #PRIVATE USE AREA-E6E4
-0xA660  0xE6E5  #PRIVATE USE AREA-E6E5
-0xA661  0xE6E6  #PRIVATE USE AREA-E6E6
-0xA662  0xE6E7  #PRIVATE USE AREA-E6E7
-0xA663  0xE6E8  #PRIVATE USE AREA-E6E8
-0xA664  0xE6E9  #PRIVATE USE AREA-E6E9
-0xA665  0xE6EA  #PRIVATE USE AREA-E6EA
-0xA666  0xE6EB  #PRIVATE USE AREA-E6EB
-0xA667  0xE6EC  #PRIVATE USE AREA-E6EC
-0xA668  0xE6ED  #PRIVATE USE AREA-E6ED
-0xA669  0xE6EE  #PRIVATE USE AREA-E6EE
-0xA66A  0xE6EF  #PRIVATE USE AREA-E6EF
-0xA66B  0xE6F0  #PRIVATE USE AREA-E6F0
-0xA66C  0xE6F1  #PRIVATE USE AREA-E6F1
-0xA66D  0xE6F2  #PRIVATE USE AREA-E6F2
-0xA66E  0xE6F3  #PRIVATE USE AREA-E6F3
-0xA66F  0xE6F4  #PRIVATE USE AREA-E6F4
-0xA670  0xE6F5  #PRIVATE USE AREA-E6F5
-0xA671  0xE6F6  #PRIVATE USE AREA-E6F6
-0xA672  0xE6F7  #PRIVATE USE AREA-E6F7
-0xA673  0xE6F8  #PRIVATE USE AREA-E6F8
-0xA674  0xE6F9  #PRIVATE USE AREA-E6F9
-0xA675  0xE6FA  #PRIVATE USE AREA-E6FA
-0xA676  0xE6FB  #PRIVATE USE AREA-E6FB
-0xA677  0xE6FC  #PRIVATE USE AREA-E6FC
-0xA678  0xE6FD  #PRIVATE USE AREA-E6FD
-0xA679  0xE6FE  #PRIVATE USE AREA-E6FE
-0xA67A  0xE6FF  #PRIVATE USE AREA-E6FF
-0xA67B  0xE700  #PRIVATE USE AREA-E700
-0xA67C  0xE701  #PRIVATE USE AREA-E701
-0xA67D  0xE702  #PRIVATE USE AREA-E702
-0xA67E  0xE703  #PRIVATE USE AREA-E703
-0xA680  0xE704  #PRIVATE USE AREA-E704
-0xA681  0xE705  #PRIVATE USE AREA-E705
-0xA682  0xE706  #PRIVATE USE AREA-E706
-0xA683  0xE707  #PRIVATE USE AREA-E707
-0xA684  0xE708  #PRIVATE USE AREA-E708
-0xA685  0xE709  #PRIVATE USE AREA-E709
-0xA686  0xE70A  #PRIVATE USE AREA-E70A
-0xA687  0xE70B  #PRIVATE USE AREA-E70B
-0xA688  0xE70C  #PRIVATE USE AREA-E70C
-0xA689  0xE70D  #PRIVATE USE AREA-E70D
-0xA68A  0xE70E  #PRIVATE USE AREA-E70E
-0xA68B  0xE70F  #PRIVATE USE AREA-E70F
-0xA68C  0xE710  #PRIVATE USE AREA-E710
-0xA68D  0xE711  #PRIVATE USE AREA-E711
-0xA68E  0xE712  #PRIVATE USE AREA-E712
-0xA68F  0xE713  #PRIVATE USE AREA-E713
-0xA690  0xE714  #PRIVATE USE AREA-E714
-0xA691  0xE715  #PRIVATE USE AREA-E715
-0xA692  0xE716  #PRIVATE USE AREA-E716
-0xA693  0xE717  #PRIVATE USE AREA-E717
-0xA694  0xE718  #PRIVATE USE AREA-E718
-0xA695  0xE719  #PRIVATE USE AREA-E719
-0xA696  0xE71A  #PRIVATE USE AREA-E71A
-0xA697  0xE71B  #PRIVATE USE AREA-E71B
-0xA698  0xE71C  #PRIVATE USE AREA-E71C
-0xA699  0xE71D  #PRIVATE USE AREA-E71D
-0xA69A  0xE71E  #PRIVATE USE AREA-E71E
-0xA69B  0xE71F  #PRIVATE USE AREA-E71F
-0xA69C  0xE720  #PRIVATE USE AREA-E720
-0xA69D  0xE721  #PRIVATE USE AREA-E721
-0xA69E  0xE722  #PRIVATE USE AREA-E722
-0xA69F  0xE723  #PRIVATE USE AREA-E723
-0xA6A0  0xE724  #PRIVATE USE AREA-E724
+0xA5F7  0xE77D  #PRIVATE USE AREA-E77D
+0xA5F8  0xE77E  #PRIVATE USE AREA-E77E
+0xA5F9  0xE77F  #PRIVATE USE AREA-E77F
+0xA5FA  0xE780  #PRIVATE USE AREA-E780
+0xA5FB  0xE781  #PRIVATE USE AREA-E781
+0xA5FC  0xE782  #PRIVATE USE AREA-E782
+0xA5FD  0xE783  #PRIVATE USE AREA-E783
+0xA5FE  0xE784  #PRIVATE USE AREA-E784
+0xA640  0xE6A6  #PRIVATE USE AREA-E6A6
+0xA641  0xE6A7  #PRIVATE USE AREA-E6A7
+0xA642  0xE6A8  #PRIVATE USE AREA-E6A8
+0xA643  0xE6A9  #PRIVATE USE AREA-E6A9
+0xA644  0xE6AA  #PRIVATE USE AREA-E6AA
+0xA645  0xE6AB  #PRIVATE USE AREA-E6AB
+0xA646  0xE6AC  #PRIVATE USE AREA-E6AC
+0xA647  0xE6AD  #PRIVATE USE AREA-E6AD
+0xA648  0xE6AE  #PRIVATE USE AREA-E6AE
+0xA649  0xE6AF  #PRIVATE USE AREA-E6AF
+0xA64A  0xE6B0  #PRIVATE USE AREA-E6B0
+0xA64B  0xE6B1  #PRIVATE USE AREA-E6B1
+0xA64C  0xE6B2  #PRIVATE USE AREA-E6B2
+0xA64D  0xE6B3  #PRIVATE USE AREA-E6B3
+0xA64E  0xE6B4  #PRIVATE USE AREA-E6B4
+0xA64F  0xE6B5  #PRIVATE USE AREA-E6B5
+0xA650  0xE6B6  #PRIVATE USE AREA-E6B6
+0xA651  0xE6B7  #PRIVATE USE AREA-E6B7
+0xA652  0xE6B8  #PRIVATE USE AREA-E6B8
+0xA653  0xE6B9  #PRIVATE USE AREA-E6B9
+0xA654  0xE6BA  #PRIVATE USE AREA-E6BA
+0xA655  0xE6BB  #PRIVATE USE AREA-E6BB
+0xA656  0xE6BC  #PRIVATE USE AREA-E6BC
+0xA657  0xE6BD  #PRIVATE USE AREA-E6BD
+0xA658  0xE6BE  #PRIVATE USE AREA-E6BE
+0xA659  0xE6BF  #PRIVATE USE AREA-E6BF
+0xA65A  0xE6C0  #PRIVATE USE AREA-E6C0
+0xA65B  0xE6C1  #PRIVATE USE AREA-E6C1
+0xA65C  0xE6C2  #PRIVATE USE AREA-E6C2
+0xA65D  0xE6C3  #PRIVATE USE AREA-E6C3
+0xA65E  0xE6C4  #PRIVATE USE AREA-E6C4
+0xA65F  0xE6C5  #PRIVATE USE AREA-E6C5
+0xA660  0xE6C6  #PRIVATE USE AREA-E6C6
+0xA661  0xE6C7  #PRIVATE USE AREA-E6C7
+0xA662  0xE6C8  #PRIVATE USE AREA-E6C8
+0xA663  0xE6C9  #PRIVATE USE AREA-E6C9
+0xA664  0xE6CA  #PRIVATE USE AREA-E6CA
+0xA665  0xE6CB  #PRIVATE USE AREA-E6CB
+0xA666  0xE6CC  #PRIVATE USE AREA-E6CC
+0xA667  0xE6CD  #PRIVATE USE AREA-E6CD
+0xA668  0xE6CE  #PRIVATE USE AREA-E6CE
+0xA669  0xE6CF  #PRIVATE USE AREA-E6CF
+0xA66A  0xE6D0  #PRIVATE USE AREA-E6D0
+0xA66B  0xE6D1  #PRIVATE USE AREA-E6D1
+0xA66C  0xE6D2  #PRIVATE USE AREA-E6D2
+0xA66D  0xE6D3  #PRIVATE USE AREA-E6D3
+0xA66E  0xE6D4  #PRIVATE USE AREA-E6D4
+0xA66F  0xE6D5  #PRIVATE USE AREA-E6D5
+0xA670  0xE6D6  #PRIVATE USE AREA-E6D6
+0xA671  0xE6D7  #PRIVATE USE AREA-E6D7
+0xA672  0xE6D8  #PRIVATE USE AREA-E6D8
+0xA673  0xE6D9  #PRIVATE USE AREA-E6D9
+0xA674  0xE6DA  #PRIVATE USE AREA-E6DA
+0xA675  0xE6DB  #PRIVATE USE AREA-E6DB
+0xA676  0xE6DC  #PRIVATE USE AREA-E6DC
+0xA677  0xE6DD  #PRIVATE USE AREA-E6DD
+0xA678  0xE6DE  #PRIVATE USE AREA-E6DE
+0xA679  0xE6DF  #PRIVATE USE AREA-E6DF
+0xA67A  0xE6E0  #PRIVATE USE AREA-E6E0
+0xA67B  0xE6E1  #PRIVATE USE AREA-E6E1
+0xA67C  0xE6E2  #PRIVATE USE AREA-E6E2
+0xA67D  0xE6E3  #PRIVATE USE AREA-E6E3
+0xA67E  0xE6E4  #PRIVATE USE AREA-E6E4
+0xA680  0xE6E5  #PRIVATE USE AREA-E6E5
+0xA681  0xE6E6  #PRIVATE USE AREA-E6E6
+0xA682  0xE6E7  #PRIVATE USE AREA-E6E7
+0xA683  0xE6E8  #PRIVATE USE AREA-E6E8
+0xA684  0xE6E9  #PRIVATE USE AREA-E6E9
+0xA685  0xE6EA  #PRIVATE USE AREA-E6EA
+0xA686  0xE6EB  #PRIVATE USE AREA-E6EB
+0xA687  0xE6EC  #PRIVATE USE AREA-E6EC
+0xA688  0xE6ED  #PRIVATE USE AREA-E6ED
+0xA689  0xE6EE  #PRIVATE USE AREA-E6EE
+0xA68A  0xE6EF  #PRIVATE USE AREA-E6EF
+0xA68B  0xE6F0  #PRIVATE USE AREA-E6F0
+0xA68C  0xE6F1  #PRIVATE USE AREA-E6F1
+0xA68D  0xE6F2  #PRIVATE USE AREA-E6F2
+0xA68E  0xE6F3  #PRIVATE USE AREA-E6F3
+0xA68F  0xE6F4  #PRIVATE USE AREA-E6F4
+0xA690  0xE6F5  #PRIVATE USE AREA-E6F5
+0xA691  0xE6F6  #PRIVATE USE AREA-E6F6
+0xA692  0xE6F7  #PRIVATE USE AREA-E6F7
+0xA693  0xE6F8  #PRIVATE USE AREA-E6F8
+0xA694  0xE6F9  #PRIVATE USE AREA-E6F9
+0xA695  0xE6FA  #PRIVATE USE AREA-E6FA
+0xA696  0xE6FB  #PRIVATE USE AREA-E6FB
+0xA697  0xE6FC  #PRIVATE USE AREA-E6FC
+0xA698  0xE6FD  #PRIVATE USE AREA-E6FD
+0xA699  0xE6FE  #PRIVATE USE AREA-E6FE
+0xA69A  0xE6FF  #PRIVATE USE AREA-E6FF
+0xA69B  0xE700  #PRIVATE USE AREA-E700
+0xA69C  0xE701  #PRIVATE USE AREA-E701
+0xA69D  0xE702  #PRIVATE USE AREA-E702
+0xA69E  0xE703  #PRIVATE USE AREA-E703
+0xA69F  0xE704  #PRIVATE USE AREA-E704
+0xA6A0  0xE705  #PRIVATE USE AREA-E705
 0xA6A1	0x0391  #GREEK CAPITAL LETTER ALPHA
 0xA6A2	0x0392  #GREEK CAPITAL LETTER BETA
 0xA6A3	0x0393  #GREEK CAPITAL LETTER GAMMA
@@ -7307,14 +7284,14 @@
 0xA6B6	0x03A7  #GREEK CAPITAL LETTER CHI
 0xA6B7	0x03A8  #GREEK CAPITAL LETTER PSI
 0xA6B8	0x03A9  #GREEK CAPITAL LETTER OMEGA
-0xA6B9  0xE725  #PRIVATE USE AREA-E725
-0xA6BA  0xE726  #PRIVATE USE AREA-E726
-0xA6BB  0xE727  #PRIVATE USE AREA-E727
-0xA6BC  0xE728  #PRIVATE USE AREA-E728
-0xA6BD  0xE729  #PRIVATE USE AREA-E729
-0xA6BE  0xE72A  #PRIVATE USE AREA-E72A
-0xA6BF  0xE72B  #PRIVATE USE AREA-E72B
-0xA6C0  0xE72C  #PRIVATE USE AREA-E72C
+0xA6B9  0xE785  #PRIVATE USE AREA-E785
+0xA6BA  0xE786  #PRIVATE USE AREA-E786
+0xA6BB  0xE787  #PRIVATE USE AREA-E787
+0xA6BC  0xE788  #PRIVATE USE AREA-E788
+0xA6BD  0xE789  #PRIVATE USE AREA-E789
+0xA6BE  0xE78A  #PRIVATE USE AREA-E78A
+0xA6BF  0xE78B  #PRIVATE USE AREA-E78B
+0xA6C0  0xE78C  #PRIVATE USE AREA-E78C
 0xA6C1	0x03B1  #GREEK SMALL LETTER ALPHA
 0xA6C2	0x03B2  #GREEK SMALL LETTER BETA
 0xA6C3	0x03B3  #GREEK SMALL LETTER GAMMA
@@ -7339,13 +7316,13 @@
 0xA6D6	0x03C7  #GREEK SMALL LETTER CHI
 0xA6D7	0x03C8  #GREEK SMALL LETTER PSI
 0xA6D8	0x03C9  #GREEK SMALL LETTER OMEGA
-0xA6D9  0xE72D  #PRIVATE USE AREA-E72D
-0xA6DA  0xE72E  #PRIVATE USE AREA-E72E
-0xA6DB  0xE72F  #PRIVATE USE AREA-E72F
-0xA6DC  0xE730  #PRIVATE USE AREA-E730
-0xA6DD  0xE731  #PRIVATE USE AREA-E731
-0xA6DE  0xE732  #PRIVATE USE AREA-E732
-0xA6DF  0xE733  #PRIVATE USE AREA-E733
+0xA6D9  0xE78D  #PRIVATE USE AREA-E78D
+0xA6DA  0xE78E  #PRIVATE USE AREA-E78E
+0xA6DB  0xE78F  #PRIVATE USE AREA-E78F
+0xA6DC  0xE790  #PRIVATE USE AREA-E790
+0xA6DD  0xE791  #PRIVATE USE AREA-E791
+0xA6DE  0xE792  #PRIVATE USE AREA-E792
+0xA6DF  0xE793  #PRIVATE USE AREA-E793
 0xA6E0	0xFE35  #PRESENTATION FORM FOR VERTICAL LEFT PARENTHESIS
 0xA6E1	0xFE36  #PRESENTATION FORM FOR VERTICAL RIGHT PARENTHESIS
 0xA6E2	0xFE39  #PRESENTATION FORM FOR VERTICAL LEFT TORTOISE SHELL BRACKET
@@ -7358,121 +7335,121 @@
 0xA6E9	0xFE42  #PRESENTATION FORM FOR VERTICAL RIGHT CORNER BRACKET
 0xA6EA	0xFE43  #PRESENTATION FORM FOR VERTICAL LEFT WHITE CORNER BRACKET
 0xA6EB	0xFE44  #PRESENTATION FORM FOR VERTICAL RIGHT WHITE CORNER BRACKET
-0xA6EC  0xE734  #PRIVATE USE AREA-E734
-0xA6ED  0xE735  #PRIVATE USE AREA-E735
+0xA6EC  0xE794  #PRIVATE USE AREA-E794
+0xA6ED  0xE795  #PRIVATE USE AREA-E795
 0xA6EE	0xFE3B  #PRESENTATION FORM FOR VERTICAL LEFT BLACK LENTICULAR BRACKET
 0xA6EF	0xFE3C  #PRESENTATION FORM FOR VERTICAL RIGHT BLACK LENTICULAR BRACKET
 0xA6F0	0xFE37  #PRESENTATION FORM FOR VERTICAL LEFT CURLY BRACKET
 0xA6F1	0xFE38  #PRESENTATION FORM FOR VERTICAL RIGHT CURLY BRACKET
 0xA6F2	0xFE31  #PRESENTATION FORM FOR VERTICAL EM DASH
-0xA6F3  0xE736  #PRIVATE USE AREA-E736
+0xA6F3  0xE796  #PRIVATE USE AREA-E796
 0xA6F4	0xFE33  #PRESENTATION FORM FOR VERTICAL LOW LINE
 0xA6F5	0xFE34  #PRESENTATION FORM FOR VERTICAL WAVY LOW LINE
-0xA6F6  0xE737  #PRIVATE USE AREA-E737
-0xA6F7  0xE738  #PRIVATE USE AREA-E738
-0xA6F8  0xE739  #PRIVATE USE AREA-E739
-0xA6F9  0xE73A  #PRIVATE USE AREA-E73A
-0xA6FA  0xE73B  #PRIVATE USE AREA-E73B
-0xA6FB  0xE73C  #PRIVATE USE AREA-E73C
-0xA6FC  0xE73D  #PRIVATE USE AREA-E73D
-0xA6FD  0xE73E  #PRIVATE USE AREA-E73E
-0xA6FE  0xE73F  #PRIVATE USE AREA-E73F
-0xA740  0xE740  #PRIVATE USE AREA-E740
-0xA741  0xE741  #PRIVATE USE AREA-E741
-0xA742  0xE742  #PRIVATE USE AREA-E742
-0xA743  0xE743  #PRIVATE USE AREA-E743
-0xA744  0xE744  #PRIVATE USE AREA-E744
-0xA745  0xE745  #PRIVATE USE AREA-E745
-0xA746  0xE746  #PRIVATE USE AREA-E746
-0xA747  0xE747  #PRIVATE USE AREA-E747
-0xA748  0xE748  #PRIVATE USE AREA-E748
-0xA749  0xE749  #PRIVATE USE AREA-E749
-0xA74A  0xE74A  #PRIVATE USE AREA-E74A
-0xA74B  0xE74B  #PRIVATE USE AREA-E74B
-0xA74C  0xE74C  #PRIVATE USE AREA-E74C
-0xA74D  0xE74D  #PRIVATE USE AREA-E74D
-0xA74E  0xE74E  #PRIVATE USE AREA-E74E
-0xA74F  0xE74F  #PRIVATE USE AREA-E74F
-0xA750  0xE750  #PRIVATE USE AREA-E750
-0xA751  0xE751  #PRIVATE USE AREA-E751
-0xA752  0xE752  #PRIVATE USE AREA-E752
-0xA753  0xE753  #PRIVATE USE AREA-E753
-0xA754  0xE754  #PRIVATE USE AREA-E754
-0xA755  0xE755  #PRIVATE USE AREA-E755
-0xA756  0xE756  #PRIVATE USE AREA-E756
-0xA757  0xE757  #PRIVATE USE AREA-E757
-0xA758  0xE758  #PRIVATE USE AREA-E758
-0xA759  0xE759  #PRIVATE USE AREA-E759
-0xA75A  0xE75A  #PRIVATE USE AREA-E75A
-0xA75B  0xE75B  #PRIVATE USE AREA-E75B
-0xA75C  0xE75C  #PRIVATE USE AREA-E75C
-0xA75D  0xE75D  #PRIVATE USE AREA-E75D
-0xA75E  0xE75E  #PRIVATE USE AREA-E75E
-0xA75F  0xE75F  #PRIVATE USE AREA-E75F
-0xA760  0xE760  #PRIVATE USE AREA-E760
-0xA761  0xE761  #PRIVATE USE AREA-E761
-0xA762  0xE762  #PRIVATE USE AREA-E762
-0xA763  0xE763  #PRIVATE USE AREA-E763
-0xA764  0xE764  #PRIVATE USE AREA-E764
-0xA765  0xE765  #PRIVATE USE AREA-E765
-0xA766  0xE766  #PRIVATE USE AREA-E766
-0xA767  0xE767  #PRIVATE USE AREA-E767
-0xA768  0xE768  #PRIVATE USE AREA-E768
-0xA769  0xE769  #PRIVATE USE AREA-E769
-0xA76A  0xE76A  #PRIVATE USE AREA-E76A
-0xA76B  0xE76B  #PRIVATE USE AREA-E76B
-0xA76C  0xE76C  #PRIVATE USE AREA-E76C
-0xA76D  0xE76D  #PRIVATE USE AREA-E76D
-0xA76E  0xE76E  #PRIVATE USE AREA-E76E
-0xA76F  0xE76F  #PRIVATE USE AREA-E76F
-0xA770  0xE770  #PRIVATE USE AREA-E770
-0xA771  0xE771  #PRIVATE USE AREA-E771
-0xA772  0xE772  #PRIVATE USE AREA-E772
-0xA773  0xE773  #PRIVATE USE AREA-E773
-0xA774  0xE774  #PRIVATE USE AREA-E774
-0xA775  0xE775  #PRIVATE USE AREA-E775
-0xA776  0xE776  #PRIVATE USE AREA-E776
-0xA777  0xE777  #PRIVATE USE AREA-E777
-0xA778  0xE778  #PRIVATE USE AREA-E778
-0xA779  0xE779  #PRIVATE USE AREA-E779
-0xA77A  0xE77A  #PRIVATE USE AREA-E77A
-0xA77B  0xE77B  #PRIVATE USE AREA-E77B
-0xA77C  0xE77C  #PRIVATE USE AREA-E77C
-0xA77D  0xE77D  #PRIVATE USE AREA-E77D
-0xA77E  0xE77E  #PRIVATE USE AREA-E77E
-0xA780  0xE77F  #PRIVATE USE AREA-E77F
-0xA781  0xE780  #PRIVATE USE AREA-E780
-0xA782  0xE781  #PRIVATE USE AREA-E781
-0xA783  0xE782  #PRIVATE USE AREA-E782
-0xA784  0xE783  #PRIVATE USE AREA-E783
-0xA785  0xE784  #PRIVATE USE AREA-E784
-0xA786  0xE785  #PRIVATE USE AREA-E785
-0xA787  0xE786  #PRIVATE USE AREA-E786
-0xA788  0xE787  #PRIVATE USE AREA-E787
-0xA789  0xE788  #PRIVATE USE AREA-E788
-0xA78A  0xE789  #PRIVATE USE AREA-E789
-0xA78B  0xE78A  #PRIVATE USE AREA-E78A
-0xA78C  0xE78B  #PRIVATE USE AREA-E78B
-0xA78D  0xE78C  #PRIVATE USE AREA-E78C
-0xA78E  0xE78D  #PRIVATE USE AREA-E78D
-0xA78F  0xE78E  #PRIVATE USE AREA-E78E
-0xA790  0xE78F  #PRIVATE USE AREA-E78F
-0xA791  0xE790  #PRIVATE USE AREA-E790
-0xA792  0xE791  #PRIVATE USE AREA-E791
-0xA793  0xE792  #PRIVATE USE AREA-E792
-0xA794  0xE793  #PRIVATE USE AREA-E793
-0xA795  0xE794  #PRIVATE USE AREA-E794
-0xA796  0xE795  #PRIVATE USE AREA-E795
-0xA797  0xE796  #PRIVATE USE AREA-E796
-0xA798  0xE797  #PRIVATE USE AREA-E797
-0xA799  0xE798  #PRIVATE USE AREA-E798
-0xA79A  0xE799  #PRIVATE USE AREA-E799
-0xA79B  0xE79A  #PRIVATE USE AREA-E79A
-0xA79C  0xE79B  #PRIVATE USE AREA-E79B
-0xA79D  0xE79C  #PRIVATE USE AREA-E79C
-0xA79E  0xE79D  #PRIVATE USE AREA-E79D
-0xA79F  0xE79E  #PRIVATE USE AREA-E79E
-0xA7A0  0xE79F  #PRIVATE USE AREA-E79F
+0xA6F6  0xE797  #PRIVATE USE AREA-E797
+0xA6F7  0xE798  #PRIVATE USE AREA-E798
+0xA6F8  0xE799  #PRIVATE USE AREA-E799
+0xA6F9  0xE79A  #PRIVATE USE AREA-E79A
+0xA6FA  0xE79B  #PRIVATE USE AREA-E79B
+0xA6FB  0xE79C  #PRIVATE USE AREA-E79C
+0xA6FC  0xE79D  #PRIVATE USE AREA-E79D
+0xA6FD  0xE79E  #PRIVATE USE AREA-E79E
+0xA6FE  0xE79F  #PRIVATE USE AREA-E79F
+0xA740  0xE706  #PRIVATE USE AREA-E706
+0xA741  0xE707  #PRIVATE USE AREA-E707
+0xA742  0xE708  #PRIVATE USE AREA-E708
+0xA743  0xE709  #PRIVATE USE AREA-E709
+0xA744  0xE70A  #PRIVATE USE AREA-E70A
+0xA745  0xE70B  #PRIVATE USE AREA-E70B
+0xA746  0xE70C  #PRIVATE USE AREA-E70C
+0xA747  0xE70D  #PRIVATE USE AREA-E70D
+0xA748  0xE70E  #PRIVATE USE AREA-E70E
+0xA749  0xE70F  #PRIVATE USE AREA-E70F
+0xA74A  0xE710  #PRIVATE USE AREA-E710
+0xA74B  0xE711  #PRIVATE USE AREA-E711
+0xA74C  0xE712  #PRIVATE USE AREA-E712
+0xA74D  0xE713  #PRIVATE USE AREA-E713
+0xA74E  0xE714  #PRIVATE USE AREA-E714
+0xA74F  0xE715  #PRIVATE USE AREA-E715
+0xA750  0xE716  #PRIVATE USE AREA-E716
+0xA751  0xE717  #PRIVATE USE AREA-E717
+0xA752  0xE718  #PRIVATE USE AREA-E718
+0xA753  0xE719  #PRIVATE USE AREA-E719
+0xA754  0xE71A  #PRIVATE USE AREA-E71A
+0xA755  0xE71B  #PRIVATE USE AREA-E71B
+0xA756  0xE71C  #PRIVATE USE AREA-E71C
+0xA757  0xE71D  #PRIVATE USE AREA-E71D
+0xA758  0xE71E  #PRIVATE USE AREA-E71E
+0xA759  0xE71F  #PRIVATE USE AREA-E71F
+0xA75A  0xE720  #PRIVATE USE AREA-E720
+0xA75B  0xE721  #PRIVATE USE AREA-E721
+0xA75C  0xE722  #PRIVATE USE AREA-E722
+0xA75D  0xE723  #PRIVATE USE AREA-E723
+0xA75E  0xE724  #PRIVATE USE AREA-E724
+0xA75F  0xE725  #PRIVATE USE AREA-E725
+0xA760  0xE726  #PRIVATE USE AREA-E726
+0xA761  0xE727  #PRIVATE USE AREA-E727
+0xA762  0xE728  #PRIVATE USE AREA-E728
+0xA763  0xE729  #PRIVATE USE AREA-E729
+0xA764  0xE72A  #PRIVATE USE AREA-E72A
+0xA765  0xE72B  #PRIVATE USE AREA-E72B
+0xA766  0xE72C  #PRIVATE USE AREA-E72C
+0xA767  0xE72D  #PRIVATE USE AREA-E72D
+0xA768  0xE72E  #PRIVATE USE AREA-E72E
+0xA769  0xE72F  #PRIVATE USE AREA-E72F
+0xA76A  0xE730  #PRIVATE USE AREA-E730
+0xA76B  0xE731  #PRIVATE USE AREA-E731
+0xA76C  0xE732  #PRIVATE USE AREA-E732
+0xA76D  0xE733  #PRIVATE USE AREA-E733
+0xA76E  0xE734  #PRIVATE USE AREA-E734
+0xA76F  0xE735  #PRIVATE USE AREA-E735
+0xA770  0xE736  #PRIVATE USE AREA-E736
+0xA771  0xE737  #PRIVATE USE AREA-E737
+0xA772  0xE738  #PRIVATE USE AREA-E738
+0xA773  0xE739  #PRIVATE USE AREA-E739
+0xA774  0xE73A  #PRIVATE USE AREA-E73A
+0xA775  0xE73B  #PRIVATE USE AREA-E73B
+0xA776  0xE73C  #PRIVATE USE AREA-E73C
+0xA777  0xE73D  #PRIVATE USE AREA-E73D
+0xA778  0xE73E  #PRIVATE USE AREA-E73E
+0xA779  0xE73F  #PRIVATE USE AREA-E73F
+0xA77A  0xE740  #PRIVATE USE AREA-E740
+0xA77B  0xE741  #PRIVATE USE AREA-E741
+0xA77C  0xE742  #PRIVATE USE AREA-E742
+0xA77D  0xE743  #PRIVATE USE AREA-E743
+0xA77E  0xE744  #PRIVATE USE AREA-E744
+0xA780  0xE745  #PRIVATE USE AREA-E745
+0xA781  0xE746  #PRIVATE USE AREA-E746
+0xA782  0xE747  #PRIVATE USE AREA-E747
+0xA783  0xE748  #PRIVATE USE AREA-E748
+0xA784  0xE749  #PRIVATE USE AREA-E749
+0xA785  0xE74A  #PRIVATE USE AREA-E74A
+0xA786  0xE74B  #PRIVATE USE AREA-E74B
+0xA787  0xE74C  #PRIVATE USE AREA-E74C
+0xA788  0xE74D  #PRIVATE USE AREA-E74D
+0xA789  0xE74E  #PRIVATE USE AREA-E74E
+0xA78A  0xE74F  #PRIVATE USE AREA-E74F
+0xA78B  0xE750  #PRIVATE USE AREA-E750
+0xA78C  0xE751  #PRIVATE USE AREA-E751
+0xA78D  0xE752  #PRIVATE USE AREA-E752
+0xA78E  0xE753  #PRIVATE USE AREA-E753
+0xA78F  0xE754  #PRIVATE USE AREA-E754
+0xA790  0xE755  #PRIVATE USE AREA-E755
+0xA791  0xE756  #PRIVATE USE AREA-E756
+0xA792  0xE757  #PRIVATE USE AREA-E757
+0xA793  0xE758  #PRIVATE USE AREA-E758
+0xA794  0xE759  #PRIVATE USE AREA-E759
+0xA795  0xE75A  #PRIVATE USE AREA-E75A
+0xA796  0xE75B  #PRIVATE USE AREA-E75B
+0xA797  0xE75C  #PRIVATE USE AREA-E75C
+0xA798  0xE75D  #PRIVATE USE AREA-E75D
+0xA799  0xE75E  #PRIVATE USE AREA-E75E
+0xA79A  0xE75F  #PRIVATE USE AREA-E75F
+0xA79B  0xE760  #PRIVATE USE AREA-E760
+0xA79C  0xE761  #PRIVATE USE AREA-E761
+0xA79D  0xE762  #PRIVATE USE AREA-E762
+0xA79E  0xE763  #PRIVATE USE AREA-E763
+0xA79F  0xE764  #PRIVATE USE AREA-E764
+0xA7A0  0xE765  #PRIVATE USE AREA-E765
 0xA7A1	0x0410  #CYRILLIC CAPITAL LETTER A
 0xA7A2	0x0411  #CYRILLIC CAPITAL LETTER BE
 0xA7A3	0x0412  #CYRILLIC CAPITAL LETTER VE
diff --git a/make/tools/Makefile b/make/tools/Makefile
index ad30894..f3af119 100644
--- a/make/tools/Makefile
+++ b/make/tools/Makefile
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -58,6 +58,11 @@
   SUBDIRS += generate_nimbus
 endif
 
+ifeq ($(PLATFORM), solaris)
+  # temporary tools to work around gobjcopy bugs
+  SUBDIRS += add_gnu_debuglink fix_empty_sec_hdr_flags
+endif
+
 include $(BUILDDIR)/common/Subdirs.gmk
 
 all build clean clobber::
diff --git a/make/tools/add_gnu_debuglink/Makefile b/make/tools/add_gnu_debuglink/Makefile
new file mode 100644
index 0000000..37b53cf
--- /dev/null
+++ b/make/tools/add_gnu_debuglink/Makefile
@@ -0,0 +1,46 @@
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#  
+#
+
+# Rules to build add_gnu_debuglink, used by various Makefiles on Solaris
+
+BUILDDIR = ../..
+include $(BUILDDIR)/common/Defs.gmk
+
+# Default name
+PROGRAM = add_gnu_debuglink
+ADD_GNU_DEBUGLINK_PROG = $(ABS_BUILDTOOLBINDIR)/$(PROGRAM)
+
+ADD_GNU_DEBUGLINK_SRC     = add_gnu_debuglink.c
+ADD_GNU_DEBUGLINK_FLAGS   = 
+LIBS_ADD_GNU_DEBUGLINK   += -lelf
+
+all: $(ADD_GNU_DEBUGLINK)
+
+$(ADD_GNU_DEBUGLINK_PROG): $(ADD_GNU_DEBUGLINK_SRC)
+	$(MKDIR) -p $(BUILDTOOLBINDIR)
+	$(CC) -g -o $@ $< $(ADD_GNU_DEBUGLINK_FLAGS) $(LIBS_ADD_GNU_DEBUGLINK)
+
+clean::
+	$(RM) $(ADD_GNU_DEBUGLINK_PROG)
+
diff --git a/make/tools/add_gnu_debuglink/add_gnu_debuglink.c b/make/tools/add_gnu_debuglink/add_gnu_debuglink.c
new file mode 100644
index 0000000..3cb2dc4
--- /dev/null
+++ b/make/tools/add_gnu_debuglink/add_gnu_debuglink.c
@@ -0,0 +1,285 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/*
+ * Name:        add_gnu_debuglink.c
+ *
+ * Description: Add a ".gnu_debuglink" section that refers to the specified
+ *     debug_info_path to the specified ELF object.
+ *
+ *     This program is adapted from the example program shown on the
+ *     elf(3elf) man page and from code from the Solaris compiler
+ *     driver.
+ */
+
+/*
+ * needed to define SHF_EXCLUDE
+ */
+#define ELF_TARGET_ALL
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <libelf.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+static void failure(void);
+static unsigned int gnu_debuglink_crc32(unsigned int crc, unsigned char *buf,
+                                        size_t len);
+
+void
+main(int argc, char ** argv) {
+                                 /* new ELF section name */
+    static char SEC_NAME[] = ".gnu_debuglink";
+
+    unsigned char buffer[8 * 1024];  /* I/O buffer */
+    int           buffer_len;        /* buffer length */
+    char *        debug_info_path;   /* debug info path */
+    void *        ehdr;              /* ELF header */
+    Elf *         elf;               /* ELF descriptor */
+    char *        elf_ident;         /* ELF identity string */
+    char *        elf_obj;           /* elf_obj file */
+    int           fd;                /* descriptor for files */
+    unsigned int  file_crc = 0;      /* CRC for debug info file */
+    int           is_elfclass64;     /* is an ELFCLASS64 file? */
+    Elf_Data *    link_dat;          /* ELF data for new debug info link */
+    Elf_Data *    name_dat;          /* ELF data for new section name */
+    Elf_Scn *     new_scn;           /* new ELF section descriptor */
+    void *        new_shdr;          /* new ELF section header */
+    Elf_Scn *     scn;               /* ELF section descriptor */
+    void *        shdr;              /* ELF section header */
+
+    if (argc != 3) {
+        (void) fprintf(stderr, "Usage: %s debug_info_path elf_obj\n", argv[0]);
+        exit(2);
+    }
+
+    debug_info_path = argv[1];  /* save for later */
+    if ((fd = open(debug_info_path, O_RDONLY)) == -1) {
+        (void) fprintf(stderr, "%s: cannot open file.\n", debug_info_path);
+        exit(3);
+    }
+
+    (void) printf("Computing CRC for '%s'\n", debug_info_path);
+    (void) fflush(stdout);
+    /* compute CRC for the debug info file */
+    for (;;) {
+        int len = read(fd, buffer, sizeof buffer);
+        if (len <= 0) {
+            break;
+        }
+        file_crc = gnu_debuglink_crc32(file_crc, buffer, len);
+    }
+    (void) close(fd);
+
+    /* open the elf_obj */
+    elf_obj = argv[2];
+    if ((fd = open(elf_obj, O_RDWR)) == -1) {
+        (void) fprintf(stderr, "%s: cannot open file.\n", elf_obj);
+        exit(4);
+    }
+
+    (void) printf("Opening '%s' for update\n", elf_obj);
+    (void) fflush(stdout);
+    (void) elf_version(EV_CURRENT);  /* coordinate ELF versions */
+
+    /* obtain the ELF descriptors from the input file */
+    if ((elf = elf_begin(fd, ELF_C_RDWR, NULL)) == NULL) {
+        failure();
+    }
+
+    /* determine if ELFCLASS64 or not? */
+    elf_ident = elf_getident(elf, NULL);
+    is_elfclass64 = (elf_ident[EI_CLASS] == ELFCLASS64);
+
+    /* get the ELF header */
+    if (is_elfclass64) {
+        ehdr = elf64_getehdr(elf);
+    } else {
+        ehdr = elf32_getehdr(elf);
+    }
+    if (ehdr == NULL) {
+        failure();
+    }
+
+    /* get the ELF section descriptor */
+    if (is_elfclass64) {
+        scn = elf_getscn(elf, ((Elf64_Ehdr *) ehdr)->e_shstrndx);
+    } else {
+        scn = elf_getscn(elf, ((Elf32_Ehdr *) ehdr)->e_shstrndx);
+    }
+    if (scn == NULL) {
+        failure();
+    }
+
+    /* get the section header */
+    if (is_elfclass64) {
+        shdr = elf64_getshdr(scn);
+    } else {
+        shdr = elf32_getshdr(scn);
+    }
+    if (shdr == NULL) {
+        failure();
+    }
+
+    (void) printf("Adding ELF data for new section name\n");
+    (void) fflush(stdout);
+    name_dat = elf_newdata(scn);
+    name_dat->d_buf = (void *) SEC_NAME;
+    if (is_elfclass64) {
+        name_dat->d_off = ((Elf64_Shdr *) shdr)->sh_size + 1;
+    } else {
+        name_dat->d_off = ((Elf32_Shdr *) shdr)->sh_size + 1;
+    }
+    name_dat->d_align = 1;
+    name_dat->d_size = strlen(SEC_NAME) + 1;
+
+    new_scn = elf_newscn(elf);
+
+    if (is_elfclass64) {
+        new_shdr = elf64_getshdr(new_scn);
+        ((Elf64_Shdr *) new_shdr)->sh_flags = SHF_EXCLUDE;
+        ((Elf64_Shdr *) new_shdr)->sh_type = SHT_PROGBITS;
+        ((Elf64_Shdr *) new_shdr)->sh_name = ((Elf64_Shdr *) shdr)->sh_size;
+        ((Elf64_Shdr *) new_shdr)->sh_addralign = 1;
+        ((Elf64_Shdr *) shdr)->sh_size += (strlen(SEC_NAME) + 1);
+    } else {
+        new_shdr = elf32_getshdr(new_scn);
+        ((Elf32_Shdr *) new_shdr)->sh_flags = SHF_EXCLUDE;
+        ((Elf32_Shdr *) new_shdr)->sh_type = SHT_PROGBITS;
+        ((Elf32_Shdr *) new_shdr)->sh_name = ((Elf32_Shdr *) shdr)->sh_size;
+        ((Elf32_Shdr *) new_shdr)->sh_addralign = 1;
+        ((Elf32_Shdr *) shdr)->sh_size += (strlen(SEC_NAME) + 1);
+    }
+
+    (void) printf("Adding ELF data for debug_info_path value\n");
+    (void) fflush(stdout);
+    (void) memset(buffer, 0, sizeof buffer);
+    buffer_len = strlen(debug_info_path) + 1;  /* +1 for NUL */
+    (void) strncpy((char *) buffer, debug_info_path, buffer_len);
+    if (buffer_len % 4 != 0) {
+        /* not on a 4 byte boundary so pad to the next one */
+        buffer_len += (4 - buffer_len % 4);
+    }
+    /* save the CRC */
+    (void) memcpy(&buffer[buffer_len], &file_crc, sizeof file_crc);
+    buffer_len += sizeof file_crc;
+
+    link_dat = elf_newdata(new_scn);
+    link_dat->d_type = ELF_T_BYTE;
+    link_dat->d_size = buffer_len;
+    link_dat->d_buf = buffer;
+    link_dat->d_align = 1;
+
+    (void) printf("Saving updates to '%s'\n", elf_obj);
+    (void) fflush(stdout);
+    (void) elf_update(elf, ELF_C_NULL);   /* recalc ELF memory structures */
+    (void) elf_update(elf, ELF_C_WRITE);  /* write out changes to ELF obj */
+    (void) elf_end(elf);                  /* done with ELF obj */
+    (void) close(fd);
+
+    (void) printf("Done updating '%s'\n", elf_obj);
+    (void) fflush(stdout);
+    exit(0);
+}  /* end main */
+
+
+static void
+failure() {
+    (void) fprintf(stderr, "%s\n", elf_errmsg(elf_errno()));
+    exit(5);
+}
+
+
+/*
+ * The CRC used in gnu_debuglink, retrieved from
+ * http://sourceware.org/gdb/current/onlinedocs/gdb/Separate-Debug-Files.html#Separate-Debug-Files.
+ */
+
+static unsigned int
+gnu_debuglink_crc32(unsigned int crc, unsigned char *buf, size_t len) {
+    static const unsigned int crc32_table[256] = {
+        0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419,
+        0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4,
+        0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07,
+        0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
+        0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856,
+        0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
+        0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4,
+        0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
+        0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3,
+        0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a,
+        0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599,
+        0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
+        0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190,
+        0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f,
+        0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e,
+        0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
+        0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed,
+        0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
+        0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3,
+        0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
+        0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a,
+        0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5,
+        0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010,
+        0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
+        0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17,
+        0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6,
+        0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615,
+        0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
+        0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344,
+        0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
+        0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a,
+        0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
+        0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1,
+        0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c,
+        0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef,
+        0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
+        0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe,
+        0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31,
+        0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c,
+        0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
+        0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b,
+        0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
+        0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1,
+        0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
+        0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278,
+        0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7,
+        0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66,
+        0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
+        0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605,
+        0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8,
+        0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b,
+        0x2d02ef8d
+    };
+
+    unsigned char *end;
+
+    crc = ~crc & 0xffffffff;
+    for (end = buf + len; buf < end; ++buf) {
+        crc = crc32_table[(crc ^ *buf) & 0xff] ^ (crc >> 8);
+    }
+    return ~crc & 0xffffffff;
+}
diff --git a/make/tools/fix_empty_sec_hdr_flags/Makefile b/make/tools/fix_empty_sec_hdr_flags/Makefile
new file mode 100644
index 0000000..0ed6b43
--- /dev/null
+++ b/make/tools/fix_empty_sec_hdr_flags/Makefile
@@ -0,0 +1,46 @@
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#  
+#
+
+# Rules to build fix_empty_sec_hdr_flags, used by various Makefiles on Solaris
+
+BUILDDIR = ../..
+include $(BUILDDIR)/common/Defs.gmk
+
+# Default name
+PROGRAM = fix_empty_sec_hdr_flags
+FIX_EMPTY_SEC_HDR_FLAGS_PROG = $(ABS_BUILDTOOLBINDIR)/$(PROGRAM)
+
+FIX_EMPTY_SEC_HDR_FLAGS_SRC     = fix_empty_sec_hdr_flags.c
+FIX_EMPTY_SEC_HDR_FLAGS_FLAGS   = 
+LIBS_FIX_EMPTY_SEC_HDR_FLAGS   += -lelf
+
+all: $(FIX_EMPTY_SEC_HDR_FLAGS)
+
+$(FIX_EMPTY_SEC_HDR_FLAGS_PROG): $(FIX_EMPTY_SEC_HDR_FLAGS_SRC)
+	$(MKDIR) -p $(BUILDTOOLBINDIR)
+	$(CC) -g -o $@ $< $(FIX_EMPTY_SEC_HDR_FLAGS_FLAGS) $(LIBS_FIX_EMPTY_SEC_HDR_FLAGS)
+
+clean::
+	$(RM) $(FIX_EMPTY_SEC_HDR_FLAGS_PROG)
+
diff --git a/make/tools/fix_empty_sec_hdr_flags/fix_empty_sec_hdr_flags.c b/make/tools/fix_empty_sec_hdr_flags/fix_empty_sec_hdr_flags.c
new file mode 100644
index 0000000..6582d95
--- /dev/null
+++ b/make/tools/fix_empty_sec_hdr_flags/fix_empty_sec_hdr_flags.c
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/*
+ * Name:        fix_empty_sec_hdr_flags.c
+ *
+ * Description: Remove the SHF_ALLOC flag from "empty" section headers.
+ *     An "empty" section header has sh_addr == 0 and sh_size == 0.
+ *
+ *     This program is adapted from the example program shown on the
+ *     elf(3elf) man page and from code from the Solaris compiler
+ *     driver.
+ */
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <libelf.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+static void failure(void);
+
+void
+main(int argc, char ** argv) {
+    void *        ehdr;           /* ELF header */
+    unsigned int  i;              /* section counter */
+    int           fd;             /* descriptor for file */
+    Elf *         elf;            /* ELF descriptor */
+    char *        elf_ident;      /* ELF identity string */
+    char *        elf_obj;        /* elf_obj file */
+    int           fix_count;      /* number of flags fixed */
+    int           is_elfclass64;  /* is an ELFCLASS64 file? */
+    Elf_Scn *     scn;            /* ELF section descriptor */
+    void *        shdr;           /* ELF section header */
+    Elf_Data *    shstrtab;       /* ELF section header string table */
+
+    if (argc != 2) {
+        (void) fprintf(stderr, "Usage: %s elf_obj\n", argv[0]);
+        exit(2);
+    }
+
+    /* open the elf_obj */
+    elf_obj = argv[1];
+    if ((fd = open(elf_obj, O_RDWR)) == -1) {
+        (void) fprintf(stderr, "%s: cannot open file.\n", elf_obj);
+        exit(3);
+    }
+
+    (void) printf("Opening '%s' for update\n", elf_obj);
+    (void) fflush(stdout);
+    (void) elf_version(EV_CURRENT);  /* coordinate ELF versions */
+
+    /* obtain the ELF descriptors from the input file */
+    if ((elf = elf_begin(fd, ELF_C_RDWR, NULL)) == NULL) {
+        failure();
+    }
+
+    /* determine if ELFCLASS64 or not? */
+    elf_ident = elf_getident(elf, NULL);
+    is_elfclass64 = (elf_ident[EI_CLASS] == ELFCLASS64);
+
+    /* get the ELF header */
+    if (is_elfclass64) {
+        ehdr = elf64_getehdr(elf);
+    } else {
+        ehdr = elf32_getehdr(elf);
+    }
+    if (ehdr == NULL) {
+        failure();
+    }
+
+    /* get the ELF section descriptor */
+    if (is_elfclass64) {
+        scn = elf_getscn(elf, ((Elf64_Ehdr *) ehdr)->e_shstrndx);
+    } else {
+        scn = elf_getscn(elf, ((Elf32_Ehdr *) ehdr)->e_shstrndx);
+    }
+    if (scn == NULL) {
+        failure();
+    }
+
+    /* get the section header string table */
+    shstrtab = elf_getdata(scn, NULL);
+    if (shstrtab == NULL) {
+        failure();
+    }
+
+    fix_count = 0;
+
+    /* traverse the sections of the input file */
+    for (i = 1, scn = NULL; scn = elf_nextscn(elf, scn); i++) {
+        int    has_flag_set;  /* is SHF_ALLOC flag set? */
+        int    is_empty;      /* is section empty? */
+        char * name;          /* short hand pointer */
+
+        /* get the section header */
+        if (is_elfclass64) {
+            shdr = elf64_getshdr(scn);
+        } else {
+            shdr = elf32_getshdr(scn);
+        }
+        if (shdr == NULL) {
+            failure();
+        }
+
+        if (is_elfclass64) {
+            name = (char *)shstrtab->d_buf + ((Elf64_Shdr *) shdr)->sh_name;
+        } else {
+            name = (char *)shstrtab->d_buf + ((Elf32_Shdr *) shdr)->sh_name;
+        }
+
+        if (is_elfclass64) {
+            has_flag_set = ((Elf64_Shdr *) shdr)->sh_flags & SHF_ALLOC;
+            is_empty = ((Elf64_Shdr *) shdr)->sh_addr == 0 &&
+                ((Elf64_Shdr *) shdr)->sh_size == 0;
+        } else {
+            has_flag_set = ((Elf32_Shdr *) shdr)->sh_flags & SHF_ALLOC;
+            is_empty = ((Elf32_Shdr *) shdr)->sh_addr == 0 &&
+                ((Elf32_Shdr *) shdr)->sh_size == 0;
+        }
+
+        if (is_empty && has_flag_set) {
+            (void) printf("section[%u] '%s' is empty, "
+                "but SHF_ALLOC flag is set.\n", i, name);
+            (void) printf("Clearing the SHF_ALLOC flag.\n");
+
+            if (is_elfclass64) {
+                ((Elf64_Shdr *) shdr)->sh_flags &= ~SHF_ALLOC;
+            } else {
+                ((Elf32_Shdr *) shdr)->sh_flags &= ~SHF_ALLOC;
+            }
+            fix_count++;
+        }
+    }  /* end for each ELF section */
+
+    if (fix_count > 0) {
+        (void) printf("Saving %d updates to '%s'\n", fix_count, elf_obj);
+        (void) fflush(stdout);
+        (void) elf_update(elf, ELF_C_NULL);   /* recalc ELF memory structures */
+        (void) elf_update(elf, ELF_C_WRITE);  /* write out changes to ELF obj */
+    } else {
+        (void) printf("No SHF_ALLOC flags needed to be cleared.\n");
+    }
+
+    (void) elf_end(elf);                  /* done with ELF obj */
+    (void) close(fd);
+
+    (void) printf("Done %s '%s'\n",
+               (fix_count > 0) ? "updating" : "with", elf_obj);
+    (void) fflush(stdout);
+    exit(0);
+}  /* end main */
+
+
+static void
+failure() {
+    (void) fprintf(stderr, "%s\n", elf_errmsg(elf_errno()));
+    exit(6);
+}
diff --git a/src/macosx/classes/com/apple/laf/AquaInternalFrameUI.java b/src/macosx/classes/com/apple/laf/AquaInternalFrameUI.java
index ea09bf8..fca4478 100644
--- a/src/macosx/classes/com/apple/laf/AquaInternalFrameUI.java
+++ b/src/macosx/classes/com/apple/laf/AquaInternalFrameUI.java
@@ -257,7 +257,7 @@
     }
 
     public Dimension getPreferredSize(JComponent x) {
-        Dimension preferredSize = super.getMinimumSize(x);
+        Dimension preferredSize = super.getPreferredSize(x);
         Dimension minimumSize = frame.getMinimumSize();
         if (preferredSize.width < minimumSize.width) {
             preferredSize.width = minimumSize.width;
diff --git a/src/macosx/classes/com/apple/laf/AquaScrollPaneUI.java b/src/macosx/classes/com/apple/laf/AquaScrollPaneUI.java
index 1035a3e..39eb640 100644
--- a/src/macosx/classes/com/apple/laf/AquaScrollPaneUI.java
+++ b/src/macosx/classes/com/apple/laf/AquaScrollPaneUI.java
@@ -60,6 +60,10 @@
             if (wasVisible) {
                 vScrollBar.setVisible(true);
             }
+
+            // Consume the event even when the scrollBar is invisible
+            // see #7124320
+            e.consume();
         }
     }
 }
diff --git a/src/macosx/classes/sun/awt/CGraphicsDevice.java b/src/macosx/classes/sun/awt/CGraphicsDevice.java
index 02f743d..dba7980 100644
--- a/src/macosx/classes/sun/awt/CGraphicsDevice.java
+++ b/src/macosx/classes/sun/awt/CGraphicsDevice.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
 import java.awt.GraphicsDevice;
 import java.awt.Window;
 import java.awt.AWTPermission;
+import java.awt.DisplayMode;
 
 import sun.java2d.opengl.CGLGraphicsConfig;
 
@@ -178,4 +179,33 @@
             peer.exitFullScreenMode();
         }
     }
+
+    @Override
+    public boolean isDisplayChangeSupported() {
+        return true;
+    }
+
+    @Override
+    public void setDisplayMode(DisplayMode dm) {
+        nativeSetDisplayMode(displayID, dm.getWidth(), dm.getHeight(), dm.getBitDepth(), dm.getRefreshRate());
+        if (isFullScreenSupported() && getFullScreenWindow() != null) {
+            getFullScreenWindow().setSize(dm.getWidth(), dm.getHeight());
+        }
+    }
+
+    @Override
+    public DisplayMode getDisplayMode() {
+        return nativeGetDisplayMode(displayID);
+    }
+
+    @Override
+    public DisplayMode[] getDisplayModes() {
+        return nativeGetDisplayModes(displayID);
+    }
+
+    private native void nativeSetDisplayMode(int displayID, int w, int h, int bpp, int refrate);
+
+    private native DisplayMode nativeGetDisplayMode(int displayID);
+
+    private native DisplayMode[] nativeGetDisplayModes(int displayID);
 }
diff --git a/src/macosx/classes/sun/awt/CGraphicsEnvironment.java b/src/macosx/classes/sun/awt/CGraphicsEnvironment.java
index 8a647d1..15ed911 100644
--- a/src/macosx/classes/sun/awt/CGraphicsEnvironment.java
+++ b/src/macosx/classes/sun/awt/CGraphicsEnvironment.java
@@ -181,6 +181,10 @@
         return devices.values().toArray(new CGraphicsDevice[devices.values().size()]);
     }
 
+    public synchronized GraphicsDevice getScreenDevice(int displayID) {
+        return devices.get(displayID);
+    }
+
     @Override
     protected synchronized int getNumScreens() {
         return devices.size();
diff --git a/src/macosx/classes/sun/lwawt/LWListPeer.java b/src/macosx/classes/sun/lwawt/LWListPeer.java
index 89a2ce9..df705fd 100644
--- a/src/macosx/classes/sun/lwawt/LWListPeer.java
+++ b/src/macosx/classes/sun/lwawt/LWListPeer.java
@@ -245,6 +245,15 @@
             }
         }
 
+        @Override
+        public void setFont(Font font) {
+            super.setFont(font);
+            if (getView() != null) {
+                getView().setFont(font);
+                LWListPeer.this.revalidate();
+            }
+        }
+
         private final class JListDelegate extends JList<Object> {
 
             JListDelegate() {
diff --git a/src/macosx/classes/sun/lwawt/LWWindowPeer.java b/src/macosx/classes/sun/lwawt/LWWindowPeer.java
index f561777..13ce563 100644
--- a/src/macosx/classes/sun/lwawt/LWWindowPeer.java
+++ b/src/macosx/classes/sun/lwawt/LWWindowPeer.java
@@ -68,7 +68,7 @@
 
     private Insets insets = new Insets(0, 0, 0, 0);
 
-    private int screenOn = -1;
+    private GraphicsDevice graphicsDevice;
     private GraphicsConfiguration graphicsConfig;
 
     private SurfaceData surfaceData;
@@ -868,17 +868,6 @@
         return 0;
     }
 
-    private static GraphicsConfiguration getScreenGraphicsConfig(int screen) {
-        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
-        GraphicsDevice[] gds = ge.getScreenDevices();
-        if (screen >= gds.length) {
-            // This could happen during device addition/removal. Use
-            // the default screen device in this case
-            return ge.getDefaultScreenDevice().getDefaultConfiguration();
-        }
-        return gds[screen].getDefaultConfiguration();
-    }
-
     /*
      * This method is called when window's graphics config is changed from
      * the app code (e.g. when the window is made non-opaque) or when
@@ -893,7 +882,7 @@
             }
             // If window's graphics config is changed from the app code, the
             // config correspond to the same device as before; when the window
-            // is moved by user, screenOn is updated in checkIfOnNewScreen().
+            // is moved by user, graphicsDevice is updated in checkIfOnNewScreen().
             // In either case, there's nothing to do with screenOn here
             graphicsConfig = gc;
         }
@@ -902,16 +891,17 @@
     }
 
     private void checkIfOnNewScreen() {
-        int windowScreen = platformWindow.getScreenImOn();
+        GraphicsDevice newGraphicsDevice = platformWindow.getGraphicsDevice();
         synchronized (getStateLock()) {
-            if (windowScreen == screenOn) {
+            if (graphicsDevice == newGraphicsDevice) {
                 return;
             }
-            screenOn = windowScreen;
+            graphicsDevice = newGraphicsDevice;
         }
 
         // TODO: DisplayChangedListener stuff
-        final GraphicsConfiguration newGC = getScreenGraphicsConfig(windowScreen);
+        final GraphicsConfiguration newGC = newGraphicsDevice.getDefaultConfiguration();
+
         if (!setGraphicsConfig(newGC)) return;
 
         SunToolkit.executeOnEventHandlerThread(getTarget(), new Runnable() {
diff --git a/src/macosx/classes/sun/lwawt/PlatformWindow.java b/src/macosx/classes/sun/lwawt/PlatformWindow.java
index 378dcab..92608b8 100644
--- a/src/macosx/classes/sun/lwawt/PlatformWindow.java
+++ b/src/macosx/classes/sun/lwawt/PlatformWindow.java
@@ -67,9 +67,9 @@
     public void setBounds(int x, int y, int w, int h);
 
     /*
-     * Returns the screen number where the window is.
+     * Returns the graphics device where the window is.
      */
-    public int getScreenImOn();
+    public GraphicsDevice getGraphicsDevice();
 
     /*
      * Returns the location of the window.
diff --git a/src/macosx/classes/sun/lwawt/macosx/CCustomCursor.java b/src/macosx/classes/sun/lwawt/macosx/CCustomCursor.java
index 5dd1844..fd1512f 100644
--- a/src/macosx/classes/sun/lwawt/macosx/CCustomCursor.java
+++ b/src/macosx/classes/sun/lwawt/macosx/CCustomCursor.java
@@ -26,6 +26,7 @@
 package sun.lwawt.macosx;
 
 import java.awt.*;
+import java.awt.image.BufferedImage;
 
 public class CCustomCursor extends Cursor {
     static Dimension sMaxCursorSize;
@@ -36,7 +37,6 @@
     }
 
     Image fImage;
-    private boolean isImageOk = false;
     Point fHotspot;
 
     public CCustomCursor(final Image cursor, final Point hotSpot, final String name) throws IndexOutOfBoundsException, HeadlessException {
@@ -61,21 +61,19 @@
         // Fix for bug 4212593 The Toolkit.createCustomCursor does not
         // check absence of the image of cursor
         // If the image is invalid, the cursor will be hidden (made completely
-        // transparent). In this case, getBestCursorSize() will adjust negative w and h,
-        // but we need to set the hotspot inside the image here.
+        // transparent).
         if (tracker.isErrorAny() || width < 0 || height < 0) {
             fHotspot.x = fHotspot.y = 0;
-            isImageOk = false;
+            width = height = 1;
+            fImage = createTransparentImage(width, height);
         } else {
-            isImageOk = true;
-        }
-
-        // Scale image to nearest supported size
-        final Dimension nativeSize = toolkit.getBestCursorSize(width, height);
-        if (nativeSize.width != width || nativeSize.height != height) {
-            fImage = fImage.getScaledInstance(nativeSize.width, nativeSize.height, Image.SCALE_DEFAULT);
-            width = nativeSize.width;
-            height = nativeSize.height;
+            // Scale image to nearest supported size
+            final Dimension nativeSize = toolkit.getBestCursorSize(width, height);
+            if (nativeSize.width != width || nativeSize.height != height) {
+                fImage = fImage.getScaledInstance(nativeSize.width, nativeSize.height, Image.SCALE_DEFAULT);
+                width = nativeSize.width;
+                height = nativeSize.height;
+            }
         }
 
         // NOTE: this was removed for 3169146, but in 1.5 the JCK tests for an exception and fails if one isn't thrown.
@@ -98,6 +96,21 @@
         }
     }
 
+    private static BufferedImage createTransparentImage(int w, int h) {
+        GraphicsEnvironment ge =
+                GraphicsEnvironment.getLocalGraphicsEnvironment();
+        GraphicsDevice gs = ge.getDefaultScreenDevice();
+        GraphicsConfiguration gc = gs.getDefaultConfiguration();
+
+        BufferedImage img = gc.createCompatibleImage(w, h, Transparency.BITMASK);
+        Graphics2D g = (Graphics2D)img.getGraphics();
+        g.setBackground(new Color(0, 0, 0, 0));
+        g.clearRect(0, 0, w, h);
+        g.dispose();
+
+        return img;
+    }
+
     public static Dimension getBestCursorSize(final int preferredWidth, final int preferredHeight) {
         // With Panther, cursors have no limit on their size. So give the client their
         // preferred size, but no larger than half the dimensions of the main screen
@@ -111,31 +124,26 @@
     }
 
     // Called from native when the cursor is set
-    // Returns long array of [NSImage ptr, x hotspot, y hotspot]
     CImage fCImage;
     long getImageData() {
         if (fCImage != null) {
             return fCImage.ptr;
         }
 
-        if (isImageOk) {
-            try {
-                fCImage = CImage.getCreator().createFromImage(fImage);
-
-                if (fCImage == null) {
-                    isImageOk = false;
-                    return 0L;
-                } else {
-                    return fCImage.ptr;
-                }
-            } catch (IllegalArgumentException iae) {
-                // Silently return null - we want to hide cursor by providing an empty
-                // ByteArray or just null
+        try {
+            fCImage = CImage.getCreator().createFromImage(fImage);
+            if (fCImage == null) {
+                // Something unexpected happened: CCustomCursor constructor
+                // takes care of invalid cursor images, yet createFromImage()
+                // failed to do its job. Return null to keep the cursor unchanged.
                 return 0L;
+            } else {
+                return fCImage.ptr;
             }
+        } catch (IllegalArgumentException iae) {
+            // see comment above
+            return 0L;
         }
-
-        return 0L;
     }
 
     Point getHotSpot() {
diff --git a/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java b/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java
index e1e7c9c..cec7c55 100644
--- a/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java
+++ b/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java
@@ -132,44 +132,31 @@
             this.setDefaultDragImage(component);
 
         // Get drag image (if any) as BufferedImage and convert that to CImage:
-        long  dragImage;
         Point dragImageOffset;
 
         if (fDragImage != null) {
-            BufferedImage bi = (fDragImage instanceof BufferedImage ? (BufferedImage) fDragImage : null);
-
-            if (bi == null) {
-                // Create a new buffered image:
-                int width  = fDragImage.getWidth(null);
-                int height = fDragImage.getHeight(null);
-                bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB_PRE);
-
-                // Draw drag image into the buffered image:
-                Graphics g = bi.getGraphics();
-                g.drawImage(fDragImage, 0, 0, null);
-                g.dispose();
+            try {
+                fDragCImage = CImage.getCreator().createFromImageImmediately(fDragImage);
+            } catch(Exception e) {
+                // image creation may fail for any reason
+                throw new InvalidDnDOperationException("Drag image can not be created.");
             }
-            /*   TODO:BG
-            fDragCImage = CImage.getCreator().createImage(bi);
-            dragImage = fDragCImage.getNSImage(); */
-            fDragCImage = null;
-            dragImage = 0L;
+            if (fDragCImage == null) {
+                throw new InvalidDnDOperationException("Drag image is not ready.");
+            }
+
             dragImageOffset = fDragImageOffset;
         } else {
 
             fDragCImage = null;
-            dragImage = 0L;
             dragImageOffset = new Point(0, 0);
         }
 
-        // Get NS drag image instance if we have a drag image:
-        long nsDragImage = 0L; //TODO:BG (fDragCImage != null ? fDragCImage.getNSImage() : 0L);
-
         try {
             // Create native dragging source:
             final long nativeDragSource = createNativeDragSource(component, peer, nativeWindowPtr, transferable, triggerEvent,
                 (int) (dragOrigin.getX() + componentOffset.x), (int) (dragOrigin.getY() + componentOffset.y), extModifiers,
-                clickCount, timestamp, cursor, dragImage, dragImageOffset.x, dragImageOffset.y,
+                clickCount, timestamp, cursor, fDragCImage, dragImageOffset.x, dragImageOffset.y,
                 getDragSourceContext().getSourceActions(), formats, formatMap);
 
             if (nativeDragSource == 0)
@@ -495,7 +482,7 @@
     // Native support:
     private native long createNativeDragSource(Component component, ComponentPeer peer, long nativePeer, Transferable transferable,
         InputEvent triggerEvent, int dragPosX, int dragPosY, int extModifiers, int clickCount, long timestamp,
-        Cursor cursor, long nsDragImage, int dragImageOffsetX, int dragImageOffsetY,
+        Cursor cursor, CImage nsDragImage, int dragImageOffsetX, int dragImageOffsetY,
         int sourceActions, long[] formats, Map formatMap);
 
     private native void doDragging(long nativeDragSource);
diff --git a/src/macosx/classes/sun/lwawt/macosx/CImage.java b/src/macosx/classes/sun/lwawt/macosx/CImage.java
index 425bd2c..d764b95 100644
--- a/src/macosx/classes/sun/lwawt/macosx/CImage.java
+++ b/src/macosx/classes/sun/lwawt/macosx/CImage.java
@@ -97,35 +97,55 @@
             return createImageUsingNativeSize(nativeCreateNSImageFromImageName(name));
         }
 
-        private static int[] imageToArray(Image image) {
+        private static int[] imageToArray(Image image, boolean prepareImage) {
             if (image == null) return null;
 
-            MediaTracker mt = new MediaTracker(new Label());
-            final int id = 0;
-            mt.addImage(image, id);
+            if (prepareImage && !(image instanceof BufferedImage)) {
+                final MediaTracker mt = new MediaTracker(new Label());
+                final int id = 0;
+                mt.addImage(image, id);
 
-            try {
-                mt.waitForID(id);
-            } catch (InterruptedException e) {
-            }
+                try {
+                    mt.waitForID(id);
+                } catch (InterruptedException e) {
+                    return null;
+                }
 
-            if (mt.isErrorID(id)) {
-                return null;
+                if (mt.isErrorID(id)) {
+                    return null;
+                }
             }
 
             int w = image.getWidth(null);
             int h = image.getHeight(null);
+
+            if (w < 0 || h < 0) {
+                return null;
+            }
+
             BufferedImage bimg = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB_PRE);
             Graphics2D g2 = bimg.createGraphics();
             g2.setComposite(AlphaComposite.Src);
             g2.drawImage(image, 0, 0, null);
             g2.dispose();
+
             return ((DataBufferInt)bimg.getRaster().getDataBuffer()).getData();
         }
 
+        public CImage createFromImageImmediately(final Image image) {
+            int[]  buffer = imageToArray(image, false);
+
+            if (buffer == null) {
+                return null;
+            }
+
+            return new CImage(nativeCreateNSImageFromArray(buffer, image.getWidth(null),
+                                                           image.getHeight(null)));
+        }
+
         // This is used to create a CImage from a Image
         public CImage createFromImage(final Image image) {
-            int[] buffer = imageToArray(image);
+            int[] buffer = imageToArray(image, true);
             if (buffer == null) {
                 return null;
             }
@@ -146,7 +166,7 @@
             num = 0;
 
             for (Image img : images) {
-                buffers[num] = imageToArray(img);
+                buffers[num] = imageToArray(img, true);
                 if (buffers[num] == null) {
                     // Unable to process the image
                     continue;
diff --git a/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java b/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java
index cf9c455..815a718 100644
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java
@@ -86,11 +86,10 @@
     }
 
     @Override
-    public int getScreenImOn() {
+    public GraphicsDevice getGraphicsDevice() {
         // REMIND: return the main screen for the initial implementation
-        CGraphicsConfig gc = (CGraphicsConfig)peer.getGraphicsConfiguration();
-        CGraphicsDevice device = gc.getDevice();
-        return device.getCoreGraphicsScreen();
+        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+        return ge.getDefaultScreenDevice();
     }
 
     @Override
diff --git a/src/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java b/src/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java
index aa5c616..059ef01 100644
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java
@@ -109,8 +109,14 @@
         final long when = System.currentTimeMillis();
         final int scrollType = MouseWheelEvent.WHEEL_UNIT_SCROLL;
         final int scrollAmount = 1;
+        int wheelRotation = (int) delta;
+        int signum = (int) Math.signum(delta);
+        if (signum * delta < 1) {
+            wheelRotation = signum;
+        }
+        // invert the wheelRotation for the peer
         peer.dispatchMouseWheelEvent(when, x, y, modifiers, scrollType,
-                                     scrollAmount, (int) -delta, -delta, null);
+                                     scrollAmount, -wheelRotation, -delta, null);
     }
 
     /**
diff --git a/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java b/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
index 2d7cfea..6a11cb5 100644
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
@@ -64,7 +64,7 @@
     private static native void nativeSetEnabled(long nsWindowPtr, boolean isEnabled);
     private static native void nativeSynthesizeMouseEnteredExitedEvents(long nsWindowPtr);
 
-    private static native int nativeGetScreenNSWindowIsOn_AppKitThread(long nsWindowPtr);
+    private static native int nativeGetNSWindowDisplayID_AppKitThread(long nsWindowPtr);
 
     // Loger to report issues happened during execution but that do not affect functionality
     private static final PlatformLogger logger = PlatformLogger.getLogger("sun.lwawt.macosx.CPlatformWindow");
@@ -452,13 +452,18 @@
         return new Point(nativeBounds.x, nativeBounds.y);
     }
 
-    @Override // PlatformWindow
-    public int getScreenImOn() {
-    // REMIND: we could also acquire screenID from the
-    // graphicsConfig.getDevice().getCoreGraphicsScreen()
-    // which might look a bit less natural but don't
-    // require new native accessor.
-        return nativeGetScreenNSWindowIsOn_AppKitThread(getNSWindowPtr());
+    @Override
+    public GraphicsDevice getGraphicsDevice() {
+        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+        CGraphicsEnvironment cge = (CGraphicsEnvironment)ge;
+        int displayID = nativeGetNSWindowDisplayID_AppKitThread(getNSWindowPtr());
+        GraphicsDevice gd = cge.getScreenDevice(displayID);
+        if (gd == null) {
+            // this could possibly happen during device removal
+            // use the default screen device in this case
+            gd = ge.getDefaultScreenDevice();
+        }
+        return gd;
     }
 
     @Override // PlatformWindow
diff --git a/src/macosx/native/sun/awt/AWTWindow.h b/src/macosx/native/sun/awt/AWTWindow.h
index b350913..991953f 100644
--- a/src/macosx/native/sun/awt/AWTWindow.h
+++ b/src/macosx/native/sun/awt/AWTWindow.h
@@ -43,6 +43,7 @@
     NSSize javaMaxSize;
     jint styleBits;
     BOOL isEnabled;
+    NSWindow *nsWindow;
 }
 
 // An instance of either AWTWindow_Normal or AWTWindow_Panel
diff --git a/src/macosx/native/sun/awt/AWTWindow.m b/src/macosx/native/sun/awt/AWTWindow.m
index 5f570a7..759631d 100644
--- a/src/macosx/native/sun/awt/AWTWindow.m
+++ b/src/macosx/native/sun/awt/AWTWindow.m
@@ -1080,38 +1080,28 @@
 
 /*
  * Class:     sun_lwawt_macosx_CPlatformWindow
- * Method:    nativeGetScreenNSWindowIsOn_AppKitThread
+ * Method:    nativeGetDisplayID_AppKitThread
  * Signature: (J)I
  */
-JNIEXPORT jint JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeGetScreenNSWindowIsOn_1AppKitThread
+JNIEXPORT jint JNICALL
+Java_sun_lwawt_macosx_CPlatformWindow_nativeGetNSWindowDisplayID_1AppKitThread
 (JNIEnv *env, jclass clazz, jlong windowPtr)
 {
-    jint index = -1;
+    jint ret; // CGDirectDisplayID
 
 JNF_COCOA_ENTER(env);
 AWT_ASSERT_APPKIT_THREAD;
 
-    NSWindow *nsWindow = OBJC(windowPtr);
-    NSScreen* screen = [nsWindow screen];
-
-    //+++gdb NOTE: This is using a linear search of the screens. If it should
-    //  prove to be a bottleneck, this can definitely be improved. However,
-    //  many screens should prove to be the exception, rather than the rule.
-    NSArray* screens = [NSScreen screens];
-    NSUInteger i;
-    for (i = 0; i < [screens count]; i++)
-    {
-        if ([[screens objectAtIndex:i] isEqualTo:screen])
-        {
-            index = i;
-            break;
-        }
-    }
+    NSWindow *window = OBJC(windowPtr);
+    NSScreen *screen = [window screen];
+    NSDictionary *deviceDescription = [screen deviceDescription];
+    NSNumber *displayID = [deviceDescription objectForKey:@"NSScreenNumber"];
+    ret = (jint)[displayID intValue];
 
 JNF_COCOA_EXIT(env);
-    return 1;
-}
 
+    return ret;
+}
 
 /*
  * Class:     sun_lwawt_macosx_CPlatformWindow
diff --git a/src/macosx/native/sun/awt/CDragSource.h b/src/macosx/native/sun/awt/CDragSource.h
index 224bba1..7e880cb 100644
--- a/src/macosx/native/sun/awt/CDragSource.h
+++ b/src/macosx/native/sun/awt/CDragSource.h
@@ -63,7 +63,7 @@
     transferable:(jobject)jtransferable triggerEvent:(jobject)jtrigger
     dragPosX:(jint)dragPosX dragPosY:(jint)dragPosY modifiers:(jint)extModifiers clickCount:(jint)clickCount timeStamp:(jlong)timeStamp
     cursor:(jobject)jcursor
-    dragImage:(jlong)jnsdragimage dragImageOffsetX:(jint)jdragimageoffsetx dragImageOffsetY:(jint)jdragimageoffsety
+    dragImage:(jobject)jnsdragimage dragImageOffsetX:(jint)jdragimageoffsetx dragImageOffsetY:(jint)jdragimageoffsety
     sourceActions:(jint)jsourceactions formats:(jlongArray)jformats formatMap:(jobject)jformatmap;
 
 - (void)removeFromView:(JNIEnv *)env;
diff --git a/src/macosx/native/sun/awt/CDragSource.m b/src/macosx/native/sun/awt/CDragSource.m
index 27f505e..cbfe627 100644
--- a/src/macosx/native/sun/awt/CDragSource.m
+++ b/src/macosx/native/sun/awt/CDragSource.m
@@ -70,6 +70,7 @@
 
 JNF_CLASS_CACHE(DataTransfererClass, "sun/awt/datatransfer/DataTransferer");
 JNF_CLASS_CACHE(CDragSourceContextPeerClass, "sun/lwawt/macosx/CDragSourceContextPeer");
+JNF_CLASS_CACHE(CImageClass, "sun/lwawt/macosx/CImage");
 
 static NSDragOperation    sDragOperation;
 static NSPoint            sDraggingLocation;
@@ -87,7 +88,7 @@
     transferable:(jobject)jtransferable triggerEvent:(jobject)jtrigger
     dragPosX:(jint)dragPosX dragPosY:(jint)dragPosY modifiers:(jint)extModifiers clickCount:(jint)clickCount
     timeStamp:(jlong)timeStamp cursor:(jobject)jcursor
-    dragImage:(jlong)jnsdragimage dragImageOffsetX:(jint)jdragimageoffsetx dragImageOffsetY:(jint)jdragimageoffsety
+    dragImage:(jobject)jnsdragimage dragImageOffsetX:(jint)jdragimageoffsetx dragImageOffsetY:(jint)jdragimageoffsety
     sourceActions:(jint)jsourceactions formats:(jlongArray)jformats formatMap:(jobject)jformatmap
 {
     self = [super init];
@@ -107,8 +108,14 @@
         fTriggerEvent = JNFNewGlobalRef(env, jtrigger);
         fCursor = JNFNewGlobalRef(env, jcursor);
 
-        fDragImage = (NSImage*) jlong_to_ptr(jnsdragimage); // Double-casting prevents compiler 'different size' warning.
-        [fDragImage retain];
+        if (jnsdragimage) {
+            JNF_MEMBER_CACHE(nsImagePtr, CImageClass, "ptr", "J");
+            jlong imgPtr = JNFGetLongField(env, jnsdragimage, nsImagePtr);
+            fDragImage = (NSImage*) jlong_to_ptr(imgPtr); // Double-casting prevents compiler 'd$|//
+
+            [fDragImage retain];
+        }
+
         fDragImageOffset = NSMakePoint(jdragimageoffsetx, jdragimageoffsety);
 
         fSourceActions = jsourceactions;
diff --git a/src/macosx/native/sun/awt/CDragSourceContextPeer.m b/src/macosx/native/sun/awt/CDragSourceContextPeer.m
index 80d296d..e2fedfe 100644
--- a/src/macosx/native/sun/awt/CDragSourceContextPeer.m
+++ b/src/macosx/native/sun/awt/CDragSourceContextPeer.m
@@ -39,7 +39,7 @@
 JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CDragSourceContextPeer_createNativeDragSource
   (JNIEnv *env, jobject jthis, jobject jcomponent, jobject jpeer, jlong jnativepeer, jobject jtransferable,
    jobject jtrigger, jint jdragposx, jint jdragposy, jint jextmodifiers, jint jclickcount, jlong jtimestamp,
-   jobject jcursor, jlong jnsdragimage, jint jdragimageoffsetx, jint jdragimageoffsety,
+   jobject jcursor, jobject jnsdragimage, jint jdragimageoffsetx, jint jdragimageoffsety,
    jint jsourceactions, jlongArray jformats, jobject jformatmap)
 {
     id controlObj = (id) jlong_to_ptr(jnativepeer);
diff --git a/src/macosx/native/sun/awt/CGraphicsDevice.m b/src/macosx/native/sun/awt/CGraphicsDevice.m
index 0d78469..62034c8 100644
--- a/src/macosx/native/sun/awt/CGraphicsDevice.m
+++ b/src/macosx/native/sun/awt/CGraphicsDevice.m
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,84 @@
 #include "LWCToolkit.h"
 
 /*
+ * Convert the mode string to the more convinient bits per pixel value
+ */
+static int getBPPFromModeString(CFStringRef mode) 
+{
+    if ((CFStringCompare(mode, CFSTR(kIO30BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo)) {
+        // This is a strange mode, where we using 10 bits per RGB component and pack it into 32 bits
+        // Java is not ready to work with this mode but we have to specify it as supported
+        return 30;
+    }
+    else if (CFStringCompare(mode, CFSTR(IO32BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
+        return 32;
+    }
+    else if (CFStringCompare(mode, CFSTR(IO16BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
+        return 16;
+    }
+    else if (CFStringCompare(mode, CFSTR(IO8BitIndexedPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
+        return 8;
+    }
+    
+    return 0;
+}
+
+/*
+ * Find the best possible match in the list of display modes that we can switch to based on
+ * the provided parameters.
+ */
+static CGDisplayModeRef getBestModeForParameters(CFArrayRef allModes, int w, int h, int bpp, int refrate) {
+    CGDisplayModeRef bestGuess = NULL;
+    CFIndex numModes = CFArrayGetCount(allModes), n;
+    int thisBpp = 0;
+    for(n = 0; n < numModes; n++ ) {
+        CGDisplayModeRef cRef = (CGDisplayModeRef) CFArrayGetValueAtIndex(allModes, n);
+        if(cRef == NULL) {
+            continue;
+        }
+        CFStringRef modeString = CGDisplayModeCopyPixelEncoding(cRef);
+        thisBpp = getBPPFromModeString(modeString);
+        CFRelease(modeString);
+        if (thisBpp != bpp || (int)CGDisplayModeGetHeight(cRef) != h || (int)CGDisplayModeGetWidth(cRef) != w) {
+            // One of the key parameters does not match
+            continue;
+        }
+        // Refresh rate might be 0 in display mode and we ask for specific display rate
+        // but if we do not find exact match then 0 refresh rate might be just Ok
+        if (CGDisplayModeGetRefreshRate(cRef) == refrate) {
+            // Exact match
+            return cRef;
+        }
+        if (CGDisplayModeGetRefreshRate(cRef) == 0) {
+            // Not exactly what was asked for, but may fit our needs if we don't find an exact match
+            bestGuess = cRef;
+        }
+    }
+    return bestGuess;
+}
+
+/*
+ * Create a new java.awt.DisplayMode instance based on provided CGDisplayModeRef
+ */
+static jobject createJavaDisplayMode(CGDisplayModeRef mode, JNIEnv *env, jint displayID) {
+    jobject ret = NULL;
+    jint h, w, bpp, refrate;
+    JNF_COCOA_ENTER(env);
+    CFStringRef currentBPP = CGDisplayModeCopyPixelEncoding(mode);
+    bpp = getBPPFromModeString(currentBPP);
+    refrate = CGDisplayModeGetRefreshRate(mode);
+    h = CGDisplayModeGetHeight(mode);
+    w = CGDisplayModeGetWidth(mode);
+    CFRelease(currentBPP);
+    static JNF_CLASS_CACHE(jc_DisplayMode, "java/awt/DisplayMode");
+    static JNF_CTOR_CACHE(jc_DisplayMode_ctor, jc_DisplayMode, "(IIII)V");
+    ret = JNFNewObject(env, jc_DisplayMode_ctor, w, h, bpp, refrate);
+    JNF_COCOA_EXIT(env);
+    return ret;
+}
+
+
+/*
  * Class:     sun_awt_CGraphicsDevice
  * Method:    nativeGetXResolution
  * Signature: (I)D
@@ -62,3 +140,89 @@
     jfloat dpi = rect.size.height / inches;
     return dpi;
 }
+
+/*
+ * Class:     sun_awt_CGraphicsDevice
+ * Method:    nativeSetDisplayMode
+ * Signature: (IIIII)V
+ */
+JNIEXPORT void JNICALL
+Java_sun_awt_CGraphicsDevice_nativeSetDisplayMode
+(JNIEnv *env, jclass class, jint displayID, jint w, jint h, jint bpp, jint refrate)
+{
+    JNF_COCOA_ENTER(env);
+    CFArrayRef allModes = CGDisplayCopyAllDisplayModes(displayID, NULL);
+    CGDisplayModeRef closestMatch = getBestModeForParameters(allModes, (int)w, (int)h, (int)bpp, (int)refrate);
+    if (closestMatch != NULL) {
+        [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+            CGDisplayConfigRef config;
+            CGError retCode = CGBeginDisplayConfiguration(&config);
+            if (retCode == kCGErrorSuccess) {
+                CGConfigureDisplayWithDisplayMode(config, displayID, closestMatch, NULL);
+                CGCompleteDisplayConfiguration(config, kCGConfigureForAppOnly);
+                if (config != NULL) {
+                    CFRelease(config);
+                }
+            }
+        }];
+    }
+    CFRelease(allModes);
+    JNF_COCOA_EXIT(env);
+}
+
+/*
+ * Class:     sun_awt_CGraphicsDevice
+ * Method:    nativeGetDisplayMode
+ * Signature: (I)Ljava/awt/DisplayMode
+ */
+JNIEXPORT jobject JNICALL
+Java_sun_awt_CGraphicsDevice_nativeGetDisplayMode
+(JNIEnv *env, jclass class, jint displayID)
+{
+    jobject ret = NULL;
+    CGDisplayModeRef currentMode = CGDisplayCopyDisplayMode(displayID);
+    ret = createJavaDisplayMode(currentMode, env, displayID);
+    CGDisplayModeRelease(currentMode);
+    return ret;
+}
+
+/*
+ * Class:     sun_awt_CGraphicsDevice
+ * Method:    nativeGetDisplayMode
+ * Signature: (I)[Ljava/awt/DisplayModes
+ */
+JNIEXPORT jobjectArray JNICALL
+Java_sun_awt_CGraphicsDevice_nativeGetDisplayModes
+(JNIEnv *env, jclass class, jint displayID)
+{
+    jobjectArray jreturnArray = NULL;
+    JNF_COCOA_ENTER(env);
+    CFArrayRef allModes = CGDisplayCopyAllDisplayModes(displayID, NULL);
+    CFIndex numModes = CFArrayGetCount(allModes);
+    static JNF_CLASS_CACHE(jc_DisplayMode, "java/awt/DisplayMode");
+
+    jreturnArray = JNFNewObjectArray(env, &jc_DisplayMode, (jsize) numModes);
+    if (!jreturnArray) {
+        NSLog(@"CGraphicsDevice can't create java array of DisplayMode objects");
+        return nil;
+    }
+
+    CFIndex n;
+    for (n=0; n < numModes; n++) {
+        CGDisplayModeRef cRef = (CGDisplayModeRef) CFArrayGetValueAtIndex(allModes, n);
+        if (cRef != NULL) {
+            jobject oneMode = createJavaDisplayMode(cRef, env, displayID);
+            (*env)->SetObjectArrayElement(env, jreturnArray, n, oneMode);
+            if ((*env)->ExceptionOccurred(env)) {
+                (*env)->ExceptionDescribe(env);
+                (*env)->ExceptionClear(env);
+                continue;
+            }
+            (*env)->DeleteLocalRef(env, oneMode);
+        }
+    }
+    CFRelease(allModes);
+    JNF_COCOA_EXIT(env);
+
+    return jreturnArray;
+}
diff --git a/src/share/classes/com/sun/java/util/jar/pack/Attribute.java b/src/share/classes/com/sun/java/util/jar/pack/Attribute.java
index 5cf2456..fd644bf 100644
--- a/src/share/classes/com/sun/java/util/jar/pack/Attribute.java
+++ b/src/share/classes/com/sun/java/util/jar/pack/Attribute.java
@@ -653,8 +653,8 @@
             return fixups[0]; // return ref-bearing cookie, if any
         }
 
-        public String layoutForPackageMajver(int majver) {
-            if (majver <= JAVA5_PACKAGE_MAJOR_VERSION) {
+        public String layoutForClassVersion(Package.Version vers) {
+            if (vers.lessThan(JAVA6_MAX_CLASS_VERSION)) {
                 // Disallow layout syntax in the oldest protocol version.
                 return expandCaseDashNotation(layout);
             }
diff --git a/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java b/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java
index a63491b..f3d5cec 100644
--- a/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java
+++ b/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java
@@ -74,30 +74,27 @@
 
     abstract protected Index getCPIndex(byte tag);
 
-    // Local copy of package version.
-    private int packageMajver = -1;
+    // Local copy of highest class version.
+    private Package.Version highestClassVersion = null;
 
     /** Call this exactly once, early, to specify the archive major version. */
-    public void initPackageMajver(int packageMajver) throws IOException {
-        assert(packageMajver > 0 && packageMajver < 0x10000);
-        if (this.packageMajver > 0) {
+    public void initHighestClassVersion(Package.Version highestClassVersion) throws IOException {
+        if (this.highestClassVersion != null) {
             throw new IOException(
-                "Package majver is already initialized to " + this.packageMajver+
-                "; new setting is " + packageMajver);
+                "Highest class major version is already initialized to " +
+                this.highestClassVersion + "; new setting is " + highestClassVersion);
         }
-        this.packageMajver = packageMajver;
-        adjustToMajver();
+        this.highestClassVersion = highestClassVersion;
+        adjustToClassVersion();
     }
-    public int getPackageMajver() {
-        if (packageMajver < 0) {
-            throw new RuntimeException("Package majver not yet initialized");
-        }
-        return packageMajver;
+
+    public Package.Version getHighestClassVersion() {
+        return highestClassVersion;
     }
 
     private final boolean isReader = this instanceof PackageReader;
-    protected BandStructure() {
-    }
+
+    protected BandStructure() {}
 
     final static Coding BYTE1 = Coding.of(1,256);
 
@@ -1866,20 +1863,12 @@
         attrClassFileVersionMask = (1<<CLASS_ATTR_ClassFile_version);
     }
 
-    private void adjustToMajver() throws IOException {
-        if (getPackageMajver() < JAVA6_PACKAGE_MAJOR_VERSION) {
+    private void adjustToClassVersion() throws IOException {
+        if (getHighestClassVersion().lessThan(JAVA6_MAX_CLASS_VERSION)) {
             if (verbose > 0)  Utils.log.fine("Legacy package version");
             // Revoke definition of pre-1.6 attribute type.
             undefineAttribute(CODE_ATTR_StackMapTable, ATTR_CONTEXT_CODE);
         }
-        if (getPackageMajver() < JAVA7_PACKAGE_MAJOR_VERSION) {
-            if (testBit(archiveOptions, AO_HAVE_CP_EXTRAS))
-                // this bit was reserved for future use in previous versions
-                throw new IOException("Format bits for Java 7 must be zero in previous releases");
-        }
-        if (testBit(archiveOptions, AO_UNUSED_MBZ)) {
-            throw new IOException("High archive option bits are reserved and must be zero: "+Integer.toHexString(archiveOptions));
-        }
     }
 
     protected void initAttrIndexLimit() {
@@ -1942,21 +1931,14 @@
         }
     }
 
-    protected Attribute makeClassFileVersionAttr(int minver, int majver) {
-        byte[] bytes = {
-            (byte)(minver >> 8), (byte)minver,
-            (byte)(majver >> 8), (byte)majver
-        };
-        return attrClassFileVersion.addContent(bytes);
+    protected Attribute makeClassFileVersionAttr(Package.Version ver) {
+        return attrClassFileVersion.addContent(ver.asBytes());
     }
 
-    protected short[] parseClassFileVersionAttr(Attribute attr) {
+    protected Package.Version parseClassFileVersionAttr(Attribute attr) {
         assert(attr.layout() == attrClassFileVersion);
         assert(attr.size() == 4);
-        byte[] bytes = attr.bytes();
-        int minver = ((bytes[0] & 0xFF) << 8) | (bytes[1] & 0xFF);
-        int majver = ((bytes[2] & 0xFF) << 8) | (bytes[3] & 0xFF);
-        return new short[]{ (short) minver, (short) majver };
+        return Package.Version.of(attr.bytes());
     }
 
     private boolean assertBandOKForElems(Band[] ab, Attribute.Layout.Element[] elems) {
diff --git a/src/share/classes/com/sun/java/util/jar/pack/ClassReader.java b/src/share/classes/com/sun/java/util/jar/pack/ClassReader.java
index 545faab..2ca2d09 100644
--- a/src/share/classes/com/sun/java/util/jar/pack/ClassReader.java
+++ b/src/share/classes/com/sun/java/util/jar/pack/ClassReader.java
@@ -174,27 +174,31 @@
                 ("Bad magic number in class file "
                  +Integer.toHexString(cls.magic),
                  ATTR_CONTEXT_CLASS, "magic-number", "pass");
-        cls.minver = (short) readUnsignedShort();
-        cls.majver = (short) readUnsignedShort();
+        int minver = (short) readUnsignedShort();
+        int majver = (short) readUnsignedShort();
+        cls.version = Package.Version.of(majver, minver);
+
         //System.out.println("ClassFile.version="+cls.majver+"."+cls.minver);
-        String bad = checkVersion(cls.majver, cls.minver);
+        String bad = checkVersion(cls.version);
         if (bad != null) {
             throw new Attribute.FormatException
                 ("classfile version too "+bad+": "
-                 +cls.majver+"."+cls.minver+" in "+cls.file,
+                 +cls.version+" in "+cls.file,
                  ATTR_CONTEXT_CLASS, "version", "pass");
         }
     }
 
-    private String checkVersion(int majver, int minver) {
-        if (majver < pkg.min_class_majver ||
-            (majver == pkg.min_class_majver &&
-             minver < pkg.min_class_minver)) {
+    private String checkVersion(Package.Version ver) {
+        int majver = ver.major;
+        int minver = ver.minor;
+        if (majver < pkg.minClassVersion.major ||
+            (majver == pkg.minClassVersion.major &&
+             minver < pkg.minClassVersion.minor)) {
             return "small";
         }
-        if (majver > pkg.max_class_majver ||
-            (majver == pkg.max_class_majver &&
-             minver > pkg.max_class_minver)) {
+        if (majver > pkg.maxClassVersion.major ||
+            (majver == pkg.maxClassVersion.major &&
+             minver > pkg.maxClassVersion.minor)) {
             return "large";
         }
         return null;  // OK
diff --git a/src/share/classes/com/sun/java/util/jar/pack/ClassWriter.java b/src/share/classes/com/sun/java/util/jar/pack/ClassWriter.java
index dacae44..deb6625 100644
--- a/src/share/classes/com/sun/java/util/jar/pack/ClassWriter.java
+++ b/src/share/classes/com/sun/java/util/jar/pack/ClassWriter.java
@@ -113,8 +113,8 @@
 
     void writeMagicNumbers() throws IOException {
         writeInt(cls.magic);
-        writeShort(cls.minver);
-        writeShort(cls.majver);
+        writeShort(cls.version.minor);
+        writeShort(cls.version.major);
     }
 
     void writeConstantPool() throws IOException {
diff --git a/src/share/classes/com/sun/java/util/jar/pack/Constants.java b/src/share/classes/com/sun/java/util/jar/pack/Constants.java
index c7fa00e..c4c3a8f 100644
--- a/src/share/classes/com/sun/java/util/jar/pack/Constants.java
+++ b/src/share/classes/com/sun/java/util/jar/pack/Constants.java
@@ -43,30 +43,40 @@
         1.0 to 1.3.X 45,3
         1.4 to 1.4.X 46,0
         1.5 to 1.5.X 49,0
-        1.6 to 1.5.x 50,0 NOTE Assumed for now
+        1.6 to 1.5.x 50,0
+        1.7 to 1.6.x 51,0
     */
 
-    public final static short JAVA_MIN_CLASS_MAJOR_VERSION = 45;
-    public final static short JAVA_MIN_CLASS_MINOR_VERSION = 03;
+    public final static Package.Version JAVA_MIN_CLASS_VERSION =
+            Package.Version.of(45, 03);
 
-    public final static short JAVA5_MAX_CLASS_MAJOR_VERSION = 49;
-    public final static short JAVA5_MAX_CLASS_MINOR_VERSION = 0;
+    public final static Package.Version JAVA5_MAX_CLASS_VERSION =
+            Package.Version.of(49, 00);
 
-    public final static short JAVA6_MAX_CLASS_MAJOR_VERSION = 50;
-    public final static short JAVA6_MAX_CLASS_MINOR_VERSION = 0;
+    public final static Package.Version JAVA6_MAX_CLASS_VERSION =
+            Package.Version.of(50, 00);
 
-    public final static short JAVA7_MAX_CLASS_MAJOR_VERSION = 51;
-    public final static short JAVA7_MAX_CLASS_MINOR_VERSION = 0;
+    public final static Package.Version JAVA7_MAX_CLASS_VERSION =
+            Package.Version.of(51, 00);
 
     public final static int JAVA_PACKAGE_MAGIC = 0xCAFED00D;
-    public final static int JAVA5_PACKAGE_MAJOR_VERSION = 150;
-    public final static int JAVA5_PACKAGE_MINOR_VERSION = 7;
 
-    public final static int JAVA6_PACKAGE_MAJOR_VERSION = 160;
-    public final static int JAVA6_PACKAGE_MINOR_VERSION = 1;
+    public final static Package.Version JAVA5_PACKAGE_VERSION =
+            Package.Version.of(150, 7);
 
-    public final static int JAVA7_PACKAGE_MAJOR_VERSION = 170;
-    public final static int JAVA7_PACKAGE_MINOR_VERSION = 1;
+    public final static Package.Version JAVA6_PACKAGE_VERSION =
+            Package.Version.of(160, 1);
+
+    public final static Package.Version JAVA7_PACKAGE_VERSION =
+            Package.Version.of(170, 1);
+
+    // upper limit, should point to the latest class version
+    public final static Package.Version JAVA_MAX_CLASS_VERSION =
+            JAVA7_MAX_CLASS_VERSION;
+
+    // upper limit should point to the latest package version, for version info!.
+    public final static Package.Version MAX_PACKAGE_VERSION =
+            JAVA7_PACKAGE_VERSION;
 
     public final static int CONSTANT_POOL_INDEX_LIMIT  = 0x10000;
     public final static int CONSTANT_POOL_NARROW_LIMIT = 0x00100;
diff --git a/src/share/classes/com/sun/java/util/jar/pack/Package.java b/src/share/classes/com/sun/java/util/jar/pack/Package.java
index fee97f4..64f9db5 100644
--- a/src/share/classes/com/sun/java/util/jar/pack/Package.java
+++ b/src/share/classes/com/sun/java/util/jar/pack/Package.java
@@ -25,6 +25,7 @@
 
 package com.sun.java.util.jar.pack;
 
+import java.util.jar.Pack200;
 import com.sun.java.util.jar.pack.Attribute.Layout;
 import com.sun.java.util.jar.pack.ConstantPool.ClassEntry;
 import com.sun.java.util.jar.pack.ConstantPool.DescriptorEntry;
@@ -67,46 +68,58 @@
             verbose = pmap.getInteger(Utils.DEBUG_VERBOSE);
     }
 
-    int magic;
-    int package_minver;
-    int package_majver;
+    final int magic = JAVA_PACKAGE_MAGIC;
 
     int default_modtime = NO_MODTIME;
     int default_options = 0;  // FO_DEFLATE_HINT
 
-    short default_class_majver = -1; // fill in later
-    short default_class_minver = 0;  // fill in later
+    Version defaultClassVersion = null;
 
     // These fields can be adjusted by driver properties.
-    short min_class_majver = JAVA_MIN_CLASS_MAJOR_VERSION;
-    short min_class_minver = JAVA_MIN_CLASS_MINOR_VERSION;
-    short max_class_majver = JAVA7_MAX_CLASS_MAJOR_VERSION;
-    short max_class_minver = JAVA7_MAX_CLASS_MINOR_VERSION;
+    final Version minClassVersion;
+    final Version maxClassVersion;
+    // null, indicates that consensus rules during package write
+    final Version packageVersion;
 
-    short observed_max_class_majver = min_class_majver;
-    short observed_max_class_minver = min_class_minver;
+    Version observedHighestClassVersion = null;
+
 
     // What constants are used in this unit?
     ConstantPool.IndexGroup cp = new ConstantPool.IndexGroup();
 
-    Package() {
-        magic          = JAVA_PACKAGE_MAGIC;
-        package_minver = -1;  // fill in later
-        package_majver = 0;   // fill in later
+    /*
+     * typically used by the PackageReader to set the defaults, in which
+     * case we take the defaults.
+     */
+    public Package() {
+        minClassVersion = JAVA_MIN_CLASS_VERSION;
+        maxClassVersion = JAVA_MAX_CLASS_VERSION;
+        packageVersion = null;
     }
 
-    public
-    void reset() {
+
+    /*
+     * Typically used by the PackerImpl during before packing, the defaults are
+     * overridden by the users preferences.
+     */
+    public Package(Version minClassVersion, Version maxClassVersion, Version packageVersion) {
+        // Fill in permitted range of major/minor version numbers.
+        this.minClassVersion = minClassVersion == null
+                ? JAVA_MIN_CLASS_VERSION
+                : minClassVersion;
+        this.maxClassVersion = maxClassVersion == null
+                ? JAVA_MAX_CLASS_VERSION
+                : maxClassVersion;
+        this.packageVersion  = packageVersion;
+    }
+
+
+    public void reset() {
         cp = new ConstantPool.IndexGroup();
         classes.clear();
         files.clear();
         BandStructure.nextSeqForDebug = 0;
-        package_minver = -1;  // fill in later
-        package_majver = 0;   // fill in later
-    }
-
-    int getPackageVersion() {
-        return (package_majver << 16) + package_minver;
+        observedHighestClassVersion = null;
     }
 
     // Special empty versions of Code and InnerClasses, used for markers.
@@ -128,73 +141,31 @@
         attrDefs = Collections.unmodifiableMap(ad);
     }
 
-    int getDefaultClassVersion() {
-        return (default_class_majver << 16) + (char)default_class_minver;
+    Version getDefaultClassVersion() {
+        return defaultClassVersion;
     }
 
     /** Return the highest version number of all classes,
      *  or 0 if there are no classes.
      */
-    int getHighestClassVersion() {
-        int res = 0;  // initial low value
+    private void setHighestClassVersion() {
+        if (observedHighestClassVersion != null)
+            return;
+        Version res = JAVA_MIN_CLASS_VERSION;  // initial low value
         for (Class cls : classes) {
-            int ver = cls.getVersion();
-            if (res < ver)  res = ver;
+            Version ver = cls.getVersion();
+            if (res.lessThan(ver))  res = ver;
         }
-        return res;
+        observedHighestClassVersion = res;
     }
 
-    /** Convenience function to choose an archive version based
-     *  on the class file versions observed within the archive.
-     */
-    void choosePackageVersion() {
-        assert(package_majver <= 0);  // do not call this twice
-        int classver = getHighestClassVersion();
-        if (classver == 0 || (classver >>> 16) < JAVA6_MAX_CLASS_MAJOR_VERSION) {
-            // There are only old classfiles in this segment or resources
-            package_majver = JAVA5_PACKAGE_MAJOR_VERSION;
-            package_minver = JAVA5_PACKAGE_MINOR_VERSION;
-        } else if ((classver >>> 16) == JAVA6_MAX_CLASS_MAJOR_VERSION) {
-            package_majver = JAVA6_PACKAGE_MAJOR_VERSION;
-            package_minver = JAVA6_PACKAGE_MINOR_VERSION;
-        } else {
-            // Normal case.  Use the newest archive format, when available
-            package_majver = JAVA7_PACKAGE_MAJOR_VERSION;
-            package_minver = JAVA7_PACKAGE_MINOR_VERSION;
-        }
+    Version getHighestClassVersion() {
+        setHighestClassVersion();
+        return observedHighestClassVersion;
     }
 
     // What Java classes are in this unit?
 
-    // Fixed 6211177, converted to throw IOException
-    void checkVersion() throws IOException {
-        if (magic != JAVA_PACKAGE_MAGIC) {
-            String gotMag = Integer.toHexString(magic);
-            String expMag = Integer.toHexString(JAVA_PACKAGE_MAGIC);
-            throw new IOException("Unexpected package magic number: got "+gotMag+"; expected "+expMag);
-        }
-        int[] majminFound = null;
-        for (int[] majmin : new int[][]{
-                { JAVA7_PACKAGE_MAJOR_VERSION, JAVA7_PACKAGE_MINOR_VERSION },
-                { JAVA6_PACKAGE_MAJOR_VERSION, JAVA6_PACKAGE_MINOR_VERSION },
-                { JAVA5_PACKAGE_MAJOR_VERSION, JAVA5_PACKAGE_MINOR_VERSION }
-            }) {
-            if (package_majver == majmin[0] && package_minver == majmin[1]) {
-                majminFound = majmin;
-                break;
-            }
-        }
-        if (majminFound == null) {
-            String gotVer = package_majver+"."+package_minver;
-            String expVer = JAVA7_PACKAGE_MAJOR_VERSION+"."+JAVA7_PACKAGE_MINOR_VERSION+
-                            " OR "+
-                            JAVA6_PACKAGE_MAJOR_VERSION+"."+JAVA6_PACKAGE_MINOR_VERSION+
-                            " OR "+
-                            JAVA5_PACKAGE_MAJOR_VERSION+"."+JAVA5_PACKAGE_MINOR_VERSION;
-            throw new IOException("Unexpected package minor version: got "+gotVer+"; expected "+expVer);
-        }
-    }
-
     ArrayList<Package.Class> classes = new ArrayList<>();
 
     public List<Package.Class> getClasses() {
@@ -210,7 +181,7 @@
 
         // File header
         int magic;
-        short minver, majver;
+        Version version;
 
         // Local constant pool (one-way mapping of index => package cp).
         Entry[] cpMap;
@@ -231,8 +202,7 @@
 
         Class(int flags, ClassEntry thisClass, ClassEntry superClass, ClassEntry[] interfaces) {
             this.magic      = JAVA_MAGIC;
-            this.minver     = default_class_minver;
-            this.majver     = default_class_majver;
+            this.version    = defaultClassVersion;
             this.flags      = flags;
             this.thisClass  = thisClass;
             this.superClass = superClass;
@@ -254,11 +224,8 @@
             return thisClass.stringValue();
         }
 
-        int getVersion() {
-            return (majver << 16) + (char)minver;
-        }
-        String getVersionString() {
-            return versionStringOf(majver, minver);
+        Version getVersion() {
+            return this.version;
         }
 
         // Note:  equals and hashCode are identity-based.
@@ -1182,13 +1149,6 @@
         }
     }
 
-    public static String versionStringOf(int majver, int minver) {
-        return majver+"."+minver;
-    }
-    public static String versionStringOf(int version) {
-        return versionStringOf(version >>> 16, (char)version);
-    }
-
     public void stripConstantFields() {
         for (Class c : classes) {
             for (Iterator<Class.Field> j = c.fields.iterator(); j.hasNext(); ) {
@@ -1342,4 +1302,75 @@
     static final List<Class.Field> noFields = Arrays.asList(new Class.Field[0]);
     static final List<Class.Method> noMethods = Arrays.asList(new Class.Method[0]);
     static final List<InnerClass> noInnerClasses = Arrays.asList(new InnerClass[0]);
+
+    protected static final class Version {
+
+        public final short major;
+        public final short minor;
+
+        private Version(short major, short minor) {
+            this.major = major;
+            this.minor = minor;
+        }
+
+        public String toString() {
+            return major + "." + minor;
+        }
+
+        public boolean equals(Object that) {
+            return that instanceof Version
+                    && major == ((Version)that).major
+                    && minor == ((Version)that).minor;
+        }
+
+        public int intValue() {
+            return (major << 16) + minor;
+        }
+
+        public int hashCode() {
+            return (major << 16) + 7 + minor;
+        }
+
+        public static Version of(int major, int minor) {
+            return new Version((short)major, (short)minor);
+        }
+
+        public static Version of(byte[] bytes) {
+           int minor = ((bytes[0] & 0xFF) << 8) | (bytes[1] & 0xFF);
+           int major = ((bytes[2] & 0xFF) << 8) | (bytes[3] & 0xFF);
+           return new Version((short)major, (short)minor);
+        }
+
+        public static Version of(int major_minor) {
+            short minor = (short)major_minor;
+            short major = (short)(major_minor >>> 16);
+            return new Version(major, minor);
+        }
+
+        public static Version makeVersion(PropMap props, String partialKey) {
+            int min = props.getInteger(Utils.COM_PREFIX
+                    + partialKey + ".minver", -1);
+            int maj = props.getInteger(Utils.COM_PREFIX
+                    + partialKey + ".majver", -1);
+            return min >= 0 && maj >= 0 ? Version.of(maj, min) : null;
+        }
+        public byte[] asBytes() {
+            byte[] bytes = {
+                (byte) (minor >> 8), (byte) minor,
+                (byte) (major >> 8), (byte) major
+            };
+            return bytes;
+        }
+        public int compareTo(Version that) {
+            return this.intValue() - that.intValue();
+        }
+
+        public boolean lessThan(Version that) {
+            return compareTo(that) < 0 ;
+        }
+
+        public boolean greaterThan(Version that) {
+            return compareTo(that) > 0 ;
+        }
+    }
 }
diff --git a/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java b/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java
index 8813b5e..26bade8 100644
--- a/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java
+++ b/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java
@@ -60,6 +60,7 @@
     Package pkg;
     byte[] bytes;
     LimitedBuffer in;
+    Package.Version packageVersion;
 
     PackageReader(Package pkg, InputStream in) throws IOException {
         this.pkg = pkg;
@@ -220,7 +221,6 @@
     final static int MAGIC_BYTES = 4;
 
     void readArchiveMagic() throws IOException {
-
         // Read a minimum of bytes in the first gulp.
         in.setReadLimit(MAGIC_BYTES + AH_LENGTH_MIN);
 
@@ -230,10 +230,38 @@
         archive_magic.readFrom(in);
 
         // read and check magic numbers:
-        pkg.magic = getMagicInt32();
+        int magic = getMagicInt32();
+        if (pkg.magic != magic) {
+            throw new IOException("Unexpected package magic number: got "
+                    + magic + "; expected " + pkg.magic);
+        }
         archive_magic.doneDisbursing();
     }
 
+     // Fixed 6211177, converted to throw IOException
+    void checkArchiveVersion() throws IOException {
+        Package.Version versionFound = null;
+        for (Package.Version v : new Package.Version[] {
+                JAVA7_PACKAGE_VERSION,
+                JAVA6_PACKAGE_VERSION,
+                JAVA5_PACKAGE_VERSION
+            }) {
+            if (packageVersion.equals(v)) {
+                versionFound = v;
+                break;
+            }
+        }
+        if (versionFound == null) {
+            String expVer = JAVA7_PACKAGE_VERSION.toString()
+                            + " OR "
+                            + JAVA6_PACKAGE_VERSION.toString()
+                            + " OR "
+                            + JAVA5_PACKAGE_VERSION.toString();
+            throw new IOException("Unexpected package minor version: got "
+                    +  packageVersion.toString() + "; expected " + expVer);
+        }
+    }
+
     void readArchiveHeader() throws IOException {
         //  archive_header:
         //        #archive_minver :UNSIGNED5[1]
@@ -264,10 +292,11 @@
         archive_header_0.expectLength(AH_LENGTH_0);
         archive_header_0.readFrom(in);
 
-        pkg.package_minver = archive_header_0.getInt();
-        pkg.package_majver = archive_header_0.getInt();
-        pkg.checkVersion();
-        this.initPackageMajver(pkg.package_majver);
+        int minver = archive_header_0.getInt();
+        int majver = archive_header_0.getInt();
+        packageVersion = Package.Version.of(majver, minver);
+        checkArchiveVersion();
+        this.initHighestClassVersion(JAVA7_MAX_CLASS_VERSION);
 
         archiveOptions = archive_header_0.getInt();
         archive_header_0.doneDisbursing();
@@ -324,8 +353,9 @@
 
         numInnerClasses = archive_header_1.getInt();
 
-        pkg.default_class_minver = (short) archive_header_1.getInt();
-        pkg.default_class_majver = (short) archive_header_1.getInt();
+        minver = (short) archive_header_1.getInt();
+        majver = (short) archive_header_1.getInt();
+        pkg.defaultClassVersion = Package.Version.of(majver, minver);
         numClasses = archive_header_1.getInt();
 
         archive_header_1.doneDisbursing();
@@ -414,7 +444,7 @@
     }
 
     void checkLegacy(String bandname) {
-        if (this.pkg.package_majver < JAVA7_PACKAGE_MAJOR_VERSION) {
+        if (packageVersion.lessThan(JAVA7_PACKAGE_VERSION)) {
             throw new RuntimeException("unexpected band " + bandname);
         }
     }
@@ -947,9 +977,9 @@
                                                             name.stringValue(),
                                                             layout.stringValue());
                 // Check layout string for Java 6 extensions.
-                String pvLayout = def.layoutForPackageMajver(getPackageMajver());
+                String pvLayout = def.layoutForClassVersion(getHighestClassVersion());
                 if (!pvLayout.equals(def.layout())) {
-                    throw new IOException("Bad attribute layout in version 150 archive: "+def.layout());
+                    throw new IOException("Bad attribute layout in archive: "+def.layout());
                 }
                 this.setAttributeLayoutIndex(def, index);
                 if (dump != null)  dump.println(index+" "+def);
@@ -1140,12 +1170,9 @@
         Attribute retroVersion = cls.getAttribute(attrClassFileVersion);
         if (retroVersion != null) {
             cls.removeAttribute(retroVersion);
-            short[] minmajver = parseClassFileVersionAttr(retroVersion);
-            cls.minver = minmajver[0];
-            cls.majver = minmajver[1];
+            cls.version = parseClassFileVersionAttr(retroVersion);
         } else {
-            cls.minver = pkg.default_class_minver;
-            cls.majver = pkg.default_class_majver;
+            cls.version = pkg.defaultClassVersion;
         }
 
         // Replace null SourceFile by "obvious" string.
diff --git a/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java b/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java
index d40a6d3..a4a2982 100644
--- a/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java
+++ b/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java
@@ -49,12 +49,13 @@
 class PackageWriter extends BandStructure {
     Package pkg;
     OutputStream finalOut;
+    Package.Version packageVersion;
 
     PackageWriter(Package pkg, OutputStream out) throws IOException {
         this.pkg = pkg;
         this.finalOut = out;
-        // Caller has specified archive version in the package:
-        initPackageMajver(pkg.package_majver);
+        // Caller has specified maximum class file version in the package:
+        initHighestClassVersion(pkg.getHighestClassVersion());
     }
 
     void write() throws IOException {
@@ -118,6 +119,57 @@
         collectInnerClasses();
     }
 
+    /*
+     * Convenience function to choose an archive version based
+     * on the class file versions observed within the archive
+     * or set the user defined version preset via properties.
+     */
+    void chooseDefaultPackageVersion() throws IOException {
+        if (pkg.packageVersion != null) {
+            packageVersion = pkg.packageVersion;
+            if (verbose > 0) {
+                Utils.log.info("package version overridden with: "
+                                + packageVersion);
+            }
+            return;
+        }
+
+        Package.Version highV = getHighestClassVersion();
+        // set the package version now
+        if (highV.lessThan(JAVA6_MAX_CLASS_VERSION)) {
+            // There are only old classfiles in this segment or resources
+            packageVersion = JAVA5_PACKAGE_VERSION;
+        } else if (highV.equals(JAVA6_MAX_CLASS_VERSION) ||
+                (highV.equals(JAVA7_MAX_CLASS_VERSION) && !pkg.cp.haveExtraTags())) {
+            // force down the package version if we have jdk7 classes without
+            // any Indy references, this is because jdk7 class file (52.0) without
+            // Indy is identical to jdk6 class file (51.0).
+            packageVersion = JAVA6_PACKAGE_VERSION;
+        } else {
+            // Normal case.  Use the newest archive format, when available
+            packageVersion = JAVA7_PACKAGE_VERSION;
+        }
+
+        if (verbose > 0) {
+            Utils.log.info("Highest version class file: " + highV
+                    + " package version: " + packageVersion);
+        }
+    }
+
+    void checkVersion() throws IOException {
+        assert(packageVersion != null);
+
+        if (packageVersion.lessThan(JAVA7_PACKAGE_VERSION)) {
+            // this bit was reserved for future use in previous versions
+            if (testBit(archiveOptions, AO_HAVE_CP_EXTRAS)) {
+                throw new IOException("Format bits for Java 7 must be zero in previous releases");
+            }
+        }
+        if (testBit(archiveOptions, AO_UNUSED_MBZ)) {
+            throw new IOException("High archive option bits are reserved and must be zero: " + Integer.toHexString(archiveOptions));
+        }
+    }
+
     void setArchiveOptions() {
         // Decide on some archive options early.
         // Does not decide on: AO_HAVE_SPECIAL_FORMATS,
@@ -168,11 +220,11 @@
             }
         }
         // Decide on default version number (majority rule).
-        Map<Integer, int[]> verCounts = new HashMap<>();
+        Map<Package.Version, int[]> verCounts = new HashMap<>();
         int bestCount = 0;
-        int bestVersion = -1;
+        Package.Version bestVersion = null;
         for (Class cls : pkg.classes) {
-            int version = cls.getVersion();
+            Package.Version version = cls.getVersion();
             int[] var = verCounts.get(version);
             if (var == null) {
                 var = new int[1];
@@ -186,28 +238,22 @@
             }
         }
         verCounts.clear();
-        if (bestVersion == -1)  bestVersion = 0;  // degenerate case
-        int bestMajver = (char)(bestVersion >>> 16);
-        int bestMinver = (char)(bestVersion);
-        pkg.default_class_majver = (short) bestMajver;
-        pkg.default_class_minver = (short) bestMinver;
-        String bestVerStr = Package.versionStringOf(bestMajver, bestMinver);
+        if (bestVersion == null)  bestVersion = JAVA_MIN_CLASS_VERSION;  // degenerate case
+        pkg.defaultClassVersion = bestVersion;
         if (verbose > 0)
-           Utils.log.info("Consensus version number in segment is "+bestVerStr);
+           Utils.log.info("Consensus version number in segment is " + bestVersion);
         if (verbose > 0)
-            Utils.log.info("Highest version number in segment is "+
-                           Package.versionStringOf(pkg.getHighestClassVersion()));
+            Utils.log.info("Highest version number in segment is "
+                            + pkg.getHighestClassVersion());
 
         // Now add explicit pseudo-attrs. to classes with odd versions.
         for (Class cls : pkg.classes) {
-            if (cls.getVersion() != bestVersion) {
-                Attribute a = makeClassFileVersionAttr(cls.minver, cls.majver);
+            if (!cls.getVersion().equals(bestVersion)) {
+                Attribute a = makeClassFileVersionAttr(cls.getVersion());
                 if (verbose > 1) {
-                    String clsVer = cls.getVersionString();
-                    String pkgVer = bestVerStr;
-                    Utils.log.fine("Version "+clsVer+" of "+cls
-                                     +" doesn't match package version "
-                                     +pkgVer);
+                    Utils.log.fine("Version "+cls.getVersion() + " of " + cls
+                                     + " doesn't match package version "
+                                     + bestVersion);
                 }
                 // Note:  Does not add in "natural" order.  (Who cares?)
                 cls.addAttribute(a);
@@ -252,7 +298,7 @@
     }
 
     void writeFileHeader() throws IOException {
-        pkg.checkVersion();
+        chooseDefaultPackageVersion();
         writeArchiveMagic();
         writeArchiveHeader();
     }
@@ -322,12 +368,13 @@
         if (haveCPExtra)
             headerSizeForDebug += AH_CP_EXTRA_LEN;
 
-        assert(pkg.package_majver > 0);  // caller must specify!
-        archive_header_0.putInt(pkg.package_minver);
-        archive_header_0.putInt(pkg.package_majver);
+        // the archiveOptions are all initialized, sanity check now!.
+        checkVersion();
+
+        archive_header_0.putInt(packageVersion.minor);
+        archive_header_0.putInt(packageVersion.major);
         if (verbose > 0)
-            Utils.log.info("Package Version for this segment:"+
-                           Package.versionStringOf(pkg.getPackageVersion()));
+            Utils.log.info("Package Version for this segment:" + packageVersion);
         archive_header_0.putInt(archiveOptions); // controls header format
         assert(archive_header_0.length() == AH_LENGTH_0);
 
@@ -361,8 +408,8 @@
         writeConstantPoolCounts(haveNumbers, haveCPExtra);
 
         archive_header_1.putInt(pkg.getAllInnerClasses().size());
-        archive_header_1.putInt(pkg.default_class_minver);
-        archive_header_1.putInt(pkg.default_class_majver);
+        archive_header_1.putInt(pkg.defaultClassVersion.minor);
+        archive_header_1.putInt(pkg.defaultClassVersion.major);
         archive_header_1.putInt(pkg.classes.size());
 
         // Sanity:  Make sure we came out to 29 (less optional fields):
@@ -892,7 +939,7 @@
                 if (predefIndex == null) {
                     // Make sure the package CP can name the local attribute.
                     Entry ne = ConstantPool.getUtf8Entry(def.name());
-                    String layout = def.layoutForPackageMajver(getPackageMajver());
+                    String layout = def.layoutForClassVersion(getHighestClassVersion());
                     Entry le = ConstantPool.getUtf8Entry(layout);
                     requiredEntries.add(ne);
                     requiredEntries.add(le);
@@ -988,7 +1035,7 @@
                 assert((header & ADH_CONTEXT_MASK) == def.ctype());
                 attr_definition_headers.putByte(header);
                 attr_definition_name.putRef(ConstantPool.getUtf8Entry(def.name()));
-                String layout = def.layoutForPackageMajver(getPackageMajver());
+                String layout = def.layoutForClassVersion(getHighestClassVersion());
                 attr_definition_layout.putRef(ConstantPool.getUtf8Entry(layout));
                 // Check that we are transmitting that correct attribute index:
                 boolean debug = false;
@@ -1542,8 +1589,8 @@
                         break;
                     default:
                         // CONSTANT_MethodHandle, etc.
-                        if (getPackageMajver() < JAVA7_PACKAGE_MAJOR_VERSION) {
-                            throw new IOException("bad package major version for Java 7 ldc");
+                        if (getHighestClassVersion().lessThan(JAVA7_MAX_CLASS_VERSION)) {
+                            throw new IOException("bad class file major version for Java 7 ldc");
                         }
                         bc_which = bc_loadablevalueref;
                         switch (bc) {
@@ -1581,8 +1628,8 @@
                     // Make sure the discarded bytes are sane:
                     assert(i.getConstant() == (1+((MemberEntry)ref).descRef.typeRef.computeSize(true)) << 8);
                 } else if (bc == _invokedynamic) {
-                    if (getPackageMajver() < JAVA7_PACKAGE_MAJOR_VERSION) {
-                        throw new IOException("bad package major version for Java 7 invokedynamic");
+                    if (getHighestClassVersion().lessThan(JAVA7_MAX_CLASS_VERSION)) {
+                        throw new IOException("bad class major version for Java 7 invokedynamic");
                     }
                     assert(i.getLength() == 5);
                     assert(i.getConstant() == 0);  // last 2 bytes MBZ
diff --git a/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java b/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java
index 93b743b..c7ef4ee 100644
--- a/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java
+++ b/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -164,8 +164,11 @@
             if (verbose > 0) Utils.log.info(props.toString());
         }
 
-        // Here's where the bits are collected before getting packed:
-        final Package pkg = new Package();
+        // Here's where the bits are collected before getting packed, we also
+        // initialize the version numbers now.
+        final Package pkg = new Package(Package.Version.makeVersion(props, "min.class"),
+                                        Package.Version.makeVersion(props, "max.class"),
+                                        Package.Version.makeVersion(props, "package"));
 
         final String unknownAttrCommand;
         {
@@ -280,23 +283,6 @@
         }
 
         {
-            // Fill in permitted range of major/minor version numbers.
-            int ver;
-            if ((ver = props.getInteger(Utils.COM_PREFIX+"min.class.majver")) != 0)
-                pkg.min_class_majver = (short) ver;
-            if ((ver = props.getInteger(Utils.COM_PREFIX+"min.class.minver")) != 0)
-                pkg.min_class_minver = (short) ver;
-            if ((ver = props.getInteger(Utils.COM_PREFIX+"max.class.majver")) != 0)
-                pkg.max_class_majver = (short) ver;
-            if ((ver = props.getInteger(Utils.COM_PREFIX+"max.class.minver")) != 0)
-                pkg.max_class_minver = (short) ver;
-            if ((ver = props.getInteger(Utils.COM_PREFIX+"package.minver")) != 0)
-                pkg.package_minver = (short) ver;
-            if ((ver = props.getInteger(Utils.COM_PREFIX+"package.majver")) != 0)
-                pkg.package_majver = (short) ver;
-        }
-
-        {
             // Hook for testing:  Forces use of special archive modes.
             int opt = props.getInteger(Utils.COM_PREFIX+"archive.options");
             if (opt != 0)
@@ -603,9 +589,6 @@
             if (props.getBoolean(Utils.COM_PREFIX+"strip.exceptions"))   pkg.stripAttributeKind("Exceptions");
             if (props.getBoolean(Utils.COM_PREFIX+"strip.innerclasses")) pkg.stripAttributeKind("InnerClasses");
 
-            // Must choose an archive version; PackageWriter does not.
-            if (pkg.package_majver <= 0)  pkg.choosePackageVersion();
-
             PackageWriter pw = new PackageWriter(pkg, out);
             pw.archiveNextCount = nextCount;
             pw.write();
diff --git a/src/share/classes/com/sun/java/util/jar/pack/PropMap.java b/src/share/classes/com/sun/java/util/jar/pack/PropMap.java
index 07887b9..e1a3855 100644
--- a/src/share/classes/com/sun/java/util/jar/pack/PropMap.java
+++ b/src/share/classes/com/sun/java/util/jar/pack/PropMap.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -193,13 +193,18 @@
     boolean setBoolean(String s, boolean val) {
         return toBoolean(setProperty(s, String.valueOf(val)));
     }
-
     int toInteger(String val) {
-        if (val == null)  return 0;
+        return toInteger(val, 0);
+    }
+    int toInteger(String val, int def) {
+        if (val == null)  return def;
         if (Pack200.Packer.TRUE.equals(val))   return 1;
         if (Pack200.Packer.FALSE.equals(val))  return 0;
         return Integer.parseInt(val);
     }
+    int getInteger(String s, int def) {
+        return toInteger(getProperty(s), def);
+    }
     int getInteger(String s) {
         return toInteger(getProperty(s));
     }
diff --git a/src/share/classes/com/sun/java/util/jar/pack/Utils.java b/src/share/classes/com/sun/java/util/jar/pack/Utils.java
index 06ecaef..5edd73e 100644
--- a/src/share/classes/com/sun/java/util/jar/pack/Utils.java
+++ b/src/share/classes/com/sun/java/util/jar/pack/Utils.java
@@ -25,12 +25,6 @@
 
 package com.sun.java.util.jar.pack;
 
-import com.sun.java.util.jar.pack.ConstantPool.ClassEntry;
-import com.sun.java.util.jar.pack.ConstantPool.DescriptorEntry;
-import com.sun.java.util.jar.pack.ConstantPool.LiteralEntry;
-import com.sun.java.util.jar.pack.ConstantPool.MemberEntry;
-import com.sun.java.util.jar.pack.ConstantPool.SignatureEntry;
-import com.sun.java.util.jar.pack.ConstantPool.Utf8Entry;
 import java.io.BufferedInputStream;
 import java.io.BufferedOutputStream;
 import java.io.File;
@@ -38,9 +32,8 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.util.Collections;
 import java.util.Date;
-import java.util.Enumeration;
-import java.util.Map;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 import java.util.jar.JarInputStream;
@@ -211,9 +204,7 @@
     static String getVersionString() {
         return "Pack200, Vendor: " +
             System.getProperty("java.vendor") +
-            ", Version: " +
-            Constants.JAVA6_PACKAGE_MAJOR_VERSION + "." +
-            Constants.JAVA6_PACKAGE_MINOR_VERSION;
+            ", Version: " + Constants.MAX_PACKAGE_VERSION;
     }
 
     static void markJarFile(JarOutputStream out) throws IOException {
@@ -240,8 +231,7 @@
     }
     static void copyJarFile(JarFile in, JarOutputStream out) throws IOException {
         byte[] buffer = new byte[1 << 14];
-        for (Enumeration<JarEntry> e = in.entries(); e.hasMoreElements(); ) {
-            JarEntry je = e.nextElement();
+        for (JarEntry je : Collections.list(in.entries())) {
             out.putNextEntry(je);
             InputStream ein = in.getInputStream(je);
             for (int nr; 0 < (nr = ein.read(buffer)); ) {
diff --git a/src/share/classes/java/awt/KeyboardFocusManager.java b/src/share/classes/java/awt/KeyboardFocusManager.java
index 5e7792a..15fe153 100644
--- a/src/share/classes/java/awt/KeyboardFocusManager.java
+++ b/src/share/classes/java/awt/KeyboardFocusManager.java
@@ -561,7 +561,7 @@
                         rootAncestor = (Container)focusOwner;
                     }
                     if (rootAncestor != null) {
-                        setGlobalCurrentFocusCycleRoot(rootAncestor);
+                        setGlobalCurrentFocusCycleRootPriv(rootAncestor);
                     }
                 }
 
diff --git a/src/share/classes/java/lang/IllegalArgumentException.java b/src/share/classes/java/lang/IllegalArgumentException.java
index 13ffbf1..c29a9d5 100644
--- a/src/share/classes/java/lang/IllegalArgumentException.java
+++ b/src/share/classes/java/lang/IllegalArgumentException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
  * inappropriate argument.
  *
  * @author  unascribed
- * @see     java.lang.Thread#setPriority(int)
  * @since   JDK1.0
  */
 public
diff --git a/src/share/classes/java/lang/Integer.java b/src/share/classes/java/lang/Integer.java
index c33e90a..48ef1bb 100644
--- a/src/share/classes/java/lang/Integer.java
+++ b/src/share/classes/java/lang/Integer.java
@@ -381,7 +381,7 @@
         int size = (i < 0) ? stringSize(-i) + 1 : stringSize(i);
         char[] buf = new char[size];
         getChars(i, size, buf);
-        return new String(0, size, buf);
+        return new String(buf, true);
     }
 
     /**
diff --git a/src/share/classes/java/lang/Long.java b/src/share/classes/java/lang/Long.java
index f4dc32d..55f7b1a 100644
--- a/src/share/classes/java/lang/Long.java
+++ b/src/share/classes/java/lang/Long.java
@@ -373,7 +373,7 @@
         int size = (i < 0) ? stringSize(-i) + 1 : stringSize(i);
         char[] buf = new char[size];
         getChars(i, size, buf);
-        return new String(0, size, buf);
+        return new String(buf, true);
     }
 
     /**
diff --git a/src/share/classes/java/lang/NumberFormatException.java b/src/share/classes/java/lang/NumberFormatException.java
index c1d19de..ea1ec9f 100644
--- a/src/share/classes/java/lang/NumberFormatException.java
+++ b/src/share/classes/java/lang/NumberFormatException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,7 @@
  * have the appropriate format.
  *
  * @author  unascribed
- * @see     java.lang.Integer#toString()
+ * @see     java.lang.Integer#parseInt(String)
  * @since   JDK1.0
  */
 public
diff --git a/src/share/classes/java/lang/String.java b/src/share/classes/java/lang/String.java
index 79c71d1..f4f2a1a 100644
--- a/src/share/classes/java/lang/String.java
+++ b/src/share/classes/java/lang/String.java
@@ -25,7 +25,6 @@
 
 package java.lang;
 
-import java.io.ObjectStreamClass;
 import java.io.ObjectStreamField;
 import java.io.UnsupportedEncodingException;
 import java.nio.charset.Charset;
@@ -108,17 +107,10 @@
  */
 
 public final class String
-    implements java.io.Serializable, Comparable<String>, CharSequence
-{
+    implements java.io.Serializable, Comparable<String>, CharSequence {
     /** The value is used for character storage. */
     private final char value[];
 
-    /** The offset is the first index of the storage that is used. */
-    private final int offset;
-
-    /** The count is the number of characters in the String. */
-    private final int count;
-
     /** Cache the hash code for the string */
     private int hash; // Default to 0
 
@@ -138,7 +130,7 @@
      * string instance within the stream.
      */
     private static final ObjectStreamField[] serialPersistentFields =
-        new ObjectStreamField[0];
+            new ObjectStreamField[0];
 
     /**
      * Initializes a newly created {@code String} object so that it represents
@@ -146,8 +138,6 @@
      * unnecessary since Strings are immutable.
      */
     public String() {
-        this.offset = 0;
-        this.count = 0;
         this.value = new char[0];
     }
 
@@ -162,23 +152,8 @@
      *         A {@code String}
      */
     public String(String original) {
-        int size = original.count;
-        char[] originalValue = original.value;
-        char[] v;
-        if (originalValue.length > size) {
-            // The array representing the String is bigger than the new
-            // String itself.  Perhaps this constructor is being called
-            // in order to trim the baggage, so make a copy of the array.
-            int off = original.offset;
-            v = Arrays.copyOfRange(originalValue, off, off+size);
-        } else {
-            // The array representing the String is the same
-            // size as the String, so no point in making a copy.
-            v = originalValue;
-        }
-        this.offset = 0;
-        this.count = size;
-        this.value = v;
+        this.value = original.value;
+        this.hash = original.hash;
     }
 
     /**
@@ -191,10 +166,7 @@
      *         The initial value of the string
      */
     public String(char value[]) {
-        int size = value.length;
-        this.offset = 0;
-        this.count = size;
-        this.value = Arrays.copyOf(value, size);
+        this.value = Arrays.copyOf(value, value.length);
     }
 
     /**
@@ -229,8 +201,6 @@
         if (offset > value.length - count) {
             throw new StringIndexOutOfBoundsException(offset + count);
         }
-        this.offset = 0;
-        this.count = count;
         this.value = Arrays.copyOfRange(value, offset, offset+count);
     }
 
@@ -293,14 +263,12 @@
         for (int i = offset, j = 0; i < end; i++, j++) {
             int c = codePoints[i];
             if (Character.isBmpCodePoint(c))
-                v[j] = (char) c;
+                v[j] = (char)c;
             else
                 Character.toSurrogates(c, v, j++);
         }
 
-        this.value  = v;
-        this.count  = n;
-        this.offset = 0;
+        this.value = v;
     }
 
     /**
@@ -348,17 +316,15 @@
         char value[] = new char[count];
 
         if (hibyte == 0) {
-            for (int i = count ; i-- > 0 ;) {
-                value[i] = (char) (ascii[i + offset] & 0xff);
+            for (int i = count; i-- > 0;) {
+                value[i] = (char)(ascii[i + offset] & 0xff);
             }
         } else {
             hibyte <<= 8;
-            for (int i = count ; i-- > 0 ;) {
-                value[i] = (char) (hibyte | (ascii[i + offset] & 0xff));
+            for (int i = count; i-- > 0;) {
+                value[i] = (char)(hibyte | (ascii[i + offset] & 0xff));
             }
         }
-        this.offset = 0;
-        this.count = count;
         this.value = value;
     }
 
@@ -444,15 +410,11 @@
      * @since  JDK1.1
      */
     public String(byte bytes[], int offset, int length, String charsetName)
-        throws UnsupportedEncodingException
-    {
+            throws UnsupportedEncodingException {
         if (charsetName == null)
             throw new NullPointerException("charsetName");
         checkBounds(bytes, offset, length);
-        char[] v = StringCoding.decode(charsetName, bytes, offset, length);
-        this.offset = 0;
-        this.count = v.length;
-        this.value = v;
+        this.value = StringCoding.decode(charsetName, bytes, offset, length);
     }
 
     /**
@@ -489,10 +451,7 @@
         if (charset == null)
             throw new NullPointerException("charset");
         checkBounds(bytes, offset, length);
-        char[] v = StringCoding.decode(charset, bytes, offset, length);
-        this.offset = 0;
-        this.count = v.length;
-        this.value = v;
+        this.value =  StringCoding.decode(charset, bytes, offset, length);
     }
 
     /**
@@ -519,8 +478,7 @@
      * @since  JDK1.1
      */
     public String(byte bytes[], String charsetName)
-        throws UnsupportedEncodingException
-    {
+            throws UnsupportedEncodingException {
         this(bytes, 0, bytes.length, charsetName);
     }
 
@@ -576,10 +534,7 @@
      */
     public String(byte bytes[], int offset, int length) {
         checkBounds(bytes, offset, length);
-        char[] v  = StringCoding.decode(bytes, offset, length);
-        this.offset = 0;
-        this.count = v.length;
-        this.value = v;
+        this.value = StringCoding.decode(bytes, offset, length);
     }
 
     /**
@@ -612,10 +567,9 @@
      *         A {@code StringBuffer}
      */
     public String(StringBuffer buffer) {
-        String result = buffer.toString();
-        this.value = result.value;
-        this.count = result.count;
-        this.offset = result.offset;
+        synchronized(buffer) {
+            this.value = Arrays.copyOf(buffer.getValue(), buffer.length());
+        }
     }
 
     /**
@@ -634,18 +588,18 @@
      * @since  1.5
      */
     public String(StringBuilder builder) {
-        String result = builder.toString();
-        this.value = result.value;
-        this.count = result.count;
-        this.offset = result.offset;
+        this.value = Arrays.copyOf(builder.getValue(), builder.length());
     }
 
-
-    // Package private constructor which shares value array for speed.
-    String(int offset, int count, char value[]) {
+    /*
+    * Package private constructor which shares value array for speed.
+    * this constructor is always expected to be called with share==true.
+    * a separate constructor is needed because we already have a public
+    * String(char[]) constructor that makes a copy of the given char[].
+    */
+    String(char[] value, boolean share) {
+        // assert share : "unshared not supported";
         this.value = value;
-        this.offset = offset;
-        this.count = count;
     }
 
     /**
@@ -657,7 +611,7 @@
      *          object.
      */
     public int length() {
-        return count;
+        return value.length;
     }
 
     /**
@@ -669,7 +623,7 @@
      * @since 1.6
      */
     public boolean isEmpty() {
-        return count == 0;
+        return value.length == 0;
     }
 
     /**
@@ -691,10 +645,10 @@
      *             string.
      */
     public char charAt(int index) {
-        if ((index < 0) || (index >= count)) {
+        if ((index < 0) || (index >= value.length)) {
             throw new StringIndexOutOfBoundsException(index);
         }
-        return value[index + offset];
+        return value[index];
     }
 
     /**
@@ -720,10 +674,10 @@
      * @since      1.5
      */
     public int codePointAt(int index) {
-        if ((index < 0) || (index >= count)) {
+        if ((index < 0) || (index >= value.length)) {
             throw new StringIndexOutOfBoundsException(index);
         }
-        return Character.codePointAtImpl(value, offset + index, offset + count);
+        return Character.codePointAtImpl(value, index, value.length);
     }
 
     /**
@@ -750,10 +704,10 @@
      */
     public int codePointBefore(int index) {
         int i = index - 1;
-        if ((i < 0) || (i >= count)) {
+        if ((i < 0) || (i >= value.length)) {
             throw new StringIndexOutOfBoundsException(index);
         }
-        return Character.codePointBeforeImpl(value, offset + index, offset);
+        return Character.codePointBeforeImpl(value, index, 0);
     }
 
     /**
@@ -778,10 +732,10 @@
      * @since  1.5
      */
     public int codePointCount(int beginIndex, int endIndex) {
-        if (beginIndex < 0 || endIndex > count || beginIndex > endIndex) {
+        if (beginIndex < 0 || endIndex > value.length || beginIndex > endIndex) {
             throw new IndexOutOfBoundsException();
         }
-        return Character.codePointCountImpl(value, offset+beginIndex, endIndex-beginIndex);
+        return Character.codePointCountImpl(value, beginIndex, endIndex - beginIndex);
     }
 
     /**
@@ -805,11 +759,11 @@
      * @since 1.5
      */
     public int offsetByCodePoints(int index, int codePointOffset) {
-        if (index < 0 || index > count) {
+        if (index < 0 || index > value.length) {
             throw new IndexOutOfBoundsException();
         }
-        return Character.offsetByCodePointsImpl(value, offset, count,
-                                                offset+index, codePointOffset) - offset;
+        return Character.offsetByCodePointsImpl(value, 0, value.length,
+                index, codePointOffset);
     }
 
     /**
@@ -817,7 +771,7 @@
      * This method doesn't perform any range checking.
      */
     void getChars(char dst[], int dstBegin) {
-        System.arraycopy(value, offset, dst, dstBegin, count);
+        System.arraycopy(value, 0, dst, dstBegin, value.length);
     }
 
     /**
@@ -854,14 +808,13 @@
         if (srcBegin < 0) {
             throw new StringIndexOutOfBoundsException(srcBegin);
         }
-        if (srcEnd > count) {
+        if (srcEnd > value.length) {
             throw new StringIndexOutOfBoundsException(srcEnd);
         }
         if (srcBegin > srcEnd) {
             throw new StringIndexOutOfBoundsException(srcEnd - srcBegin);
         }
-        System.arraycopy(value, offset + srcBegin, dst, dstBegin,
-             srcEnd - srcBegin);
+        System.arraycopy(value, srcBegin, dst, dstBegin, srcEnd - srcBegin);
     }
 
     /**
@@ -912,15 +865,15 @@
         if (srcBegin < 0) {
             throw new StringIndexOutOfBoundsException(srcBegin);
         }
-        if (srcEnd > count) {
+        if (srcEnd > value.length) {
             throw new StringIndexOutOfBoundsException(srcEnd);
         }
         if (srcBegin > srcEnd) {
             throw new StringIndexOutOfBoundsException(srcEnd - srcBegin);
         }
         int j = dstBegin;
-        int n = offset + srcEnd;
-        int i = offset + srcBegin;
+        int n = srcEnd;
+        int i = srcBegin;
         char[] val = value;   /* avoid getfield opcode */
 
         while (i < n) {
@@ -949,10 +902,9 @@
      * @since  JDK1.1
      */
     public byte[] getBytes(String charsetName)
-        throws UnsupportedEncodingException
-    {
+            throws UnsupportedEncodingException {
         if (charsetName == null) throw new NullPointerException();
-        return StringCoding.encode(charsetName, value, offset, count);
+        return StringCoding.encode(charsetName, value, 0, value.length);
     }
 
     /**
@@ -975,7 +927,7 @@
      */
     public byte[] getBytes(Charset charset) {
         if (charset == null) throw new NullPointerException();
-        return StringCoding.encode(charset, value, offset, count);
+        return StringCoding.encode(charset, value, 0, value.length);
     }
 
     /**
@@ -992,7 +944,7 @@
      * @since      JDK1.1
      */
     public byte[] getBytes() {
-        return StringCoding.encode(value, offset, count);
+        return StringCoding.encode(value, 0, value.length);
     }
 
     /**
@@ -1015,16 +967,16 @@
             return true;
         }
         if (anObject instanceof String) {
-            String anotherString = (String)anObject;
-            int n = count;
-            if (n == anotherString.count) {
+            String anotherString = (String) anObject;
+            int n = value.length;
+            if (n == anotherString.value.length) {
                 char v1[] = value;
                 char v2[] = anotherString.value;
-                int i = offset;
-                int j = anotherString.offset;
+                int i = 0;
                 while (n-- != 0) {
-                    if (v1[i++] != v2[j++])
-                        return false;
+                    if (v1[i] != v2[i])
+                            return false;
+                    i++;
                 }
                 return true;
             }
@@ -1047,8 +999,8 @@
      * @since  1.4
      */
     public boolean contentEquals(StringBuffer sb) {
-        synchronized(sb) {
-            return contentEquals((CharSequence)sb);
+        synchronized (sb) {
+            return contentEquals((CharSequence) sb);
         }
     }
 
@@ -1067,18 +1019,18 @@
      * @since  1.5
      */
     public boolean contentEquals(CharSequence cs) {
-        if (count != cs.length())
+        if (value.length != cs.length())
             return false;
         // Argument is a StringBuffer, StringBuilder
         if (cs instanceof AbstractStringBuilder) {
             char v1[] = value;
-            char v2[] = ((AbstractStringBuilder)cs).getValue();
-            int i = offset;
-            int j = 0;
-            int n = count;
+            char v2[] = ((AbstractStringBuilder) cs).getValue();
+            int i = 0;
+            int n = value.length;
             while (n-- != 0) {
-                if (v1[i++] != v2[j++])
+                if (v1[i] != v2[i])
                     return false;
+                i++;
             }
             return true;
         }
@@ -1087,12 +1039,12 @@
             return true;
         // Argument is a generic CharSequence
         char v1[] = value;
-        int i = offset;
-        int j = 0;
-        int n = count;
+        int i = 0;
+        int n = value.length;
         while (n-- != 0) {
-            if (v1[i++] != cs.charAt(j++))
+            if (v1[i] != cs.charAt(i))
                 return false;
+            i++;
         }
         return true;
     }
@@ -1126,9 +1078,10 @@
      * @see  #equals(Object)
      */
     public boolean equalsIgnoreCase(String anotherString) {
-        return (this == anotherString) ? true :
-               (anotherString != null) && (anotherString.count == count) &&
-               regionMatches(true, 0, anotherString, 0, count);
+        return (this == anotherString) ? true
+                : (anotherString != null)
+                && (anotherString.value.length == value.length)
+                && regionMatches(true, 0, anotherString, 0, value.length);
     }
 
     /**
@@ -1173,33 +1126,20 @@
      *          lexicographically greater than the string argument.
      */
     public int compareTo(String anotherString) {
-        int len1 = count;
-        int len2 = anotherString.count;
-        int n = Math.min(len1, len2);
+        int len1 = value.length;
+        int len2 = anotherString.value.length;
+        int lim = Math.min(len1, len2);
         char v1[] = value;
         char v2[] = anotherString.value;
-        int i = offset;
-        int j = anotherString.offset;
 
-        if (i == j) {
-            int k = i;
-            int lim = n + i;
-            while (k < lim) {
-                char c1 = v1[k];
-                char c2 = v2[k];
-                if (c1 != c2) {
-                    return c1 - c2;
-                }
-                k++;
+        int k = 0;
+        while (k < lim) {
+            char c1 = v1[k];
+            char c2 = v2[k];
+            if (c1 != c2) {
+                return c1 - c2;
             }
-        } else {
-            while (n-- != 0) {
-                char c1 = v1[i++];
-                char c2 = v2[j++];
-                if (c1 != c2) {
-                    return c1 - c2;
-                }
-            }
+            k++;
         }
         return len1 - len2;
     }
@@ -1219,7 +1159,7 @@
     public static final Comparator<String> CASE_INSENSITIVE_ORDER
                                          = new CaseInsensitiveComparator();
     private static class CaseInsensitiveComparator
-                         implements Comparator<String>, java.io.Serializable {
+            implements Comparator<String>, java.io.Serializable {
         // use serialVersionUID from JDK 1.2.2 for interoperability
         private static final long serialVersionUID = 8575799808933029326L;
 
@@ -1306,14 +1246,15 @@
      *          {@code false} otherwise.
      */
     public boolean regionMatches(int toffset, String other, int ooffset,
-                                 int len) {
+            int len) {
         char ta[] = value;
-        int to = offset + toffset;
+        int to = toffset;
         char pa[] = other.value;
-        int po = other.offset + ooffset;
+        int po = ooffset;
         // Note: toffset, ooffset, or len might be near -1>>>1.
-        if ((ooffset < 0) || (toffset < 0) || (toffset > (long)count - len)
-            || (ooffset > (long)other.count - len)) {
+        if ((ooffset < 0) || (toffset < 0)
+                || (toffset > (long)value.length - len)
+                || (ooffset > (long)other.value.length - len)) {
             return false;
         }
         while (len-- > 0) {
@@ -1351,7 +1292,7 @@
      * integer <i>k</i> less than <tt>len</tt> such that:
      * <blockquote><pre>
      * Character.toLowerCase(this.charAt(toffset+k)) !=
-               Character.toLowerCase(other.charAt(ooffset+k))
+     Character.toLowerCase(other.charAt(ooffset+k))
      * </pre></blockquote>
      * and:
      * <blockquote><pre>
@@ -1375,14 +1316,15 @@
      *          argument.
      */
     public boolean regionMatches(boolean ignoreCase, int toffset,
-                           String other, int ooffset, int len) {
+            String other, int ooffset, int len) {
         char ta[] = value;
-        int to = offset + toffset;
+        int to = toffset;
         char pa[] = other.value;
-        int po = other.offset + ooffset;
+        int po = ooffset;
         // Note: toffset, ooffset, or len might be near -1>>>1.
-        if ((ooffset < 0) || (toffset < 0) || (toffset > (long)count - len) ||
-                (ooffset > (long)other.count - len)) {
+        if ((ooffset < 0) || (toffset < 0)
+                || (toffset > (long)value.length - len)
+                || (ooffset > (long)other.value.length - len)) {
             return false;
         }
         while (len-- > 0) {
@@ -1433,12 +1375,12 @@
      */
     public boolean startsWith(String prefix, int toffset) {
         char ta[] = value;
-        int to = offset + toffset;
+        int to = toffset;
         char pa[] = prefix.value;
-        int po = prefix.offset;
-        int pc = prefix.count;
+        int po = 0;
+        int pc = prefix.value.length;
         // Note: toffset might be near -1>>>1.
-        if ((toffset < 0) || (toffset > count - pc)) {
+        if ((toffset < 0) || (toffset > value.length - pc)) {
             return false;
         }
         while (--pc >= 0) {
@@ -1478,7 +1420,7 @@
      *          as determined by the {@link #equals(Object)} method.
      */
     public boolean endsWith(String suffix) {
-        return startsWith(suffix, count - suffix.count);
+        return startsWith(suffix, value.length - suffix.value.length);
     }
 
     /**
@@ -1496,13 +1438,11 @@
      */
     public int hashCode() {
         int h = hash;
-        if (h == 0 && count > 0) {
-            int off = offset;
+        if (h == 0 && value.length > 0) {
             char val[] = value;
-            int len = count;
 
-            for (int i = 0; i < len; i++) {
-                h = 31*h + val[off++];
+            for (int i = 0; i < value.length; i++) {
+                h = 31 * h + val[i];
             }
             hash = h;
         }
@@ -1577,9 +1517,10 @@
      *          if the character does not occur.
      */
     public int indexOf(int ch, int fromIndex) {
+        final int max = value.length;
         if (fromIndex < 0) {
             fromIndex = 0;
-        } else if (fromIndex >= count) {
+        } else if (fromIndex >= max) {
             // Note: fromIndex might be near -1>>>1.
             return -1;
         }
@@ -1588,11 +1529,9 @@
             // handle most cases here (ch is a BMP code point or a
             // negative value (invalid code point))
             final char[] value = this.value;
-            final int offset = this.offset;
-            final int max = offset + count;
-            for (int i = offset + fromIndex; i < max ; i++) {
+            for (int i = fromIndex; i < max; i++) {
                 if (value[i] == ch) {
-                    return i - offset;
+                    return i;
                 }
             }
             return -1;
@@ -1607,13 +1546,12 @@
     private int indexOfSupplementary(int ch, int fromIndex) {
         if (Character.isValidCodePoint(ch)) {
             final char[] value = this.value;
-            final int offset = this.offset;
             final char hi = Character.highSurrogate(ch);
             final char lo = Character.lowSurrogate(ch);
-            final int max = offset + count - 1;
-            for (int i = offset + fromIndex; i < max; i++) {
-                if (value[i] == hi && value[i+1] == lo) {
-                    return i - offset;
+            final int max = value.length - 1;
+            for (int i = fromIndex; i < max; i++) {
+                if (value[i] == hi && value[i + 1] == lo) {
+                    return i;
                 }
             }
         }
@@ -1644,7 +1582,7 @@
      *          {@code -1} if the character does not occur.
      */
     public int lastIndexOf(int ch) {
-        return lastIndexOf(ch, count - 1);
+        return lastIndexOf(ch, value.length - 1);
     }
 
     /**
@@ -1686,11 +1624,10 @@
             // handle most cases here (ch is a BMP code point or a
             // negative value (invalid code point))
             final char[] value = this.value;
-            final int offset = this.offset;
-            int i = offset + Math.min(fromIndex, count - 1);
-            for (; i >= offset ; i--) {
+            int i = Math.min(fromIndex, value.length - 1);
+            for (; i >= 0; i--) {
                 if (value[i] == ch) {
-                    return i - offset;
+                    return i;
                 }
             }
             return -1;
@@ -1705,13 +1642,12 @@
     private int lastIndexOfSupplementary(int ch, int fromIndex) {
         if (Character.isValidCodePoint(ch)) {
             final char[] value = this.value;
-            final int offset = this.offset;
             char hi = Character.highSurrogate(ch);
             char lo = Character.lowSurrogate(ch);
-            int i = offset + Math.min(fromIndex, count - 2);
-            for (; i >= offset; i--) {
-                if (value[i] == hi && value[i+1] == lo) {
-                    return i - offset;
+            int i = Math.min(fromIndex, value.length - 2);
+            for (; i >= 0; i--) {
+                if (value[i] == hi && value[i + 1] == lo) {
+                    return i;
                 }
             }
         }
@@ -1753,8 +1689,8 @@
      *          or {@code -1} if there is no such occurrence.
      */
     public int indexOf(String str, int fromIndex) {
-        return indexOf(value, offset, count,
-                       str.value, str.offset, str.count, fromIndex);
+        return indexOf(value, 0, value.length,
+                str.value, 0, str.value.length, fromIndex);
     }
 
     /**
@@ -1771,8 +1707,8 @@
      * @param   fromIndex    the index to begin searching from.
      */
     static int indexOf(char[] source, int sourceOffset, int sourceCount,
-                       char[] target, int targetOffset, int targetCount,
-                       int fromIndex) {
+            char[] target, int targetOffset, int targetCount,
+            int fromIndex) {
         if (fromIndex >= sourceCount) {
             return (targetCount == 0 ? sourceCount : -1);
         }
@@ -1783,7 +1719,7 @@
             return fromIndex;
         }
 
-        char first  = target[targetOffset];
+        char first = target[targetOffset];
         int max = sourceOffset + (sourceCount - targetCount);
 
         for (int i = sourceOffset + fromIndex; i <= max; i++) {
@@ -1796,8 +1732,8 @@
             if (i <= max) {
                 int j = i + 1;
                 int end = j + targetCount - 1;
-                for (int k = targetOffset + 1; j < end && source[j] ==
-                         target[k]; j++, k++);
+                for (int k = targetOffset + 1; j < end && source[j]
+                        == target[k]; j++, k++);
 
                 if (j == end) {
                     /* Found whole string. */
@@ -1824,7 +1760,7 @@
      *          or {@code -1} if there is no such occurrence.
      */
     public int lastIndexOf(String str) {
-        return lastIndexOf(str, count);
+        return lastIndexOf(str, value.length);
     }
 
     /**
@@ -1844,8 +1780,8 @@
      *          or {@code -1} if there is no such occurrence.
      */
     public int lastIndexOf(String str, int fromIndex) {
-        return lastIndexOf(value, offset, count,
-                           str.value, str.offset, str.count, fromIndex);
+        return lastIndexOf(value, 0, value.length,
+                str.value, 0, str.value.length, fromIndex);
     }
 
     /**
@@ -1862,8 +1798,8 @@
      * @param   fromIndex    the index to begin searching from.
      */
     static int lastIndexOf(char[] source, int sourceOffset, int sourceCount,
-                           char[] target, int targetOffset, int targetCount,
-                           int fromIndex) {
+            char[] target, int targetOffset, int targetCount,
+            int fromIndex) {
         /*
          * Check arguments; return immediately where possible. For
          * consistency, don't check for null str.
@@ -1885,7 +1821,7 @@
         int min = sourceOffset + targetCount - 1;
         int i = min + fromIndex;
 
-    startSearchForLastChar:
+        startSearchForLastChar:
         while (true) {
             while (i >= min && source[i] != strLastChar) {
                 i--;
@@ -1925,7 +1861,14 @@
      *             length of this {@code String} object.
      */
     public String substring(int beginIndex) {
-        return substring(beginIndex, count);
+        if (beginIndex < 0) {
+            throw new StringIndexOutOfBoundsException(beginIndex);
+        }
+        int subLen = value.length - beginIndex;
+        if (subLen < 0) {
+            throw new StringIndexOutOfBoundsException(subLen);
+        }
+        return (beginIndex == 0) ? this : new String(value, beginIndex, subLen);
     }
 
     /**
@@ -1954,14 +1897,15 @@
         if (beginIndex < 0) {
             throw new StringIndexOutOfBoundsException(beginIndex);
         }
-        if (endIndex > count) {
+        if (endIndex > value.length) {
             throw new StringIndexOutOfBoundsException(endIndex);
         }
-        if (beginIndex > endIndex) {
-            throw new StringIndexOutOfBoundsException(endIndex - beginIndex);
+        int subLen = endIndex - beginIndex;
+        if (subLen < 0) {
+            throw new StringIndexOutOfBoundsException(subLen);
         }
-        return ((beginIndex == 0) && (endIndex == count)) ? this :
-            new String(offset + beginIndex, endIndex - beginIndex, value);
+        return ((beginIndex == 0) && (endIndex == value.length)) ? this
+                : new String(value, beginIndex, subLen);
     }
 
     /**
@@ -2021,10 +1965,10 @@
         if (otherLen == 0) {
             return this;
         }
-        char buf[] = new char[count + otherLen];
-        getChars(0, count, buf, 0);
-        str.getChars(0, otherLen, buf, count);
-        return new String(0, count + otherLen, buf);
+        int len = value.length;
+        char buf[] = Arrays.copyOf(value, len + otherLen);
+        str.getChars(buf, len);
+        return new String(buf, true);
     }
 
     /**
@@ -2058,27 +2002,26 @@
      */
     public String replace(char oldChar, char newChar) {
         if (oldChar != newChar) {
-            int len = count;
+            int len = value.length;
             int i = -1;
             char[] val = value; /* avoid getfield opcode */
-            int off = offset;   /* avoid getfield opcode */
 
             while (++i < len) {
-                if (val[off + i] == oldChar) {
+                if (val[i] == oldChar) {
                     break;
                 }
             }
             if (i < len) {
                 char buf[] = new char[len];
-                for (int j = 0 ; j < i ; j++) {
-                    buf[j] = val[off+j];
+                for (int j = 0; j < i; j++) {
+                    buf[j] = val[j];
                 }
                 while (i < len) {
-                    char c = val[off + i];
+                    char c = val[i];
                     buf[i] = (c == oldChar) ? newChar : c;
                     i++;
                 }
-                return new String(0, len, buf);
+                return new String(buf, true);
             }
         }
         return this;
@@ -2229,7 +2172,7 @@
      */
     public String replace(CharSequence target, CharSequence replacement) {
         return Pattern.compile(target.toString(), Pattern.LITERAL).matcher(
-            this).replaceAll(Matcher.quoteReplacement(replacement.toString()));
+                this).replaceAll(Matcher.quoteReplacement(replacement.toString()));
     }
 
     /**
@@ -2314,13 +2257,13 @@
      */
     public String[] split(String regex, int limit) {
         /* fastpath if the regex is a
-           (1)one-char String and this character is not one of the
-              RegEx's meta characters ".$|()[{^?*+\\", or
-           (2)two-char String and the first char is the backslash and
-              the second is not the ascii digit or ascii letter.
-        */
+         (1)one-char String and this character is not one of the
+            RegEx's meta characters ".$|()[{^?*+\\", or
+         (2)two-char String and the first char is the backslash and
+            the second is not the ascii digit or ascii letter.
+         */
         char ch = 0;
-        if (((regex.count == 1 &&
+        if (((regex.value.length == 1 &&
              ".$|()[{^?*+\\".indexOf(ch = regex.charAt(0)) == -1) ||
              (regex.length() == 2 &&
               regex.charAt(0) == '\\' &&
@@ -2340,23 +2283,23 @@
                     off = next + 1;
                 } else {    // last one
                     //assert (list.size() == limit - 1);
-                    list.add(substring(off, count));
-                    off = count;
+                    list.add(substring(off, value.length));
+                    off = value.length;
                     break;
                 }
             }
             // If no match was found, return this
             if (off == 0)
-                return new String[] { this };
+                return new String[]{this};
 
             // Add remaining segment
             if (!limited || list.size() < limit)
-                list.add(substring(off, count));
+                list.add(substring(off, value.length));
 
             // Construct result
             int resultSize = list.size();
             if (limit == 0)
-                while (resultSize > 0 && list.get(resultSize-1).length() == 0)
+                while (resultSize > 0 && list.get(resultSize - 1).length() == 0)
                     resultSize--;
             String[] result = new String[resultSize];
             return list.subList(0, resultSize).toArray(result);
@@ -2463,14 +2406,15 @@
             throw new NullPointerException();
         }
 
-        int     firstUpper;
+        int firstUpper;
+        final int len = value.length;
 
         /* Now check if there are any characters that need to be changed. */
         scan: {
-            for (firstUpper = 0 ; firstUpper < count; ) {
-                char c = value[offset+firstUpper];
-                if ((c >= Character.MIN_HIGH_SURROGATE) &&
-                    (c <= Character.MAX_HIGH_SURROGATE)) {
+            for (firstUpper = 0 ; firstUpper < len; ) {
+                char c = value[firstUpper];
+                if ((c >= Character.MIN_HIGH_SURROGATE)
+                        && (c <= Character.MAX_HIGH_SURROGATE)) {
                     int supplChar = codePointAt(firstUpper);
                     if (supplChar != Character.toLowerCase(supplChar)) {
                         break scan;
@@ -2486,24 +2430,24 @@
             return this;
         }
 
-        char[]  result = new char[count];
-        int     resultOffset = 0;  /* result may grow, so i+resultOffset
-                                    * is the write location in result */
+        char[] result = new char[len];
+        int resultOffset = 0;  /* result may grow, so i+resultOffset
+                                * is the write location in result */
 
         /* Just copy the first few lowerCase characters. */
-        System.arraycopy(value, offset, result, 0, firstUpper);
+        System.arraycopy(value, 0, result, 0, firstUpper);
 
         String lang = locale.getLanguage();
         boolean localeDependent =
-            (lang == "tr" || lang == "az" || lang == "lt");
+                (lang == "tr" || lang == "az" || lang == "lt");
         char[] lowerCharArray;
         int lowerChar;
         int srcChar;
         int srcCount;
-        for (int i = firstUpper; i < count; i += srcCount) {
-            srcChar = (int)value[offset+i];
-            if ((char)srcChar >= Character.MIN_HIGH_SURROGATE &&
-                (char)srcChar <= Character.MAX_HIGH_SURROGATE) {
+        for (int i = firstUpper; i < len; i += srcCount) {
+            srcChar = (int)value[i];
+            if ((char)srcChar >= Character.MIN_HIGH_SURROGATE
+                    && (char)srcChar <= Character.MAX_HIGH_SURROGATE) {
                 srcChar = codePointAt(i);
                 srcCount = Character.charCount(srcChar);
             } else {
@@ -2516,16 +2460,16 @@
             } else {
                 lowerChar = Character.toLowerCase(srcChar);
             }
-            if ((lowerChar == Character.ERROR) ||
-                (lowerChar >= Character.MIN_SUPPLEMENTARY_CODE_POINT)) {
+            if ((lowerChar == Character.ERROR)
+                    || (lowerChar >= Character.MIN_SUPPLEMENTARY_CODE_POINT)) {
                 if (lowerChar == Character.ERROR) {
-                     if (!localeDependent && srcChar == '\u0130') {
-                         lowerCharArray =
-                             ConditionalSpecialCasing.toLowerCaseCharArray(this, i, Locale.ENGLISH);
-                     } else {
+                    if (!localeDependent && srcChar == '\u0130') {
                         lowerCharArray =
-                            ConditionalSpecialCasing.toLowerCaseCharArray(this, i, locale);
-                     }
+                                ConditionalSpecialCasing.toLowerCaseCharArray(this, i, Locale.ENGLISH);
+                    } else {
+                        lowerCharArray =
+                                ConditionalSpecialCasing.toLowerCaseCharArray(this, i, locale);
+                    }
                 } else if (srcCount == 2) {
                     resultOffset += Character.toChars(lowerChar, result, i + resultOffset) - srcCount;
                     continue;
@@ -2537,19 +2481,18 @@
                 int mapLen = lowerCharArray.length;
                 if (mapLen > srcCount) {
                     char[] result2 = new char[result.length + mapLen - srcCount];
-                    System.arraycopy(result, 0, result2, 0,
-                        i + resultOffset);
+                    System.arraycopy(result, 0, result2, 0, i + resultOffset);
                     result = result2;
                 }
-                for (int x=0; x<mapLen; ++x) {
-                    result[i+resultOffset+x] = lowerCharArray[x];
+                for (int x = 0; x < mapLen; ++x) {
+                    result[i + resultOffset + x] = lowerCharArray[x];
                 }
                 resultOffset += (mapLen - srcCount);
             } else {
-                result[i+resultOffset] = (char)lowerChar;
+                result[i + resultOffset] = (char)lowerChar;
             }
         }
-        return new String(0, count+resultOffset, result);
+        return new String(result, 0, len + resultOffset);
     }
 
     /**
@@ -2628,23 +2571,24 @@
             throw new NullPointerException();
         }
 
-        int     firstLower;
+        int firstLower;
+        final int len = value.length;
 
         /* Now check if there are any characters that need to be changed. */
         scan: {
-            for (firstLower = 0 ; firstLower < count; ) {
-                int c = (int)value[offset+firstLower];
+            for (firstLower = 0 ; firstLower < len; ) {
+                int c = (int)value[firstLower];
                 int srcCount;
-                if ((c >= Character.MIN_HIGH_SURROGATE) &&
-                    (c <= Character.MAX_HIGH_SURROGATE)) {
+                if ((c >= Character.MIN_HIGH_SURROGATE)
+                        && (c <= Character.MAX_HIGH_SURROGATE)) {
                     c = codePointAt(firstLower);
                     srcCount = Character.charCount(c);
                 } else {
                     srcCount = 1;
                 }
                 int upperCaseChar = Character.toUpperCaseEx(c);
-                if ((upperCaseChar == Character.ERROR) ||
-                    (c != upperCaseChar)) {
+                if ((upperCaseChar == Character.ERROR)
+                        || (c != upperCaseChar)) {
                     break scan;
                 }
                 firstLower += srcCount;
@@ -2652,22 +2596,22 @@
             return this;
         }
 
-        char[]  result       = new char[count]; /* may grow */
-        int     resultOffset = 0;  /* result may grow, so i+resultOffset
-                                    * is the write location in result */
+        char[] result = new char[len]; /* may grow */
+        int resultOffset = 0;  /* result may grow, so i+resultOffset
+         * is the write location in result */
 
         /* Just copy the first few upperCase characters. */
-        System.arraycopy(value, offset, result, 0, firstLower);
+        System.arraycopy(value, 0, result, 0, firstLower);
 
         String lang = locale.getLanguage();
         boolean localeDependent =
-            (lang == "tr" || lang == "az" || lang == "lt");
+                (lang == "tr" || lang == "az" || lang == "lt");
         char[] upperCharArray;
         int upperChar;
         int srcChar;
         int srcCount;
-        for (int i = firstLower; i < count; i += srcCount) {
-            srcChar = (int)value[offset+i];
+        for (int i = firstLower; i < len; i += srcCount) {
+            srcChar = (int)value[i];
             if ((char)srcChar >= Character.MIN_HIGH_SURROGATE &&
                 (char)srcChar <= Character.MAX_HIGH_SURROGATE) {
                 srcChar = codePointAt(i);
@@ -2680,12 +2624,12 @@
             } else {
                 upperChar = Character.toUpperCaseEx(srcChar);
             }
-            if ((upperChar == Character.ERROR) ||
-                (upperChar >= Character.MIN_SUPPLEMENTARY_CODE_POINT)) {
+            if ((upperChar == Character.ERROR)
+                    || (upperChar >= Character.MIN_SUPPLEMENTARY_CODE_POINT)) {
                 if (upperChar == Character.ERROR) {
                     if (localeDependent) {
                         upperCharArray =
-                            ConditionalSpecialCasing.toUpperCaseCharArray(this, i, locale);
+                                ConditionalSpecialCasing.toUpperCaseCharArray(this, i, locale);
                     } else {
                         upperCharArray = Character.toUpperCaseCharArray(srcChar);
                     }
@@ -2700,19 +2644,18 @@
                 int mapLen = upperCharArray.length;
                 if (mapLen > srcCount) {
                     char[] result2 = new char[result.length + mapLen - srcCount];
-                    System.arraycopy(result, 0, result2, 0,
-                        i + resultOffset);
+                    System.arraycopy(result, 0, result2, 0, i + resultOffset);
                     result = result2;
                 }
-                for (int x=0; x<mapLen; ++x) {
-                    result[i+resultOffset+x] = upperCharArray[x];
+                for (int x = 0; x < mapLen; ++x) {
+                    result[i + resultOffset + x] = upperCharArray[x];
                 }
                 resultOffset += (mapLen - srcCount);
             } else {
-                result[i+resultOffset] = (char)upperChar;
+                result[i + resultOffset] = (char)upperChar;
             }
         }
-        return new String(0, count+resultOffset, result);
+        return new String(result, 0, len + resultOffset);
     }
 
     /**
@@ -2770,18 +2713,17 @@
      *          trailing white space.
      */
     public String trim() {
-        int len = count;
+        int len = value.length;
         int st = 0;
-        int off = offset;      /* avoid getfield opcode */
         char[] val = value;    /* avoid getfield opcode */
 
-        while ((st < len) && (val[off + st] <= ' ')) {
+        while ((st < len) && (val[st] <= ' ')) {
             st++;
         }
-        while ((st < len) && (val[off + len - 1] <= ' ')) {
+        while ((st < len) && (val[len - 1] <= ' ')) {
             len--;
         }
-        return ((st > 0) || (len < count)) ? substring(st, len) : this;
+        return ((st > 0) || (len < value.length)) ? substring(st, len) : this;
     }
 
     /**
@@ -2801,8 +2743,9 @@
      *          the character sequence represented by this string.
      */
     public char[] toCharArray() {
-        char result[] = new char[count];
-        getChars(0, count, result, 0);
+        // Cannot use Arrays.copyOf because of class initialization order issues
+        char result[] = new char[value.length];
+        System.arraycopy(value, 0, result, 0, value.length);
         return result;
     }
 
@@ -2844,7 +2787,7 @@
      * @see  java.util.Formatter
      * @since  1.5
      */
-    public static String format(String format, Object ... args) {
+    public static String format(String format, Object... args) {
         return new Formatter().format(format, args).toString();
     }
 
@@ -2888,7 +2831,7 @@
      * @see  java.util.Formatter
      * @since  1.5
      */
-    public static String format(Locale l, String format, Object ... args) {
+    public static String format(Locale l, String format, Object... args) {
         return new Formatter(l).format(format, args).toString();
     }
 
@@ -2968,7 +2911,7 @@
      *          character array.
      */
     public static String copyValueOf(char data[]) {
-        return copyValueOf(data, 0, data.length);
+        return new String(data);
     }
 
     /**
@@ -2993,7 +2936,7 @@
      */
     public static String valueOf(char c) {
         char data[] = {c};
-        return new String(0, 1, data);
+        return new String(data, true);
     }
 
     /**
@@ -3077,4 +3020,100 @@
      */
     public native String intern();
 
+    /**
+     * Seed value used for each alternative hash calculated.
+     */
+    private static final int HASHING_SEED;
+
+    static {
+        long nanos = System.nanoTime();
+        long now = System.currentTimeMillis();
+        int SEED_MATERIAL[] = {
+                System.identityHashCode(String.class),
+                System.identityHashCode(System.class),
+                (int) (nanos >>> 32),
+                (int) nanos,
+                (int) (now >>> 32),
+                (int) now,
+                (int) (System.nanoTime() >>> 2)
+        };
+
+        // Use murmur3 to scramble the seeding material.
+        // Inline implementation to avoid loading classes
+        int h1 = 0;
+
+        // body
+        for(int k1 : SEED_MATERIAL) {
+            k1 *= 0xcc9e2d51;
+            k1 = (k1 << 15) | (k1 >>> 17);
+            k1 *= 0x1b873593;
+
+            h1 ^= k1;
+            h1 = (h1 << 13) | (h1 >>> 19);
+            h1 = h1 * 5 + 0xe6546b64;
+        }
+
+        // tail (always empty, as body is always 32-bit chunks)
+
+        // finalization
+
+        h1 ^= SEED_MATERIAL.length * 4;
+
+        // finalization mix force all bits of a hash block to avalanche
+        h1 ^= h1 >>> 16;
+        h1 *= 0x85ebca6b;
+        h1 ^= h1 >>> 13;
+        h1 *= 0xc2b2ae35;
+        h1 ^= h1 >>> 16;
+
+        HASHING_SEED = h1;
+    }
+
+    /**
+     * Cached value of the hashing algorithm result
+     */
+    private transient int hash32 = 0;
+
+    /**
+    * Return a 32-bit hash code value for this object.
+    * <p>
+    * The general contract of {@code hash32} is:
+    * <ul>
+    * <li>Whenever it is invoked on the same object more than once during
+    *     an execution of a Java application, the {@code hash32} method
+    *     must consistently return the same integer, provided no information
+    *     used in {@code equals} comparisons on the object is modified.
+    *     This integer need not remain consistent from one execution of an
+    *     application to another execution of the same application.
+    * <li>If two objects are equal according to the {@code equals(Object)}
+    *     method, then calling the {@code hash32} method on each of
+    *     the two objects must produce the same integer result.
+    * <li>It is <em>not</em> required that if two objects are unequal
+    *     according to the {@link java.lang.Object#equals(java.lang.Object)}
+    *     method, then calling the {@code hash32} method on each of the
+    *     two objects must produce distinct integer results.  However, the
+    *     programmer should be aware that producing distinct integer results
+    *     for unequal objects may improve the performance of hash tables.
+    * </ul>
+    * <p/>
+     * The hash value will never be zero.
+    *
+    * @return  a hash code value for this object.
+    * @see     java.lang.Object#equals(java.lang.Object)
+    */
+    public int hash32() {
+        int h = hash32;
+        if (0 == h) {
+           // harmless data race on hash32 here.
+           h = sun.misc.Hashing.murmur3_32(HASHING_SEED, value, 0, value.length);
+
+           // ensure result is not zero to avoid recalcing
+           h = (0 != h) ? h : 1;
+
+           hash32 = h;
+        }
+
+        return h;
+    }
+
 }
diff --git a/src/share/classes/java/lang/StringCoding.java b/src/share/classes/java/lang/StringCoding.java
index 95fb45a..2c08a0d 100644
--- a/src/share/classes/java/lang/StringCoding.java
+++ b/src/share/classes/java/lang/StringCoding.java
@@ -250,6 +250,7 @@
     static char[] decode(byte[] ba, int off, int len) {
         String csn = Charset.defaultCharset().name();
         try {
+            // use charset name decode() variant which provides caching.
             return decode(csn, ba, off, len);
         } catch (UnsupportedEncodingException x) {
             warnUnsupportedCharset(csn);
@@ -382,6 +383,7 @@
     static byte[] encode(char[] ca, int off, int len) {
         String csn = Charset.defaultCharset().name();
         try {
+            // use charset name encode() variant which provides caching.
             return encode(csn, ca, off, len);
         } catch (UnsupportedEncodingException x) {
             warnUnsupportedCharset(csn);
diff --git a/src/share/classes/java/security/Signature.java b/src/share/classes/java/security/Signature.java
index 72d2b08..cf9e6d6 100644
--- a/src/share/classes/java/security/Signature.java
+++ b/src/share/classes/java/security/Signature.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -658,7 +658,7 @@
         throws SignatureException {
         if (state == VERIFY) {
             if ((signature == null) || (offset < 0) || (length < 0) ||
-                (offset + length > signature.length)) {
+                (length > signature.length - offset)) {
                 throw new IllegalArgumentException("Bad arguments");
             }
 
diff --git a/src/share/classes/java/security/cert/CertPathBuilder.java b/src/share/classes/java/security/cert/CertPathBuilder.java
index 95988d4..096627d 100644
--- a/src/share/classes/java/security/cert/CertPathBuilder.java
+++ b/src/share/classes/java/security/cert/CertPathBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,15 +45,28 @@
  * one of the static <code>getInstance</code> methods, passing in the
  * algorithm name of the <code>CertPathBuilder</code> desired and optionally
  * the name of the provider desired.
- * <p>
- * Once a <code>CertPathBuilder</code> object has been created, certification
+ *
+ * <p>Once a <code>CertPathBuilder</code> object has been created, certification
  * paths can be constructed by calling the {@link #build build} method and
  * passing it an algorithm-specific set of parameters. If successful, the
  * result (including the <code>CertPath</code> that was built) is returned
  * in an object that implements the <code>CertPathBuilderResult</code>
  * interface.
  *
- * <p> Every implementation of the Java platform is required to support the
+ * <p>The {@link #getRevocationChecker} method allows an application to specify
+ * additional algorithm-specific parameters and options used by the
+ * {@code CertPathBuilder} when checking the revocation status of certificates.
+ * Here is an example demonstrating how it is used with the PKIX algorithm:
+ *
+ * <pre>
+ * CertPathBuilder cpb = CertPathBuilder.getInstance("PKIX");
+ * PKIXRevocationChecker rc = (PKIXRevocationChecker)cpb.getRevocationChecker();
+ * rc.setOptions(EnumSet.of(Option.PREFER_CRLS));
+ * params.addCertPathChecker(rc);
+ * CertPathBuilderResult cpbr = cpb.build(params);
+ * </pre>
+ *
+ * <p>Every implementation of the Java platform is required to support the
  * following standard <code>CertPathBuilder</code> algorithm:
  * <ul>
  * <li><tt>PKIX</tt></li>
@@ -96,10 +109,9 @@
      * </pre>
      */
     private static final String CPB_TYPE = "certpathbuilder.type";
-    private static final Debug debug = Debug.getInstance("certpath");
-    private CertPathBuilderSpi builderSpi;
-    private Provider provider;
-    private String algorithm;
+    private final CertPathBuilderSpi builderSpi;
+    private final Provider provider;
+    private final String algorithm;
 
     /**
      * Creates a <code>CertPathBuilder</code> object of the given algorithm,
@@ -290,15 +302,30 @@
      * if no such property exists.
      */
     public final static String getDefaultType() {
-        String cpbtype;
-        cpbtype = AccessController.doPrivileged(new PrivilegedAction<String>() {
-            public String run() {
-                return Security.getProperty(CPB_TYPE);
-            }
-        });
-        if (cpbtype == null) {
-            cpbtype = "PKIX";
-        }
-        return cpbtype;
+        String cpbtype =
+            AccessController.doPrivileged(new PrivilegedAction<String>() {
+                public String run() {
+                    return Security.getProperty(CPB_TYPE);
+                }
+            });
+        return (cpbtype == null) ? "PKIX" : cpbtype;
+    }
+
+    /**
+     * Returns a {@code CertPathChecker} that the encapsulated
+     * {@code CertPathBuilderSpi} implementation uses to check the revocation
+     * status of certificates. A PKIX implementation returns objects of
+     * type {@code PKIXRevocationChecker}.
+     *
+     * <p>The primary purpose of this method is to allow callers to specify
+     * additional input parameters and options specific to revocation checking.
+     * See the class description for an example.
+     *
+     * @throws UnsupportedOperationException if the service provider does not
+     *         support this method
+     * @since 1.8
+     */
+    public final CertPathChecker getRevocationChecker() {
+        return builderSpi.engineGetRevocationChecker();
     }
 }
diff --git a/src/share/classes/java/security/cert/CertPathBuilderSpi.java b/src/share/classes/java/security/cert/CertPathBuilderSpi.java
index 0c10a4d..49a35b3 100644
--- a/src/share/classes/java/security/cert/CertPathBuilderSpi.java
+++ b/src/share/classes/java/security/cert/CertPathBuilderSpi.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -72,4 +72,25 @@
      */
     public abstract CertPathBuilderResult engineBuild(CertPathParameters params)
         throws CertPathBuilderException, InvalidAlgorithmParameterException;
+
+    /**
+     * Returns a {@code CertPathChecker} that this implementation uses to
+     * check the revocation status of certificates. A PKIX implementation
+     * returns objects of type {@code PKIXRevocationChecker}.
+     *
+     * <p>The primary purpose of this method is to allow callers to specify
+     * additional input parameters and options specific to revocation checking.
+     * See the class description of {@code CertPathBuilder} for an example.
+     *
+     * <p>This method was added to version 1.8 of the Java Platform Standard
+     * Edition. In order to maintain backwards compatibility with existing
+     * service providers, this method cannot be abstract and by default throws
+     * an {@code UnsupportedOperationException}.
+     *
+     * @throws UnsupportedOperationException if this method is not supported
+     * @since 1.8
+     */
+    public CertPathChecker engineGetRevocationChecker() {
+        throw new UnsupportedOperationException();
+    }
 }
diff --git a/src/share/classes/java/security/cert/CertPathChecker.java b/src/share/classes/java/security/cert/CertPathChecker.java
new file mode 100644
index 0000000..c40a65b
--- /dev/null
+++ b/src/share/classes/java/security/cert/CertPathChecker.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.security.cert;
+
+/**
+ * <p>Performs one or more checks on each {@code Certificate} of a
+ * {@code CertPath}.
+ *
+ * <p>A {@code CertPathChecker} implementation is typically created to extend
+ * a certification path validation algorithm. For example, an implementation
+ * may check for and process a critical private extension of each certificate
+ * in a certification path.
+ *
+ * @since 1.8
+ */
+public interface CertPathChecker {
+
+    /**
+     * Initializes the internal state of this {@code CertPathChecker}.
+     *
+     * <p>The {@code forward} flag specifies the order that certificates will
+     * be passed to the {@link #check check} method (forward or reverse).
+     *
+     * @param forward the order that certificates are presented to the
+     *        {@code check} method. If {@code true}, certificates are
+     *        presented from target to trust anchor (forward); if
+     *        {@code false}, from trust anchor to target (reverse).
+     * @throws CertPathValidatorException if this {@code CertPathChecker} is
+     *         unable to check certificates in the specified order
+     */
+    void init(boolean forward) throws CertPathValidatorException;
+
+    /**
+     * Indicates if forward checking is supported. Forward checking refers
+     * to the ability of the {@code CertPathChecker} to perform its checks
+     * when certificates are presented to the {@code check} method in the
+     * forward direction (from target to trust anchor).
+     *
+     * @return {@code true} if forward checking is supported, {@code false}
+     *         otherwise
+     */
+    boolean isForwardCheckingSupported();
+
+    /**
+     * Performs the check(s) on the specified certificate using its internal
+     * state. The certificates are presented in the order specified by the
+     * {@code init} method.
+     *
+     * @param cert the {@code Certificate} to be checked
+     * @throws CertPathValidatorException if the specified certificate does
+     *         not pass the check
+     */
+    void check(Certificate cert) throws CertPathValidatorException;
+}
diff --git a/src/share/classes/java/security/cert/CertPathValidator.java b/src/share/classes/java/security/cert/CertPathValidator.java
index ddeea99..9d912ac 100644
--- a/src/share/classes/java/security/cert/CertPathValidator.java
+++ b/src/share/classes/java/security/cert/CertPathValidator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,15 +46,29 @@
  * call one of the static <code>getInstance</code> methods, passing in the
  * algorithm name of the <code>CertPathValidator</code> desired and
  * optionally the name of the provider desired.
- * <p>
- * Once a <code>CertPathValidator</code> object has been created, it can
+ *
+ * <p>Once a <code>CertPathValidator</code> object has been created, it can
  * be used to validate certification paths by calling the {@link #validate
  * validate} method and passing it the <code>CertPath</code> to be validated
  * and an algorithm-specific set of parameters. If successful, the result is
  * returned in an object that implements the
  * <code>CertPathValidatorResult</code> interface.
  *
- * <p> Every implementation of the Java platform is required to support the
+ * <p>The {@link #getRevocationChecker} method allows an application to specify
+ * additional algorithm-specific parameters and options used by the
+ * {@code CertPathValidator} when checking the revocation status of
+ * certificates. Here is an example demonstrating how it is used with the PKIX
+ * algorithm:
+ *
+ * <pre>
+ * CertPathValidator cpv = CertPathValidator.getInstance("PKIX");
+ * PKIXRevocationChecker rc = (PKIXRevocationChecker)cpv.getRevocationChecker();
+ * rc.setOptions(EnumSet.of(Option.SOFT_FAIL));
+ * params.addCertPathChecker(rc);
+ * CertPathValidatorResult cpvr = cpv.validate(path, params);
+ * </pre>
+ *
+ * <p>Every implementation of the Java platform is required to support the
  * following standard <code>CertPathValidator</code> algorithm:
  * <ul>
  * <li><tt>PKIX</tt></li>
@@ -96,10 +110,9 @@
      * </pre>
      */
     private static final String CPV_TYPE = "certpathvalidator.type";
-    private static final Debug debug = Debug.getInstance("certpath");
-    private CertPathValidatorSpi validatorSpi;
-    private Provider provider;
-    private String algorithm;
+    private final CertPathValidatorSpi validatorSpi;
+    private final Provider provider;
+    private final String algorithm;
 
     /**
      * Creates a <code>CertPathValidator</code> object of the given algorithm,
@@ -301,15 +314,30 @@
      * if no such property exists.
      */
     public final static String getDefaultType() {
-        String cpvtype;
-        cpvtype = AccessController.doPrivileged(new PrivilegedAction<String>() {
-            public String run() {
-                return Security.getProperty(CPV_TYPE);
-            }
-        });
-        if (cpvtype == null) {
-            cpvtype = "PKIX";
-        }
-        return cpvtype;
+        String cpvtype =
+            AccessController.doPrivileged(new PrivilegedAction<String>() {
+                public String run() {
+                    return Security.getProperty(CPV_TYPE);
+                }
+            });
+        return (cpvtype == null) ? "PKIX" : cpvtype;
+    }
+
+    /**
+     * Returns a {@code CertPathChecker} that the encapsulated
+     * {@code CertPathValidatorSpi} implementation uses to check the revocation
+     * status of certificates. A PKIX implementation returns objects of
+     * type {@code PKIXRevocationChecker}.
+     *
+     * <p>The primary purpose of this method is to allow callers to specify
+     * additional input parameters and options specific to revocation checking.
+     * See the class description for an example.
+     *
+     * @throws UnsupportedOperationException if the service provider does not
+     *         support this method
+     * @since 1.8
+     */
+    public final CertPathChecker getRevocationChecker() {
+        return validatorSpi.engineGetRevocationChecker();
     }
 }
diff --git a/src/share/classes/java/security/cert/CertPathValidatorSpi.java b/src/share/classes/java/security/cert/CertPathValidatorSpi.java
index 6dd4143..6d3bd8c 100644
--- a/src/share/classes/java/security/cert/CertPathValidatorSpi.java
+++ b/src/share/classes/java/security/cert/CertPathValidatorSpi.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -82,4 +82,25 @@
     public abstract CertPathValidatorResult
         engineValidate(CertPath certPath, CertPathParameters params)
         throws CertPathValidatorException, InvalidAlgorithmParameterException;
+
+    /**
+     * Returns a {@code CertPathChecker} that this implementation uses to
+     * check the revocation status of certificates. A PKIX implementation
+     * returns objects of type {@code PKIXRevocationChecker}.
+     *
+     * <p>The primary purpose of this method is to allow callers to specify
+     * additional input parameters and options specific to revocation checking.
+     * See the class description of {@code CertPathValidator} for an example.
+     *
+     * <p>This method was added to version 1.8 of the Java Platform Standard
+     * Edition. In order to maintain backwards compatibility with existing
+     * service providers, this method cannot be abstract and by default throws
+     * an {@code UnsupportedOperationException}.
+     *
+     * @throws UnsupportedOperationException if this method is not supported
+     * @since 1.8
+     */
+    public CertPathChecker engineGetRevocationChecker() {
+        throw new UnsupportedOperationException();
+    }
 }
diff --git a/src/share/classes/java/security/cert/PKIXCertPathChecker.java b/src/share/classes/java/security/cert/PKIXCertPathChecker.java
index 656a517..30b44c3 100644
--- a/src/share/classes/java/security/cert/PKIXCertPathChecker.java
+++ b/src/share/classes/java/security/cert/PKIXCertPathChecker.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -87,7 +87,8 @@
  * @author      Yassir Elley
  * @author      Sean Mullan
  */
-public abstract class PKIXCertPathChecker implements Cloneable {
+public abstract class PKIXCertPathChecker
+    implements CertPathChecker, Cloneable {
 
     /**
      * Default constructor.
@@ -111,6 +112,7 @@
      * the specified order; it should never be thrown if the forward flag
      * is false since reverse checking must be supported
      */
+    @Override
     public abstract void init(boolean forward)
         throws CertPathValidatorException;
 
@@ -123,6 +125,7 @@
      * @return <code>true</code> if forward checking is supported,
      * <code>false</code> otherwise
      */
+    @Override
     public abstract boolean isForwardCheckingSupported();
 
     /**
@@ -163,6 +166,17 @@
             throws CertPathValidatorException;
 
     /**
+     * {@inheritDoc}
+     *
+     * <p>This implementation calls
+     * {@code check(cert, java.util.Collections.<String>emptySet())}.
+     */
+    @Override
+    public void check(Certificate cert) throws CertPathValidatorException {
+        check(cert, java.util.Collections.<String>emptySet());
+    }
+
+    /**
      * Returns a clone of this object. Calls the <code>Object.clone()</code>
      * method.
      * All subclasses which maintain state must support and
@@ -170,6 +184,7 @@
      *
      * @return a copy of this <code>PKIXCertPathChecker</code>
      */
+    @Override
     public Object clone() {
         try {
             return super.clone();
diff --git a/src/share/classes/java/security/cert/PKIXRevocationChecker.java b/src/share/classes/java/security/cert/PKIXRevocationChecker.java
new file mode 100644
index 0000000..a97f834
--- /dev/null
+++ b/src/share/classes/java/security/cert/PKIXRevocationChecker.java
@@ -0,0 +1,271 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package java.security.cert;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+/**
+ * A {@code PKIXCertPathChecker} for checking the revocation status of
+ * certificates with the PKIX algorithm.
+ *
+ * <p>A {@code PKIXRevocationChecker} checks the revocation status of
+ * certificates with the Online Certificate Status Protocol (OCSP) or
+ * Certificate Revocation Lists (CRLs). OCSP is described in RFC 2560 and
+ * is a network protocol for determining the status of a certificate. A CRL
+ * is a time-stamped list identifying revoked certificates, and RFC 5280
+ * describes an algorithm for determining the revocation status of certificates
+ * using CRLs.
+ *
+ * <p>Each {@code PKIXRevocationChecker} must be able to check the revocation
+ * status of certificates with OCSP and CRLs. By default, OCSP is the
+ * preferred mechanism for checking revocation status, with CRLs as the
+ * fallback mechanism. However, this preference can be switched to CRLs with
+ * the {@link Option.PREFER_CRLS} option.
+ *
+ * <p>A {@code PKIXRevocationChecker} is obtained by calling the
+ * {@link CertPathValidator#getRevocationChecker getRevocationChecker} method
+ * of a PKIX {@code CertPathValidator}. Additional parameters and options
+ * specific to revocation can be set (by calling {@link #setOCSPResponder}
+ * method for instance). The {@code PKIXRevocationChecker} is added to
+ * a {@code PKIXParameters} object using the
+ * {@link PKIXParameters#addCertPathChecker addCertPathChecker}
+ * or {@link PKIXParameters#setCertPathCheckers setCertPathCheckers} method,
+ * and then the {@code PKIXParameters} is passed along with the {@code CertPath}
+ * to be validated to the {@link CertPathValidator#validate validate} method
+ * of a PKIX {@code CertPathValidator}. When supplying a revocation checker in
+ * this manner, do not enable the default revocation checking mechanism (by
+ * calling {@link PKIXParameters#setRevocationEnabled}.
+ *
+ * <p>Note that when a {@code PKIXRevocationChecker} is added to
+ * {@code PKIXParameters}, it clones the {@code PKIXRevocationChecker};
+ * thus any subsequent modifications to the {@code PKIXRevocationChecker}
+ * have no effect.
+ *
+ * <p>Any parameter that is not set (or is set to {@code null}) will be set to
+ * the default value for that parameter.
+ *
+ * <p><b>Concurrent Access</b>
+ *
+ * <p>Unless otherwise specified, the methods defined in this class are not
+ * thread-safe. Multiple threads that need to access a single object
+ * concurrently should synchronize amongst themselves and provide the
+ * necessary locking. Multiple threads each manipulating separate objects
+ * need not synchronize.
+ *
+ * @since 1.8
+ */
+public abstract class PKIXRevocationChecker extends PKIXCertPathChecker {
+    private URI ocspResponder;
+    private X509Certificate ocspResponderCert;
+    private List<Extension> ocspExtensions = Collections.<Extension>emptyList();
+    private Map<X509Certificate, byte[]> ocspStapled = Collections.emptyMap();
+    private Set<Option> options = Collections.emptySet();
+
+    protected PKIXRevocationChecker() {}
+
+    /**
+     * Sets the URI that identifies the location of the OCSP responder. This
+     * overrides the {@code ocsp.responderURL} security property and any
+     * responder specified in a certificate's Authority Information Access
+     * Extension, as defined in RFC 5280.
+     *
+     * @param uri the responder URI
+     */
+    public void setOCSPResponder(URI uri) {
+        this.ocspResponder = uri;
+    }
+
+    /**
+     * Gets the URI that identifies the location of the OCSP responder. This
+     * overrides the {@code ocsp.responderURL} security property. If this
+     * parameter or the {@code ocsp.responderURL} property is not set, the
+     * location is determined from the certificate's Authority Information
+     * Access Extension, as defined in RFC 5280.
+     *
+     * @return the responder URI, or {@code null} if not set
+     */
+    public URI getOCSPResponder() {
+        return ocspResponder;
+    }
+
+    /**
+     * Sets the OCSP responder's certificate. This overrides the
+     * {@code ocsp.responderCertSubjectName},
+     * {@code ocsp.responderCertIssuerName},
+     * and {@code ocsp.responderCertSerialNumber} security properties.
+     *
+     * @param cert the responder's certificate
+     */
+    public void setOCSPResponderCert(X509Certificate cert) {
+        this.ocspResponderCert = cert;
+    }
+
+    /**
+     * Gets the OCSP responder's certificate. This overrides the
+     * {@code ocsp.responderCertSubjectName},
+     * {@code ocsp.responderCertIssuerName},
+     * and {@code ocsp.responderCertSerialNumber} security properties. If this
+     * parameter or the aforementioned properties are not set, then the
+     * responder's certificate is determined as specified in RFC 2560.
+     *
+     * @return the responder's certificate, or {@code null} if not set
+     */
+    public X509Certificate getOCSPResponderCert() {
+        return ocspResponderCert;
+    }
+
+    // request extensions; single extensions not supported
+    /**
+     * Sets the optional OCSP request extensions.
+     *
+     * @param extensions a list of extensions. The list is copied to protect
+     *        against subsequent modification.
+     */
+    public void setOCSPExtensions(List<Extension> extensions)
+    {
+        this.ocspExtensions = (extensions == null)
+                              ? Collections.<Extension>emptyList()
+                              : new ArrayList<Extension>(extensions);
+    }
+
+    /**
+     * Gets the optional OCSP request extensions.
+     *
+     * @return an unmodifiable list of extensions. Returns an empty list if no
+     *         extensions have been specified.
+     */
+    public List<Extension> getOCSPExtensions() {
+        return Collections.unmodifiableList(ocspExtensions);
+    }
+
+    /**
+     * Sets the stapled OCSP responses. These responses are used to determine
+     * the revocation status of the specified certificates when OCSP is used.
+     *
+     * @param responses a map of stapled OCSP responses. Each key is an
+     *        {@code X509Certificate} that maps to the corresponding
+     *        DER-encoded OCSP response for that certificate. A deep copy of
+     *        the map is performed to protect against subsequent modification.
+     */
+    public void setOCSPStapledResponses(Map<X509Certificate, byte[]> responses)
+    {
+        if (responses == null) {
+            this.ocspStapled = Collections.<X509Certificate, byte[]>emptyMap();
+        } else {
+            Map<X509Certificate, byte[]> copy = new HashMap<>(responses.size());
+            for (Map.Entry<X509Certificate, byte[]> e : responses.entrySet()) {
+                copy.put(e.getKey(), e.getValue().clone());
+            }
+            this.ocspStapled = copy;
+        }
+    }
+
+    /**
+     * Gets the stapled OCSP responses. These responses are used to determine
+     * the revocation status of the specified certificates when OCSP is used.
+     *
+     * @return a map of stapled OCSP responses. Each key is an
+     *        {@code X509Certificate} that maps to the corresponding
+     *        DER-encoded OCSP response for that certificate. A deep copy of
+     *        the map is returned to protect against subsequent modification.
+     *        Returns an empty map if no responses have been specified.
+     */
+    public Map<X509Certificate, byte[]> getOCSPStapledResponses() {
+        Map<X509Certificate, byte[]> copy = new HashMap<>(ocspStapled.size());
+        for (Map.Entry<X509Certificate, byte[]> e : ocspStapled.entrySet()) {
+            copy.put(e.getKey(), e.getValue().clone());
+        }
+        return copy;
+    }
+
+    /**
+     * Sets the revocation options.
+     *
+     * @param options a set of revocation options. The set is copied to protect
+     *        against subsequent modification.
+     */
+    public void setOptions(Set<Option> options) {
+        this.options = (options == null)
+                       ? Collections.<Option>emptySet()
+                       : new HashSet<Option>(options);
+    }
+
+    /**
+     * Gets the revocation options.
+     *
+     * @return an unmodifiable set of revocation options, or an empty set if
+     *         none are specified
+     */
+    public Set<Option> getOptions() {
+        return Collections.unmodifiableSet(options);
+    }
+
+    @Override
+    public Object clone() {
+        PKIXRevocationChecker copy = (PKIXRevocationChecker)super.clone();
+        copy.ocspExtensions = new ArrayList<>(ocspExtensions);
+        copy.ocspStapled = new HashMap<>(ocspStapled);
+        // deep-copy the encoded stapled responses, since they are mutable
+        for (Map.Entry<X509Certificate, byte[]> entry :
+                 copy.ocspStapled.entrySet())
+        {
+            byte[] encoded = entry.getValue();
+            entry.setValue(encoded.clone());
+        }
+        copy.options = new HashSet<>(options);
+        return copy;
+    }
+
+    /**
+     * Various revocation options that can be specified for the revocation
+     * checking mechanism.
+     */
+    public enum Option {
+        /**
+         * Only check the revocation status of end-entity certificates.
+         */
+        ONLY_END_ENTITY,
+        /**
+         * Prefer CRLs to OSCP. The default behavior is to prefer OCSP. Each
+         * PKIX implementation should document further details of their
+         * specific preference rules and fallback policies.
+         */
+        PREFER_CRLS,
+        /**
+         * Ignore network failures. The default behavior is to consider it a
+         * failure if the revocation status of a certificate cannot be obtained
+         * due to a network error. This option applies to both OCSP and CRLs.
+         */
+        SOFT_FAIL
+    }
+}
diff --git a/src/share/classes/java/security/cert/package.html b/src/share/classes/java/security/cert/package.html
index 569a113..239f7ff 100644
--- a/src/share/classes/java/security/cert/package.html
+++ b/src/share/classes/java/security/cert/package.html
@@ -1,5 +1,5 @@
 <!--
- Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
  This code is free software; you can redistribute it and/or modify it
@@ -38,8 +38,10 @@
   <li><a href="{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
     <b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
     Cryptography Architecture (JCA) Reference Guide</b></a>
-  <li>RFC 3280: Internet X.509 Public Key Infrastructure Certificate and 
+  <li>RFC 5280: Internet X.509 Public Key Infrastructure Certificate and 
     Certificate Revocation List (CRL) Profile
+  <li>RFC 2560: X.509 Internet Public Key Infrastructure Online Certificate
+    Status Protocol - OCSP
   <li><a href="{@docRoot}/../technotes/guides/security/StandardNames.html">
     <b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
     Cryptography Architecture Standard Algorithm Name
@@ -50,8 +52,8 @@
 
 For information about X.509 certificates and CRLs, please see:
 <ul>
-  <li><a href="http://www.ietf.org/rfc/rfc3280.txt">
-    http://www.ietf.org/rfc/rfc3280.txt</a>
+  <li><a href="http://www.ietf.org/rfc/rfc5280.txt">
+    http://www.ietf.org/rfc/rfc5280.txt</a>
   <li><a href=
     "{@docRoot}/../technotes/guides/security/certpath/CertPathProgGuide.html">
     <b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
diff --git a/src/share/classes/java/sql/DriverManager.java b/src/share/classes/java/sql/DriverManager.java
index 0a7cd94..785b733 100644
--- a/src/share/classes/java/sql/DriverManager.java
+++ b/src/share/classes/java/sql/DriverManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,7 @@
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.concurrent.CopyOnWriteArrayList;
+import sun.reflect.Reflection;
 
 
 /**
@@ -462,6 +463,15 @@
 
     //------------------------------------------------------------------------
 
+    // Internal method used to get the caller's class loader.
+    // Replaces the call to the native method
+    private static ClassLoader getCallerClassLoader() {
+        Class<?> cc = Reflection.getCallerClass(3);
+        ClassLoader cl = (cc != null) ? cc.getClassLoader() : null;
+        return cl;
+    }
+
+
     // Indicates whether the class object that would be created if the code calling
     // DriverManager is accessible.
     private static boolean isDriverAllowed(Driver driver, ClassLoader classLoader) {
@@ -604,8 +614,6 @@
         throw new SQLException("No suitable driver found for "+ url, "08001");
     }
 
-    /* Returns the caller's class loader, or null if none */
-    private static native ClassLoader getCallerClassLoader();
 
 }
 
diff --git a/src/share/classes/java/text/AttributedCharacterIterator.java b/src/share/classes/java/text/AttributedCharacterIterator.java
index 86597bf..3c6ed68 100644
--- a/src/share/classes/java/text/AttributedCharacterIterator.java
+++ b/src/share/classes/java/text/AttributedCharacterIterator.java
@@ -97,7 +97,7 @@
         private String name;
 
         // table of all instances in this class, used by readResolve
-        private static final Map instanceMap = new HashMap(7);
+        private static final Map<String, Attribute> instanceMap = new HashMap<>(7);
 
         /**
          * Constructs an {@code Attribute} with the given name.
@@ -150,7 +150,7 @@
                 throw new InvalidObjectException("subclass didn't correctly implement readResolve");
             }
 
-            Attribute instance = (Attribute) instanceMap.get(getName());
+            Attribute instance = instanceMap.get(getName());
             if (instance != null) {
                 return instance;
             } else {
diff --git a/src/share/classes/java/text/AttributedString.java b/src/share/classes/java/text/AttributedString.java
index c7c1f05..7e06e42 100644
--- a/src/share/classes/java/text/AttributedString.java
+++ b/src/share/classes/java/text/AttributedString.java
@@ -61,8 +61,8 @@
     int runArraySize;               // current size of the arrays
     int runCount;                   // actual number of runs, <= runArraySize
     int runStarts[];                // start index for each run
-    Vector runAttributes[];         // vector of attribute keys for each run
-    Vector runAttributeValues[];    // parallel vector of attribute values for each run
+    Vector<Attribute> runAttributes[];         // vector of attribute keys for each run
+    Vector<Object> runAttributeValues[];    // parallel vector of attribute values for each run
 
     /**
      * Constructs an AttributedString instance with the given
@@ -92,7 +92,7 @@
                 // Determine the runs, creating a new run when the attributes
                 // differ.
                 int offset = 0;
-                Map last = null;
+                Map<Attribute,Object> last = null;
 
                 for (int counter = 0; counter < iterators.length; counter++) {
                     AttributedCharacterIterator iterator = iterators[counter];
@@ -103,7 +103,7 @@
                     while (index < end) {
                         iterator.setIndex(index);
 
-                        Map attrs = iterator.getAttributes();
+                        Map<Attribute,Object> attrs = iterator.getAttributes();
 
                         if (mapsDiffer(last, attrs)) {
                             setAttributes(attrs, index - start + offset);
@@ -156,13 +156,14 @@
         int attributeCount = attributes.size();
         if (attributeCount > 0) {
             createRunAttributeDataVectors();
-            Vector newRunAttributes = new Vector(attributeCount);
-            Vector newRunAttributeValues = new Vector(attributeCount);
+            Vector<Attribute> newRunAttributes = new Vector<>(attributeCount);
+            Vector<Object> newRunAttributeValues = new Vector<>(attributeCount);
             runAttributes[0] = newRunAttributes;
             runAttributeValues[0] = newRunAttributeValues;
-            Iterator iterator = attributes.entrySet().iterator();
+
+            Iterator<? extends Map.Entry<? extends Attribute, ?>> iterator = attributes.entrySet().iterator();
             while (iterator.hasNext()) {
-                Map.Entry entry = (Map.Entry) iterator.next();
+                Map.Entry<? extends Attribute, ?> entry = iterator.next();
                 newRunAttributes.addElement(entry.getKey());
                 newRunAttributeValues.addElement(entry.getValue());
             }
@@ -252,7 +253,7 @@
             return;
 
         // Select attribute keys to be taken care of
-        HashSet keys = new HashSet();
+        HashSet<Attribute> keys = new HashSet<>();
         if (attributes == null) {
             keys.addAll(text.getAllAttributeKeys());
         } else {
@@ -266,9 +267,9 @@
         // Get and set attribute runs for each attribute name. Need to
         // scan from the top of the text so that we can discard any
         // Annotation that is no longer applied to a subset text segment.
-        Iterator itr = keys.iterator();
+        Iterator<Attribute> itr = keys.iterator();
         while (itr.hasNext()) {
-            Attribute attributeKey = (Attribute)itr.next();
+            Attribute attributeKey = itr.next();
             text.setIndex(textBeginIndex);
             while (text.getIndex() < endIndex) {
                 int start = text.getRunStart(attributeKey);
@@ -390,10 +391,11 @@
         int beginRunIndex = ensureRunBreak(beginIndex);
         int endRunIndex = ensureRunBreak(endIndex);
 
-        Iterator iterator = attributes.entrySet().iterator();
+        Iterator<? extends Map.Entry<? extends Attribute, ?>> iterator =
+            attributes.entrySet().iterator();
         while (iterator.hasNext()) {
-            Map.Entry entry = (Map.Entry) iterator.next();
-            addAttributeRunData((Attribute) entry.getKey(), entry.getValue(), beginRunIndex, endRunIndex);
+            Map.Entry<? extends Attribute, ?> entry = iterator.next();
+            addAttributeRunData(entry.getKey(), entry.getValue(), beginRunIndex, endRunIndex);
         }
     }
 
@@ -415,8 +417,13 @@
     private final void createRunAttributeDataVectors() {
         // use temporary variables so things remain consistent in case of an exception
         int newRunStarts[] = new int[ARRAY_SIZE_INCREMENT];
-        Vector newRunAttributes[] = new Vector[ARRAY_SIZE_INCREMENT];
-        Vector newRunAttributeValues[] = new Vector[ARRAY_SIZE_INCREMENT];
+
+        @SuppressWarnings("unchecked")
+        Vector<Attribute> newRunAttributes[] = (Vector<Attribute>[]) new Vector<?>[ARRAY_SIZE_INCREMENT];
+
+        @SuppressWarnings("unchecked")
+        Vector<Object> newRunAttributeValues[] = (Vector<Object>[]) new Vector<?>[ARRAY_SIZE_INCREMENT];
+
         runStarts = newRunStarts;
         runAttributes = newRunAttributes;
         runAttributeValues = newRunAttributeValues;
@@ -461,8 +468,13 @@
         if (runCount == runArraySize) {
             int newArraySize = runArraySize + ARRAY_SIZE_INCREMENT;
             int newRunStarts[] = new int[newArraySize];
-            Vector newRunAttributes[] = new Vector[newArraySize];
-            Vector newRunAttributeValues[] = new Vector[newArraySize];
+
+            @SuppressWarnings("unchecked")
+            Vector<Attribute> newRunAttributes[] = (Vector<Attribute>[]) new Vector<?>[newArraySize];
+
+            @SuppressWarnings("unchecked")
+            Vector<Object> newRunAttributeValues[] = (Vector<Object>[]) new Vector<?>[newArraySize];
+
             for (int i = 0; i < runArraySize; i++) {
                 newRunStarts[i] = runStarts[i];
                 newRunAttributes[i] = runAttributes[i];
@@ -476,17 +488,17 @@
 
         // make copies of the attribute information of the old run that the new one used to be part of
         // use temporary variables so things remain consistent in case of an exception
-        Vector newRunAttributes = null;
-        Vector newRunAttributeValues = null;
+        Vector<Attribute> newRunAttributes = null;
+        Vector<Object> newRunAttributeValues = null;
 
         if (copyAttrs) {
-            Vector oldRunAttributes = runAttributes[runIndex - 1];
-            Vector oldRunAttributeValues = runAttributeValues[runIndex - 1];
+            Vector<Attribute> oldRunAttributes = runAttributes[runIndex - 1];
+            Vector<Object> oldRunAttributeValues = runAttributeValues[runIndex - 1];
             if (oldRunAttributes != null) {
-                newRunAttributes = (Vector) oldRunAttributes.clone();
+                newRunAttributes = new Vector<>(oldRunAttributes);
             }
             if (oldRunAttributeValues != null) {
-                newRunAttributeValues = (Vector) oldRunAttributeValues.clone();
+                newRunAttributeValues =  new Vector<>(oldRunAttributeValues);
             }
         }
 
@@ -511,8 +523,8 @@
         for (int i = beginRunIndex; i < endRunIndex; i++) {
             int keyValueIndex = -1; // index of key and value in our vectors; assume we don't have an entry yet
             if (runAttributes[i] == null) {
-                Vector newRunAttributes = new Vector();
-                Vector newRunAttributeValues = new Vector();
+                Vector<Attribute> newRunAttributes = new Vector<>();
+                Vector<Object> newRunAttributeValues = new Vector<>();
                 runAttributes[i] = newRunAttributes;
                 runAttributeValues[i] = newRunAttributeValues;
             } else {
@@ -597,8 +609,8 @@
     }
 
     private synchronized Object getAttribute(Attribute attribute, int runIndex) {
-        Vector currentRunAttributes = runAttributes[runIndex];
-        Vector currentRunAttributeValues = runAttributeValues[runIndex];
+        Vector<Attribute> currentRunAttributes = runAttributes[runIndex];
+        Vector<Object> currentRunAttributeValues = runAttributeValues[runIndex];
         if (currentRunAttributes == null) {
             return null;
         }
@@ -650,10 +662,10 @@
     }
 
     // returns whether all specified attributes have equal values in the runs with the given indices
-    private boolean attributeValuesMatch(Set attributes, int runIndex1, int runIndex2) {
-        Iterator iterator = attributes.iterator();
+    private boolean attributeValuesMatch(Set<? extends Attribute> attributes, int runIndex1, int runIndex2) {
+        Iterator<? extends Attribute> iterator = attributes.iterator();
         while (iterator.hasNext()) {
-            Attribute key = (Attribute) iterator.next();
+            Attribute key = iterator.next();
            if (!valuesMatch(getAttribute(key, runIndex1), getAttribute(key, runIndex2))) {
                 return false;
             }
@@ -690,7 +702,7 @@
      * (typically the end of the text) to the ones specified in attrs.
      * This is only meant to be called from the constructor!
      */
-    private void setAttributes(Map attrs, int offset) {
+    private void setAttributes(Map<Attribute, Object> attrs, int offset) {
         if (runCount == 0) {
             createRunAttributeDataVectors();
         }
@@ -699,12 +711,12 @@
         int size;
 
         if (attrs != null && (size = attrs.size()) > 0) {
-            Vector runAttrs = new Vector(size);
-            Vector runValues = new Vector(size);
-            Iterator iterator = attrs.entrySet().iterator();
+            Vector<Attribute> runAttrs = new Vector<>(size);
+            Vector<Object> runValues = new Vector<>(size);
+            Iterator<Map.Entry<Attribute, Object>> iterator = attrs.entrySet().iterator();
 
             while (iterator.hasNext()) {
-                Map.Entry entry = (Map.Entry)iterator.next();
+                Map.Entry<Attribute, Object> entry = iterator.next();
 
                 runAttrs.add(entry.getKey());
                 runValues.add(entry.getValue());
@@ -717,7 +729,7 @@
     /**
      * Returns true if the attributes specified in last and attrs differ.
      */
-    private static boolean mapsDiffer(Map last, Map attrs) {
+    private static <K,V> boolean mapsDiffer(Map<K, V> last, Map<K, V> attrs) {
         if (last == null) {
             return (attrs != null && attrs.size() > 0);
         }
@@ -761,7 +773,7 @@
             this.currentIndex = beginIndex;
             updateRunInfo();
             if (attributes != null) {
-                relevantAttributes = (Attribute[]) attributes.clone();
+                relevantAttributes = attributes.clone();
             }
         }
 
@@ -944,7 +956,7 @@
             if (runAttributes == null || currentRunIndex == -1 || runAttributes[currentRunIndex] == null) {
                 // ??? would be nice to return null, but current spec doesn't allow it
                 // returning Hashtable saves AttributeMap from dealing with emptiness
-                return new Hashtable();
+                return new Hashtable<>();
             }
             return new AttributeMap(currentRunIndex, beginIndex, endIndex);
         }
@@ -954,16 +966,16 @@
             if (runAttributes == null) {
                 // ??? would be nice to return null, but current spec doesn't allow it
                 // returning HashSet saves us from dealing with emptiness
-                return new HashSet();
+                return new HashSet<>();
             }
             synchronized (AttributedString.this) {
                 // ??? should try to create this only once, then update if necessary,
                 // and give callers read-only view
-                Set keys = new HashSet();
+                Set<Attribute> keys = new HashSet<>();
                 int i = 0;
                 while (i < runCount) {
                     if (runStarts[i] < endIndex && (i == runCount - 1 || runStarts[i + 1] > beginIndex)) {
-                        Vector currentRunAttributes = runAttributes[i];
+                        Vector<Attribute> currentRunAttributes = runAttributes[i];
                         if (currentRunAttributes != null) {
                             int j = currentRunAttributes.size();
                             while (j-- > 0) {
@@ -1052,12 +1064,12 @@
             this.endIndex = endIndex;
         }
 
-        public Set entrySet() {
-            HashSet set = new HashSet();
+        public Set<Map.Entry<Attribute, Object>> entrySet() {
+            HashSet<Map.Entry<Attribute, Object>> set = new HashSet<>();
             synchronized (AttributedString.this) {
                 int size = runAttributes[runIndex].size();
                 for (int i = 0; i < size; i++) {
-                    Attribute key = (Attribute) runAttributes[runIndex].get(i);
+                    Attribute key = runAttributes[runIndex].get(i);
                     Object value = runAttributeValues[runIndex].get(i);
                     if (value instanceof Annotation) {
                         value = AttributedString.this.getAttributeCheckRange(key,
@@ -1066,7 +1078,8 @@
                             continue;
                         }
                     }
-                    Map.Entry entry = new AttributeEntry(key, value);
+
+                    Map.Entry<Attribute, Object> entry = new AttributeEntry(key, value);
                     set.add(entry);
                 }
             }
@@ -1079,7 +1092,7 @@
     }
 }
 
-class AttributeEntry implements Map.Entry {
+class AttributeEntry implements Map.Entry<Attribute,Object> {
 
     private Attribute key;
     private Object value;
@@ -1098,7 +1111,7 @@
             (value == null ? other.value == null : other.value.equals(value));
     }
 
-    public Object getKey() {
+    public Attribute getKey() {
         return key;
     }
 
diff --git a/src/share/classes/java/text/BreakDictionary.java b/src/share/classes/java/text/BreakDictionary.java
index 1e34503..bc0fccc 100644
--- a/src/share/classes/java/text/BreakDictionary.java
+++ b/src/share/classes/java/text/BreakDictionary.java
@@ -145,9 +145,9 @@
 
         BufferedInputStream in;
         try {
-            in = (BufferedInputStream)AccessController.doPrivileged(
-                new PrivilegedExceptionAction() {
-                    public Object run() throws Exception {
+            in = AccessController.doPrivileged(
+                new PrivilegedExceptionAction<BufferedInputStream>() {
+                    public BufferedInputStream run() throws Exception {
                         return new BufferedInputStream(getClass().getResourceAsStream("/sun/text/resources/" + dictionaryName));
                     }
                 }
diff --git a/src/share/classes/java/text/BreakIterator.java b/src/share/classes/java/text/BreakIterator.java
index 6010784..7520cd1 100644
--- a/src/share/classes/java/text/BreakIterator.java
+++ b/src/share/classes/java/text/BreakIterator.java
@@ -439,7 +439,9 @@
     private static final int WORD_INDEX = 1;
     private static final int LINE_INDEX = 2;
     private static final int SENTENCE_INDEX = 3;
-    private static final SoftReference[] iterCache = new SoftReference[4];
+
+    @SuppressWarnings("unchecked")
+    private static final SoftReference<BreakIteratorCache>[] iterCache = (SoftReference<BreakIteratorCache>[]) new SoftReference<?>[4];
 
     /**
      * Returns a new <code>BreakIterator</code> instance
@@ -554,7 +556,7 @@
                                                   String dataName,
                                                   String dictionaryName) {
         if (iterCache[type] != null) {
-            BreakIteratorCache cache = (BreakIteratorCache) iterCache[type].get();
+            BreakIteratorCache cache = iterCache[type].get();
             if (cache != null) {
                 if (cache.getLocale().equals(locale)) {
                     return cache.createBreakInstance();
@@ -567,13 +569,13 @@
                                                    dataName,
                                                    dictionaryName);
         BreakIteratorCache cache = new BreakIteratorCache(locale, result);
-        iterCache[type] = new SoftReference(cache);
+        iterCache[type] = new SoftReference<>(cache);
         return result;
     }
 
     private static ResourceBundle getBundle(final String baseName, final Locale locale) {
-         return (ResourceBundle) AccessController.doPrivileged(new PrivilegedAction() {
-            public Object run() {
+         return AccessController.doPrivileged(new PrivilegedAction<ResourceBundle>() {
+            public ResourceBundle run() {
                 return ResourceBundle.getBundle(baseName, locale);
             }
         });
diff --git a/src/share/classes/java/text/CharacterIteratorFieldDelegate.java b/src/share/classes/java/text/CharacterIteratorFieldDelegate.java
index 019bfe7..284108c 100644
--- a/src/share/classes/java/text/CharacterIteratorFieldDelegate.java
+++ b/src/share/classes/java/text/CharacterIteratorFieldDelegate.java
@@ -41,7 +41,7 @@
      * for existing regions result in invoking addAttribute on the existing
      * AttributedStrings.
      */
-    private ArrayList attributedStrings;
+    private ArrayList<AttributedString> attributedStrings;
     /**
      * Running count of the number of characters that have
      * been encountered.
@@ -50,7 +50,7 @@
 
 
     CharacterIteratorFieldDelegate() {
-        attributedStrings = new ArrayList();
+        attributedStrings = new ArrayList<>();
     }
 
     public void formatted(Format.Field attr, Object value, int start, int end,
@@ -62,7 +62,7 @@
                 int asIndex = attributedStrings.size() - 1;
 
                 while (start < index) {
-                    AttributedString as = (AttributedString)attributedStrings.
+                    AttributedString as = attributedStrings.
                                            get(asIndex--);
                     int newIndex = index - as.length();
                     int aStart = Math.max(0, start - newIndex);
@@ -116,8 +116,8 @@
                                     AttributedCharacterIterator[iCount];
 
         for (int counter = 0; counter < iCount; counter++) {
-            iterators[counter] = ((AttributedString)attributedStrings.
-                                  get(counter)).getIterator();
+            iterators[counter] = attributedStrings.
+                                  get(counter).getIterator();
         }
         return new AttributedString(iterators).getIterator();
     }
diff --git a/src/share/classes/java/text/ChoiceFormat.java b/src/share/classes/java/text/ChoiceFormat.java
index f513cd9..4d5e006 100644
--- a/src/share/classes/java/text/ChoiceFormat.java
+++ b/src/share/classes/java/text/ChoiceFormat.java
@@ -457,8 +457,8 @@
     {
         ChoiceFormat other = (ChoiceFormat) super.clone();
         // for primitives or immutables, shallow clone is enough
-        other.choiceLimits = (double[]) choiceLimits.clone();
-        other.choiceFormats = (String[]) choiceFormats.clone();
+        other.choiceLimits = choiceLimits.clone();
+        other.choiceFormats = choiceFormats.clone();
         return other;
     }
 
diff --git a/src/share/classes/java/text/CollationElementIterator.java b/src/share/classes/java/text/CollationElementIterator.java
index 94fc84e..62b6a12 100644
--- a/src/share/classes/java/text/CollationElementIterator.java
+++ b/src/share/classes/java/text/CollationElementIterator.java
@@ -412,6 +412,7 @@
      * @param newOffset The new character offset into the original text.
      * @since 1.2
      */
+    @SuppressWarnings("deprecation") // getBeginIndex, getEndIndex and setIndex are deprecated
     public void setOffset(int newOffset)
     {
         if (text != null) {
@@ -645,14 +646,14 @@
     {
         // First get the ordering of this single character,
         // which is always the first element in the list
-        Vector list = ordering.getContractValues(ch);
-        EntryPair pair = (EntryPair)list.firstElement();
+        Vector<EntryPair> list = ordering.getContractValues(ch);
+        EntryPair pair = list.firstElement();
         int order = pair.value;
 
         // find out the length of the longest contracting character sequence in the list.
         // There's logic in the builder code to make sure the longest sequence is always
         // the last.
-        pair = (EntryPair)list.lastElement();
+        pair = list.lastElement();
         int maxLength = pair.entryName.length();
 
         // (the Normalizer is cloned here so that the seeking we do in the next loop
@@ -684,7 +685,7 @@
         // to this sequence
         maxLength = 1;
         for (int i = list.size() - 1; i > 0; i--) {
-            pair = (EntryPair)list.elementAt(i);
+            pair = list.elementAt(i);
             if (!pair.fwd)
                 continue;
 
@@ -721,11 +722,11 @@
         // rather than off.  Notice that we still use append() and startsWith() when
         // working on the fragment.  This is because the entry pairs that are used
         // in reverse iteration have their names reversed already.
-        Vector list = ordering.getContractValues(ch);
-        EntryPair pair = (EntryPair)list.firstElement();
+        Vector<EntryPair> list = ordering.getContractValues(ch);
+        EntryPair pair = list.firstElement();
         int order = pair.value;
 
-        pair = (EntryPair)list.lastElement();
+        pair = list.lastElement();
         int maxLength = pair.entryName.length();
 
         NormalizerBase tempText = (NormalizerBase)text.clone();
@@ -747,7 +748,7 @@
 
         maxLength = 1;
         for (int i = list.size() - 1; i > 0; i--) {
-            pair = (EntryPair)list.elementAt(i);
+            pair = list.elementAt(i);
             if (pair.fwd)
                 continue;
 
diff --git a/src/share/classes/java/text/DateFormat.java b/src/share/classes/java/text/DateFormat.java
index 38ef970..964fca9 100644
--- a/src/share/classes/java/text/DateFormat.java
+++ b/src/share/classes/java/text/DateFormat.java
@@ -798,7 +798,7 @@
         private static final long serialVersionUID = 7441350119349544720L;
 
         // table of all instances in this class, used by readResolve
-        private static final Map instanceMap = new HashMap(18);
+        private static final Map<String, Field> instanceMap = new HashMap<>(18);
         // Maps from Calendar constant (such as Calendar.ERA) to Field
         // constant (such as Field.ERA).
         private static final Field[] calendarToFieldMapping =
diff --git a/src/share/classes/java/text/DecimalFormat.java b/src/share/classes/java/text/DecimalFormat.java
index 3dd9a5b..2ac67b2 100644
--- a/src/share/classes/java/text/DecimalFormat.java
+++ b/src/share/classes/java/text/DecimalFormat.java
@@ -2051,7 +2051,7 @@
      * @return FieldPosition array of the resulting fields.
      */
     private FieldPosition[] expandAffix(String pattern) {
-        ArrayList positions = null;
+        ArrayList<FieldPosition> positions = null;
         int stringIndex = 0;
         for (int i=0; i<pattern.length(); ) {
             char c = pattern.charAt(i++);
@@ -2071,7 +2071,7 @@
                     }
                     if (string.length() > 0) {
                         if (positions == null) {
-                            positions = new ArrayList(2);
+                            positions = new ArrayList<>(2);
                         }
                         FieldPosition fp = new FieldPosition(Field.CURRENCY);
                         fp.setBeginIndex(stringIndex);
@@ -2098,7 +2098,7 @@
                 }
                 if (fieldID != null) {
                     if (positions == null) {
-                        positions = new ArrayList(2);
+                        positions = new ArrayList<>(2);
                     }
                     FieldPosition fp = new FieldPosition(fieldID, field);
                     fp.setBeginIndex(stringIndex);
@@ -2109,7 +2109,7 @@
             stringIndex++;
         }
         if (positions != null) {
-            return (FieldPosition[])positions.toArray(EmptyFieldPositionArray);
+            return positions.toArray(EmptyFieldPositionArray);
         }
         return EmptyFieldPositionArray;
     }
diff --git a/src/share/classes/java/text/DictionaryBasedBreakIterator.java b/src/share/classes/java/text/DictionaryBasedBreakIterator.java
index 78d7e4a..4911eb5 100644
--- a/src/share/classes/java/text/DictionaryBasedBreakIterator.java
+++ b/src/share/classes/java/text/DictionaryBasedBreakIterator.java
@@ -356,9 +356,9 @@
         // continues in this way until we either successfully make it all the way
         // across the range, or exhaust all of our combinations of break
         // positions.)
-        Stack currentBreakPositions = new Stack();
-        Stack possibleBreakPositions = new Stack();
-        Vector wrongBreakPositions = new Vector();
+        Stack<Integer> currentBreakPositions = new Stack<>();
+        Stack<Integer> possibleBreakPositions = new Stack<>();
+        Vector<Integer> wrongBreakPositions = new Vector<>();
 
         // the dictionary is implemented as a trie, which is treated as a state
         // machine.  -1 represents the end of a legal word.  Every word in the
@@ -374,7 +374,7 @@
         // farthest as real break positions, and then start over from scratch with
         // the character where the error occurred.
         int farthestEndPoint = text.getIndex();
-        Stack bestBreakPositions = null;
+        Stack<Integer> bestBreakPositions = null;
 
         // initialize (we always exit the loop with a break statement)
         c = getCurrent();
@@ -409,7 +409,11 @@
                 // case there's an error in the text
                 if (text.getIndex() > farthestEndPoint) {
                     farthestEndPoint = text.getIndex();
-                    bestBreakPositions = (Stack)(currentBreakPositions.clone());
+
+                    @SuppressWarnings("unchecked")
+                    Stack<Integer> currentBreakPositionsCopy = (Stack<Integer>) currentBreakPositions.clone();
+
+                    bestBreakPositions = currentBreakPositionsCopy;
                 }
 
                 // wrongBreakPositions is a list of all break positions
@@ -448,7 +452,7 @@
                     }
                     else {
                         if ((currentBreakPositions.size() == 0 ||
-                             ((Integer)(currentBreakPositions.peek())).intValue() != text.getIndex())
+                             currentBreakPositions.peek().intValue() != text.getIndex())
                             && text.getIndex() != startPos) {
                             currentBreakPositions.push(new Integer(text.getIndex()));
                         }
@@ -463,15 +467,15 @@
                 // it.  Then back up to that position and start over from there (i.e.,
                 // treat that position as the beginning of a new word)
                 else {
-                    Integer temp = (Integer)possibleBreakPositions.pop();
-                    Object temp2 = null;
+                    Integer temp = possibleBreakPositions.pop();
+                    Integer temp2 = null;
                     while (!currentBreakPositions.isEmpty() && temp.intValue() <
-                           ((Integer)currentBreakPositions.peek()).intValue()) {
+                           currentBreakPositions.peek().intValue()) {
                         temp2 = currentBreakPositions.pop();
                         wrongBreakPositions.addElement(temp2);
                     }
                     currentBreakPositions.push(temp);
-                    text.setIndex(((Integer)currentBreakPositions.peek()).intValue());
+                    text.setIndex(currentBreakPositions.peek().intValue());
                 }
 
                 // re-sync "c" for the next go-round, and drop out of the loop if
@@ -507,7 +511,7 @@
         cachedBreakPositions[0] = startPos;
 
         for (int i = 0; i < currentBreakPositions.size(); i++) {
-            cachedBreakPositions[i + 1] = ((Integer)currentBreakPositions.elementAt(i)).intValue();
+            cachedBreakPositions[i + 1] = currentBreakPositions.elementAt(i).intValue();
         }
         positionInCache = 0;
     }
diff --git a/src/share/classes/java/text/MergeCollation.java b/src/share/classes/java/text/MergeCollation.java
index d764f03..1a07fe5 100644
--- a/src/share/classes/java/text/MergeCollation.java
+++ b/src/share/classes/java/text/MergeCollation.java
@@ -88,19 +88,19 @@
     public String getPattern(boolean withWhiteSpace) {
         StringBuffer result = new StringBuffer();
         PatternEntry tmp = null;
-        ArrayList extList = null;
+        ArrayList<PatternEntry> extList = null;
         int i;
         for (i = 0; i < patterns.size(); ++i) {
-            PatternEntry entry = (PatternEntry) patterns.get(i);
+            PatternEntry entry = patterns.get(i);
             if (entry.extension.length() != 0) {
                 if (extList == null)
-                    extList = new ArrayList();
+                    extList = new ArrayList<>();
                 extList.add(entry);
             } else {
                 if (extList != null) {
                     PatternEntry last = findLastWithNoExtension(i-1);
                     for (int j = extList.size() - 1; j >= 0 ; j--) {
-                        tmp = (PatternEntry)(extList.get(j));
+                        tmp = extList.get(j);
                         tmp.addToBuffer(result, false, withWhiteSpace, last);
                     }
                     extList = null;
@@ -111,7 +111,7 @@
         if (extList != null) {
             PatternEntry last = findLastWithNoExtension(i-1);
             for (int j = extList.size() - 1; j >= 0 ; j--) {
-                tmp = (PatternEntry)(extList.get(j));
+                tmp = extList.get(j);
                 tmp.addToBuffer(result, false, withWhiteSpace, last);
             }
             extList = null;
@@ -121,7 +121,7 @@
 
     private final PatternEntry findLastWithNoExtension(int i) {
         for (--i;i >= 0; --i) {
-            PatternEntry entry = (PatternEntry) patterns.get(i);
+            PatternEntry entry = patterns.get(i);
             if (entry.extension.length() == 0) {
                 return entry;
             }
@@ -149,7 +149,7 @@
         StringBuffer result = new StringBuffer();
         for (int i = 0; i < patterns.size(); ++i)
         {
-            PatternEntry entry = (PatternEntry) patterns.get(i);
+            PatternEntry entry = patterns.get(i);
             if (entry != null) {
                 entry.addToBuffer(result, true, withWhiteSpace, null);
             }
@@ -198,13 +198,13 @@
      * @return the requested pattern entry
      */
     public PatternEntry getItemAt(int index) {
-        return (PatternEntry) patterns.get(index);
+        return patterns.get(index);
     }
 
     //============================================================
     // privates
     //============================================================
-    ArrayList patterns = new ArrayList(); // a list of PatternEntries
+    ArrayList<PatternEntry> patterns = new ArrayList<>(); // a list of PatternEntries
 
     private transient PatternEntry saveEntry = null;
     private transient PatternEntry lastEntry = null;
@@ -326,7 +326,7 @@
         } else {
             int i;
             for (i = patterns.size() - 1; i >= 0; --i) {
-                PatternEntry e = (PatternEntry) patterns.get(i);
+                PatternEntry e = patterns.get(i);
                 if (e.chars.regionMatches(0,entry.chars,0,
                                               e.chars.length())) {
                     excessChars.append(entry.chars.substring(e.chars.length(),
diff --git a/src/share/classes/java/text/MessageFormat.java b/src/share/classes/java/text/MessageFormat.java
index 6590e76..0b7b1fa 100644
--- a/src/share/classes/java/text/MessageFormat.java
+++ b/src/share/classes/java/text/MessageFormat.java
@@ -422,6 +422,7 @@
      * @param pattern the pattern for this message format
      * @exception IllegalArgumentException if the pattern is invalid
      */
+    @SuppressWarnings("fallthrough") // fallthrough in switch is expected, suppress it
     public void applyPattern(String pattern) {
             StringBuilder[] segments = new StringBuilder[4];
             // Allocate only segments[SEG_RAW] here. The rest are
@@ -897,7 +898,7 @@
      */
     public AttributedCharacterIterator formatToCharacterIterator(Object arguments) {
         StringBuffer result = new StringBuffer();
-        ArrayList iterators = new ArrayList();
+        ArrayList<AttributedCharacterIterator> iterators = new ArrayList<>();
 
         if (arguments == null) {
             throw new NullPointerException(
@@ -908,7 +909,7 @@
             return createAttributedCharacterIterator("");
         }
         return createAttributedCharacterIterator(
-                     (AttributedCharacterIterator[])iterators.toArray(
+                     iterators.toArray(
                      new AttributedCharacterIterator[iterators.size()]));
     }
 
@@ -1074,14 +1075,14 @@
         MessageFormat other = (MessageFormat) super.clone();
 
         // clone arrays. Can't do with utility because of bug in Cloneable
-        other.formats = (Format[]) formats.clone(); // shallow clone
+        other.formats = formats.clone(); // shallow clone
         for (int i = 0; i < formats.length; ++i) {
             if (formats[i] != null)
                 other.formats[i] = (Format)formats[i].clone();
         }
         // for primitives or immutables, shallow clone is enough
-        other.offsets = (int[]) offsets.clone();
-        other.argumentNumbers = (int[]) argumentNumbers.clone();
+        other.offsets = offsets.clone();
+        other.argumentNumbers = argumentNumbers.clone();
 
         return other;
     }
@@ -1224,7 +1225,7 @@
      *            expected by the format element(s) that use it.
      */
     private StringBuffer subformat(Object[] arguments, StringBuffer result,
-                                   FieldPosition fp, List characterIterators) {
+                                   FieldPosition fp, List<AttributedCharacterIterator> characterIterators) {
         // note: this implementation assumes a fast substring & index.
         // if this is not true, would be better to append chars one by one.
         int lastOffset = 0;
diff --git a/src/share/classes/java/text/NumberFormat.java b/src/share/classes/java/text/NumberFormat.java
index 59f8e1f..43dfea4 100644
--- a/src/share/classes/java/text/NumberFormat.java
+++ b/src/share/classes/java/text/NumberFormat.java
@@ -756,7 +756,7 @@
         }
 
         /* try the cache first */
-        String[] numberPatterns = (String[])cachedLocaleData.get(desiredLocale);
+        String[] numberPatterns = cachedLocaleData.get(desiredLocale);
         if (numberPatterns == null) { /* cache miss */
             ResourceBundle resource = LocaleData.getNumberFormatData(desiredLocale);
             numberPatterns = resource.getStringArray("NumberPatterns");
@@ -844,7 +844,7 @@
     /**
      * Cache to hold the NumberPatterns of a Locale.
      */
-    private static final Hashtable cachedLocaleData = new Hashtable(3);
+    private static final Hashtable<Locale, String[]> cachedLocaleData = new Hashtable<>(3);
 
     // Constants used by factory methods to specify a style of format.
     private static final int NUMBERSTYLE = 0;
@@ -1035,7 +1035,7 @@
         private static final long serialVersionUID = 7494728892700160890L;
 
         // table of all instances in this class, used by readResolve
-        private static final Map instanceMap = new HashMap(11);
+        private static final Map<String, Field> instanceMap = new HashMap<>(11);
 
         /**
          * Creates a Field instance with the specified
diff --git a/src/share/classes/java/text/ParseException.java b/src/share/classes/java/text/ParseException.java
index ee0fd5c..abcebfd 100644
--- a/src/share/classes/java/text/ParseException.java
+++ b/src/share/classes/java/text/ParseException.java
@@ -49,6 +49,8 @@
 public
 class ParseException extends Exception {
 
+    private static final long serialVersionUID = 2703218443322787634L;
+
     /**
      * Constructs a ParseException with the specified detail message and
      * offset.
diff --git a/src/share/classes/java/text/RBCollationTables.java b/src/share/classes/java/text/RBCollationTables.java
index 321e1c1..aa349e6 100644
--- a/src/share/classes/java/text/RBCollationTables.java
+++ b/src/share/classes/java/text/RBCollationTables.java
@@ -112,8 +112,8 @@
         void fillInTables(boolean f2ary,
                           boolean swap,
                           UCompactIntArray map,
-                          Vector cTbl,
-                          Vector eTbl,
+                          Vector<Vector<EntryPair>> cTbl,
+                          Vector<int[]> eTbl,
                           IntHashtable cFlgs,
                           short mso,
                           short mto) {
@@ -155,18 +155,18 @@
      *  table.
      *  @param ch the starting character of the contracting string
      */
-    Vector getContractValues(int ch)
+    Vector<EntryPair> getContractValues(int ch)
     {
         int index = mapping.elementAt(ch);
         return getContractValuesImpl(index - CONTRACTCHARINDEX);
     }
 
     //get contract values from contractTable by index
-    private Vector getContractValuesImpl(int index)
+    private Vector<EntryPair> getContractValuesImpl(int index)
     {
         if (index >= 0)
         {
-            return (Vector)contractTable.elementAt(index);
+            return contractTable.elementAt(index);
         }
         else // not found
         {
@@ -202,7 +202,7 @@
             // this could cause a performance problem, but in practise that
             // rarely happens
             for (int i = 0; i < expandTable.size(); i++) {
-                int[] valueList = (int [])expandTable.elementAt(i);
+                int[] valueList = expandTable.elementAt(i);
                 int length = valueList.length;
 
                 if (length > result && valueList[length-1] == order) {
@@ -220,7 +220,7 @@
      *  @param idx the index of the expanding string value list
      */
     final int[] getExpandValueList(int order) {
-        return (int[])expandTable.elementAt(order - EXPANDCHARINDEX);
+        return expandTable.elementAt(order - EXPANDCHARINDEX);
     }
 
     /**
@@ -260,9 +260,9 @@
         }
     }
 
-    final static int getEntry(Vector list, String name, boolean fwd) {
+    final static int getEntry(Vector<EntryPair> list, String name, boolean fwd) {
         for (int i = 0; i < list.size(); i++) {
-            EntryPair pair = (EntryPair)list.elementAt(i);
+            EntryPair pair = list.elementAt(i);
             if (pair.fwd == fwd && pair.entryName.equals(name)) {
                 return i;
             }
@@ -294,8 +294,8 @@
     private boolean seAsianSwapping = false;
 
     private UCompactIntArray mapping = null;
-    private Vector contractTable = null;
-    private Vector expandTable = null;
+    private Vector<Vector<EntryPair>> contractTable = null;
+    private Vector<int[]> expandTable = null;
     private IntHashtable contractFlags = null;
 
     private short maxSecOrder = 0;
diff --git a/src/share/classes/java/text/RBTableBuilder.java b/src/share/classes/java/text/RBTableBuilder.java
index fe35ab5..a788729 100644
--- a/src/share/classes/java/text/RBTableBuilder.java
+++ b/src/share/classes/java/text/RBTableBuilder.java
@@ -85,7 +85,7 @@
             throw new ParseException("Build rules empty.", 0);
 
         // This array maps Unicode characters to their collation ordering
-        mapping = new UCompactIntArray((int)RBCollationTables.UNMAPPED);
+        mapping = new UCompactIntArray(RBCollationTables.UNMAPPED);
         // Normalize the build rules.  Find occurances of all decomposed characters
         // and normalize the rules before feeding into the builder.  By "normalize",
         // we mean that all precomposed Unicode characters must be converted into
@@ -263,7 +263,7 @@
     {
         if (expandTable != null) {
             for (int i = 0; i < expandTable.size(); i++) {
-                int[] valueList = (int [])expandTable.elementAt(i);
+                int[] valueList = expandTable.elementAt(i);
                 for (int j = 0; j < valueList.length; j++) {
                     int order = valueList[j];
                     if (order < RBCollationTables.EXPANDCHARINDEX && order > CHARINDEX) {
@@ -354,7 +354,7 @@
                                           boolean fwd)
     {
         if (contractTable == null) {
-            contractTable = new Vector(INITIALTABLESIZE);
+            contractTable = new Vector<>(INITIALTABLESIZE);
         }
 
         //initial character
@@ -366,12 +366,12 @@
           */
         // See if the initial character of the string already has a contract table.
         int entry = mapping.elementAt(ch);
-        Vector entryTable = getContractValuesImpl(entry - RBCollationTables.CONTRACTCHARINDEX);
+        Vector<EntryPair> entryTable = getContractValuesImpl(entry - RBCollationTables.CONTRACTCHARINDEX);
 
         if (entryTable == null) {
             // We need to create a new table of contract entries for this base char
             int tableIndex = RBCollationTables.CONTRACTCHARINDEX + contractTable.size();
-            entryTable = new Vector(INITIALTABLESIZE);
+            entryTable = new Vector<>(INITIALTABLESIZE);
             contractTable.addElement(entryTable);
 
             // Add the initial character's current ordering first. then
@@ -383,10 +383,10 @@
         // Now add (or replace) this string in the table
         int index = RBCollationTables.getEntry(entryTable, groupChars, fwd);
         if (index != RBCollationTables.UNMAPPED) {
-            EntryPair pair = (EntryPair) entryTable.elementAt(index);
+            EntryPair pair = entryTable.elementAt(index);
             pair.value = anOrder;
         } else {
-            EntryPair pair = (EntryPair)entryTable.lastElement();
+            EntryPair pair = entryTable.lastElement();
 
             // NOTE:  This little bit of logic is here to speed CollationElementIterator
             // .nextContractChar().  This code ensures that the longest sequence in
@@ -426,11 +426,11 @@
             int ch = Character.isHighSurrogate(ch0)?
               Character.toCodePoint(ch0, groupChars.charAt(1)):ch0;
               */
-            Vector entryTable = getContractValues(ch);
+            Vector<EntryPair> entryTable = getContractValues(ch);
             if (entryTable != null) {
                 int index = RBCollationTables.getEntry(entryTable, groupChars, true);
                 if (index != RBCollationTables.UNMAPPED) {
-                    EntryPair pair = (EntryPair) entryTable.elementAt(index);
+                    EntryPair pair = entryTable.elementAt(index);
                     result = pair.value;
                 }
             }
@@ -442,8 +442,8 @@
         int order = mapping.elementAt(ch);
 
         if (order >= RBCollationTables.CONTRACTCHARINDEX) {
-            Vector groupList = getContractValuesImpl(order - RBCollationTables.CONTRACTCHARINDEX);
-            EntryPair pair = (EntryPair)groupList.firstElement();
+            Vector<EntryPair> groupList = getContractValuesImpl(order - RBCollationTables.CONTRACTCHARINDEX);
+            EntryPair pair = groupList.firstElement();
             order = pair.value;
         }
         return order;
@@ -454,17 +454,17 @@
      *  table.
      *  @param ch the starting character of the contracting string
      */
-    private Vector getContractValues(int ch)
+    private Vector<EntryPair> getContractValues(int ch)
     {
         int index = mapping.elementAt(ch);
         return getContractValuesImpl(index - RBCollationTables.CONTRACTCHARINDEX);
     }
 
-    private Vector getContractValuesImpl(int index)
+    private Vector<EntryPair> getContractValuesImpl(int index)
     {
         if (index >= 0)
         {
-            return (Vector)contractTable.elementAt(index);
+            return contractTable.elementAt(index);
         }
         else // not found
         {
@@ -513,7 +513,7 @@
      */
     private int addExpansion(int anOrder, String expandChars) {
         if (expandTable == null) {
-            expandTable = new Vector(INITIALTABLESIZE);
+            expandTable = new Vector<>(INITIALTABLESIZE);
         }
 
         // If anOrder is valid, we want to add it at the beginning of the list
@@ -610,8 +610,8 @@
     private boolean seAsianSwapping = false;
 
     private UCompactIntArray mapping = null;
-    private Vector   contractTable = null;
-    private Vector   expandTable = null;
+    private Vector<Vector<EntryPair>>   contractTable = null;
+    private Vector<int[]>   expandTable = null;
 
     private short maxSecOrder = 0;
     private short maxTerOrder = 0;
diff --git a/src/share/classes/java/text/RuleBasedBreakIterator.java b/src/share/classes/java/text/RuleBasedBreakIterator.java
index 201eee7..7f1c1b8 100644
--- a/src/share/classes/java/text/RuleBasedBreakIterator.java
+++ b/src/share/classes/java/text/RuleBasedBreakIterator.java
@@ -444,9 +444,9 @@
 
         BufferedInputStream is;
         try {
-            is = (BufferedInputStream)AccessController.doPrivileged(
-                new PrivilegedExceptionAction() {
-                    public Object run() throws Exception {
+            is = AccessController.doPrivileged(
+                new PrivilegedExceptionAction<BufferedInputStream>() {
+                    public BufferedInputStream run() throws Exception {
                         return new BufferedInputStream(getClass().getResourceAsStream("/sun/text/resources/" + datafile));
                     }
                 }
diff --git a/src/share/classes/java/util/EnumMap.java b/src/share/classes/java/util/EnumMap.java
index 90046ab..dba44a9 100644
--- a/src/share/classes/java/util/EnumMap.java
+++ b/src/share/classes/java/util/EnumMap.java
@@ -730,6 +730,7 @@
             throw new AssertionError();
         }
         result.vals = result.vals.clone();
+        result.entrySet = null;
         return result;
     }
 
diff --git a/src/share/classes/java/util/HashMap.java b/src/share/classes/java/util/HashMap.java
index efc707f..2191b98 100644
--- a/src/share/classes/java/util/HashMap.java
+++ b/src/share/classes/java/util/HashMap.java
@@ -175,6 +175,35 @@
      */
     transient int modCount;
 
+    private static class Holder {
+         /**
+         *
+         */
+        static final sun.misc.Unsafe UNSAFE;
+
+        /**
+         * Offset of "final" hashSeed field we must set in
+         * readObject() method.
+         */
+        static final long HASHSEED_OFFSET;
+
+        static {
+            try {
+                UNSAFE = sun.misc.Unsafe.getUnsafe();
+                HASHSEED_OFFSET = UNSAFE.objectFieldOffset(
+                    HashMap.class.getDeclaredField("hashSeed"));
+            } catch (NoSuchFieldException | SecurityException e) {
+                throw new InternalError("Failed to record hashSeed offset", e);
+            }
+        }
+    }
+
+    /**
+     * A randomizing value associated with this instance that is applied to
+     * hash code of keys to make hash collisions harder to find.
+     */
+    transient final int hashSeed = sun.misc.Hashing.randomHashSeed(this);
+
     /**
      * Constructs an empty <tt>HashMap</tt> with the specified initial
      * capacity and load factor.
@@ -200,7 +229,7 @@
             capacity <<= 1;
 
         this.loadFactor = loadFactor;
-        threshold = (int)(capacity * loadFactor);
+        threshold = (int)Math.min(capacity * loadFactor, MAXIMUM_CAPACITY + 1);
         table = new Entry[capacity];
         init();
     }
@@ -221,10 +250,7 @@
      * (16) and the default load factor (0.75).
      */
     public HashMap() {
-        this.loadFactor = DEFAULT_LOAD_FACTOR;
-        threshold = (int)(DEFAULT_INITIAL_CAPACITY * DEFAULT_LOAD_FACTOR);
-        table = new Entry[DEFAULT_INITIAL_CAPACITY];
-        init();
+        this(DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR);
     }
 
     /**
@@ -255,13 +281,20 @@
     }
 
     /**
-     * Applies a supplemental hash function to a given hashCode, which
-     * defends against poor quality hash functions.  This is critical
-     * because HashMap uses power-of-two length hash tables, that
+     * Retrieve object hash code and applies a supplemental hash function to the
+     * result hash, which defends against poor quality hash functions.  This is
+     * critical because HashMap uses power-of-two length hash tables, that
      * otherwise encounter collisions for hashCodes that do not differ
-     * in lower bits. Note: Null keys always map to hash 0, thus index 0.
+     * in lower bits.
      */
-    static int hash(int h) {
+    final int hash(Object k) {
+        int h = hashSeed;
+        if (k instanceof String) {
+            return ((String)k).hash32();
+        }
+
+        h ^= k.hashCode();
+
         // This function ensures that hashCodes that differ only by
         // constant multiples at each bit position have a bounded
         // number of collisions (approximately 8 at default load factor).
@@ -313,32 +346,9 @@
      */
     @SuppressWarnings("unchecked")
     public V get(Object key) {
-        if (key == null)
-            return (V)getForNullKey();
-        int hash = hash(key.hashCode());
-        for (Entry<?,?> e = table[indexFor(hash, table.length)];
-             e != null;
-             e = e.next) {
-            Object k;
-            if (e.hash == hash && ((k = e.key) == key || key.equals(k)))
-                return (V)e.value;
-        }
-        return null;
-    }
+        Entry<K,V> entry = getEntry(key);
 
-    /**
-     * Offloaded version of get() to look up null keys.  Null keys map
-     * to index 0.  This null case is split out into separate methods
-     * for the sake of performance in the two most commonly used
-     * operations (get and put), but incorporated with conditionals in
-     * others.
-     */
-    private Object getForNullKey() {
-        for (Entry<?,?> e = table[0]; e != null; e = e.next) {
-            if (e.key == null)
-                return e.value;
-        }
-        return null;
+        return null == entry ? null : entry.getValue();
     }
 
     /**
@@ -360,7 +370,7 @@
      */
     @SuppressWarnings("unchecked")
     final Entry<K,V> getEntry(Object key) {
-        int hash = (key == null) ? 0 : hash(key.hashCode());
+        int hash = (key == null) ? 0 : hash(key);
         for (Entry<?,?> e = table[indexFor(hash, table.length)];
              e != null;
              e = e.next) {
@@ -388,7 +398,7 @@
     public V put(K key, V value) {
         if (key == null)
             return putForNullKey(value);
-        int hash = hash(key.hashCode());
+        int hash = hash(key);
         int i = indexFor(hash, table.length);
         @SuppressWarnings("unchecked")
         Entry<K,V> e = (Entry<K,V>)table[i];
@@ -433,7 +443,7 @@
      * addEntry.
      */
     private void putForCreate(K key, V value) {
-        int hash = (key == null) ? 0 : hash(key.hashCode());
+        int hash = null == key ? 0 : hash(key);
         int i = indexFor(hash, table.length);
 
         /**
@@ -484,7 +494,7 @@
         Entry<?,?>[] newTable = new Entry<?,?>[newCapacity];
         transfer(newTable);
         table = newTable;
-        threshold = (int)(newCapacity * loadFactor);
+        threshold = (int)Math.min(newCapacity * loadFactor, MAXIMUM_CAPACITY + 1);
     }
 
     /**
@@ -494,19 +504,17 @@
     void transfer(Entry<?,?>[] newTable) {
         Entry<?,?>[] src = table;
         int newCapacity = newTable.length;
-        for (int j = 0; j < src.length; j++) {
-            Entry<K,V> e = (Entry<K,V>)src[j];
-            if (e != null) {
-                src[j] = null;
-                do {
-                    Entry<K,V> next = e.next;
-                    int i = indexFor(e.hash, newCapacity);
-                    e.next = (Entry<K,V>)newTable[i];
-                    newTable[i] = e;
-                    e = next;
-                } while (e != null);
+        for (int j = 0; j < src.length; j++ ) {
+            Entry<K,V> e = (Entry<K,V>) src[j];
+            while(null != e) {
+                Entry<K,V> next = e.next;
+                int i = indexFor(e.hash, newCapacity);
+                e.next = (Entry<K,V>) newTable[i];
+                newTable[i] = e;
+                e = next;
             }
         }
+        Arrays.fill(table, null);
     }
 
     /**
@@ -566,7 +574,7 @@
      * for this key.
      */
     final Entry<K,V> removeEntryForKey(Object key) {
-        int hash = (key == null) ? 0 : hash(key.hashCode());
+        int hash = (key == null) ? 0 : hash(key);
         int i = indexFor(hash, table.length);
         @SuppressWarnings("unchecked")
             Entry<K,V> prev = (Entry<K,V>)table[i];
@@ -594,7 +602,8 @@
     }
 
     /**
-     * Special version of remove for EntrySet.
+     * Special version of remove for EntrySet using {@code Map.Entry.equals()}
+     * for matching.
      */
     final Entry<K,V> removeMapping(Object o) {
         if (!(o instanceof Map.Entry))
@@ -602,7 +611,7 @@
 
         Map.Entry<?,?> entry = (Map.Entry<?,?>) o;
         Object key = entry.getKey();
-        int hash = (key == null) ? 0 : hash(key.hashCode());
+        int hash = (key == null) ? 0 : hash(key);
         int i = indexFor(hash, table.length);
         @SuppressWarnings("unchecked")
             Entry<K,V> prev = (Entry<K,V>)table[i];
@@ -773,11 +782,13 @@
      * Subclass overrides this to alter the behavior of put method.
      */
     void addEntry(int hash, K key, V value, int bucketIndex) {
-        @SuppressWarnings("unchecked")
-            Entry<K,V> e = (Entry<K,V>)table[bucketIndex];
-        table[bucketIndex] = new Entry<>(hash, key, value, e);
-        if (size++ >= threshold)
+        if ((size >= threshold) && (null != table[bucketIndex])) {
             resize(2 * table.length);
+            hash = (null != key) ? hash(key) : 0;
+            bucketIndex = indexFor(hash, table.length);
+        }
+
+        createEntry(hash, key, value, bucketIndex);
     }
 
     /**
@@ -841,7 +852,6 @@
             HashMap.this.removeEntryForKey(k);
             expectedModCount = modCount;
         }
-
     }
 
     private final class ValueIterator extends HashIterator<V> {
@@ -1021,9 +1031,8 @@
         s.writeInt(size);
 
         // Write out keys and values (alternating)
-        if (i != null) {
-            while (i.hasNext()) {
-                Map.Entry<K,V> e = i.next();
+        if (size > 0) {
+            for(Map.Entry<K,V> e : entrySet0()) {
                 s.writeObject(e.getKey());
                 s.writeObject(e.getValue());
             }
@@ -1033,26 +1042,50 @@
     private static final long serialVersionUID = 362498820763181265L;
 
     /**
-     * Reconstitute the <tt>HashMap</tt> instance from a stream (i.e.,
+     * Reconstitute the {@code HashMap} instance from a stream (i.e.,
      * deserialize it).
      */
     private void readObject(java.io.ObjectInputStream s)
          throws IOException, ClassNotFoundException
     {
-        // Read in the threshold, loadfactor, and any hidden stuff
+        // Read in the threshold (ignored), loadfactor, and any hidden stuff
         s.defaultReadObject();
+        if (loadFactor <= 0 || Float.isNaN(loadFactor))
+            throw new InvalidObjectException("Illegal load factor: " +
+                                               loadFactor);
+
+        // set hashMask
+        Holder.UNSAFE.putIntVolatile(this, Holder.HASHSEED_OFFSET,
+                sun.misc.Hashing.randomHashSeed(this));
 
         // Read in number of buckets and allocate the bucket array;
-        int numBuckets = s.readInt();
-        table = new Entry[numBuckets];
+        s.readInt(); // ignored
 
+        // Read number of mappings
+        int mappings = s.readInt();
+        if (mappings < 0)
+            throw new InvalidObjectException("Illegal mappings count: " +
+                                               mappings);
+
+        int initialCapacity = (int) Math.min(
+                // capacity chosen by number of mappings
+                // and desired load (if >= 0.25)
+                mappings * Math.min(1 / loadFactor, 4.0f),
+                // we have limits...
+                HashMap.MAXIMUM_CAPACITY);
+        int capacity = 1;
+        // find smallest power of two which holds all mappings
+        while (capacity < initialCapacity) {
+            capacity <<= 1;
+        }
+
+        table = new Entry[capacity];
+        threshold = (int) Math.min(capacity * loadFactor, MAXIMUM_CAPACITY + 1);
         init();  // Give subclass a chance to do its thing.
 
-        // Read in size (number of Mappings)
-        int size = s.readInt();
 
         // Read the keys and values, and put the mappings in the HashMap
-        for (int i=0; i<size; i++) {
+        for (int i=0; i<mappings; i++) {
             @SuppressWarnings("unchecked")
                 K key = (K) s.readObject();
             @SuppressWarnings("unchecked")
diff --git a/src/share/classes/java/util/Hashtable.java b/src/share/classes/java/util/Hashtable.java
index d0b9d46..593c171 100644
--- a/src/share/classes/java/util/Hashtable.java
+++ b/src/share/classes/java/util/Hashtable.java
@@ -163,6 +163,52 @@
     /** use serialVersionUID from JDK 1.0.2 for interoperability */
     private static final long serialVersionUID = 1421746759512286392L;
 
+    private static class Holder {
+            // Unsafe mechanics
+        /**
+         *
+         */
+        static final sun.misc.Unsafe UNSAFE;
+
+        /**
+         * Offset of "final" hashSeed field we must set in
+         * readObject() method.
+         */
+        static final long HASHSEED_OFFSET;
+
+        static {
+            try {
+                UNSAFE = sun.misc.Unsafe.getUnsafe();
+                HASHSEED_OFFSET = UNSAFE.objectFieldOffset(
+                    Hashtable.class.getDeclaredField("hashSeed"));
+            } catch (NoSuchFieldException | SecurityException e) {
+                throw new InternalError("Failed to record hashSeed offset", e);
+            }
+        }
+    }
+
+    /**
+     * A randomizing value associated with this instance that is applied to
+     * hash code of keys to make hash collisions harder to find.
+     */
+    transient final int hashSeed = sun.misc.Hashing.randomHashSeed(this);
+
+    private int hash(Object k) {
+        int h = hashSeed;
+
+        if (k instanceof String) {
+            return ((String)k).hash32();
+        } else {
+            h ^= k.hashCode();
+
+            // This function ensures that hashCodes that differ only by
+            // constant multiples at each bit position have a bounded
+            // number of collisions (approximately 8 at default load factor).
+            h ^= (h >>> 20) ^ (h >>> 12);
+            return h ^ (h >>> 7) ^ (h >>> 4);
+        }
+    }
+
     /**
      * Constructs a new, empty hashtable with the specified initial
      * capacity and the specified load factor.
@@ -183,7 +229,7 @@
             initialCapacity = 1;
         this.loadFactor = loadFactor;
         table = new Entry<?,?>[initialCapacity];
-        threshold = (int)(initialCapacity * loadFactor);
+        threshold = (int)Math.min(initialCapacity * loadFactor, MAX_ARRAY_SIZE + 1);
     }
 
     /**
@@ -327,7 +373,7 @@
      */
     public synchronized boolean containsKey(Object key) {
         Entry<?,?> tab[] = table;
-        int hash = key.hashCode();
+        int hash = hash(key);
         int index = (hash & 0x7FFFFFFF) % tab.length;
         for (Entry<?,?> e = tab[index] ; e != null ; e = e.next) {
             if ((e.hash == hash) && e.key.equals(key)) {
@@ -355,7 +401,7 @@
     @SuppressWarnings("unchecked")
     public synchronized V get(Object key) {
         Entry<?,?> tab[] = table;
-        int hash = key.hashCode();
+        int hash = hash(key);
         int index = (hash & 0x7FFFFFFF) % tab.length;
         for (Entry<?,?> e = tab[index] ; e != null ; e = e.next) {
             if ((e.hash == hash) && e.key.equals(key)) {
@@ -396,7 +442,7 @@
         Entry<?,?>[] newMap = new Entry<?,?>[newCapacity];
 
         modCount++;
-        threshold = (int)(newCapacity * loadFactor);
+        threshold = (int)Math.min(newCapacity * loadFactor, MAX_ARRAY_SIZE + 1);
         table = newMap;
 
         for (int i = oldCapacity ; i-- > 0 ;) {
@@ -436,7 +482,7 @@
 
         // Makes sure the key is not already in the hashtable.
         Entry<?,?> tab[] = table;
-        int hash = key.hashCode();
+        int hash = hash(key);
         int index = (hash & 0x7FFFFFFF) % tab.length;
         @SuppressWarnings("unchecked")
         Entry<K,V> entry = (Entry<K,V>)tab[index];
@@ -454,6 +500,7 @@
             rehash();
 
             tab = table;
+            hash = hash(key);
             index = (hash & 0x7FFFFFFF) % tab.length;
         }
 
@@ -476,7 +523,7 @@
      */
     public synchronized V remove(Object key) {
         Entry<?,?> tab[] = table;
-        int hash = key.hashCode();
+        int hash = hash(key);
         int index = (hash & 0x7FFFFFFF) % tab.length;
         @SuppressWarnings("unchecked")
         Entry<K,V> e = (Entry<K,V>)tab[index];
@@ -685,7 +732,7 @@
             Map.Entry<?,?> entry = (Map.Entry<?,?>)o;
             Object key = entry.getKey();
             Entry<?,?>[] tab = table;
-            int hash = key.hashCode();
+            int hash = hash(key);
             int index = (hash & 0x7FFFFFFF) % tab.length;
 
             for (Entry<?,?> e = tab[index]; e != null; e = e.next)
@@ -700,7 +747,7 @@
             Map.Entry<?,?> entry = (Map.Entry<?,?>) o;
             Object key = entry.getKey();
             Entry<?,?>[] tab = table;
-            int hash = key.hashCode();
+            int hash = hash(key);
             int index = (hash & 0x7FFFFFFF) % tab.length;
 
             @SuppressWarnings("unchecked")
@@ -835,9 +882,13 @@
 
         loadFactor = -loadFactor;  // Mark hashCode computation in progress
         Entry<?,?>[] tab = table;
-        for (int i = 0; i < tab.length; i++)
-            for (Entry<?,?> e = tab[i]; e != null; e = e.next)
-                h += e.key.hashCode() ^ e.value.hashCode();
+        for (Entry<?,?> entry : tab) {
+            while (entry != null) {
+                h += entry.hashCode();
+                entry = entry.next;
+            }
+        }
+
         loadFactor = -loadFactor;  // Mark hashCode computation complete
 
         return h;
@@ -894,6 +945,10 @@
         // Read in the length, threshold, and loadfactor
         s.defaultReadObject();
 
+        // set hashMask
+        Holder.UNSAFE.putIntVolatile(this, Holder.HASHSEED_OFFSET,
+                sun.misc.Hashing.randomHashSeed(this));
+
         // Read the original length of the array and number of elements
         int origlength = s.readInt();
         int elements = s.readInt();
@@ -907,7 +962,8 @@
             length--;
         if (origlength > 0 && length > origlength)
             length = origlength;
-        Entry<?,?>[] table = new Entry<?,?>[length];
+        table = new Entry<?,?>[length];
+        threshold = (int)Math.min(length * loadFactor, MAX_ARRAY_SIZE + 1);
         count = 0;
 
         // Read the number of elements and then all the key/value objects
@@ -919,7 +975,6 @@
             // synch could be eliminated for performance
             reconstitutionPut(table, key, value);
         }
-        this.table = table;
     }
 
     /**
@@ -941,7 +996,7 @@
         }
         // Makes sure the key is not already in the hashtable.
         // This should not happen in deserialized version.
-        int hash = key.hashCode();
+        int hash = hash(key);
         int index = (hash & 0x7FFFFFFF) % tab.length;
         for (Entry<?,?> e = tab[index] ; e != null ; e = e.next) {
             if ((e.hash == hash) && e.key.equals(key)) {
@@ -956,17 +1011,17 @@
     }
 
     /**
-     * Hashtable collision list.
+     * Hashtable bucket collision list entry
      */
     private static class Entry<K,V> implements Map.Entry<K,V> {
-        int hash;
+        final int hash;
         K key;
         V value;
         Entry<K,V> next;
 
         protected Entry(int hash, K key, V value, Entry<K,V> next) {
             this.hash = hash;
-            this.key = key;
+            this.key =  key;
             this.value = value;
             this.next = next;
         }
diff --git a/src/share/classes/java/util/LinkedHashMap.java b/src/share/classes/java/util/LinkedHashMap.java
index 5e656c8..7a6f70f 100644
--- a/src/share/classes/java/util/LinkedHashMap.java
+++ b/src/share/classes/java/util/LinkedHashMap.java
@@ -236,6 +236,7 @@
      * readObject) before any entries are inserted into the map.  Initializes
      * the chain.
      */
+    @Override
     void init() {
         header = new Entry<>(-1, null, null, null);
         header.before = header.after = header;
@@ -246,6 +247,7 @@
      * by superclass resize.  It is overridden for performance, as it is
      * faster to iterate using our linked list.
      */
+    @Override
     @SuppressWarnings("unchecked")
     void transfer(HashMap.Entry[] newTable) {
         int newCapacity = newTable.length;
@@ -421,15 +423,12 @@
      * removes the eldest entry if appropriate.
      */
     void addEntry(int hash, K key, V value, int bucketIndex) {
-        createEntry(hash, key, value, bucketIndex);
+        super.addEntry(hash, key, value, bucketIndex);
 
-        // Remove eldest entry if instructed, else grow capacity if appropriate
+        // Remove eldest entry if instructed
         Entry<K,V> eldest = header.after;
         if (removeEldestEntry(eldest)) {
             removeEntryForKey(eldest.key);
-        } else {
-            if (size >= threshold)
-                resize(2 * table.length);
         }
     }
 
diff --git a/src/share/classes/java/util/WeakHashMap.java b/src/share/classes/java/util/WeakHashMap.java
index f5f6237..ed9e1ad 100644
--- a/src/share/classes/java/util/WeakHashMap.java
+++ b/src/share/classes/java/util/WeakHashMap.java
@@ -90,7 +90,8 @@
  * from being discarded.  Note that a value object may refer indirectly to its
  * key via the <tt>WeakHashMap</tt> itself; that is, a value object may
  * strongly refer to some other key object whose associated value object, in
- * turn, strongly refers to the key of the first value object.  One way
+ * turn, strongly refers to the key of the first value object.  If the values
+ * in the map do not rely on the map holding strong references to them, one way
  * to deal with this is to wrap values themselves within
  * <tt>WeakReferences</tt> before
  * inserting, as in: <tt>m.put(key, new WeakReference(value))</tt>,
@@ -184,6 +185,12 @@
      */
     int modCount;
 
+    /**
+     * A randomizing value associated with this instance that is applied to
+     * hash code of keys to make hash collisions harder to find.
+     */
+    transient final int hashSeed = sun.misc.Hashing.randomHashSeed(this);
+
     @SuppressWarnings("unchecked")
     private Entry<K,V>[] newTable(int n) {
         return (Entry<K,V>[]) new Entry<?,?>[n];
@@ -232,9 +239,7 @@
      * capacity (16) and load factor (0.75).
      */
     public WeakHashMap() {
-        this.loadFactor = DEFAULT_LOAD_FACTOR;
-        threshold = DEFAULT_INITIAL_CAPACITY;
-        table = newTable(DEFAULT_INITIAL_CAPACITY);
+        this(DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR);
     }
 
     /**
@@ -248,7 +253,8 @@
      * @since   1.3
      */
     public WeakHashMap(Map<? extends K, ? extends V> m) {
-        this(Math.max((int) (m.size() / DEFAULT_LOAD_FACTOR) + 1, 16),
+        this(Math.max((int) (m.size() / DEFAULT_LOAD_FACTOR) + 1,
+                DEFAULT_INITIAL_CAPACITY),
              DEFAULT_LOAD_FACTOR);
         putAll(m);
     }
@@ -283,6 +289,28 @@
     }
 
     /**
+     * Retrieve object hash code and applies a supplemental hash function to the
+     * result hash, which defends against poor quality hash functions.  This is
+     * critical because HashMap uses power-of-two length hash tables, that
+     * otherwise encounter collisions for hashCodes that do not differ
+     * in lower bits.
+     */
+    int hash(Object k) {
+        int h = hashSeed;
+        if (k instanceof String) {
+            return ((String) k).hash32();
+        } else {
+            h ^= k.hashCode();
+        }
+
+        // This function ensures that hashCodes that differ only by
+        // constant multiples at each bit position have a bounded
+        // number of collisions (approximately 8 at default load factor).
+        h ^= (h >>> 20) ^ (h >>> 12);
+        return h ^ (h >>> 7) ^ (h >>> 4);
+    }
+
+    /**
      * Returns index for hash code h.
      */
     private static int indexFor(int h, int length) {
@@ -371,7 +399,7 @@
      */
     public V get(Object key) {
         Object k = maskNull(key);
-        int h = HashMap.hash(k.hashCode());
+        int h = hash(k);
         Entry<K,V>[] tab = getTable();
         int index = indexFor(h, tab.length);
         Entry<K,V> e = tab[index];
@@ -401,7 +429,7 @@
      */
     Entry<K,V> getEntry(Object key) {
         Object k = maskNull(key);
-        int h = HashMap.hash(k.hashCode());
+        int h = hash(k);
         Entry<K,V>[] tab = getTable();
         int index = indexFor(h, tab.length);
         Entry<K,V> e = tab[index];
@@ -424,7 +452,7 @@
      */
     public V put(K key, V value) {
         Object k = maskNull(key);
-        int h = HashMap.hash(k.hashCode());
+        int h = hash(k);
         Entry<K,V>[] tab = getTable();
         int i = indexFor(h, tab.length);
 
@@ -566,7 +594,7 @@
      */
     public V remove(Object key) {
         Object k = maskNull(key);
-        int h = HashMap.hash(k.hashCode());
+        int h = hash(k);
         Entry<K,V>[] tab = getTable();
         int i = indexFor(h, tab.length);
         Entry<K,V> prev = tab[i];
@@ -597,7 +625,7 @@
         Entry<K,V>[] tab = getTable();
         Map.Entry<?,?> entry = (Map.Entry<?,?>)o;
         Object k = maskNull(entry.getKey());
-        int h = HashMap.hash(k.hashCode());
+        int h = hash(k);
         int i = indexFor(h, tab.length);
         Entry<K,V> prev = tab[i];
         Entry<K,V> e = prev;
diff --git a/src/share/classes/java/util/concurrent/ConcurrentHashMap.java b/src/share/classes/java/util/concurrent/ConcurrentHashMap.java
index 48b0021..deddc7f 100644
--- a/src/share/classes/java/util/concurrent/ConcurrentHashMap.java
+++ b/src/share/classes/java/util/concurrent/ConcurrentHashMap.java
@@ -175,6 +175,12 @@
     /* ---------------- Fields -------------- */
 
     /**
+     * A randomizing value associated with this instance that is applied to
+     * hash code of keys to make hash collisions harder to find.
+     */
+   private transient final int hashSeed = sun.misc.Hashing.randomHashSeed(this);
+
+    /**
      * Mask value for indexing into segments. The upper bits of a
      * key's hash code are used to choose the segment.
      */
@@ -262,7 +268,15 @@
      * that otherwise encounter collisions for hashCodes that do not
      * differ in lower or upper bits.
      */
-    private static int hash(int h) {
+    private int hash(Object k) {
+       int h = hashSeed;
+
+        if (k instanceof String) {
+            return ((String) k).hash32();
+        }
+
+        h ^= k.hashCode();
+
         // Spread bits to regularize both segment and index locations,
         // using variant of single-word Wang/Jenkins hash.
         h += (h <<  15) ^ 0xffffcd7d;
@@ -917,7 +931,7 @@
     public V get(Object key) {
         Segment<K,V> s; // manually integrate access methods to reduce overhead
         HashEntry<K,V>[] tab;
-        int h = hash(key.hashCode());
+        int h = hash(key);
         long u = (((h >>> segmentShift) & segmentMask) << SSHIFT) + SBASE;
         if ((s = (Segment<K,V>)UNSAFE.getObjectVolatile(segments, u)) != null &&
             (tab = s.table) != null) {
@@ -945,7 +959,7 @@
     public boolean containsKey(Object key) {
         Segment<K,V> s; // same as get() except no need for volatile value read
         HashEntry<K,V>[] tab;
-        int h = hash(key.hashCode());
+        int h = hash(key);
         long u = (((h >>> segmentShift) & segmentMask) << SSHIFT) + SBASE;
         if ((s = (Segment<K,V>)UNSAFE.getObjectVolatile(segments, u)) != null &&
             (tab = s.table) != null) {
@@ -1054,7 +1068,7 @@
         Segment<K,V> s;
         if (value == null)
             throw new NullPointerException();
-        int hash = hash(key.hashCode());
+        int hash = hash(key);
         int j = (hash >>> segmentShift) & segmentMask;
         if ((s = (Segment<K,V>)UNSAFE.getObject          // nonvolatile; recheck
              (segments, (j << SSHIFT) + SBASE)) == null) //  in ensureSegment
@@ -1074,7 +1088,7 @@
         Segment<K,V> s;
         if (value == null)
             throw new NullPointerException();
-        int hash = hash(key.hashCode());
+        int hash = hash(key);
         int j = (hash >>> segmentShift) & segmentMask;
         if ((s = (Segment<K,V>)UNSAFE.getObject
              (segments, (j << SSHIFT) + SBASE)) == null)
@@ -1104,7 +1118,7 @@
      * @throws NullPointerException if the specified key is null
      */
     public V remove(Object key) {
-        int hash = hash(key.hashCode());
+        int hash = hash(key);
         Segment<K,V> s = segmentForHash(hash);
         return s == null ? null : s.remove(key, hash, null);
     }
@@ -1115,7 +1129,7 @@
      * @throws NullPointerException if the specified key is null
      */
     public boolean remove(Object key, Object value) {
-        int hash = hash(key.hashCode());
+        int hash = hash(key);
         Segment<K,V> s;
         return value != null && (s = segmentForHash(hash)) != null &&
             s.remove(key, hash, value) != null;
@@ -1127,7 +1141,7 @@
      * @throws NullPointerException if any of the arguments are null
      */
     public boolean replace(K key, V oldValue, V newValue) {
-        int hash = hash(key.hashCode());
+        int hash = hash(key);
         if (oldValue == null || newValue == null)
             throw new NullPointerException();
         Segment<K,V> s = segmentForHash(hash);
@@ -1142,7 +1156,7 @@
      * @throws NullPointerException if the specified key or value is null
      */
     public V replace(K key, V value) {
-        int hash = hash(key.hashCode());
+        int hash = hash(key);
         if (value == null)
             throw new NullPointerException();
         Segment<K,V> s = segmentForHash(hash);
@@ -1473,6 +1487,10 @@
             throws java.io.IOException, ClassNotFoundException {
         s.defaultReadObject();
 
+        // set hashMask
+        UNSAFE.putIntVolatile(this, HASHSEED_OFFSET,
+                 sun.misc.Hashing.randomHashSeed(this));
+
         // Re-initialize segments to be minimally sized, and let grow.
         int cap = MIN_SEGMENT_TABLE_CAPACITY;
         final Segment<K,V>[] segments = this.segments;
@@ -1500,6 +1518,7 @@
     private static final int SSHIFT;
     private static final long TBASE;
     private static final int TSHIFT;
+    private static final long HASHSEED_OFFSET;
 
     static {
         int ss, ts;
@@ -1511,6 +1530,8 @@
             SBASE = UNSAFE.arrayBaseOffset(sc);
             ts = UNSAFE.arrayIndexScale(tc);
             ss = UNSAFE.arrayIndexScale(sc);
+            HASHSEED_OFFSET = UNSAFE.objectFieldOffset(
+                ConcurrentHashMap.class.getDeclaredField("hashSeed"));
         } catch (Exception e) {
             throw new Error(e);
         }
diff --git a/src/share/classes/javax/swing/JPopupMenu.java b/src/share/classes/javax/swing/JPopupMenu.java
index 7564b9f..10f92946 100644
--- a/src/share/classes/javax/swing/JPopupMenu.java
+++ b/src/share/classes/javax/swing/JPopupMenu.java
@@ -826,7 +826,7 @@
             popupFactory.setPopupType(PopupFactory.LIGHT_WEIGHT_POPUP);
         }
         else {
-            popupFactory.setPopupType(PopupFactory.MEDIUM_WEIGHT_POPUP);
+            popupFactory.setPopupType(PopupFactory.HEAVY_WEIGHT_POPUP);
         }
 
         // adjust the location of the popup
@@ -853,6 +853,11 @@
     /**
      * Sets the location of the upper left corner of the
      * popup menu using x, y coordinates.
+     * <p>
+     * The method changes the geometry-related data. Therefore,
+     * the native windowing system may ignore such requests, or it may modify
+     * the requested data, so that the {@code JPopupMenu} object is placed and sized
+     * in a way that corresponds closely to the desktop settings.
      *
      * @param x the x coordinate of the popup's new position
      *          in the screen's coordinate space
diff --git a/src/share/classes/javax/swing/PopupFactory.java b/src/share/classes/javax/swing/PopupFactory.java
index 713ada7..13a1f9d 100644
--- a/src/share/classes/javax/swing/PopupFactory.java
+++ b/src/share/classes/javax/swing/PopupFactory.java
@@ -203,12 +203,6 @@
                     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();
         }
diff --git a/src/share/classes/sun/awt/FontConfiguration.java b/src/share/classes/sun/awt/FontConfiguration.java
index 1744d08..a984cc3 100644
--- a/src/share/classes/sun/awt/FontConfiguration.java
+++ b/src/share/classes/sun/awt/FontConfiguration.java
@@ -947,7 +947,7 @@
                     public Object run() {
                         try {
                             return Class.forName(charsetName, true,
-                                                 Thread.currentThread().getContextClassLoader());
+                                                 ClassLoader.getSystemClassLoader());
                         } catch (ClassNotFoundException e) {
                         }
                         return null;
diff --git a/src/share/classes/sun/misc/Hashing.java b/src/share/classes/sun/misc/Hashing.java
new file mode 100644
index 0000000..1659501
--- /dev/null
+++ b/src/share/classes/sun/misc/Hashing.java
@@ -0,0 +1,251 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package sun.misc;
+
+import java.util.Random;
+
+/**
+ * Hashing utilities.
+ *
+ * Little endian implementations of Murmur3 hashing.
+ */
+public class Hashing {
+
+    /**
+     * Static utility methods only.
+     */
+    private Hashing() {
+        throw new Error("No instances");
+    }
+
+    public static int murmur3_32(byte[] data) {
+        return murmur3_32(0, data, 0, data.length);
+    }
+
+    public static int murmur3_32(int seed, byte[] data) {
+        return murmur3_32(seed, data, 0, data.length);
+    }
+
+    @SuppressWarnings("fallthrough")
+    public static int murmur3_32(int seed, byte[] data, int offset, int len) {
+        int h1 = seed;
+        int count = len;
+
+        // body
+        while (count >= 4) {
+            int k1 = (data[offset] & 0x0FF)
+                    | (data[offset + 1] & 0x0FF) << 8
+                    | (data[offset + 2] & 0x0FF) << 16
+                    | data[offset + 3] << 24;
+
+            count -= 4;
+            offset += 4;
+
+            k1 *= 0xcc9e2d51;
+            k1 = Integer.rotateLeft(k1, 15);
+            k1 *= 0x1b873593;
+
+            h1 ^= k1;
+            h1 = Integer.rotateLeft(h1, 13);
+            h1 = h1 * 5 + 0xe6546b64;
+        }
+
+        // tail
+
+        if (count > 0) {
+            int k1 = 0;
+
+            switch (count) {
+                case 3:
+                    k1 ^= (data[offset + 2] & 0xff) << 16;
+                // fall through
+                case 2:
+                    k1 ^= (data[offset + 1] & 0xff) << 8;
+                // fall through
+                case 1:
+                    k1 ^= (data[offset] & 0xff);
+                // fall through
+                default:
+                    k1 *= 0xcc9e2d51;
+                    k1 = Integer.rotateLeft(k1, 15);
+                    k1 *= 0x1b873593;
+                    h1 ^= k1;
+            }
+        }
+
+        // finalization
+
+        h1 ^= len;
+
+        // finalization mix force all bits of a hash block to avalanche
+        h1 ^= h1 >>> 16;
+        h1 *= 0x85ebca6b;
+        h1 ^= h1 >>> 13;
+        h1 *= 0xc2b2ae35;
+        h1 ^= h1 >>> 16;
+
+        return h1;
+    }
+
+    public static int murmur3_32(char[] data) {
+        return murmur3_32(0, data, 0, data.length);
+    }
+
+    public static int murmur3_32(int seed, char[] data) {
+        return murmur3_32(seed, data, 0, data.length);
+    }
+
+    public static int murmur3_32(int seed, char[] data, int offset, int len) {
+        int h1 = seed;
+
+        int off = offset;
+        int count = len;
+
+        // body
+        while (count >= 2) {
+            int k1 = (data[off++] & 0xFFFF) | (data[off++] << 16);
+
+            count -= 2;
+
+            k1 *= 0xcc9e2d51;
+            k1 = Integer.rotateLeft(k1, 15);
+            k1 *= 0x1b873593;
+
+            h1 ^= k1;
+            h1 = Integer.rotateLeft(h1, 13);
+            h1 = h1 * 5 + 0xe6546b64;
+        }
+
+        // tail
+
+        if (count > 0) {
+            int k1 = data[off];
+
+            k1 *= 0xcc9e2d51;
+            k1 = Integer.rotateLeft(k1, 15);
+            k1 *= 0x1b873593;
+            h1 ^= k1;
+        }
+
+        // finalization
+
+        h1 ^= len * (Character.SIZE / Byte.SIZE);
+
+        // finalization mix force all bits of a hash block to avalanche
+        h1 ^= h1 >>> 16;
+        h1 *= 0x85ebca6b;
+        h1 ^= h1 >>> 13;
+        h1 *= 0xc2b2ae35;
+        h1 ^= h1 >>> 16;
+
+        return h1;
+    }
+
+    public static int murmur3_32(int[] data) {
+        return murmur3_32(0, data, 0, data.length);
+    }
+
+    public static int murmur3_32(int seed, int[] data) {
+        return murmur3_32(seed, data, 0, data.length);
+    }
+
+    public static int murmur3_32(int seed, int[] data, int offset, int len) {
+        int h1 = seed;
+
+        int off = offset;
+        int end = offset + len;
+
+        // body
+        while (off < end) {
+            int k1 = data[off++];
+
+            k1 *= 0xcc9e2d51;
+            k1 = Integer.rotateLeft(k1, 15);
+            k1 *= 0x1b873593;
+
+            h1 ^= k1;
+            h1 = Integer.rotateLeft(h1, 13);
+            h1 = h1 * 5 + 0xe6546b64;
+        }
+
+        // tail (always empty, as body is always 32-bit chunks)
+
+        // finalization
+
+        h1 ^= len * (Integer.SIZE / Byte.SIZE);
+
+        // finalization mix force all bits of a hash block to avalanche
+        h1 ^= h1 >>> 16;
+        h1 *= 0x85ebca6b;
+        h1 ^= h1 >>> 13;
+        h1 *= 0xc2b2ae35;
+        h1 ^= h1 >>> 16;
+
+        return h1;
+    }
+
+    /**
+     * Holds references to things that can't be initialized until after VM
+     * is fully booted.
+     */
+    private static class Holder {
+
+        /**
+         * Used for generating per-instance hash seeds.
+         *
+         * We try to improve upon the default seeding.
+         */
+        static final Random SEED_MAKER = new Random(
+                Double.doubleToRawLongBits(Math.random())
+                ^ System.identityHashCode(Hashing.class)
+                ^ System.currentTimeMillis()
+                ^ System.nanoTime()
+                ^ Runtime.getRuntime().freeMemory());
+    }
+
+    public static int randomHashSeed(Object instance) {
+        int seed;
+        if (sun.misc.VM.isBooted()) {
+            seed = Holder.SEED_MAKER.nextInt();
+        } else {
+            // lower quality "random" seed value--still better than zero and not
+            // not practically reversible.
+            int hashing_seed[] = {
+                System.identityHashCode(Hashing.class),
+                System.identityHashCode(instance),
+                System.identityHashCode(Thread.currentThread()),
+                (int) Thread.currentThread().getId(),
+                (int) (System.currentTimeMillis() >>> 2), // resolution is poor
+                (int) (System.nanoTime() >>> 5), // resolution is poor
+                (int) (Runtime.getRuntime().freeMemory() >>> 4) // alloc min
+            };
+
+            seed = murmur3_32(hashing_seed);
+        }
+
+        // force to non-zero.
+        return (0 != seed) ? seed : 1;
+    }
+}
diff --git a/src/share/classes/sun/nio/ch/DatagramChannelImpl.java b/src/share/classes/sun/nio/ch/DatagramChannelImpl.java
index 1a40457..cd65cb9 100644
--- a/src/share/classes/sun/nio/ch/DatagramChannelImpl.java
+++ b/src/share/classes/sun/nio/ch/DatagramChannelImpl.java
@@ -663,7 +663,12 @@
                         throw new AlreadyBoundException();
                     InetSocketAddress isa;
                     if (local == null) {
-                        isa = new InetSocketAddress(0);
+                        // only Inet4Address allowed with IPv4 socket
+                        if (family == StandardProtocolFamily.INET) {
+                            isa = new InetSocketAddress(InetAddress.getByName("0.0.0.0"), 0);
+                        } else {
+                            isa = new InetSocketAddress(0);
+                        }
                     } else {
                         isa = Net.checkAddress(local);
 
diff --git a/src/share/classes/sun/nio/ch/IOUtil.java b/src/share/classes/sun/nio/ch/IOUtil.java
index e5320bc..6b4dc6f 100644
--- a/src/share/classes/sun/nio/ch/IOUtil.java
+++ b/src/share/classes/sun/nio/ch/IOUtil.java
@@ -334,6 +334,8 @@
 
     static native void setfdVal(FileDescriptor fd, int value);
 
+    static native int fdLimit();
+
     static native void initIDs();
 
     static {
diff --git a/src/share/classes/sun/security/krb5/KdcComm.java b/src/share/classes/sun/security/krb5/KdcComm.java
index 281cac4..756beb9 100644
--- a/src/share/classes/sun/security/krb5/KdcComm.java
+++ b/src/share/classes/sun/security/krb5/KdcComm.java
@@ -365,37 +365,36 @@
 
             for (int i=1; i <= retries; i++) {
                 String proto = useTCP?"TCP":"UDP";
-                NetClient kdcClient = NetClient.getInstance(
-                        proto, kdc, port, timeout);
-                if (DEBUG) {
-                    System.out.println(">>> KDCCommunication: kdc=" + kdc
-                           + " " + proto + ":"
-                           +  port +  ", timeout="
-                           + timeout
-                           + ",Attempt =" + i
-                           + ", #bytes=" + obuf.length);
-                }
-                try {
-                    /*
-                     * Send the data to the kdc.
-                     */
-                    kdcClient.send(obuf);
-                    /*
-                     * And get a response.
-                     */
-                    ibuf = kdcClient.receive();
-                    break;
-                } catch (SocketTimeoutException se) {
+                try (NetClient kdcClient = NetClient.getInstance(
+                        proto, kdc, port, timeout)) {
                     if (DEBUG) {
-                        System.out.println ("SocketTimeOutException with " +
-                                            "attempt: " + i);
+                        System.out.println(">>> KDCCommunication: kdc=" + kdc
+                            + " " + proto + ":"
+                            +  port +  ", timeout="
+                            + timeout
+                            + ",Attempt =" + i
+                            + ", #bytes=" + obuf.length);
                     }
-                    if (i == retries) {
-                        ibuf = null;
-                        throw se;
+                    try {
+                        /*
+                        * Send the data to the kdc.
+                        */
+                        kdcClient.send(obuf);
+                        /*
+                        * And get a response.
+                        */
+                        ibuf = kdcClient.receive();
+                        break;
+                    } catch (SocketTimeoutException se) {
+                        if (DEBUG) {
+                            System.out.println ("SocketTimeOutException with " +
+                                                "attempt: " + i);
+                        }
+                        if (i == retries) {
+                            ibuf = null;
+                            throw se;
+                        }
                     }
-                } finally {
-                    kdcClient.close();
                 }
             }
             return ibuf;
diff --git a/src/share/classes/sun/security/krb5/internal/NetClient.java b/src/share/classes/sun/security/krb5/internal/NetClient.java
index 2e9da75..f7f300d 100644
--- a/src/share/classes/sun/security/krb5/internal/NetClient.java
+++ b/src/share/classes/sun/security/krb5/internal/NetClient.java
@@ -34,7 +34,7 @@
 import java.io.*;
 import java.net.*;
 
-public abstract class NetClient {
+public abstract class NetClient implements AutoCloseable {
     public static NetClient getInstance(String protocol, String hostname, int port,
             int timeout) throws IOException {
         if (protocol.equals("TCP")) {
@@ -45,9 +45,7 @@
     }
 
     abstract public void send(byte[] data) throws IOException;
-
     abstract public byte[] receive() throws IOException;
-
     abstract public void close() throws IOException;
 }
 
@@ -190,6 +188,7 @@
         iport = port;
         dgSocket = new DatagramSocket();
         dgSocket.setSoTimeout(timeout);
+        dgSocket.connect(iaddr, iport);
     }
 
     @Override
@@ -207,6 +206,9 @@
             dgSocket.receive(dgPacketIn);
         }
         catch (SocketException e) {
+            if (e instanceof PortUnreachableException) {
+                throw e;
+            }
             dgSocket.receive(dgPacketIn);
         }
         byte[] data = new byte[dgPacketIn.getLength()];
diff --git a/src/share/classes/sun/security/provider/certpath/AdjacencyList.java b/src/share/classes/sun/security/provider/certpath/AdjacencyList.java
index 0001e66..3a4f688 100644
--- a/src/share/classes/sun/security/provider/certpath/AdjacencyList.java
+++ b/src/share/classes/sun/security/provider/certpath/AdjacencyList.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,13 +24,11 @@
  */
 package sun.security.provider.certpath;
 
-
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 
-
 /**
  * An AdjacencyList is used to store the history of certification paths
  * attempted in constructing a path from an initiator to a target. The
@@ -123,124 +121,117 @@
      * at the start.
      */
     private boolean buildList(List<List<Vertex>> theList, int index,
-        BuildStep follow) {
+                              BuildStep follow) {
 
         // Each time this method is called, we're examining a new list
         // from the global list. So, we have to start by getting the list
         // that contains the set of Vertexes we're considering.
         List<Vertex> l = theList.get(index);
 
-        try {
-            // we're interested in the case where all indexes are -1...
-            boolean allNegOne = true;
-            // ...and in the case where every entry has a Throwable
-            boolean allXcps = true;
+        // we're interested in the case where all indexes are -1...
+        boolean allNegOne = true;
+        // ...and in the case where every entry has a Throwable
+        boolean allXcps = true;
+
+        for (Vertex v : l) {
+            if (v.getIndex() != -1) {
+                // count an empty list the same as an index of -1...this
+                // is to patch a bug somewhere in the builder
+                if (theList.get(v.getIndex()).size() != 0)
+                    allNegOne = false;
+            } else {
+                if (v.getThrowable() == null)
+                    allXcps = false;
+            }
+            // every entry, regardless of the final use for it, is always
+            // entered as a possible step before we take any actions
+            mStepList.add(new BuildStep(v, BuildStep.POSSIBLE));
+        }
+
+        if (allNegOne) {
+            // There are two cases that we could be looking at here. We
+            // may need to back up, or the build may have succeeded at
+            // this point. This is based on whether or not any
+            // exceptions were found in the list.
+            if (allXcps) {
+                // we need to go back...see if this is the last one
+                if (follow == null)
+                    mStepList.add(new BuildStep(null, BuildStep.FAIL));
+                else
+                    mStepList.add(new BuildStep(follow.getVertex(),
+                                                BuildStep.BACK));
+
+                return false;
+            } else {
+                // we succeeded...now the only question is which is the
+                // successful step? If there's only one entry without
+                // a throwable, then that's the successful step. Otherwise,
+                // we'll have to make some guesses...
+                List<Vertex> possibles = new ArrayList<>();
+                for (Vertex v : l) {
+                    if (v.getThrowable() == null)
+                        possibles.add(v);
+                }
+
+                if (possibles.size() == 1) {
+                    // real easy...we've found the final Vertex
+                    mStepList.add(new BuildStep(possibles.get(0),
+                                                BuildStep.SUCCEED));
+                } else {
+                    // ok...at this point, there is more than one Cert
+                    // which might be the succeed step...how do we know
+                    // which it is? I'm going to assume that our builder
+                    // algorithm is good enough to know which is the
+                    // correct one, and put it first...but a FIXME goes
+                    // here anyway, and we should be comparing to the
+                    // target/initiator Cert...
+                    mStepList.add(new BuildStep(possibles.get(0),
+                                                BuildStep.SUCCEED));
+                }
+
+                return true;
+            }
+        } else {
+            // There's at least one thing that we can try before we give
+            // up and go back. Run through the list now, and enter a new
+            // BuildStep for each path that we try to follow. If none of
+            // the paths we try produce a successful end, we're going to
+            // have to back out ourselves.
+            boolean success = false;
 
             for (Vertex v : l) {
-                if (v.getIndex() != -1) {
-                    // count an empty list the same as an index of -1...this
-                    // is to patch a bug somewhere in the builder
-                    if (theList.get(v.getIndex()).size() != 0)
-                        allNegOne = false;
-                }
-                else
-                    if (v.getThrowable() == null)
-                        allXcps = false;
 
-                // every entry, regardless of the final use for it, is always
-                // entered as a possible step before we take any actions
-                mStepList.add(new BuildStep(v, BuildStep.POSSIBLE));
+                // Note that we'll only find a SUCCEED case when we're
+                // looking at the last possible path, so we don't need to
+                // consider success in the while loop
+
+                if (v.getIndex() != -1) {
+                    if (theList.get(v.getIndex()).size() != 0) {
+                        // If the entry we're looking at doesn't have an
+                        // index of -1, and doesn't lead to an empty list,
+                        // then it's something we follow!
+                        BuildStep bs = new BuildStep(v, BuildStep.FOLLOW);
+                        mStepList.add(bs);
+                        success = buildList(theList, v.getIndex(), bs);
+                    }
+                }
             }
 
-            if (allNegOne) {
-                // There are two cases that we could be looking at here. We
-                // may need to back up, or the build may have succeeded at
-                // this point. This is based on whether or not any
-                // exceptions were found in the list.
-                if (allXcps) {
-                    // we need to go back...see if this is the last one
-                    if (follow == null)
-                        mStepList.add(new BuildStep(null, BuildStep.FAIL));
-                    else
-                        mStepList.add(new BuildStep(follow.getVertex(),
-                                                    BuildStep.BACK));
-
-                    return false;
-                } else {
-                    // we succeeded...now the only question is which is the
-                    // successful step? If there's only one entry without
-                    // a throwable, then that's the successful step. Otherwise,
-                    // we'll have to make some guesses...
-                    List<Vertex> possibles = new ArrayList<Vertex>();
-                    for (Vertex v : l) {
-                        if (v.getThrowable() == null)
-                            possibles.add(v);
-                    }
-
-                    if (possibles.size() == 1) {
-                        // real easy...we've found the final Vertex
-                        mStepList.add(new BuildStep(possibles.get(0),
-                                                    BuildStep.SUCCEED));
-                    } else {
-                        // ok...at this point, there is more than one Cert
-                        // which might be the succeed step...how do we know
-                        // which it is? I'm going to assume that our builder
-                        // algorithm is good enough to know which is the
-                        // correct one, and put it first...but a FIXME goes
-                        // here anyway, and we should be comparing to the
-                        // target/initiator Cert...
-                        mStepList.add(new BuildStep(possibles.get(0),
-                                                    BuildStep.SUCCEED));
-                    }
-
-                    return true;
-                }
+            if (success) {
+                // We're already finished!
+                return true;
             } else {
-                // There's at least one thing that we can try before we give
-                // up and go back. Run through the list now, and enter a new
-                // BuildStep for each path that we try to follow. If none of
-                // the paths we try produce a successful end, we're going to
-                // have to back out ourselves.
-                boolean success = false;
+                // We failed, and we've exhausted all the paths that we
+                // could take. The only choice is to back ourselves out.
+                if (follow == null)
+                    mStepList.add(new BuildStep(null, BuildStep.FAIL));
+                else
+                    mStepList.add(new BuildStep(follow.getVertex(),
+                                                BuildStep.BACK));
 
-                for (Vertex v : l) {
-
-                    // Note that we'll only find a SUCCEED case when we're
-                    // looking at the last possible path, so we don't need to
-                    // consider success in the while loop
-
-                    if (v.getIndex() != -1) {
-                        if (theList.get(v.getIndex()).size() != 0) {
-                            // If the entry we're looking at doesn't have an
-                            // index of -1, and doesn't lead to an empty list,
-                            // then it's something we follow!
-                            BuildStep bs = new BuildStep(v, BuildStep.FOLLOW);
-                            mStepList.add(bs);
-                            success = buildList(theList, v.getIndex(), bs);
-                        }
-                    }
-                }
-
-                if (success) {
-                    // We're already finished!
-                    return true;
-                } else {
-                    // We failed, and we've exhausted all the paths that we
-                    // could take. The only choice is to back ourselves out.
-                    if (follow == null)
-                        mStepList.add(new BuildStep(null, BuildStep.FAIL));
-                    else
-                        mStepList.add(new BuildStep(follow.getVertex(),
-                                                    BuildStep.BACK));
-
-                    return false;
-                }
+                return false;
             }
         }
-        catch (Exception e) {}
-
-        // we'll never get here, but you know java...
-        return false;
     }
 
     /**
@@ -248,23 +239,20 @@
      *
      * @return String representation
      */
+    @Override
     public String toString() {
-        String out = "[\n";
+        StringBuilder sb = new StringBuilder("[\n");
 
         int i = 0;
         for (List<Vertex> l : mOrigList) {
-            out = out + "LinkedList[" + i++ + "]:\n";
+            sb.append("LinkedList[").append(i++).append("]:\n");
 
             for (Vertex step : l) {
-                try {
-                    out = out + step.toString();
-                    out = out + "\n";
-                }
-                catch (Exception e) { out = out + "No Such Element\n"; }
+                sb.append(step.toString()).append("\n");
             }
         }
-        out = out + "]\n";
+        sb.append("]\n");
 
-        return out;
+        return sb.toString();
     }
 }
diff --git a/src/share/classes/sun/security/provider/certpath/BasicChecker.java b/src/share/classes/sun/security/provider/certpath/BasicChecker.java
index dbc4126..d545877 100644
--- a/src/share/classes/sun/security/provider/certpath/BasicChecker.java
+++ b/src/share/classes/sun/security/provider/certpath/BasicChecker.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -62,7 +62,7 @@
     private static final Debug debug = Debug.getInstance("certpath");
     private final PublicKey trustedPubKey;
     private final X500Principal caName;
-    private final Date testDate;
+    private final Date date;
     private final String sigProvider;
     private final boolean sigOnly;
     private X500Principal prevSubject;
@@ -73,14 +73,13 @@
      *
      * @param anchor the anchor selected to validate the target certificate
      * @param testDate the time for which the validity of the certificate
-     * should be determined
+     *        should be determined
      * @param sigProvider the name of the signature provider
      * @param sigOnly true if only signature checking is to be done;
      *        if false, all checks are done
      */
-    BasicChecker(TrustAnchor anchor, Date testDate, String sigProvider,
-        boolean sigOnly) throws CertPathValidatorException
-    {
+    BasicChecker(TrustAnchor anchor, Date date, String sigProvider,
+                 boolean sigOnly) {
         if (anchor.getTrustedCert() != null) {
             this.trustedPubKey = anchor.getTrustedCert().getPublicKey();
             this.caName = anchor.getTrustedCert().getSubjectX500Principal();
@@ -88,16 +87,16 @@
             this.trustedPubKey = anchor.getCAPublicKey();
             this.caName = anchor.getCA();
         }
-        this.testDate = testDate;
+        this.date = date;
         this.sigProvider = sigProvider;
         this.sigOnly = sigOnly;
-        init(false);
     }
 
     /**
      * Initializes the internal state of the checker from parameters
      * specified in the constructor.
      */
+    @Override
     public void init(boolean forward) throws CertPathValidatorException {
         if (!forward) {
             prevPubKey = trustedPubKey;
@@ -108,10 +107,12 @@
         }
     }
 
+    @Override
     public boolean isForwardCheckingSupported() {
         return false;
     }
 
+    @Override
     public Set<String> getSupportedExtensions() {
         return null;
     }
@@ -124,33 +125,31 @@
      * @param cert the Certificate
      * @param unresolvedCritExts a Collection of the unresolved critical
      * extensions
-     * @exception CertPathValidatorException Exception thrown if certificate
-     * does not verify.
+     * @throws CertPathValidatorException if certificate does not verify
      */
+    @Override
     public void check(Certificate cert, Collection<String> unresolvedCritExts)
         throws CertPathValidatorException
     {
-        X509Certificate currCert = (X509Certificate) cert;
+        X509Certificate currCert = (X509Certificate)cert;
 
         if (!sigOnly) {
-            verifyTimestamp(currCert, testDate);
-            verifyNameChaining(currCert, prevSubject);
+            verifyTimestamp(currCert);
+            verifyNameChaining(currCert);
         }
-        verifySignature(currCert, prevPubKey, sigProvider);
+        verifySignature(currCert);
 
         updateState(currCert);
     }
 
     /**
-     * Verifies the signature on the certificate using the previous public key
-     * @param cert the Certificate
-     * @param prevPubKey the previous PublicKey
-     * @param sigProvider a String containing the signature provider
-     * @exception CertPathValidatorException Exception thrown if certificate
-     * does not verify.
+     * Verifies the signature on the certificate using the previous public key.
+     *
+     * @param cert the X509Certificate
+     * @throws CertPathValidatorException if certificate does not verify
      */
-    private void verifySignature(X509Certificate cert, PublicKey prevPubKey,
-        String sigProvider) throws CertPathValidatorException
+    private void verifySignature(X509Certificate cert)
+        throws CertPathValidatorException
     {
         String msg = "signature";
         if (debug != null)
@@ -162,7 +161,7 @@
             throw new CertPathValidatorException
                 (msg + " check failed", e, null, -1,
                  BasicReason.INVALID_SIGNATURE);
-        } catch (Exception e) {
+        } catch (GeneralSecurityException e) {
             throw new CertPathValidatorException(msg + " check failed", e);
         }
 
@@ -173,7 +172,7 @@
     /**
      * Internal method to verify the timestamp on a certificate
      */
-    private void verifyTimestamp(X509Certificate cert, Date date)
+    private void verifyTimestamp(X509Certificate cert)
         throws CertPathValidatorException
     {
         String msg = "timestamp";
@@ -197,8 +196,8 @@
     /**
      * Internal method to check that cert has a valid DN to be next in a chain
      */
-    private void verifyNameChaining(X509Certificate cert,
-        X500Principal prevSubject) throws CertPathValidatorException
+    private void verifyNameChaining(X509Certificate cert)
+        throws CertPathValidatorException
     {
         if (prevSubject != null) {
 
@@ -207,8 +206,8 @@
                 debug.println("---checking " + msg + "...");
 
             X500Principal currIssuer = cert.getIssuerX500Principal();
-            // reject null or empty issuer DNs
 
+            // reject null or empty issuer DNs
             if (X500Name.asX500Name(currIssuer).isEmpty()) {
                 throw new CertPathValidatorException
                     (msg + " check failed: " +
diff --git a/src/share/classes/sun/security/provider/certpath/BuildStep.java b/src/share/classes/sun/security/provider/certpath/BuildStep.java
index ef3e021..bf06411 100644
--- a/src/share/classes/sun/security/provider/certpath/BuildStep.java
+++ b/src/share/classes/sun/security/provider/certpath/BuildStep.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,6 @@
 
 package sun.security.provider.certpath;
 
-import sun.security.util.Debug;
 import java.security.cert.X509Certificate;
 
 /**
@@ -39,7 +38,6 @@
  */
 public class BuildStep {
 
-    private static final Debug debug = Debug.getInstance("certpath");
     private Vertex          vertex;
     private X509Certificate cert;
     private Throwable       throwable;
@@ -86,7 +84,7 @@
     public BuildStep(Vertex vtx, int res) {
         vertex = vtx;
         if (vertex != null) {
-            cert = (X509Certificate)vertex.getCertificate();
+            cert = vertex.getCertificate();
             throwable = vertex.getThrowable();
         }
         result = res;
@@ -117,7 +115,7 @@
      * @returns String form of issuer name or null, if no certificate.
      */
     public String getIssuerName() {
-        return (cert == null ? null : cert.getIssuerX500Principal().toString());
+        return getIssuerName(null);
     }
 
     /**
@@ -142,7 +140,7 @@
      * @returns String form of subject name or null, if no certificate.
      */
     public String getSubjectName() {
-        return (cert == null ? null : cert.getSubjectX500Principal().toString());
+        return getSubjectName(null);
     }
 
     /**
@@ -191,21 +189,21 @@
     public String resultToString(int res) {
         String resultString = "";
         switch (res) {
-            case BuildStep.POSSIBLE:
+            case POSSIBLE:
                 resultString = "Certificate to be tried.\n";
                 break;
-            case BuildStep.BACK:
+            case BACK:
                 resultString = "Certificate backed out since path does not "
                     + "satisfy build requirements.\n";
                 break;
-            case BuildStep.FOLLOW:
+            case FOLLOW:
                 resultString = "Certificate satisfies conditions.\n";
                 break;
-            case BuildStep.FAIL:
+            case FAIL:
                 resultString = "Certificate backed out since path does not "
                     + "satisfy conditions.\n";
                 break;
-            case BuildStep.SUCCEED:
+            case SUCCEED:
                 resultString = "Certificate satisfies conditions.\n";
                 break;
             default:
@@ -220,6 +218,7 @@
      *
      * @returns String
      */
+    @Override
     public String toString() {
         String out = "Internal Error\n";
         switch (result) {
@@ -273,8 +272,6 @@
      * @returns String
      */
     public String fullToString() {
-        String out = resultToString(getResult());
-        out = out + vertex.toString();
-        return out;
+        return resultToString(getResult()) + vertex.toString();
     }
 }
diff --git a/src/share/classes/sun/security/provider/certpath/Builder.java b/src/share/classes/sun/security/provider/certpath/Builder.java
index 182a0d2..e053b20 100644
--- a/src/share/classes/sun/security/provider/certpath/Builder.java
+++ b/src/share/classes/sun/security/provider/certpath/Builder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,9 +31,8 @@
 import java.security.cert.*;
 import java.util.*;
 
-import javax.security.auth.x500.X500Principal;
-
 import sun.security.action.GetBooleanAction;
+import sun.security.provider.certpath.PKIX.BuilderParams;
 import sun.security.util.Debug;
 import sun.security.x509.GeneralNames;
 import sun.security.x509.GeneralNameInterface;
@@ -56,9 +55,7 @@
 
     private static final Debug debug = Debug.getInstance("certpath");
     private Set<String> matchingPolicies;
-    final PKIXBuilderParameters buildParams;
-    final X500Principal targetSubjectDN;
-    final Date date;
+    final BuilderParams buildParams;
     final X509CertSelector targetCertConstraints;
 
     /**
@@ -74,14 +71,10 @@
      *
      * @param params the parameter set used to build a certification path
      */
-    Builder(PKIXBuilderParameters buildParams, X500Principal targetSubjectDN) {
+    Builder(BuilderParams buildParams) {
         this.buildParams = buildParams;
-        this.targetSubjectDN = targetSubjectDN;
-        // Initialize date if not specified
-        Date paramsDate = buildParams.getDate();
-        this.date = paramsDate != null ? paramsDate : new Date();
         this.targetCertConstraints =
-            (X509CertSelector) buildParams.getTargetCertConstraints();
+            (X509CertSelector)buildParams.targetCertConstraints();
     }
 
     /**
@@ -104,7 +97,8 @@
      * @param certPathList the certPathList generated thus far
      */
     abstract void verifyCert(X509Certificate cert, State currentState,
-        List<X509Certificate> certPathList) throws GeneralSecurityException;
+                             List<X509Certificate> certPathList)
+        throws GeneralSecurityException;
 
     /**
      * Verifies whether the input certificate completes the path.
@@ -123,7 +117,7 @@
      * @param certPathList the certification path list
      */
     abstract void addCertToPath(X509Certificate cert,
-        LinkedList<X509Certificate> certPathList);
+                                LinkedList<X509Certificate> certPathList);
 
     /**
      * Removes final certificate from the certPathList
@@ -147,7 +141,8 @@
      *         is a grandparent, etc.
      */
     static int distance(GeneralNameInterface base,
-        GeneralNameInterface test, int incomparable) {
+                        GeneralNameInterface test, int incomparable)
+    {
         switch (base.constrains(test)) {
         case GeneralNameInterface.NAME_DIFF_TYPE:
             if (debug != null) {
@@ -192,7 +187,8 @@
      *         some number of down hops.
      */
     static int hops(GeneralNameInterface base, GeneralNameInterface test,
-        int incomparable) {
+                    int incomparable)
+    {
         int baseRtest = base.constrains(test);
         switch (baseRtest) {
         case GeneralNameInterface.NAME_DIFF_TYPE:
@@ -282,9 +278,9 @@
      * @throws IOException if certificate does not get closer
      */
     static int targetDistance(NameConstraintsExtension constraints,
-            X509Certificate cert, GeneralNameInterface target)
-            throws IOException {
-
+                              X509Certificate cert, GeneralNameInterface target)
+            throws IOException
+    {
         /* ensure that certificate satisfies existing name constraints */
         if (constraints != null && !constraints.verify(cert)) {
             throw new IOException("certificate does not satisfy existing name "
@@ -295,7 +291,7 @@
         try {
             certImpl = X509CertImpl.toImpl(cert);
         } catch (CertificateException e) {
-            throw (IOException)new IOException("Invalid certificate").initCause(e);
+            throw new IOException("Invalid certificate", e);
         }
         /* see if certificate subject matches target */
         X500Name subject = X500Name.asX500Name(certImpl.getSubjectX500Principal());
@@ -398,13 +394,13 @@
      */
     Set<String> getMatchingPolicies() {
         if (matchingPolicies != null) {
-            Set<String> initialPolicies = buildParams.getInitialPolicies();
+            Set<String> initialPolicies = buildParams.initialPolicies();
             if ((!initialPolicies.isEmpty()) &&
                 (!initialPolicies.contains(PolicyChecker.ANY_POLICY)) &&
-                (buildParams.isPolicyMappingInhibited()))
+                (buildParams.policyMappingInhibited()))
             {
-                initialPolicies.add(PolicyChecker.ANY_POLICY);
-                matchingPolicies = initialPolicies;
+                matchingPolicies = new HashSet<>(initialPolicies);
+                matchingPolicies.add(PolicyChecker.ANY_POLICY);
             } else {
                 // we just return an empty set to make sure that there is
                 // at least a certificate policies extension in the cert
@@ -429,13 +425,15 @@
      * Returns true iff resultCerts changed (a cert was added to the collection)
      */
     boolean addMatchingCerts(X509CertSelector selector,
-            Collection<CertStore> certStores,
-            Collection<X509Certificate> resultCerts, boolean checkAll) {
+                             Collection<CertStore> certStores,
+                             Collection<X509Certificate> resultCerts,
+                             boolean checkAll)
+    {
         X509Certificate targetCert = selector.getCertificate();
         if (targetCert != null) {
             // no need to search CertStores
             if (selector.match(targetCert) && !X509CertImpl.isSelfSigned
-                (targetCert, buildParams.getSigProvider())) {
+                (targetCert, buildParams.sigProvider())) {
                 if (debug != null) {
                     debug.println("Builder.addMatchingCerts: adding target cert");
                 }
@@ -450,7 +448,7 @@
                                         store.getCertificates(selector);
                 for (Certificate cert : certs) {
                     if (!X509CertImpl.isSelfSigned
-                        ((X509Certificate)cert, buildParams.getSigProvider())) {
+                        ((X509Certificate)cert, buildParams.sigProvider())) {
                         if (resultCerts.add((X509Certificate)cert)) {
                             add = true;
                         }
@@ -471,16 +469,4 @@
         }
         return add;
     }
-
-    /**
-     * Returns true if CertStore is local. Currently, returns true if
-     * type is Collection or if it has been initialized with
-     * CollectionCertStoreParameters. A new API method should be added
-     * to CertStore that returns local or remote.
-     */
-    static boolean isLocalCertStore(CertStore certStore) {
-        return (certStore.getType().equals("Collection") ||
-                certStore.getCertStoreParameters() instanceof
-                CollectionCertStoreParameters);
-    }
 }
diff --git a/src/share/classes/sun/security/provider/certpath/CertStoreHelper.java b/src/share/classes/sun/security/provider/certpath/CertStoreHelper.java
index 8670778..7a091c1 100644
--- a/src/share/classes/sun/security/provider/certpath/CertStoreHelper.java
+++ b/src/share/classes/sun/security/provider/certpath/CertStoreHelper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -83,9 +83,8 @@
                                 = (CertStoreHelper)c.newInstance();
                             cache.put(type, csh);
                             return csh;
-                        } catch (InstantiationException e) {
-                            throw new AssertionError(e);
-                        } catch (IllegalAccessException e) {
+                        } catch (InstantiationException |
+                                 IllegalAccessException e) {
                             throw new AssertionError(e);
                         }
                     }
diff --git a/src/share/classes/sun/security/provider/certpath/CollectionCertStore.java b/src/share/classes/sun/security/provider/certpath/CollectionCertStore.java
index 54c47c8..f991434 100644
--- a/src/share/classes/sun/security/provider/certpath/CollectionCertStore.java
+++ b/src/share/classes/sun/security/provider/certpath/CollectionCertStore.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,6 @@
 import java.util.Collection;
 import java.util.ConcurrentModificationException;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.security.cert.CertSelector;
 import java.security.cert.CertStore;
 import java.security.cert.CertStoreException;
@@ -114,6 +113,7 @@
      *         match the specified selector
      * @throws CertStoreException if an exception occurs
      */
+    @Override
     public Collection<Certificate> engineGetCertificates
             (CertSelector selector) throws CertStoreException {
         if (coll == null) {
@@ -122,18 +122,15 @@
         // Tolerate a few ConcurrentModificationExceptions
         for (int c = 0; c < 10; c++) {
             try {
-                HashSet<Certificate> result = new HashSet<Certificate>();
-                Iterator<?> i = coll.iterator();
+                HashSet<Certificate> result = new HashSet<>();
                 if (selector != null) {
-                    while (i.hasNext()) {
-                        Object o = i.next();
+                    for (Object o : coll) {
                         if ((o instanceof Certificate) &&
                             selector.match((Certificate) o))
                             result.add((Certificate)o);
                     }
                 } else {
-                    while (i.hasNext()) {
-                        Object o = i.next();
+                    for (Object o : coll) {
                         if (o instanceof Certificate)
                             result.add((Certificate)o);
                     }
@@ -157,6 +154,7 @@
      *         match the specified selector
      * @throws CertStoreException if an exception occurs
      */
+    @Override
     public Collection<CRL> engineGetCRLs(CRLSelector selector)
         throws CertStoreException
     {
@@ -166,22 +164,19 @@
         // Tolerate a few ConcurrentModificationExceptions
         for (int c = 0; c < 10; c++) {
             try {
-                HashSet<CRL> result = new HashSet<CRL>();
-                Iterator<?> i = coll.iterator();
+                HashSet<CRL> result = new HashSet<>();
                 if (selector != null) {
-                    while (i.hasNext()) {
-                        Object o = i.next();
+                    for (Object o : coll) {
                         if ((o instanceof CRL) && selector.match((CRL) o))
                             result.add((CRL)o);
                     }
                 } else {
-                    while (i.hasNext()) {
-                        Object o = i.next();
+                    for (Object o : coll) {
                         if (o instanceof CRL)
                             result.add((CRL)o);
                     }
                 }
-                return(result);
+                return result;
             } catch (ConcurrentModificationException e) { }
         }
         throw new ConcurrentModificationException("Too many "
diff --git a/src/share/classes/sun/security/provider/certpath/ConstraintsChecker.java b/src/share/classes/sun/security/provider/certpath/ConstraintsChecker.java
index d393ac1..a08c990 100644
--- a/src/share/classes/sun/security/provider/certpath/ConstraintsChecker.java
+++ b/src/share/classes/sun/security/provider/certpath/ConstraintsChecker.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,19 +25,20 @@
 
 package sun.security.provider.certpath;
 
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Set;
-import java.util.HashSet;
 import java.io.IOException;
 import java.security.cert.Certificate;
 import java.security.cert.CertificateException;
 import java.security.cert.CertPathValidatorException;
-import java.security.cert.X509Certificate;
 import java.security.cert.PKIXCertPathChecker;
 import java.security.cert.PKIXReason;
+import java.security.cert.X509Certificate;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
 import sun.security.util.Debug;
-import sun.security.x509.PKIXExtensions;
+import static sun.security.x509.PKIXExtensions.*;
 import sun.security.x509.NameConstraintsExtension;
 import sun.security.x509.X509CertImpl;
 
@@ -66,13 +67,12 @@
      * Creates a ConstraintsChecker.
      *
      * @param certPathLength the length of the certification path
-     * @throws CertPathValidatorException if the checker cannot be initialized
      */
-    ConstraintsChecker(int certPathLength) throws CertPathValidatorException {
+    ConstraintsChecker(int certPathLength) {
         this.certPathLength = certPathLength;
-        init(false);
     }
 
+    @Override
     public void init(boolean forward) throws CertPathValidatorException {
         if (!forward) {
             i = 0;
@@ -84,15 +84,17 @@
         }
     }
 
+    @Override
     public boolean isForwardCheckingSupported() {
         return false;
     }
 
+    @Override
     public Set<String> getSupportedExtensions() {
         if (supportedExts == null) {
-            supportedExts = new HashSet<String>();
-            supportedExts.add(PKIXExtensions.BasicConstraints_Id.toString());
-            supportedExts.add(PKIXExtensions.NameConstraints_Id.toString());
+            supportedExts = new HashSet<String>(2);
+            supportedExts.add(BasicConstraints_Id.toString());
+            supportedExts.add(NameConstraints_Id.toString());
             supportedExts = Collections.unmodifiableSet(supportedExts);
         }
         return supportedExts;
@@ -104,14 +106,15 @@
      *
      * @param cert the <code>Certificate</code> to be checked
      * @param unresCritExts a <code>Collection</code> of OID strings
-     * representing the current set of unresolved critical extensions
+     *        representing the current set of unresolved critical extensions
      * @throws CertPathValidatorException if the specified certificate
-     * does not pass the check
+     *         does not pass the check
      */
+    @Override
     public void check(Certificate cert, Collection<String> unresCritExts)
         throws CertPathValidatorException
     {
-        X509Certificate currCert = (X509Certificate) cert;
+        X509Certificate currCert = (X509Certificate)cert;
 
         i++;
         // MUST run NC check second, since it depends on BC check to
@@ -120,8 +123,8 @@
         verifyNameConstraints(currCert);
 
         if (unresCritExts != null && !unresCritExts.isEmpty()) {
-            unresCritExts.remove(PKIXExtensions.BasicConstraints_Id.toString());
-            unresCritExts.remove(PKIXExtensions.NameConstraints_Id.toString());
+            unresCritExts.remove(BasicConstraints_Id.toString());
+            unresCritExts.remove(NameConstraints_Id.toString());
         }
     }
 
@@ -166,9 +169,9 @@
     /**
      * Helper to fold sets of name constraints together
      */
-    static NameConstraintsExtension
-        mergeNameConstraints(X509Certificate currCert,
-            NameConstraintsExtension prevNC) throws CertPathValidatorException
+    static NameConstraintsExtension mergeNameConstraints(
+        X509Certificate currCert, NameConstraintsExtension prevNC)
+        throws CertPathValidatorException
     {
         X509CertImpl currCertImpl;
         try {
@@ -197,7 +200,7 @@
                 // Make sure we do a clone here, because we're probably
                 // going to modify this object later and we don't want to
                 // be sharing it with a Certificate object!
-                return (NameConstraintsExtension) newConstraints.clone();
+                return (NameConstraintsExtension)newConstraints.clone();
             }
         } else {
             try {
diff --git a/src/share/classes/sun/security/provider/certpath/CrlRevocationChecker.java b/src/share/classes/sun/security/provider/certpath/CrlRevocationChecker.java
deleted file mode 100644
index 8552e630..0000000
--- a/src/share/classes/sun/security/provider/certpath/CrlRevocationChecker.java
+++ /dev/null
@@ -1,785 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.security.provider.certpath;
-
-import java.math.BigInteger;
-import java.util.Arrays;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.Iterator;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.NoSuchAlgorithmException;
-import java.security.PublicKey;
-import java.security.cert.*;
-import java.security.cert.CertPathValidatorException.BasicReason;
-import java.security.interfaces.DSAPublicKey;
-import sun.security.util.Debug;
-import sun.security.x509.AccessDescription;
-import sun.security.x509.AuthorityInfoAccessExtension;
-import sun.security.x509.CRLDistributionPointsExtension;
-import sun.security.x509.DistributionPoint;
-import sun.security.x509.GeneralName;
-import sun.security.x509.GeneralNames;
-import sun.security.x509.PKIXExtensions;
-import sun.security.x509.X500Name;
-import sun.security.x509.X509CertImpl;
-import sun.security.x509.X509CRLEntryImpl;
-
-/**
- * CrlRevocationChecker is a <code>PKIXCertPathChecker</code> that checks
- * revocation status information on a PKIX certificate using CRLs obtained
- * from one or more <code>CertStores</code>. This is based on section 6.3
- * of RFC 3280 (http://www.ietf.org/rfc/rfc3280.txt).
- *
- * @since       1.4
- * @author      Seth Proctor
- * @author      Steve Hanna
- */
-class CrlRevocationChecker extends PKIXCertPathChecker {
-
-    private static final Debug debug = Debug.getInstance("certpath");
-    private final TrustAnchor mAnchor;
-    private final List<CertStore> mStores;
-    private final String mSigProvider;
-    private final Date mCurrentTime;
-    private PublicKey mPrevPubKey;
-    private boolean mCRLSignFlag;
-    private HashSet<X509CRL> mPossibleCRLs;
-    private HashSet<X509CRL> mApprovedCRLs;
-    private final PKIXParameters mParams;
-    private static final boolean [] mCrlSignUsage =
-        { false, false, false, false, false, false, true };
-    private static final boolean[] ALL_REASONS =
-        {true, true, true, true, true, true, true, true, true};
-    private boolean mOnlyEECert = false;
-
-    // Maximum clock skew in milliseconds (15 minutes) allowed when checking
-    // validity of CRLs
-    private static final long MAX_CLOCK_SKEW = 900000;
-
-    /**
-     * Creates a <code>CrlRevocationChecker</code>.
-     *
-     * @param anchor anchor selected to validate the target certificate
-     * @param params <code>PKIXParameters</code> to be used for
-     *               finding certificates and CRLs, etc.
-     */
-    CrlRevocationChecker(TrustAnchor anchor, PKIXParameters params)
-        throws CertPathValidatorException
-    {
-        this(anchor, params, null);
-    }
-
-    /**
-     * Creates a <code>CrlRevocationChecker</code>, allowing
-     * extra certificates to be supplied beyond those contained
-     * in the <code>PKIXParameters</code>.
-     *
-     * @param anchor anchor selected to validate the target certificate
-     * @param params <code>PKIXParameters</code> to be used for
-     *               finding certificates and CRLs, etc.
-     * @param certs a <code>Collection</code> of certificates
-     *              that may be useful, beyond those available
-     *              through <code>params</code> (<code>null</code>
-     *              if none)
-     */
-    CrlRevocationChecker(TrustAnchor anchor, PKIXParameters params,
-        Collection<X509Certificate> certs) throws CertPathValidatorException
-    {
-        this(anchor, params, certs, false);
-    }
-
-    CrlRevocationChecker(TrustAnchor anchor, PKIXParameters params,
-        Collection<X509Certificate> certs, boolean onlyEECert)
-        throws CertPathValidatorException {
-        mAnchor = anchor;
-        mParams = params;
-        mStores = new ArrayList<CertStore>(params.getCertStores());
-        mSigProvider = params.getSigProvider();
-        if (certs != null) {
-            try {
-                mStores.add(CertStore.getInstance("Collection",
-                    new CollectionCertStoreParameters(certs)));
-            } catch (Exception e) {
-                // should never occur but not necessarily fatal, so log it,
-                // ignore and continue
-                if (debug != null) {
-                    debug.println("CrlRevocationChecker: " +
-                        "error creating Collection CertStore: " + e);
-                }
-            }
-        }
-        Date testDate = params.getDate();
-        mCurrentTime = (testDate != null ? testDate : new Date());
-        mOnlyEECert = onlyEECert;
-        init(false);
-    }
-
-    /**
-     * Initializes the internal state of the checker from parameters
-     * specified in the constructor
-     */
-    public void init(boolean forward) throws CertPathValidatorException
-    {
-        if (!forward) {
-            if (mAnchor != null) {
-                if (mAnchor.getCAPublicKey() != null) {
-                    mPrevPubKey = mAnchor.getCAPublicKey();
-                } else {
-                    mPrevPubKey = mAnchor.getTrustedCert().getPublicKey();
-                }
-            } else {
-                mPrevPubKey = null;
-            }
-            mCRLSignFlag = true;
-        } else {
-            throw new CertPathValidatorException("forward checking "
-                                + "not supported");
-        }
-    }
-
-    public boolean isForwardCheckingSupported() {
-        return false;
-    }
-
-    public Set<String> getSupportedExtensions() {
-        return null;
-    }
-
-    /**
-     * Performs the revocation status check on the certificate using
-     * its internal state.
-     *
-     * @param cert the Certificate
-     * @param unresolvedCritExts a Collection of the unresolved critical
-     * extensions
-     * @exception CertPathValidatorException Exception thrown if
-     * certificate does not verify
-     */
-    public void check(Certificate cert, Collection<String> unresolvedCritExts)
-        throws CertPathValidatorException
-    {
-        X509Certificate currCert = (X509Certificate) cert;
-        verifyRevocationStatus(currCert, mPrevPubKey, mCRLSignFlag, true);
-
-        // Make new public key if parameters are missing
-        PublicKey cKey = currCert.getPublicKey();
-        if (cKey instanceof DSAPublicKey &&
-            ((DSAPublicKey)cKey).getParams() == null) {
-            // cKey needs to inherit DSA parameters from prev key
-            cKey = BasicChecker.makeInheritedParamsKey(cKey, mPrevPubKey);
-        }
-        mPrevPubKey = cKey;
-        mCRLSignFlag = certCanSignCrl(currCert);
-    }
-
-    /**
-     * Performs the revocation status check on the certificate using
-     * the provided state variables, as well as the constant internal
-     * data.
-     *
-     * @param currCert the Certificate
-     * @param prevKey the previous PublicKey in the chain
-     * @param signFlag a boolean as returned from the last call, or true
-     * if this is the first cert in the chain
-     * @return a boolean specifying if the cert is allowed to vouch for the
-     * validity of a CRL for the next iteration
-     * @exception CertPathValidatorException Exception thrown if
-     *            certificate does not verify.
-     */
-    public boolean check(X509Certificate currCert, PublicKey prevKey,
-        boolean signFlag) throws CertPathValidatorException
-    {
-        verifyRevocationStatus(currCert, prevKey, signFlag, true);
-        return certCanSignCrl(currCert);
-    }
-
-    /**
-     * Checks that a cert can be used to verify a CRL.
-     *
-     * @param currCert an X509Certificate to check
-     * @return a boolean specifying if the cert is allowed to vouch for the
-     * validity of a CRL
-     */
-    static boolean certCanSignCrl(X509Certificate currCert) {
-        // if the cert doesn't include the key usage ext, or
-        // the key usage ext asserts cRLSigning, return true,
-        // otherwise return false.
-        boolean[] kbools = currCert.getKeyUsage();
-        if (kbools != null) {
-            return kbools[6];
-        }
-        return false;
-    }
-
-    /**
-     * Internal method to start the verification of a cert
-     */
-    private void verifyRevocationStatus(X509Certificate currCert,
-        PublicKey prevKey, boolean signFlag, boolean allowSeparateKey)
-        throws CertPathValidatorException
-    {
-        verifyRevocationStatus(currCert, prevKey, signFlag,
-                   allowSeparateKey, null, mParams.getTrustAnchors());
-    }
-
-    /**
-     * Internal method to start the verification of a cert
-     * @param stackedCerts a <code>Set</code> of <code>X509Certificate</code>s>
-     *                     whose revocation status depends on the
-     *                     non-revoked status of this cert. To avoid
-     *                     circular dependencies, we assume they're
-     *                     revoked while checking the revocation
-     *                     status of this cert.
-     * @param trustAnchors a <code>Set</code> of <code>TrustAnchor</code>s
-     */
-    private void verifyRevocationStatus(X509Certificate currCert,
-        PublicKey prevKey, boolean signFlag, boolean allowSeparateKey,
-        Set<X509Certificate> stackedCerts,
-        Set<TrustAnchor> trustAnchors) throws CertPathValidatorException {
-
-        String msg = "revocation status";
-        if (debug != null) {
-            debug.println("CrlRevocationChecker.verifyRevocationStatus()" +
-                " ---checking " + msg + "...");
-        }
-
-        if (mOnlyEECert && currCert.getBasicConstraints() != -1) {
-            if (debug != null) {
-                debug.println("Skipping revocation check, not end entity cert");
-            }
-            return;
-        }
-
-        // reject circular dependencies - RFC 3280 is not explicit on how
-        // to handle this, so we feel it is safest to reject them until
-        // the issue is resolved in the PKIX WG.
-        if ((stackedCerts != null) && stackedCerts.contains(currCert)) {
-            if (debug != null) {
-                debug.println("CrlRevocationChecker.verifyRevocationStatus()" +
-                    " circular dependency");
-            }
-            throw new CertPathValidatorException
-                ("Could not determine revocation status", null, null, -1,
-                 BasicReason.UNDETERMINED_REVOCATION_STATUS);
-        }
-
-        // init the state for this run
-        mPossibleCRLs = new HashSet<X509CRL>();
-        mApprovedCRLs = new HashSet<X509CRL>();
-        boolean[] reasonsMask = new boolean[9];
-
-        try {
-            X509CRLSelector sel = new X509CRLSelector();
-            sel.setCertificateChecking(currCert);
-            CertPathHelper.setDateAndTime(sel, mCurrentTime, MAX_CLOCK_SKEW);
-
-            for (CertStore mStore : mStores) {
-                for (java.security.cert.CRL crl : mStore.getCRLs(sel)) {
-                    mPossibleCRLs.add((X509CRL)crl);
-                }
-            }
-            DistributionPointFetcher store =
-                DistributionPointFetcher.getInstance();
-            // all CRLs returned by the DP Fetcher have also been verified
-            mApprovedCRLs.addAll(store.getCRLs(sel, signFlag, prevKey,
-                mSigProvider, mStores, reasonsMask, trustAnchors,
-                mParams.getDate()));
-        } catch (Exception e) {
-            if (debug != null) {
-                debug.println("CrlRevocationChecker.verifyRevocationStatus() "
-                    + "unexpected exception: " + e.getMessage());
-            }
-            throw new CertPathValidatorException(e);
-        }
-
-        if (debug != null) {
-            debug.println("CrlRevocationChecker.verifyRevocationStatus() " +
-                "crls.size() = " + mPossibleCRLs.size());
-        }
-        if (!mPossibleCRLs.isEmpty()) {
-            // Now that we have a list of possible CRLs, see which ones can
-            // be approved
-            mApprovedCRLs.addAll(verifyPossibleCRLs(mPossibleCRLs, currCert,
-                signFlag, prevKey, reasonsMask, trustAnchors));
-        }
-        if (debug != null) {
-            debug.println("CrlRevocationChecker.verifyRevocationStatus() " +
-                "approved crls.size() = " + mApprovedCRLs.size());
-        }
-
-        // make sure that we have at least one CRL that _could_ cover
-        // the certificate in question and all reasons are covered
-        if (mApprovedCRLs.isEmpty() ||
-            !Arrays.equals(reasonsMask, ALL_REASONS)) {
-            if (allowSeparateKey) {
-                verifyWithSeparateSigningKey(currCert, prevKey, signFlag,
-                                             stackedCerts);
-                return;
-            } else {
-                throw new CertPathValidatorException
-                ("Could not determine revocation status", null, null, -1,
-                 BasicReason.UNDETERMINED_REVOCATION_STATUS);
-            }
-        }
-
-        // See if the cert is in the set of approved crls.
-        if (debug != null) {
-            BigInteger sn = currCert.getSerialNumber();
-            debug.println("CrlRevocationChecker.verifyRevocationStatus() " +
-                            "starting the final sweep...");
-            debug.println("CrlRevocationChecker.verifyRevocationStatus" +
-                            " cert SN: " + sn.toString());
-        }
-
-        CRLReason reasonCode = CRLReason.UNSPECIFIED;
-        X509CRLEntryImpl entry = null;
-        for (X509CRL crl : mApprovedCRLs) {
-            X509CRLEntry e = crl.getRevokedCertificate(currCert);
-            if (e != null) {
-                try {
-                    entry = X509CRLEntryImpl.toImpl(e);
-                } catch (CRLException ce) {
-                    throw new CertPathValidatorException(ce);
-                }
-                if (debug != null) {
-                    debug.println("CrlRevocationChecker.verifyRevocationStatus"
-                        + " CRL entry: " + entry.toString());
-                }
-
-                /*
-                 * Abort CRL validation and throw exception if there are any
-                 * unrecognized critical CRL entry extensions (see section
-                 * 5.3 of RFC 3280).
-                 */
-                Set<String> unresCritExts = entry.getCriticalExtensionOIDs();
-                if (unresCritExts != null && !unresCritExts.isEmpty()) {
-                    /* remove any that we will process */
-                    unresCritExts.remove
-                        (PKIXExtensions.ReasonCode_Id.toString());
-                    unresCritExts.remove
-                        (PKIXExtensions.CertificateIssuer_Id.toString());
-                    if (!unresCritExts.isEmpty()) {
-                        if (debug != null) {
-                            debug.println("Unrecognized "
-                            + "critical extension(s) in revoked CRL entry: "
-                            + unresCritExts);
-                        }
-                        throw new CertPathValidatorException
-                        ("Could not determine revocation status", null, null,
-                         -1, BasicReason.UNDETERMINED_REVOCATION_STATUS);
-                    }
-                }
-
-                reasonCode = entry.getRevocationReason();
-                if (reasonCode == null) {
-                    reasonCode = CRLReason.UNSPECIFIED;
-                }
-                Throwable t = new CertificateRevokedException
-                    (entry.getRevocationDate(), reasonCode,
-                     crl.getIssuerX500Principal(), entry.getExtensions());
-                throw new CertPathValidatorException(t.getMessage(), t,
-                    null, -1, BasicReason.REVOKED);
-            }
-        }
-    }
-
-    /**
-     * We have a cert whose revocation status couldn't be verified by
-     * a CRL issued by the cert that issued the CRL. See if we can
-     * find a valid CRL issued by a separate key that can verify the
-     * revocation status of this certificate.
-     * <p>
-     * Note that this does not provide support for indirect CRLs,
-     * only CRLs signed with a different key (but the same issuer
-     * name) as the certificate being checked.
-     *
-     * @param currCert the <code>X509Certificate</code> to be checked
-     * @param prevKey the <code>PublicKey</code> that failed
-     * @param signFlag <code>true</code> if that key was trusted to sign CRLs
-     * @param stackedCerts a <code>Set</code> of <code>X509Certificate</code>s>
-     *                     whose revocation status depends on the
-     *                     non-revoked status of this cert. To avoid
-     *                     circular dependencies, we assume they're
-     *                     revoked while checking the revocation
-     *                     status of this cert.
-     * @throws CertPathValidatorException if the cert's revocation status
-     *         cannot be verified successfully with another key
-     */
-    private void verifyWithSeparateSigningKey(X509Certificate currCert,
-        PublicKey prevKey, boolean signFlag, Set<X509Certificate> stackedCerts)
-        throws CertPathValidatorException {
-        String msg = "revocation status";
-        if (debug != null) {
-            debug.println(
-                "CrlRevocationChecker.verifyWithSeparateSigningKey()" +
-                " ---checking " + msg + "...");
-        }
-
-        // reject circular dependencies - RFC 3280 is not explicit on how
-        // to handle this, so we feel it is safest to reject them until
-        // the issue is resolved in the PKIX WG.
-        if ((stackedCerts != null) && stackedCerts.contains(currCert)) {
-            if (debug != null) {
-                debug.println(
-                    "CrlRevocationChecker.verifyWithSeparateSigningKey()" +
-                    " circular dependency");
-            }
-            throw new CertPathValidatorException
-                ("Could not determine revocation status", null, null,
-                 -1, BasicReason.UNDETERMINED_REVOCATION_STATUS);
-        }
-
-        // If prevKey wasn't trusted, maybe we just didn't have the right
-        // path to it. Don't rule that key out.
-        if (!signFlag) {
-            prevKey = null;
-        }
-
-        // Try to find another key that might be able to sign
-        // CRLs vouching for this cert.
-        buildToNewKey(currCert, prevKey, stackedCerts);
-    }
-
-    /**
-     * Tries to find a CertPath that establishes a key that can be
-     * used to verify the revocation status of a given certificate.
-     * Ignores keys that have previously been tried. Throws a
-     * CertPathValidatorException if no such key could be found.
-     *
-     * @param currCert the <code>X509Certificate</code> to be checked
-     * @param prevKey the <code>PublicKey</code> of the certificate whose key
-     *    cannot be used to vouch for the CRL and should be ignored
-     * @param stackedCerts a <code>Set</code> of <code>X509Certificate</code>s>
-     *                     whose revocation status depends on the
-     *                     establishment of this path.
-     * @throws CertPathValidatorException on failure
-     */
-    private void buildToNewKey(X509Certificate currCert,
-        PublicKey prevKey, Set<X509Certificate> stackedCerts)
-        throws CertPathValidatorException {
-
-        if (debug != null) {
-            debug.println("CrlRevocationChecker.buildToNewKey()" +
-                          " starting work");
-        }
-        Set<PublicKey> badKeys = new HashSet<PublicKey>();
-        if (prevKey != null) {
-            badKeys.add(prevKey);
-        }
-        X509CertSelector certSel = new RejectKeySelector(badKeys);
-        certSel.setSubject(currCert.getIssuerX500Principal());
-        certSel.setKeyUsage(mCrlSignUsage);
-
-        Set<TrustAnchor> newAnchors =
-            (mAnchor == null ? mParams.getTrustAnchors() :
-                                Collections.singleton(mAnchor));
-
-        PKIXBuilderParameters builderParams;
-        if (mParams instanceof PKIXBuilderParameters) {
-            builderParams = (PKIXBuilderParameters) mParams.clone();
-            builderParams.setTargetCertConstraints(certSel);
-            // Policy qualifiers must be rejected, since we don't have
-            // any way to convey them back to the application.
-            builderParams.setPolicyQualifiersRejected(true);
-            try {
-                builderParams.setTrustAnchors(newAnchors);
-            } catch (InvalidAlgorithmParameterException iape) {
-                throw new RuntimeException(iape); // should never occur
-            }
-        } else {
-            // It's unfortunate that there's no easy way to make a
-            // PKIXBuilderParameters object from a PKIXParameters
-            // object. This might miss some things if parameters
-            // are added in the future or the validatorParams object
-            // is a custom class derived from PKIXValidatorParameters.
-            try {
-                builderParams = new PKIXBuilderParameters(newAnchors, certSel);
-            } catch (InvalidAlgorithmParameterException iape) {
-                throw new RuntimeException(iape); // should never occur
-            }
-            builderParams.setInitialPolicies(mParams.getInitialPolicies());
-            builderParams.setCertStores(mStores);
-            builderParams.setExplicitPolicyRequired
-                (mParams.isExplicitPolicyRequired());
-            builderParams.setPolicyMappingInhibited
-                (mParams.isPolicyMappingInhibited());
-            builderParams.setAnyPolicyInhibited(mParams.isAnyPolicyInhibited());
-            // Policy qualifiers must be rejected, since we don't have
-            // any way to convey them back to the application.
-            // That's the default, so no need to write code.
-            builderParams.setDate(mParams.getDate());
-            builderParams.setCertPathCheckers(mParams.getCertPathCheckers());
-            builderParams.setSigProvider(mParams.getSigProvider());
-        }
-
-        // Skip revocation during this build to detect circular
-        // references. But check revocation afterwards, using the
-        // key (or any other that works).
-        builderParams.setRevocationEnabled(false);
-
-        // check for AuthorityInformationAccess extension
-        if (Builder.USE_AIA == true) {
-            X509CertImpl currCertImpl = null;
-            try {
-                currCertImpl = X509CertImpl.toImpl(currCert);
-            } catch (CertificateException ce) {
-                // ignore but log it
-                if (debug != null) {
-                    debug.println("CrlRevocationChecker.buildToNewKey: " +
-                        "error decoding cert: " + ce);
-                }
-            }
-            AuthorityInfoAccessExtension aiaExt = null;
-            if (currCertImpl != null) {
-                aiaExt = currCertImpl.getAuthorityInfoAccessExtension();
-            }
-            if (aiaExt != null) {
-                List<AccessDescription> adList = aiaExt.getAccessDescriptions();
-                if (adList != null) {
-                    for (AccessDescription ad : adList) {
-                        CertStore cs = URICertStore.getInstance(ad);
-                        if (cs != null) {
-                            if (debug != null) {
-                                debug.println("adding AIAext CertStore");
-                            }
-                            builderParams.addCertStore(cs);
-                        }
-                    }
-                }
-            }
-        }
-
-        CertPathBuilder builder = null;
-        try {
-            builder = CertPathBuilder.getInstance("PKIX");
-        } catch (NoSuchAlgorithmException nsae) {
-            throw new CertPathValidatorException(nsae);
-        }
-        while (true) {
-            try {
-                if (debug != null) {
-                    debug.println("CrlRevocationChecker.buildToNewKey()" +
-                                  " about to try build ...");
-                }
-                PKIXCertPathBuilderResult cpbr =
-                    (PKIXCertPathBuilderResult) builder.build(builderParams);
-
-                if (debug != null) {
-                    debug.println("CrlRevocationChecker.buildToNewKey()" +
-                                  " about to check revocation ...");
-                }
-                // Now check revocation of all certs in path, assuming that
-                // the stackedCerts are revoked.
-                if (stackedCerts == null) {
-                    stackedCerts = new HashSet<X509Certificate>();
-                }
-                stackedCerts.add(currCert);
-                TrustAnchor ta = cpbr.getTrustAnchor();
-                PublicKey prevKey2 = ta.getCAPublicKey();
-                if (prevKey2 == null) {
-                    prevKey2 = ta.getTrustedCert().getPublicKey();
-                }
-                boolean signFlag = true;
-                List<? extends Certificate> cpList =
-                    cpbr.getCertPath().getCertificates();
-                try {
-                    for (int i = cpList.size()-1; i >= 0; i-- ) {
-                        X509Certificate cert = (X509Certificate) cpList.get(i);
-
-                        if (debug != null) {
-                            debug.println("CrlRevocationChecker.buildToNewKey()"
-                                + " index " + i + " checking " + cert);
-                        }
-                        verifyRevocationStatus(cert, prevKey2, signFlag, true,
-                                stackedCerts, newAnchors);
-                        signFlag = certCanSignCrl(cert);
-                        prevKey2 = cert.getPublicKey();
-                    }
-                } catch (CertPathValidatorException cpve) {
-                    // ignore it and try to get another key
-                    badKeys.add(cpbr.getPublicKey());
-                    continue;
-                }
-
-                if (debug != null) {
-                    debug.println("CrlRevocationChecker.buildToNewKey()" +
-                                  " got key " + cpbr.getPublicKey());
-                }
-                // Now check revocation on the current cert using that key.
-                // If it doesn't check out, try to find a different key.
-                // And if we can't find a key, then return false.
-                PublicKey newKey = cpbr.getPublicKey();
-                try {
-                    verifyRevocationStatus(currCert, newKey, true, false);
-                    // If that passed, the cert is OK!
-                    return;
-                } catch (CertPathValidatorException cpve) {
-                    // If it is revoked, rethrow exception
-                    if (cpve.getReason() == BasicReason.REVOKED) {
-                        throw cpve;
-                    }
-                    // Otherwise, ignore the exception and
-                    // try to get another key.
-                }
-                badKeys.add(newKey);
-            } catch (InvalidAlgorithmParameterException iape) {
-                throw new CertPathValidatorException(iape);
-            } catch (CertPathBuilderException cpbe) {
-                throw new CertPathValidatorException
-                    ("Could not determine revocation status", null, null,
-                     -1, BasicReason.UNDETERMINED_REVOCATION_STATUS);
-            }
-        }
-    }
-
-    /*
-     * This inner class extends the X509CertSelector to add an additional
-     * check to make sure the subject public key isn't on a particular list.
-     * This class is used by buildToNewKey() to make sure the builder doesn't
-     * end up with a CertPath to a public key that has already been rejected.
-     */
-    private static class RejectKeySelector extends X509CertSelector {
-        private final Set<PublicKey> badKeySet;
-
-        /**
-         * Creates a new <code>RejectKeySelector</code>.
-         *
-         * @param badPublicKeys a <code>Set</code> of
-         *                      <code>PublicKey</code>s that
-         *                      should be rejected (or <code>null</code>
-         *                      if no such check should be done)
-         */
-        RejectKeySelector(Set<PublicKey> badPublicKeys) {
-            this.badKeySet = badPublicKeys;
-        }
-
-        /**
-         * Decides whether a <code>Certificate</code> should be selected.
-         *
-         * @param cert the <code>Certificate</code> to be checked
-         * @return <code>true</code> if the <code>Certificate</code> should be
-         *         selected, <code>false</code> otherwise
-         */
-        public boolean match(Certificate cert) {
-            if (!super.match(cert))
-                return(false);
-
-            if (badKeySet.contains(cert.getPublicKey())) {
-                if (debug != null)
-                    debug.println("RejectCertSelector.match: bad key");
-                return false;
-            }
-
-            if (debug != null)
-                debug.println("RejectCertSelector.match: returning true");
-            return true;
-        }
-
-        /**
-         * Return a printable representation of the <code>CertSelector</code>.
-         *
-         * @return a <code>String</code> describing the contents of the
-         *         <code>CertSelector</code>
-         */
-        public String toString() {
-            StringBuilder sb = new StringBuilder();
-            sb.append("RejectCertSelector: [\n");
-            sb.append(super.toString());
-            sb.append(badKeySet);
-            sb.append("]");
-            return sb.toString();
-        }
-    }
-
-    /**
-     * Internal method that verifies a set of possible_crls,
-     * and sees if each is approved, based on the cert.
-     *
-     * @param crls a set of possible CRLs to test for acceptability
-     * @param cert the certificate whose revocation status is being checked
-     * @param signFlag <code>true</code> if prevKey was trusted to sign CRLs
-     * @param prevKey the public key of the issuer of cert
-     * @param reasonsMask the reason code mask
-     * @param trustAnchors a <code>Set</code> of <code>TrustAnchor</code>s>
-     * @return a collection of approved crls (or an empty collection)
-     */
-    private Collection<X509CRL> verifyPossibleCRLs(Set<X509CRL> crls,
-        X509Certificate cert, boolean signFlag, PublicKey prevKey,
-        boolean[] reasonsMask,
-        Set<TrustAnchor> trustAnchors) throws CertPathValidatorException {
-
-        try {
-            X509CertImpl certImpl = X509CertImpl.toImpl(cert);
-            if (debug != null) {
-                debug.println("CRLRevocationChecker.verifyPossibleCRLs: " +
-                        "Checking CRLDPs for "
-                        + certImpl.getSubjectX500Principal());
-            }
-            CRLDistributionPointsExtension ext =
-                certImpl.getCRLDistributionPointsExtension();
-            List<DistributionPoint> points = null;
-            if (ext == null) {
-                // assume a DP with reasons and CRLIssuer fields omitted
-                // and a DP name of the cert issuer.
-                // TODO add issuerAltName too
-                X500Name certIssuer = (X500Name)certImpl.getIssuerDN();
-                DistributionPoint point = new DistributionPoint
-                    (new GeneralNames().add(new GeneralName(certIssuer)),
-                     null, null);
-                points = Collections.singletonList(point);
-            } else {
-                points = ext.get(CRLDistributionPointsExtension.POINTS);
-            }
-            Set<X509CRL> results = new HashSet<X509CRL>();
-            DistributionPointFetcher dpf =
-                DistributionPointFetcher.getInstance();
-            for (Iterator<DistributionPoint> t = points.iterator();
-                 t.hasNext() && !Arrays.equals(reasonsMask, ALL_REASONS); ) {
-                DistributionPoint point = t.next();
-                for (X509CRL crl : crls) {
-                    if (dpf.verifyCRL(certImpl, point, crl, reasonsMask,
-                            signFlag, prevKey, mSigProvider,
-                            trustAnchors, mStores, mParams.getDate())) {
-                        results.add(crl);
-                    }
-                }
-            }
-            return results;
-        } catch (Exception e) {
-            if (debug != null) {
-                debug.println("Exception while verifying CRL: "+e.getMessage());
-                e.printStackTrace();
-            }
-            return Collections.emptySet();
-        }
-    }
-}
diff --git a/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java b/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java
index b335557..f556200 100644
--- a/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java
+++ b/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,14 +27,14 @@
 
 import java.io.*;
 import java.net.URI;
-import java.util.*;
 import java.security.*;
 import java.security.cert.*;
 import javax.security.auth.x500.X500Principal;
+import java.util.*;
 
-import sun.security.action.GetBooleanAction;
 import sun.security.util.Debug;
 import sun.security.util.DerOutputStream;
+import static sun.security.x509.PKIXExtensions.*;
 import sun.security.x509.*;
 
 /**
@@ -58,44 +58,23 @@
         {true, true, true, true, true, true, true, true, true};
 
     /**
-     * Flag indicating whether support for the CRL distribution point
-     * extension shall be enabled. Currently disabled by default for
-     * compatibility and legal reasons.
-     */
-    private final static boolean USE_CRLDP = AccessController.doPrivileged
-        (new GetBooleanAction("com.sun.security.enableCRLDP"));
-
-    // singleton instance
-    private static final DistributionPointFetcher INSTANCE =
-        new DistributionPointFetcher();
-
-    /**
      * Private instantiation only.
      */
     private DistributionPointFetcher() {}
 
     /**
-     * Return a DistributionPointFetcher instance.
-     */
-    static DistributionPointFetcher getInstance() {
-        return INSTANCE;
-    }
-
-    /**
      * Return the X509CRLs matching this selector. The selector must be
      * an X509CRLSelector with certificateChecking set.
-     *
-     * If CRLDP support is disabled, this method always returns an
-     * empty set.
      */
-    Collection<X509CRL> getCRLs(X509CRLSelector selector, boolean signFlag,
-        PublicKey prevKey, String provider, List<CertStore> certStores,
-        boolean[] reasonsMask, Set<TrustAnchor> trustAnchors,
-        Date validity) throws CertStoreException {
-
-        if (USE_CRLDP == false) {
-            return Collections.emptySet();
-        }
+    static Collection<X509CRL> getCRLs(X509CRLSelector selector,
+                                       boolean signFlag, PublicKey prevKey,
+                                       String provider,
+                                       List<CertStore> certStores,
+                                       boolean[] reasonsMask,
+                                       Set<TrustAnchor> trustAnchors,
+                                       Date validity)
+        throws CertStoreException
+    {
         X509Certificate cert = selector.getCertificateChecking();
         if (cert == null) {
             return Collections.emptySet();
@@ -116,7 +95,7 @@
             }
             List<DistributionPoint> points =
                     ext.get(CRLDistributionPointsExtension.POINTS);
-            Set<X509CRL> results = new HashSet<X509CRL>();
+            Set<X509CRL> results = new HashSet<>();
             for (Iterator<DistributionPoint> t = points.iterator();
                  t.hasNext() && !Arrays.equals(reasonsMask, ALL_REASONS); ) {
                 DistributionPoint point = t.next();
@@ -129,9 +108,7 @@
                 debug.println("Returning " + results.size() + " CRLs");
             }
             return results;
-        } catch (CertificateException e) {
-            return Collections.emptySet();
-        } catch (IOException e) {
+        } catch (CertificateException | IOException e) {
             return Collections.emptySet();
         }
     }
@@ -140,7 +117,7 @@
      * Download CRLs from the given distribution point, verify and return them.
      * See the top of the class for current limitations.
      */
-    private Collection<X509CRL> getCRLs(X509CRLSelector selector,
+    private static Collection<X509CRL> getCRLs(X509CRLSelector selector,
         X509CertImpl certImpl, DistributionPoint point, boolean[] reasonsMask,
         boolean signFlag, PublicKey prevKey, String provider,
         List<CertStore> certStores, Set<TrustAnchor> trustAnchors,
@@ -200,7 +177,7 @@
                         certStores, validity)) {
                     crls.add(crl);
                 }
-            } catch (Exception e) {
+            } catch (IOException | CRLException e) {
                 // don't add the CRL
                 if (debug != null) {
                     debug.println("Exception verifying CRL: " + e.getMessage());
@@ -214,7 +191,7 @@
     /**
      * Download CRL from given URI.
      */
-    private X509CRL getCRL(URIName name) {
+    private static X509CRL getCRL(URIName name) {
         URI uri = name.getURI();
         if (debug != null) {
             debug.println("Trying to fetch CRL from DP " + uri);
@@ -240,7 +217,7 @@
     /**
      * Fetch CRLs from certStores.
      */
-    private Collection<X509CRL> getCRLs(X500Name name,
+    private static Collection<X509CRL> getCRLs(X500Name name,
         X500Principal certIssuer, List<CertStore> certStores)
     {
         if (debug != null) {
@@ -249,7 +226,7 @@
         X509CRLSelector xcs = new X509CRLSelector();
         xcs.addIssuer(name.asX500Principal());
         xcs.addIssuer(certIssuer);
-        Collection<X509CRL> crls = new ArrayList<X509CRL>();
+        Collection<X509CRL> crls = new ArrayList<>();
         for (CertStore store : certStores) {
             try {
                 for (CRL crl : store.getCRLs(xcs)) {
@@ -285,7 +262,7 @@
      *        certification path should be determined
      * @return true if ok, false if not
      */
-    boolean verifyCRL(X509CertImpl certImpl, DistributionPoint point,
+    static boolean verifyCRL(X509CertImpl certImpl, DistributionPoint point,
         X509CRL crl, boolean[] reasonsMask, boolean signFlag,
         PublicKey prevKey, String provider,
         Set<TrustAnchor> trustAnchors, List<CertStore> certStores,
@@ -340,9 +317,9 @@
         } else {
             // in case of self-issued indirect CRL issuer.
             byte[] certAKID = certImpl.getExtensionValue(
-                                PKIXExtensions.AuthorityKey_Id.toString());
+                                AuthorityKey_Id.toString());
             byte[] crlAKID = crlImpl.getExtensionValue(
-                                PKIXExtensions.AuthorityKey_Id.toString());
+                                AuthorityKey_Id.toString());
 
             if (certAKID == null || crlAKID == null) {
                 // cannot recognize indirect CRL without AKID
@@ -539,7 +516,7 @@
         // verify that interim reasons mask includes one or more reasons
         // not included in the reasons mask
         boolean oneOrMore = false;
-        for (int i=0; i < interimReasonsMask.length && !oneOrMore; i++) {
+        for (int i = 0; i < interimReasonsMask.length && !oneOrMore; i++) {
             if (!reasonsMask[i] && interimReasonsMask[i]) {
                 oneOrMore = true;
             }
@@ -615,7 +592,7 @@
                 PKIXCertPathBuilderResult result =
                     (PKIXCertPathBuilderResult) builder.build(params);
                 prevKey = result.getPublicKey();
-            } catch (Exception e) {
+            } catch (GeneralSecurityException e) {
                 throw new CRLException(e);
             }
         }
@@ -633,7 +610,7 @@
         // validate the signature on the CRL
         try {
             crl.verify(prevKey, provider);
-        } catch (Exception e) {
+        } catch (GeneralSecurityException e) {
             if (debug != null) {
                 debug.println("CRL signature failed to verify");
             }
@@ -644,22 +621,21 @@
         Set<String> unresCritExts = crl.getCriticalExtensionOIDs();
         // remove any that we have processed
         if (unresCritExts != null) {
-            unresCritExts.remove
-                (PKIXExtensions.IssuingDistributionPoint_Id.toString());
+            unresCritExts.remove(IssuingDistributionPoint_Id.toString());
             if (!unresCritExts.isEmpty()) {
                 if (debug != null) {
                     debug.println("Unrecognized critical extension(s) in CRL: "
                         + unresCritExts);
-                    Iterator<String> i = unresCritExts.iterator();
-                    while (i.hasNext())
-                        debug.println(i.next());
+                    for (String ext : unresCritExts) {
+                        debug.println(ext);
+                    }
                 }
                 return false;
             }
         }
 
         // update reasonsMask
-        for (int i=0; i < interimReasonsMask.length; i++) {
+        for (int i = 0; i < interimReasonsMask.length; i++) {
             if (!reasonsMask[i] && interimReasonsMask[i]) {
                 reasonsMask[i] = true;
             }
@@ -671,9 +647,10 @@
      * Append relative name to the issuer name and return a new
      * GeneralNames object.
      */
-    private GeneralNames getFullNames(X500Name issuer, RDN rdn)
-        throws IOException {
-        List<RDN> rdns = new ArrayList<RDN>(issuer.rdns());
+    private static GeneralNames getFullNames(X500Name issuer, RDN rdn)
+        throws IOException
+    {
+        List<RDN> rdns = new ArrayList<>(issuer.rdns());
         rdns.add(rdn);
         X500Name fullName = new X500Name(rdns.toArray(new RDN[0]));
         GeneralNames fullNames = new GeneralNames();
@@ -681,15 +658,16 @@
         return fullNames;
     }
 
-    /** Verifies whether a CRL is issued by a certain certificate
+    /**
+     * Verifies whether a CRL is issued by a certain certificate
      *
      * @param cert the certificate
      * @param crl the CRL to be verified
      * @param provider the name of the signature provider
      */
     private static boolean issues(X509CertImpl cert, X509CRLImpl crl,
-            String provider) throws IOException {
-
+                                  String provider) throws IOException
+    {
         boolean matched = false;
 
         AdaptableX509CertSelector issuerSelector =
@@ -727,7 +705,7 @@
             try {
                 crl.verify(cert.getPublicKey(), provider);
                 matched = true;
-            } catch (Exception e) {
+            } catch (GeneralSecurityException e) {
                 matched = false;
             }
         }
diff --git a/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java b/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java
index 2bcc691..4281fdd 100644
--- a/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java
+++ b/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java
@@ -26,10 +26,9 @@
 package sun.security.provider.certpath;
 
 import java.io.IOException;
-import java.util.*;
-
 import java.security.GeneralSecurityException;
 import java.security.InvalidKeyException;
+import java.security.PublicKey;
 import java.security.cert.CertificateException;
 import java.security.cert.CertPathValidatorException;
 import java.security.cert.PKIXReason;
@@ -40,12 +39,14 @@
 import java.security.cert.TrustAnchor;
 import java.security.cert.X509Certificate;
 import java.security.cert.X509CertSelector;
+import java.util.*;
 import javax.security.auth.x500.X500Principal;
 
+import sun.security.provider.certpath.PKIX.BuilderParams;
 import sun.security.util.Debug;
 import sun.security.x509.AccessDescription;
 import sun.security.x509.AuthorityInfoAccessExtension;
-import sun.security.x509.PKIXExtensions;
+import static sun.security.x509.PKIXExtensions.*;
 import sun.security.x509.PolicyMappingsExtension;
 import sun.security.x509.X500Name;
 import sun.security.x509.X509CertImpl;
@@ -72,21 +73,17 @@
     TrustAnchor trustAnchor;
     private Comparator<X509Certificate> comparator;
     private boolean searchAllCertStores = true;
-    private boolean onlyEECert = false;
 
     /**
      * Initialize the builder with the input parameters.
      *
      * @param params the parameter set used to build a certification path
      */
-    ForwardBuilder(PKIXBuilderParameters buildParams,
-        X500Principal targetSubjectDN, boolean searchAllCertStores,
-        boolean onlyEECert)
-    {
-        super(buildParams, targetSubjectDN);
+    ForwardBuilder(BuilderParams buildParams, boolean searchAllCertStores) {
+        super(buildParams);
 
         // populate sets of trusted certificates and subject DNs
-        trustAnchors = buildParams.getTrustAnchors();
+        trustAnchors = buildParams.trustAnchors();
         trustedCerts = new HashSet<X509Certificate>(trustAnchors.size());
         trustedSubjectDNs = new HashSet<X500Principal>(trustAnchors.size());
         for (TrustAnchor anchor : trustAnchors) {
@@ -100,7 +97,6 @@
         }
         comparator = new PKIXCertComparator(trustedSubjectDNs);
         this.searchAllCertStores = searchAllCertStores;
-        this.onlyEECert = onlyEECert;
     }
 
     /**
@@ -112,8 +108,9 @@
      *        Must be an instance of <code>ForwardState</code>
      * @param certStores list of CertStores
      */
-    Collection<X509Certificate> getMatchingCerts
-        (State currentState, List<CertStore> certStores)
+    @Override
+    Collection<X509Certificate> getMatchingCerts(State currentState,
+                                                 List<CertStore> certStores)
         throws CertStoreException, CertificateException, IOException
     {
         if (debug != null) {
@@ -127,7 +124,7 @@
          * As each cert is added, it is sorted based on the PKIXCertComparator
          * algorithm.
          */
-        Set<X509Certificate> certs = new TreeSet<X509Certificate>(comparator);
+        Set<X509Certificate> certs = new TreeSet<>(comparator);
 
         /*
          * Only look for EE certs if search has just started.
@@ -145,9 +142,10 @@
      * and requirements specified in the parameters and PKIX state.
      */
     private void getMatchingEECerts(ForwardState currentState,
-        List<CertStore> certStores, Collection<X509Certificate> eeCerts)
-        throws IOException {
-
+                                    List<CertStore> certStores,
+                                    Collection<X509Certificate> eeCerts)
+        throws IOException
+    {
         if (debug != null) {
             debug.println("ForwardBuilder.getMatchingEECerts()...");
         }
@@ -165,12 +163,12 @@
             /*
              * Match on certificate validity date
              */
-            eeSelector.setCertificateValid(date);
+            eeSelector.setCertificateValid(buildParams.date());
 
             /*
              * Policy processing optimizations
              */
-            if (buildParams.isExplicitPolicyRequired()) {
+            if (buildParams.explicitPolicyRequired()) {
                 eeSelector.setPolicy(getMatchingPolicies());
             }
             /*
@@ -188,9 +186,10 @@
      * and requirements specified in the parameters and PKIX state.
      */
     private void getMatchingCACerts(ForwardState currentState,
-        List<CertStore> certStores, Collection<X509Certificate> caCerts)
-        throws IOException {
-
+                                    List<CertStore> certStores,
+                                    Collection<X509Certificate> caCerts)
+        throws IOException
+    {
         if (debug != null) {
             debug.println("ForwardBuilder.getMatchingCACerts()...");
         }
@@ -216,8 +215,8 @@
             }
 
             if (caTargetSelector == null) {
-                caTargetSelector = (X509CertSelector)
-                    targetCertConstraints.clone();
+                caTargetSelector =
+                    (X509CertSelector) targetCertConstraints.clone();
 
                 /*
                  * Since we don't check the validity period of trusted
@@ -229,7 +228,7 @@
                 /*
                  * Policy processing optimizations
                  */
-                if (buildParams.isExplicitPolicyRequired())
+                if (buildParams.explicitPolicyRequired())
                     caTargetSelector.setPolicy(getMatchingPolicies());
             }
 
@@ -249,7 +248,7 @@
                 /*
                  * Policy processing optimizations
                  */
-                if (buildParams.isExplicitPolicyRequired())
+                if (buildParams.explicitPolicyRequired())
                     caSelector.setPolicy(getMatchingPolicies());
             }
 
@@ -278,7 +277,7 @@
              * check the validity period
              */
             caSelector.setValidityPeriod(currentState.cert.getNotBefore(),
-                                            currentState.cert.getNotAfter());
+                                         currentState.cert.getNotAfter());
 
             sel = caSelector;
         }
@@ -307,7 +306,7 @@
          * The trusted certificate matching is completed. We need to match
          * on certificate validity date.
          */
-        sel.setCertificateValid(date);
+        sel.setCertificateValid(buildParams.date());
 
         /*
          * Require CA certs with a pathLenConstraint that allows
@@ -323,11 +322,12 @@
          * certificate pairs.
          */
         if (currentState.isInitial() ||
-           (buildParams.getMaxPathLength() == -1) ||
-           (buildParams.getMaxPathLength() > currentState.traversedCACerts))
+           (buildParams.maxPathLength() == -1) ||
+           (buildParams.maxPathLength() > currentState.traversedCACerts))
         {
             if (addMatchingCerts(sel, certStores,
-                    caCerts, searchAllCertStores) && !searchAllCertStores) {
+                                 caCerts, searchAllCertStores)
+                && !searchAllCertStores) {
                 return;
             }
         }
@@ -356,7 +356,8 @@
     // because of the selector, so the cast is safe
     @SuppressWarnings("unchecked")
     private boolean getCerts(AuthorityInfoAccessExtension aiaExt,
-        Collection<X509Certificate> certs) {
+                             Collection<X509Certificate> certs)
+    {
         if (Builder.USE_AIA == false) {
             return false;
         }
@@ -449,6 +450,7 @@
          * @throws ClassCastException if either argument is not of type
          * X509Certificate
          */
+        @Override
         public int compare(X509Certificate oCert1, X509Certificate oCert2) {
 
             // if certs are the same, return 0
@@ -651,8 +653,10 @@
      * @param currentState the current state against which the cert is verified
      * @param certPathList the certPathList generated thus far
      */
+    @Override
     void verifyCert(X509Certificate cert, State currentState,
-        List<X509Certificate> certPathList) throws GeneralSecurityException
+                    List<X509Certificate> certPathList)
+        throws GeneralSecurityException
     {
         if (debug != null) {
             debug.println("ForwardBuilder.verifyCert(SN: "
@@ -686,7 +690,7 @@
                     debug.println("policyMappingFound = " + policyMappingFound);
                 }
                 if (cert.equals(cpListCert)) {
-                    if ((buildParams.isPolicyMappingInhibited()) ||
+                    if ((buildParams.policyMappingInhibited()) ||
                         (!policyMappingFound)) {
                         if (debug != null) {
                             debug.println("loop detected!!");
@@ -721,7 +725,7 @@
              * all extensions that all user checkers are capable of
              * processing.
              */
-            for (PKIXCertPathChecker checker : buildParams.getCertPathCheckers()) {
+            for (PKIXCertPathChecker checker : buildParams.certPathCheckers()) {
                 if (!checker.isForwardCheckingSupported()) {
                     Set<String> supportedExts = checker.getSupportedExtensions();
                     if (supportedExts != null) {
@@ -735,23 +739,15 @@
              * to check. If there are any left, throw an exception!
              */
             if (!unresCritExts.isEmpty()) {
-                unresCritExts.remove(
-                    PKIXExtensions.BasicConstraints_Id.toString());
-                unresCritExts.remove(
-                    PKIXExtensions.NameConstraints_Id.toString());
-                unresCritExts.remove(
-                    PKIXExtensions.CertificatePolicies_Id.toString());
-                unresCritExts.remove(
-                    PKIXExtensions.PolicyMappings_Id.toString());
-                unresCritExts.remove(
-                    PKIXExtensions.PolicyConstraints_Id.toString());
-                unresCritExts.remove(
-                    PKIXExtensions.InhibitAnyPolicy_Id.toString());
-                unresCritExts.remove(
-                    PKIXExtensions.SubjectAlternativeName_Id.toString());
-                unresCritExts.remove(PKIXExtensions.KeyUsage_Id.toString());
-                unresCritExts.remove(
-                    PKIXExtensions.ExtendedKeyUsage_Id.toString());
+                unresCritExts.remove(BasicConstraints_Id.toString());
+                unresCritExts.remove(NameConstraints_Id.toString());
+                unresCritExts.remove(CertificatePolicies_Id.toString());
+                unresCritExts.remove(PolicyMappings_Id.toString());
+                unresCritExts.remove(PolicyConstraints_Id.toString());
+                unresCritExts.remove(InhibitAnyPolicy_Id.toString());
+                unresCritExts.remove(SubjectAlternativeName_Id.toString());
+                unresCritExts.remove(KeyUsage_Id.toString());
+                unresCritExts.remove(ExtendedKeyUsage_Id.toString());
 
                 if (!unresCritExts.isEmpty())
                     throw new CertPathValidatorException
@@ -789,31 +785,12 @@
          */
 
         /*
-         * Check revocation for the previous cert
-         */
-        if (buildParams.isRevocationEnabled()) {
-
-            // first off, see if this cert can authorize revocation...
-            if (CrlRevocationChecker.certCanSignCrl(cert)) {
-                // And then check to be sure no key requiring key parameters
-                // has been encountered
-                if (!currState.keyParamsNeeded())
-                    // If all that checks out, we can check the
-                    // revocation status of the cert. Otherwise,
-                    // we'll just wait until the end.
-                    currState.crlChecker.check(currState.cert,
-                                               cert.getPublicKey(),
-                                               true);
-            }
-        }
-
-        /*
          * Check signature only if no key requiring key parameters has been
          * encountered.
          */
         if (!currState.keyParamsNeeded()) {
             (currState.cert).verify(cert.getPublicKey(),
-                                    buildParams.getSigProvider());
+                                    buildParams.sigProvider());
         }
     }
 
@@ -829,6 +806,7 @@
      * @param cert the certificate to test
      * @return a boolean value indicating whether the cert completes the path.
      */
+    @Override
     boolean isPathCompleted(X509Certificate cert) {
         for (TrustAnchor anchor : trustAnchors) {
             if (anchor.getTrustedCert() != null) {
@@ -840,7 +818,7 @@
                 }
             } else {
                 X500Principal principal = anchor.getCA();
-                java.security.PublicKey publicKey = anchor.getCAPublicKey();
+                PublicKey publicKey = anchor.getCAPublicKey();
 
                 if (principal != null && publicKey != null &&
                         principal.equals(cert.getSubjectX500Principal())) {
@@ -859,21 +837,6 @@
                 }
             }
 
-            /* Check revocation if it is enabled */
-            if (buildParams.isRevocationEnabled()) {
-                try {
-                    CrlRevocationChecker crlChecker = new CrlRevocationChecker
-                        (anchor, buildParams, null, onlyEECert);
-                    crlChecker.check(cert, anchor.getCAPublicKey(), true);
-                } catch (CertPathValidatorException cpve) {
-                    if (debug != null) {
-                        debug.println("ForwardBuilder.isPathCompleted() cpve");
-                        cpve.printStackTrace();
-                    }
-                    continue;
-                }
-            }
-
             /*
              * Check signature
              */
@@ -882,18 +845,17 @@
                 // parameters, yet there is no key to inherit the parameters
                 // from.  This is probably such a rare case that it is not worth
                 // trying to detect the situation earlier.
-                cert.verify(anchor.getCAPublicKey(),
-                            buildParams.getSigProvider());
+                cert.verify(anchor.getCAPublicKey(), buildParams.sigProvider());
             } catch (InvalidKeyException ike) {
                 if (debug != null) {
                     debug.println("ForwardBuilder.isPathCompleted() invalid "
-                        + "DSA key found");
+                                  + "DSA key found");
                 }
                 continue;
-            } catch (Exception e){
+            } catch (GeneralSecurityException e){
                 if (debug != null) {
                     debug.println("ForwardBuilder.isPathCompleted() " +
-                        "unexpected exception");
+                                  "unexpected exception");
                     e.printStackTrace();
                 }
                 continue;
@@ -911,8 +873,10 @@
      * @param cert the certificate to be added
      * @param certPathList the certification path list
      */
+    @Override
     void addCertToPath(X509Certificate cert,
-        LinkedList<X509Certificate> certPathList) {
+                       LinkedList<X509Certificate> certPathList)
+    {
         certPathList.addFirst(cert);
     }
 
@@ -920,6 +884,7 @@
      *
      * @param certPathList the certification path list
      */
+    @Override
     void removeFinalCertFromPath(LinkedList<X509Certificate> certPathList) {
         certPathList.removeFirst();
     }
diff --git a/src/share/classes/sun/security/provider/certpath/ForwardState.java b/src/share/classes/sun/security/provider/certpath/ForwardState.java
index b2dd884..95baaf8 100644
--- a/src/share/classes/sun/security/provider/certpath/ForwardState.java
+++ b/src/share/classes/sun/security/provider/certpath/ForwardState.java
@@ -34,7 +34,6 @@
 import java.security.interfaces.DSAPublicKey;
 import java.util.ArrayList;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.ListIterator;
 import javax.security.auth.x500.X500Principal;
@@ -76,8 +75,6 @@
     /* Flag indicating if state is initial (path is just starting) */
     private boolean init = true;
 
-    /* the checker used for revocation status */
-    public CrlRevocationChecker crlChecker;
 
     /* the untrusted certificates checker */
     UntrustedChecker untrustedChecker;
@@ -96,6 +93,7 @@
      *
      * @return boolean flag indicating if the state is initial (just starting)
      */
+    @Override
     public boolean isInitial() {
         return init;
     }
@@ -107,6 +105,7 @@
      * @return boolean true if key needing to inherit parameters has been
      * encountered; false otherwise.
      */
+    @Override
     public boolean keyParamsNeeded() {
         return keyParamsNeededFlag;
     }
@@ -114,23 +113,18 @@
     /**
      * Display state for debugging purposes
      */
+    @Override
     public String toString() {
-        StringBuffer sb = new StringBuffer();
-        try {
-            sb.append("State [");
-            sb.append("\n  issuerDN of last cert: " + issuerDN);
-            sb.append("\n  traversedCACerts: " + traversedCACerts);
-            sb.append("\n  init: " + String.valueOf(init));
-            sb.append("\n  keyParamsNeeded: "
-                + String.valueOf(keyParamsNeededFlag));
-            sb.append("\n  subjectNamesTraversed: \n" + subjectNamesTraversed);
-            sb.append("]\n");
-        } catch (Exception e) {
-            if (debug != null) {
-                debug.println("ForwardState.toString() unexpected exception");
-                e.printStackTrace();
-            }
-        }
+        StringBuilder sb = new StringBuilder();
+        sb.append("State [");
+        sb.append("\n  issuerDN of last cert: ").append(issuerDN);
+        sb.append("\n  traversedCACerts: ").append(traversedCACerts);
+        sb.append("\n  init: ").append(String.valueOf(init));
+        sb.append("\n  keyParamsNeeded: ").append
+                 (String.valueOf(keyParamsNeededFlag));
+        sb.append("\n  subjectNamesTraversed: \n").append
+                 (subjectNamesTraversed);
+        sb.append("]\n");
         return sb.toString();
     }
 
@@ -150,12 +144,10 @@
          * that supports forward checking and initialize the forwardCheckers
          */
         forwardCheckers = new ArrayList<PKIXCertPathChecker>();
-        if (certPathCheckers != null) {
-            for (PKIXCertPathChecker checker : certPathCheckers) {
-                if (checker.isForwardCheckingSupported()) {
-                    checker.init(true);
-                    forwardCheckers.add(checker);
-                }
+        for (PKIXCertPathChecker checker : certPathCheckers) {
+            if (checker.isForwardCheckingSupported()) {
+                checker.init(true);
+                forwardCheckers.add(checker);
             }
         }
 
@@ -167,6 +159,7 @@
      *
      * @param cert the certificate which is used to update the state
      */
+    @Override
     public void updateState(X509Certificate cert)
         throws CertificateException, IOException, CertPathValidatorException {
 
@@ -211,13 +204,11 @@
                 if (subjAltNameExt != null) {
                     GeneralNames gNames = subjAltNameExt.get(
                             SubjectAlternativeNameExtension.SUBJECT_NAME);
-                    for (Iterator<GeneralName> t = gNames.iterator();
-                                t.hasNext(); ) {
-                        GeneralNameInterface gName = t.next().getName();
-                        subjectNamesTraversed.add(gName);
+                    for (GeneralName gName : gNames.names()) {
+                        subjectNamesTraversed.add(gName.getName());
                     }
                 }
-            } catch (Exception e) {
+            } catch (IOException e) {
                 if (debug != null) {
                     debug.println("ForwardState.updateState() unexpected "
                         + "exception");
@@ -239,6 +230,7 @@
      * because some of them will
      * not have their contents modified by subsequent calls to updateState.
      */
+    @Override
     @SuppressWarnings("unchecked") // Safe casts assuming clone() works correctly
     public Object clone() {
         try {
diff --git a/src/share/classes/sun/security/provider/certpath/IndexedCollectionCertStore.java b/src/share/classes/sun/security/provider/certpath/IndexedCollectionCertStore.java
index 79f0c96..64fcc56 100644
--- a/src/share/classes/sun/security/provider/certpath/IndexedCollectionCertStore.java
+++ b/src/share/classes/sun/security/provider/certpath/IndexedCollectionCertStore.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -180,7 +180,7 @@
                 if (cert.equals(oldEntry)) {
                     return;
                 }
-                List<X509Certificate> list = new ArrayList<X509Certificate>(2);
+                List<X509Certificate> list = new ArrayList<>(2);
                 list.add(cert);
                 list.add((X509Certificate)oldEntry);
                 certSubjects.put(subject, list);
@@ -206,7 +206,7 @@
                 if (crl.equals(oldEntry)) {
                     return;
                 }
-                List<X509CRL> list = new ArrayList<X509CRL>(2);
+                List<X509CRL> list = new ArrayList<>(2);
                 list.add(crl);
                 list.add((X509CRL)oldEntry);
                 crlIssuers.put(issuer, list);
@@ -234,19 +234,20 @@
      *         match the specified selector
      * @throws CertStoreException if an exception occurs
      */
+    @Override
     public Collection<? extends Certificate> engineGetCertificates(CertSelector selector)
             throws CertStoreException {
 
         // no selector means match all
         if (selector == null) {
-            Set<Certificate> matches = new HashSet<Certificate>();
+            Set<Certificate> matches = new HashSet<>();
             matchX509Certs(new X509CertSelector(), matches);
             matches.addAll(otherCertificates);
             return matches;
         }
 
         if (selector instanceof X509CertSelector == false) {
-            Set<Certificate> matches = new HashSet<Certificate>();
+            Set<Certificate> matches = new HashSet<>();
             matchX509Certs(selector, matches);
             for (Certificate cert : otherCertificates) {
                 if (selector.match(cert)) {
@@ -285,7 +286,7 @@
                 // See certSubjects javadoc.
                 @SuppressWarnings("unchecked")
                 List<X509Certificate> list = (List<X509Certificate>)entry;
-                Set<X509Certificate> matches = new HashSet<X509Certificate>(16);
+                Set<X509Certificate> matches = new HashSet<>(16);
                 for (X509Certificate cert : list) {
                     if (x509Selector.match(cert)) {
                         matches.add(cert);
@@ -295,7 +296,7 @@
             }
         }
         // cannot use index, iterate all
-        Set<Certificate> matches = new HashSet<Certificate>(16);
+        Set<Certificate> matches = new HashSet<>(16);
         matchX509Certs(x509Selector, matches);
         return matches;
     }
@@ -338,18 +339,19 @@
      *         match the specified selector
      * @throws CertStoreException if an exception occurs
      */
+    @Override
     public Collection<CRL> engineGetCRLs(CRLSelector selector)
             throws CertStoreException {
 
         if (selector == null) {
-            Set<CRL> matches = new HashSet<CRL>();
+            Set<CRL> matches = new HashSet<>();
             matchX509CRLs(new X509CRLSelector(), matches);
             matches.addAll(otherCRLs);
             return matches;
         }
 
         if (selector instanceof X509CRLSelector == false) {
-            Set<CRL> matches = new HashSet<CRL>();
+            Set<CRL> matches = new HashSet<>();
             matchX509CRLs(selector, matches);
             for (CRL crl : otherCRLs) {
                 if (selector.match(crl)) {
@@ -366,7 +368,7 @@
         // see if the issuer is specified
         Collection<X500Principal> issuers = x509Selector.getIssuers();
         if (issuers != null) {
-            HashSet<CRL> matches = new HashSet<CRL>(16);
+            HashSet<CRL> matches = new HashSet<>(16);
             for (X500Principal issuer : issuers) {
                 Object entry = crlIssuers.get(issuer);
                 if (entry == null) {
@@ -390,7 +392,7 @@
             return matches;
         }
         // cannot use index, iterate all
-        Set<CRL> matches = new HashSet<CRL>(16);
+        Set<CRL> matches = new HashSet<>(16);
         matchX509CRLs(x509Selector, matches);
         return matches;
     }
diff --git a/src/share/classes/sun/security/provider/certpath/KeyChecker.java b/src/share/classes/sun/security/provider/certpath/KeyChecker.java
index 1619efb..2d45d95 100644
--- a/src/share/classes/sun/security/provider/certpath/KeyChecker.java
+++ b/src/share/classes/sun/security/provider/certpath/KeyChecker.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
 import java.security.cert.PKIXReason;
 
 import sun.security.util.Debug;
-import sun.security.x509.PKIXExtensions;
+import static sun.security.x509.PKIXExtensions.*;
 
 /**
  * KeyChecker is a <code>PKIXCertPathChecker</code> that checks that the
@@ -45,33 +45,29 @@
 class KeyChecker extends PKIXCertPathChecker {
 
     private static final Debug debug = Debug.getInstance("certpath");
-    // the index of keyCertSign in the boolean KeyUsage array
-    private static final int keyCertSign = 5;
     private final int certPathLen;
-    private CertSelector targetConstraints;
+    private final CertSelector targetConstraints;
     private int remainingCerts;
 
     private Set<String> supportedExts;
 
     /**
-     * Default Constructor
+     * Creates a KeyChecker.
      *
      * @param certPathLen allowable cert path length
      * @param targetCertSel a CertSelector object specifying the constraints
      * on the target certificate
      */
-    KeyChecker(int certPathLen, CertSelector targetCertSel)
-        throws CertPathValidatorException
-    {
+    KeyChecker(int certPathLen, CertSelector targetCertSel) {
         this.certPathLen = certPathLen;
         this.targetConstraints = targetCertSel;
-        init(false);
     }
 
     /**
      * Initializes the internal state of the checker from parameters
      * specified in the constructor
      */
+    @Override
     public void init(boolean forward) throws CertPathValidatorException {
         if (!forward) {
             remainingCerts = certPathLen;
@@ -81,16 +77,18 @@
         }
     }
 
-    public final boolean isForwardCheckingSupported() {
+    @Override
+    public boolean isForwardCheckingSupported() {
         return false;
     }
 
+    @Override
     public Set<String> getSupportedExtensions() {
         if (supportedExts == null) {
-            supportedExts = new HashSet<String>();
-            supportedExts.add(PKIXExtensions.KeyUsage_Id.toString());
-            supportedExts.add(PKIXExtensions.ExtendedKeyUsage_Id.toString());
-            supportedExts.add(PKIXExtensions.SubjectAlternativeName_Id.toString());
+            supportedExts = new HashSet<String>(3);
+            supportedExts.add(KeyUsage_Id.toString());
+            supportedExts.add(ExtendedKeyUsage_Id.toString());
+            supportedExts.add(SubjectAlternativeName_Id.toString());
             supportedExts = Collections.unmodifiableSet(supportedExts);
         }
         return supportedExts;
@@ -102,20 +100,20 @@
      *
      * @param cert the Certificate
      * @param unresolvedCritExts the unresolved critical extensions
-     * @exception CertPathValidatorException Exception thrown if certificate
-     * does not verify
+     * @throws CertPathValidatorException if certificate does not verify
      */
+    @Override
     public void check(Certificate cert, Collection<String> unresCritExts)
         throws CertPathValidatorException
     {
-        X509Certificate currCert = (X509Certificate) cert;
+        X509Certificate currCert = (X509Certificate)cert;
 
         remainingCerts--;
 
         // if final certificate, check that target constraints are satisfied
         if (remainingCerts == 0) {
-            if ((targetConstraints != null) &&
-                (targetConstraints.match(currCert) == false)) {
+            if (targetConstraints != null &&
+                targetConstraints.match(currCert) == false) {
                 throw new CertPathValidatorException("target certificate " +
                     "constraints check failed");
             }
@@ -126,25 +124,26 @@
 
         // remove the extensions that we have checked
         if (unresCritExts != null && !unresCritExts.isEmpty()) {
-            unresCritExts.remove(PKIXExtensions.KeyUsage_Id.toString());
-            unresCritExts.remove(PKIXExtensions.ExtendedKeyUsage_Id.toString());
-            unresCritExts.remove(
-                PKIXExtensions.SubjectAlternativeName_Id.toString());
+            unresCritExts.remove(KeyUsage_Id.toString());
+            unresCritExts.remove(ExtendedKeyUsage_Id.toString());
+            unresCritExts.remove(SubjectAlternativeName_Id.toString());
         }
     }
 
+    // the index of keyCertSign in the boolean KeyUsage array
+    private static final int KEY_CERT_SIGN = 5;
     /**
-     * Static method to verify that the key usage and extended key usage
-     * extension in a CA cert. The key usage extension, if present, must
-     * assert the keyCertSign bit. The extended key usage extension, if
-     * present, must include anyExtendedKeyUsage.
+     * Verifies the key usage extension in a CA cert.
+     * The key usage extension, if present, must assert the keyCertSign bit.
+     * The extended key usage extension is not checked (see CR 4776794 for
+     * more information).
      */
     static void verifyCAKeyUsage(X509Certificate cert)
             throws CertPathValidatorException {
         String msg = "CA key usage";
         if (debug != null) {
             debug.println("KeyChecker.verifyCAKeyUsage() ---checking " + msg
-                + "...");
+                          + "...");
         }
 
         boolean[] keyUsageBits = cert.getKeyUsage();
@@ -156,7 +155,7 @@
         }
 
         // throw an exception if the keyCertSign bit is not set
-        if (!keyUsageBits[keyCertSign]) {
+        if (!keyUsageBits[KEY_CERT_SIGN]) {
             throw new CertPathValidatorException
                 (msg + " check failed: keyCertSign bit is not set", null,
                  null, -1, PKIXReason.INVALID_KEY_USAGE);
@@ -164,7 +163,7 @@
 
         if (debug != null) {
             debug.println("KeyChecker.verifyCAKeyUsage() " + msg
-                + " verified.");
+                          + " verified.");
         }
     }
 }
diff --git a/src/share/classes/sun/security/provider/certpath/OCSP.java b/src/share/classes/sun/security/provider/certpath/OCSP.java
index bd426c5..ee10ab3 100644
--- a/src/share/classes/sun/security/provider/certpath/OCSP.java
+++ b/src/share/classes/sun/security/provider/certpath/OCSP.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,7 @@
 
 import static sun.security.provider.certpath.OCSPResponse.*;
 import sun.security.util.Debug;
+import sun.security.util.ObjectIdentifier;
 import sun.security.x509.AccessDescription;
 import sun.security.x509.AuthorityInfoAccessExtension;
 import sun.security.x509.GeneralName;
@@ -62,6 +63,9 @@
  */
 public final class OCSP {
 
+    static final ObjectIdentifier NONCE_EXTENSION_OID =
+        ObjectIdentifier.newInternal(new int[]{ 1, 3, 6, 1, 5, 5, 7, 48, 1, 2});
+
     private static final Debug debug = Debug.getInstance("certpath");
 
     private static final int CONNECT_TIMEOUT = 15000; // 15 seconds
@@ -83,7 +87,7 @@
      *    encoding the OCSP Request or validating the OCSP Response
      */
     public static RevocationStatus check(X509Certificate cert,
-        X509Certificate issuerCert)
+                                         X509Certificate issuerCert)
         throws IOException, CertPathValidatorException {
         CertId certId = null;
         URI responderURI = null;
@@ -95,16 +99,13 @@
                     ("No OCSP Responder URI in certificate");
             }
             certId = new CertId(issuerCert, certImpl.getSerialNumberObject());
-        } catch (CertificateException ce) {
+        } catch (CertificateException | IOException e) {
             throw new CertPathValidatorException
-                ("Exception while encoding OCSPRequest", ce);
-        } catch (IOException ioe) {
-            throw new CertPathValidatorException
-                ("Exception while encoding OCSPRequest", ioe);
+                ("Exception while encoding OCSPRequest", e);
         }
         OCSPResponse ocspResponse = check(Collections.singletonList(certId),
-            responderURI, issuerCert, null);
-        return (RevocationStatus) ocspResponse.getSingleResponse(certId);
+            responderURI, issuerCert, null, Collections.<Extension>emptyList());
+        return (RevocationStatus)ocspResponse.getSingleResponse(certId);
     }
 
     /**
@@ -123,22 +124,34 @@
      *    encoding the OCSP Request or validating the OCSP Response
      */
     public static RevocationStatus check(X509Certificate cert,
-        X509Certificate issuerCert, URI responderURI, X509Certificate
-        responderCert, Date date)
-        throws IOException, CertPathValidatorException {
+                                         X509Certificate issuerCert,
+                                         URI responderURI,
+                                         X509Certificate responderCert,
+                                         Date date)
+        throws IOException, CertPathValidatorException
+    {
+        return check(cert, issuerCert, responderURI, responderCert, date,
+                     Collections.<Extension>emptyList());
+    }
+
+    // Called by com.sun.deploy.security.TrustDecider
+    public static RevocationStatus check(X509Certificate cert,
+                                         X509Certificate issuerCert,
+                                         URI responderURI,
+                                         X509Certificate responderCert,
+                                         Date date, List<Extension> extensions)
+        throws IOException, CertPathValidatorException
+    {
         CertId certId = null;
         try {
             X509CertImpl certImpl = X509CertImpl.toImpl(cert);
             certId = new CertId(issuerCert, certImpl.getSerialNumberObject());
-        } catch (CertificateException ce) {
+        } catch (CertificateException | IOException e) {
             throw new CertPathValidatorException
-                ("Exception while encoding OCSPRequest", ce);
-        } catch (IOException ioe) {
-            throw new CertPathValidatorException
-                ("Exception while encoding OCSPRequest", ioe);
+                ("Exception while encoding OCSPRequest", e);
         }
         OCSPResponse ocspResponse = check(Collections.singletonList(certId),
-            responderURI, responderCert, date);
+            responderURI, responderCert, date, extensions);
         return (RevocationStatus) ocspResponse.getSingleResponse(certId);
     }
 
@@ -157,12 +170,14 @@
      *    encoding the OCSP Request or validating the OCSP Response
      */
     static OCSPResponse check(List<CertId> certIds, URI responderURI,
-        X509Certificate responderCert, Date date)
-        throws IOException, CertPathValidatorException {
-
+                              X509Certificate responderCert, Date date,
+                              List<Extension> extensions)
+        throws IOException, CertPathValidatorException
+    {
         byte[] bytes = null;
+        OCSPRequest request = null;
         try {
-            OCSPRequest request = new OCSPRequest(certIds);
+            request = new OCSPRequest(certIds, extensions);
             bytes = request.encodeBytes();
         } catch (IOException ioe) {
             throw new CertPathValidatorException
@@ -214,6 +229,8 @@
                 }
             }
             response = Arrays.copyOf(response, total);
+        } catch (IOException ioe) {
+            throw new NetworkFailureException(ioe);
         } finally {
             if (in != null) {
                 try {
@@ -233,33 +250,15 @@
 
         OCSPResponse ocspResponse = null;
         try {
-            ocspResponse = new OCSPResponse(response, date, responderCert);
+            ocspResponse = new OCSPResponse(response);
         } catch (IOException ioe) {
             // response decoding exception
             throw new CertPathValidatorException(ioe);
         }
-        if (ocspResponse.getResponseStatus() != ResponseStatus.SUCCESSFUL) {
-            throw new CertPathValidatorException
-                ("OCSP response error: " + ocspResponse.getResponseStatus());
-        }
 
-        // Check that the response includes a response for all of the
-        // certs that were supplied in the request
-        for (CertId certId : certIds) {
-            SingleResponse sr = ocspResponse.getSingleResponse(certId);
-            if (sr == null) {
-                if (debug != null) {
-                    debug.println("No response found for CertId: " + certId);
-                }
-                throw new CertPathValidatorException(
-                    "OCSP response does not include a response for a " +
-                    "certificate supplied in the OCSP request");
-            }
-            if (debug != null) {
-                debug.println("Status of certificate (with serial number " +
-                    certId.getSerialNumber() + ") is: " + sr.getCertStatus());
-            }
-        }
+        // verify the response
+        ocspResponse.verify(certIds, responderCert, date, request.getNonce());
+
         return ocspResponse;
     }
 
@@ -271,6 +270,7 @@
      * @param cert the certificate
      * @return the URI of the OCSP Responder, or null if not specified
      */
+    // Called by com.sun.deploy.security.TrustDecider
     public static URI getResponderURI(X509Certificate cert) {
         try {
             return getResponderURI(X509CertImpl.toImpl(cert));
@@ -330,4 +330,12 @@
          */
         Map<String, Extension> getSingleExtensions();
     }
+
+    static class NetworkFailureException extends CertPathValidatorException {
+        private static final long serialVersionUID = 0l;
+
+        private NetworkFailureException(IOException ioe) {
+            super(ioe);
+        }
+    }
 }
diff --git a/src/share/classes/sun/security/provider/certpath/OCSPChecker.java b/src/share/classes/sun/security/provider/certpath/OCSPChecker.java
deleted file mode 100644
index 8eb4551..0000000
--- a/src/share/classes/sun/security/provider/certpath/OCSPChecker.java
+++ /dev/null
@@ -1,446 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.security.provider.certpath;
-
-import java.math.BigInteger;
-import java.util.*;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.Security;
-import java.security.cert.*;
-import java.security.cert.CertPathValidatorException.BasicReason;
-import java.net.URI;
-import java.net.URISyntaxException;
-import javax.security.auth.x500.X500Principal;
-
-import static sun.security.provider.certpath.OCSP.*;
-import sun.security.util.Debug;
-import sun.security.x509.*;
-
-/**
- * OCSPChecker is a <code>PKIXCertPathChecker</code> that uses the
- * Online Certificate Status Protocol (OCSP) as specified in RFC 2560
- * <a href="http://www.ietf.org/rfc/rfc2560.txt">
- * http://www.ietf.org/rfc/rfc2560.txt</a>.
- *
- * @author      Ram Marti
- */
-class OCSPChecker extends PKIXCertPathChecker {
-
-    static final String OCSP_ENABLE_PROP = "ocsp.enable";
-    static final String OCSP_URL_PROP = "ocsp.responderURL";
-    static final String OCSP_CERT_SUBJECT_PROP =
-        "ocsp.responderCertSubjectName";
-    static final String OCSP_CERT_ISSUER_PROP = "ocsp.responderCertIssuerName";
-    static final String OCSP_CERT_NUMBER_PROP =
-        "ocsp.responderCertSerialNumber";
-
-    private static final String HEX_DIGITS = "0123456789ABCDEFabcdef";
-    private static final Debug DEBUG = Debug.getInstance("certpath");
-    private static final boolean dump = false;
-
-    private int remainingCerts;
-
-    private X509Certificate[] certs;
-
-    private CertPath cp;
-
-    private PKIXParameters pkixParams;
-
-    private boolean onlyEECert = false;
-
-    /**
-     * Default Constructor
-     *
-     * @param certPath the X509 certification path
-     * @param pkixParams the input PKIX parameter set
-     * @throws CertPathValidatorException if OCSPChecker can not be created
-     */
-    OCSPChecker(CertPath certPath, PKIXParameters pkixParams)
-        throws CertPathValidatorException {
-        this(certPath, pkixParams, false);
-    }
-
-    OCSPChecker(CertPath certPath, PKIXParameters pkixParams, boolean onlyEECert)
-        throws CertPathValidatorException {
-
-        this.cp = certPath;
-        this.pkixParams = pkixParams;
-        this.onlyEECert = onlyEECert;
-        List<? extends Certificate> tmp = cp.getCertificates();
-        certs = tmp.toArray(new X509Certificate[tmp.size()]);
-        init(false);
-    }
-
-    /**
-     * Initializes the internal state of the checker from parameters
-     * specified in the constructor
-     */
-    @Override
-    public void init(boolean forward) throws CertPathValidatorException {
-        if (!forward) {
-            remainingCerts = certs.length + 1;
-        } else {
-            throw new CertPathValidatorException(
-                "Forward checking not supported");
-        }
-    }
-
-    @Override public boolean isForwardCheckingSupported() {
-        return false;
-    }
-
-    @Override public Set<String> getSupportedExtensions() {
-        return Collections.<String>emptySet();
-    }
-
-    /**
-     * Sends an OCSPRequest for the certificate to the OCSP Server and
-     * processes the response back from the OCSP Server.
-     *
-     * @param cert the Certificate
-     * @param unresolvedCritExts the unresolved critical extensions
-     * @exception CertPathValidatorException Exception is thrown if the
-     *            certificate has been revoked.
-     */
-    @Override
-    public void check(Certificate cert, Collection<String> unresolvedCritExts)
-        throws CertPathValidatorException {
-
-        // Decrement the certificate counter
-        remainingCerts--;
-
-        X509CertImpl currCertImpl = null;
-        try {
-            currCertImpl = X509CertImpl.toImpl((X509Certificate)cert);
-        } catch (CertificateException ce) {
-            throw new CertPathValidatorException(ce);
-        }
-
-        if (onlyEECert && currCertImpl.getBasicConstraints() != -1) {
-            if (DEBUG != null) {
-                DEBUG.println("Skipping revocation check, not end entity cert");
-            }
-            return;
-        }
-
-        /*
-         * OCSP security property values, in the following order:
-         *   1. ocsp.responderURL
-         *   2. ocsp.responderCertSubjectName
-         *   3. ocsp.responderCertIssuerName
-         *   4. ocsp.responderCertSerialNumber
-         */
-        // should cache these properties to avoid calling every time?
-        String[] properties = getOCSPProperties();
-
-        // Check whether OCSP is feasible before seeking cert information
-        URI uri = getOCSPServerURI(currCertImpl, properties[0]);
-
-        // When responder's subject name is set then the issuer/serial
-        // properties are ignored
-        X500Principal responderSubjectName = null;
-        X500Principal responderIssuerName = null;
-        BigInteger responderSerialNumber = null;
-        if (properties[1] != null) {
-            responderSubjectName = new X500Principal(properties[1]);
-        } else if (properties[2] != null && properties[3] != null) {
-            responderIssuerName = new X500Principal(properties[2]);
-            // remove colon or space separators
-            String value = stripOutSeparators(properties[3]);
-            responderSerialNumber = new BigInteger(value, 16);
-        } else if (properties[2] != null || properties[3] != null) {
-            throw new CertPathValidatorException(
-                "Must specify both ocsp.responderCertIssuerName and " +
-                "ocsp.responderCertSerialNumber properties");
-        }
-
-        // If the OCSP responder cert properties are set then the
-        // identified cert must be located in the trust anchors or
-        // in the cert stores.
-        boolean seekResponderCert = false;
-        if (responderSubjectName != null || responderIssuerName != null) {
-            seekResponderCert = true;
-        }
-
-        // Set the issuer certificate to the next cert in the chain
-        // (unless we're processing the final cert).
-        X509Certificate issuerCert = null;
-        boolean seekIssuerCert = true;
-        X509Certificate responderCert = null;
-        if (remainingCerts < certs.length) {
-            issuerCert = certs[remainingCerts];
-            seekIssuerCert = false; // done
-
-            // By default, the OCSP responder's cert is the same as the
-            // issuer of the cert being validated.
-            if (!seekResponderCert) {
-                responderCert = issuerCert;
-                if (DEBUG != null) {
-                    DEBUG.println("Responder's certificate is the same " +
-                        "as the issuer of the certificate being validated");
-                }
-            }
-        }
-
-        // Check anchor certs for:
-        //    - the issuer cert (of the cert being validated)
-        //    - the OCSP responder's cert
-        if (seekIssuerCert || seekResponderCert) {
-
-            if (DEBUG != null && seekResponderCert) {
-                DEBUG.println("Searching trust anchors for responder's " +
-                    "certificate");
-            }
-
-            // Extract the anchor certs
-            Iterator<TrustAnchor> anchors
-                = pkixParams.getTrustAnchors().iterator();
-            if (!anchors.hasNext()) {
-                throw new CertPathValidatorException(
-                    "Must specify at least one trust anchor");
-            }
-
-            X500Principal certIssuerName =
-                currCertImpl.getIssuerX500Principal();
-            while (anchors.hasNext() && (seekIssuerCert || seekResponderCert)) {
-
-                TrustAnchor anchor = anchors.next();
-                X509Certificate anchorCert = anchor.getTrustedCert();
-                X500Principal anchorSubjectName =
-                    anchorCert.getSubjectX500Principal();
-
-                if (dump) {
-                    System.out.println("Issuer DN is " + certIssuerName);
-                    System.out.println("Subject DN is " + anchorSubjectName);
-                }
-
-                // Check if anchor cert is the issuer cert
-                if (seekIssuerCert &&
-                    certIssuerName.equals(anchorSubjectName)) {
-
-                    issuerCert = anchorCert;
-                    seekIssuerCert = false; // done
-
-                    // By default, the OCSP responder's cert is the same as
-                    // the issuer of the cert being validated.
-                    if (!seekResponderCert && responderCert == null) {
-                        responderCert = anchorCert;
-                        if (DEBUG != null) {
-                            DEBUG.println("Responder's certificate is the" +
-                                " same as the issuer of the certificate " +
-                                "being validated");
-                        }
-                    }
-                }
-
-                // Check if anchor cert is the responder cert
-                if (seekResponderCert) {
-                    // Satisfy the responder subject name property only, or
-                    // satisfy the responder issuer name and serial number
-                    // properties only
-                    if ((responderSubjectName != null &&
-                         responderSubjectName.equals(anchorSubjectName)) ||
-                        (responderIssuerName != null &&
-                         responderSerialNumber != null &&
-                         responderIssuerName.equals(
-                         anchorCert.getIssuerX500Principal()) &&
-                         responderSerialNumber.equals(
-                         anchorCert.getSerialNumber()))) {
-
-                        responderCert = anchorCert;
-                        seekResponderCert = false; // done
-                    }
-                }
-            }
-            if (issuerCert == null) {
-                throw new CertPathValidatorException(
-                    "No trusted certificate for " + currCertImpl.getIssuerDN());
-            }
-
-            // Check cert stores if responder cert has not yet been found
-            if (seekResponderCert) {
-                if (DEBUG != null) {
-                    DEBUG.println("Searching cert stores for responder's " +
-                        "certificate");
-                }
-                X509CertSelector filter = null;
-                if (responderSubjectName != null) {
-                    filter = new X509CertSelector();
-                    filter.setSubject(responderSubjectName);
-                } else if (responderIssuerName != null &&
-                    responderSerialNumber != null) {
-                    filter = new X509CertSelector();
-                    filter.setIssuer(responderIssuerName);
-                    filter.setSerialNumber(responderSerialNumber);
-                }
-                if (filter != null) {
-                    List<CertStore> certStores = pkixParams.getCertStores();
-                    for (CertStore certStore : certStores) {
-                        Iterator<? extends Certificate> i = null;
-                        try {
-                            i = certStore.getCertificates(filter).iterator();
-                        } catch (CertStoreException cse) {
-                            // ignore and try next certStore
-                            if (DEBUG != null) {
-                                DEBUG.println("CertStore exception:" + cse);
-                            }
-                            continue;
-                        }
-                        if (i.hasNext()) {
-                            responderCert = (X509Certificate) i.next();
-                            seekResponderCert = false; // done
-                            break;
-                        }
-                    }
-                }
-            }
-        }
-
-        // Could not find the certificate identified in the OCSP properties
-        if (seekResponderCert) {
-            throw new CertPathValidatorException(
-                "Cannot find the responder's certificate " +
-                "(set using the OCSP security properties).");
-        }
-
-        // The algorithm constraints of the OCSP trusted responder certificate
-        // does not need to be checked in this code. The constraints will be
-        // checked when the responder's certificate is validated.
-
-        CertId certId = null;
-        OCSPResponse response = null;
-        try {
-            certId = new CertId
-                (issuerCert, currCertImpl.getSerialNumberObject());
-            response = OCSP.check(Collections.singletonList(certId), uri,
-                responderCert, pkixParams.getDate());
-        } catch (Exception e) {
-            if (e instanceof CertPathValidatorException) {
-                throw (CertPathValidatorException) e;
-            } else {
-                // Wrap exceptions in CertPathValidatorException so that
-                // we can fallback to CRLs, if enabled.
-                throw new CertPathValidatorException(e);
-            }
-        }
-
-        RevocationStatus rs = (RevocationStatus) response.getSingleResponse(certId);
-        RevocationStatus.CertStatus certStatus = rs.getCertStatus();
-        if (certStatus == RevocationStatus.CertStatus.REVOKED) {
-            Throwable t = new CertificateRevokedException(
-                rs.getRevocationTime(), rs.getRevocationReason(),
-                responderCert.getSubjectX500Principal(),
-                rs.getSingleExtensions());
-            throw new CertPathValidatorException(t.getMessage(), t,
-                null, -1, BasicReason.REVOKED);
-        } else if (certStatus == RevocationStatus.CertStatus.UNKNOWN) {
-            throw new CertPathValidatorException(
-                "Certificate's revocation status is unknown", null, cp,
-                remainingCerts, BasicReason.UNDETERMINED_REVOCATION_STATUS);
-        }
-    }
-
-    /*
-     * The OCSP security property values are in the following order:
-     *   1. ocsp.responderURL
-     *   2. ocsp.responderCertSubjectName
-     *   3. ocsp.responderCertIssuerName
-     *   4. ocsp.responderCertSerialNumber
-     */
-    private static URI getOCSPServerURI(X509CertImpl currCertImpl,
-        String responderURL) throws CertPathValidatorException {
-
-        if (responderURL != null) {
-            try {
-                return new URI(responderURL);
-            } catch (URISyntaxException e) {
-                throw new CertPathValidatorException(e);
-            }
-        }
-
-        // Examine the certificate's AuthorityInfoAccess extension
-        AuthorityInfoAccessExtension aia =
-            currCertImpl.getAuthorityInfoAccessExtension();
-        if (aia == null) {
-            throw new CertPathValidatorException(
-                "Must specify the location of an OCSP Responder");
-        }
-
-        List<AccessDescription> descriptions = aia.getAccessDescriptions();
-        for (AccessDescription description : descriptions) {
-            if (description.getAccessMethod().equals((Object)
-                AccessDescription.Ad_OCSP_Id)) {
-
-                GeneralName generalName = description.getAccessLocation();
-                if (generalName.getType() == GeneralNameInterface.NAME_URI) {
-                    URIName uri = (URIName) generalName.getName();
-                    return uri.getURI();
-                }
-            }
-        }
-
-        throw new CertPathValidatorException(
-            "Cannot find the location of the OCSP Responder");
-    }
-
-    /*
-     * Retrieves the values of the OCSP security properties.
-     */
-    private static String[] getOCSPProperties() {
-        final String[] properties = new String[4];
-
-        AccessController.doPrivileged(
-            new PrivilegedAction<Void>() {
-                public Void run() {
-                    properties[0] = Security.getProperty(OCSP_URL_PROP);
-                    properties[1] =
-                        Security.getProperty(OCSP_CERT_SUBJECT_PROP);
-                    properties[2] =
-                        Security.getProperty(OCSP_CERT_ISSUER_PROP);
-                    properties[3] =
-                        Security.getProperty(OCSP_CERT_NUMBER_PROP);
-                    return null;
-                }
-            });
-
-        return properties;
-    }
-
-    /*
-     * Removes any non-hexadecimal characters from a string.
-     */
-    private static String stripOutSeparators(String value) {
-        char[] chars = value.toCharArray();
-        StringBuilder hexNumber = new StringBuilder();
-        for (int i = 0; i < chars.length; i++) {
-            if (HEX_DIGITS.indexOf(chars[i]) != -1) {
-                hexNumber.append(chars[i]);
-            }
-        }
-        return hexNumber.toString();
-    }
-}
diff --git a/src/share/classes/sun/security/provider/certpath/OCSPRequest.java b/src/share/classes/sun/security/provider/certpath/OCSPRequest.java
index 0132e91..0854243 100644
--- a/src/share/classes/sun/security/provider/certpath/OCSPRequest.java
+++ b/src/share/classes/sun/security/provider/certpath/OCSPRequest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,8 +26,10 @@
 package sun.security.provider.certpath;
 
 import java.io.IOException;
+import java.security.cert.Extension;
 import java.util.Collections;
 import java.util.List;
+
 import sun.misc.HexDumpEncoder;
 import sun.security.util.*;
 
@@ -74,22 +76,29 @@
 
 class OCSPRequest {
 
-    private static final Debug debug = Debug.getInstance("certpath");
     private static final boolean dump = false;
 
     // List of request CertIds
     private final List<CertId> certIds;
+    private final List<Extension> extensions;
+    private byte[] nonce;
 
     /*
      * Constructs an OCSPRequest. This constructor is used
      * to construct an unsigned OCSP Request for a single user cert.
      */
     OCSPRequest(CertId certId) {
-        this.certIds = Collections.singletonList(certId);
+        this(Collections.singletonList(certId));
     }
 
     OCSPRequest(List<CertId> certIds) {
         this.certIds = certIds;
+        this.extensions = Collections.<Extension>emptyList();
+    }
+
+    OCSPRequest(List<CertId> certIds, List<Extension> extensions) {
+        this.certIds = certIds;
+        this.extensions = extensions;
     }
 
     byte[] encodeBytes() throws IOException {
@@ -104,7 +113,20 @@
         }
 
         tmp.write(DerValue.tag_Sequence, requestsOut);
-        // No extensions supported
+        if (!extensions.isEmpty()) {
+            DerOutputStream extOut = new DerOutputStream();
+            for (Extension ext : extensions) {
+                ext.encode(extOut);
+                if (ext.getId().equals(OCSP.NONCE_EXTENSION_OID.toString())) {
+                    nonce = ext.getValue();
+                }
+            }
+            DerOutputStream extsOut = new DerOutputStream();
+            extsOut.write(DerValue.tag_Sequence, extOut);
+            tmp.write(DerValue.createTag(DerValue.TAG_CONTEXT,
+                                         true, (byte)2), extsOut);
+        }
+
         DerOutputStream tbsRequest = new DerOutputStream();
         tbsRequest.write(DerValue.tag_Sequence, tmp);
 
@@ -126,4 +148,8 @@
     List<CertId> getCertIds() {
         return certIds;
     }
+
+    byte[] getNonce() {
+        return nonce;
+    }
 }
diff --git a/src/share/classes/sun/security/provider/certpath/OCSPResponse.java b/src/share/classes/sun/security/provider/certpath/OCSPResponse.java
index 0eb3d28..fee077e 100644
--- a/src/share/classes/sun/security/provider/certpath/OCSPResponse.java
+++ b/src/share/classes/sun/security/provider/certpath/OCSPResponse.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,11 +33,15 @@
 import java.security.cert.CRLReason;
 import java.security.cert.TrustAnchor;
 import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import javax.security.auth.x500.X500Principal;
+
 import sun.misc.HexDumpEncoder;
 import sun.security.x509.*;
 import sun.security.util.*;
@@ -125,13 +129,10 @@
     };
     private static ResponseStatus[] rsvalues = ResponseStatus.values();
 
-    private static final Debug DEBUG = Debug.getInstance("certpath");
+    private static final Debug debug = Debug.getInstance("certpath");
     private static final boolean dump = false;
     private static final ObjectIdentifier OCSP_BASIC_RESPONSE_OID =
         ObjectIdentifier.newInternal(new int[] { 1, 3, 6, 1, 5, 5, 7, 48, 1, 1});
-    private static final ObjectIdentifier OCSP_NONCE_EXTENSION_OID =
-        ObjectIdentifier.newInternal(new int[] { 1, 3, 6, 1, 5, 5, 7, 48, 1, 2});
-
     private static final int CERT_STATUS_GOOD = 0;
     private static final int CERT_STATUS_REVOKED = 1;
     private static final int CERT_STATUS_UNKNOWN = 2;
@@ -143,9 +144,6 @@
     // Object identifier for the OCSPSigning key purpose
     private static final String KP_OCSP_SIGNING_OID = "1.3.6.1.5.5.7.3.9";
 
-    private final ResponseStatus responseStatus;
-    private final Map<CertId, SingleResponse> singleResponseMap;
-
     // Maximum clock skew in milliseconds (15 minutes) allowed when checking
     // validity of OCSP responses
     private static final long MAX_CLOCK_SKEW = 900000;
@@ -153,14 +151,20 @@
     // an array of all of the CRLReasons (used in SingleResponse)
     private static CRLReason[] values = CRLReason.values();
 
+    private final ResponseStatus responseStatus;
+    private final Map<CertId, SingleResponse> singleResponseMap;
+    private final List<X509CertImpl> certs;
+    private final AlgorithmId sigAlgId;
+    private final byte[] signature;
+    private final byte[] tbsResponseData;
+    private final X500Principal responderName;
+    private final byte[] responderKey;
+    private final byte[] responseNonce;
+
     /*
      * Create an OCSP response from its ASN.1 DER encoding.
      */
-    OCSPResponse(byte[] bytes, Date dateCheckedAgainst,
-        X509Certificate responderCert)
-        throws IOException, CertPathValidatorException {
-
-        // OCSPResponse
+    OCSPResponse(byte[] bytes) throws IOException {
         if (dump) {
             HexDumpEncoder hexEnc = new HexDumpEncoder();
             System.out.println("OCSPResponse bytes are...");
@@ -181,12 +185,19 @@
             // unspecified responseStatus
             throw new IOException("Unknown OCSPResponse status: " + status);
         }
-        if (DEBUG != null) {
-            DEBUG.println("OCSP response status: " + responseStatus);
+        if (debug != null) {
+            debug.println("OCSP response status: " + responseStatus);
         }
         if (responseStatus != ResponseStatus.SUCCESSFUL) {
             // no need to continue, responseBytes are not set.
             singleResponseMap = Collections.emptyMap();
+            certs = Collections.<X509CertImpl>emptyList();
+            sigAlgId = null;
+            signature = null;
+            tbsResponseData = null;
+            responderName = null;
+            responderKey = null;
+            responseNonce = null;
             return;
         }
 
@@ -206,15 +217,15 @@
         derIn = tmp.data;
         ObjectIdentifier responseType = derIn.getOID();
         if (responseType.equals((Object)OCSP_BASIC_RESPONSE_OID)) {
-            if (DEBUG != null) {
-                DEBUG.println("OCSP response type: basic");
+            if (debug != null) {
+                debug.println("OCSP response type: basic");
             }
         } else {
-            if (DEBUG != null) {
-                DEBUG.println("OCSP response type: " + responseType);
+            if (debug != null) {
+                debug.println("OCSP response type: " + responseType);
             }
             throw new IOException("Unsupported OCSP response type: " +
-                responseType);
+                                  responseType);
         }
 
         // BasicOCSPResponse
@@ -229,7 +240,7 @@
         DerValue responseData = seqTmp[0];
 
         // Need the DER encoded ResponseData to verify the signature later
-        byte[] responseDataDer = seqTmp[0].toByteArray();
+        tbsResponseData = seqTmp[0].toByteArray();
 
         // tbsResponseData
         if (responseData.tag != DerValue.tag_Sequence) {
@@ -257,12 +268,15 @@
         // responderID
         short tag = (byte)(seq.tag & 0x1f);
         if (tag == NAME_TAG) {
-            if (DEBUG != null) {
-                X500Name responderName = new X500Name(seq.getData());
-                DEBUG.println("OCSP Responder name: " + responderName);
+            responderName =
+                new X500Principal(new ByteArrayInputStream(seq.toByteArray()));
+            if (debug != null) {
+                debug.println("OCSP Responder name: " + responderName);
             }
+            responderKey = null;
         } else if (tag == KEY_TAG) {
-            // Ignore, for now
+            responderKey = seq.getOctetString();
+            responderName = null;
         } else {
             throw new IOException("Bad encoding in responderID element of " +
                 "OCSP response: expected ASN.1 context specific tag 0 or 1");
@@ -270,57 +284,55 @@
 
         // producedAt
         seq = seqDerIn.getDerValue();
-        if (DEBUG != null) {
+        if (debug != null) {
             Date producedAtDate = seq.getGeneralizedTime();
-            DEBUG.println("OCSP response produced at: " + producedAtDate);
+            debug.println("OCSP response produced at: " + producedAtDate);
         }
 
         // responses
         DerValue[] singleResponseDer = seqDerIn.getSequence(1);
-        singleResponseMap
-            = new HashMap<CertId, SingleResponse>(singleResponseDer.length);
-        if (DEBUG != null) {
-            DEBUG.println("OCSP number of SingleResponses: "
-                + singleResponseDer.length);
+        singleResponseMap = new HashMap<>(singleResponseDer.length);
+        if (debug != null) {
+            debug.println("OCSP number of SingleResponses: "
+                          + singleResponseDer.length);
         }
         for (int i = 0; i < singleResponseDer.length; i++) {
-            SingleResponse singleResponse
-                = new SingleResponse(singleResponseDer[i]);
+            SingleResponse singleResponse =
+                new SingleResponse(singleResponseDer[i]);
             singleResponseMap.put(singleResponse.getCertId(), singleResponse);
         }
 
         // responseExtensions
+        byte[] nonce = null;
         if (seqDerIn.available() > 0) {
             seq = seqDerIn.getDerValue();
             if (seq.isContextSpecific((byte)1)) {
                 DerValue[] responseExtDer = seq.data.getSequence(3);
                 for (int i = 0; i < responseExtDer.length; i++) {
-                    Extension responseExtension
-                        = new Extension(responseExtDer[i]);
-                    if (DEBUG != null) {
-                        DEBUG.println("OCSP extension: " + responseExtension);
+                    Extension ext = new Extension(responseExtDer[i]);
+                    if (debug != null) {
+                        debug.println("OCSP extension: " + ext);
                     }
-                    if (responseExtension.getExtensionId().equals((Object)
-                        OCSP_NONCE_EXTENSION_OID)) {
-                        /*
-                        ocspNonce =
-                            responseExtension[i].getExtensionValue();
-                         */
-                    } else if (responseExtension.isCritical())  {
+                    // Only the NONCE extension is recognized
+                    if (ext.getExtensionId().equals((Object)
+                        OCSP.NONCE_EXTENSION_OID))
+                    {
+                        nonce = ext.getExtensionValue();
+                    } else if (ext.isCritical())  {
                         throw new IOException(
                             "Unsupported OCSP critical extension: " +
-                            responseExtension.getExtensionId());
+                            ext.getExtensionId());
                     }
                 }
             }
         }
+        responseNonce = nonce;
 
         // signatureAlgorithmId
-        AlgorithmId sigAlgId = AlgorithmId.parse(seqTmp[1]);
+        sigAlgId = AlgorithmId.parse(seqTmp[1]);
 
         // signature
-        byte[] signature = seqTmp[2].getBitString();
-        X509CertImpl[] x509Certs = null;
+        signature = seqTmp[2].getBitString();
 
         // if seq[3] is available , then it is a sequence of certificates
         if (seqTmp.length > 3) {
@@ -330,30 +342,59 @@
                 throw new IOException("Bad encoding in certs element of " +
                     "OCSP response: expected ASN.1 context specific tag 0.");
             }
-            DerValue[] certs = seqCert.getData().getSequence(3);
-            x509Certs = new X509CertImpl[certs.length];
+            DerValue[] derCerts = seqCert.getData().getSequence(3);
+            certs = new ArrayList<X509CertImpl>(derCerts.length);
             try {
-                for (int i = 0; i < certs.length; i++) {
-                    x509Certs[i] = new X509CertImpl(certs[i].toByteArray());
+                for (int i = 0; i < derCerts.length; i++) {
+                    certs.add(new X509CertImpl(derCerts[i].toByteArray()));
                 }
             } catch (CertificateException ce) {
                 throw new IOException("Bad encoding in X509 Certificate", ce);
             }
+        } else {
+            certs = Collections.<X509CertImpl>emptyList();
+        }
+    }
+
+    void verify(List<CertId> certIds, X509Certificate responderCert,
+                Date date, byte[] nonce)
+        throws CertPathValidatorException
+    {
+        if (responseStatus != ResponseStatus.SUCCESSFUL) {
+            throw new CertPathValidatorException
+                ("OCSP response error: " + responseStatus);
         }
 
-        // Check whether the cert returned by the responder is trusted
-        if (x509Certs != null && x509Certs[0] != null) {
-            X509CertImpl cert = x509Certs[0];
+        // Check that the response includes a response for all of the
+        // certs that were supplied in the request
+        for (CertId certId : certIds) {
+            SingleResponse sr = getSingleResponse(certId);
+            if (sr == null) {
+                if (debug != null) {
+                    debug.println("No response found for CertId: " + certId);
+                }
+                throw new CertPathValidatorException(
+                    "OCSP response does not include a response for a " +
+                    "certificate supplied in the OCSP request");
+            }
+            if (debug != null) {
+                debug.println("Status of certificate (with serial number " +
+                    certId.getSerialNumber() + ") is: " + sr.getCertStatus());
+            }
+        }
 
-            // First check if the cert matches the responder cert which
-            // was set locally.
+
+        // Check whether the cert returned by the responder is trusted
+        if (!certs.isEmpty()) {
+            X509CertImpl cert = certs.get(0);
+            // First check if the cert matches the expected responder cert
             if (cert.equals(responderCert)) {
                 // cert is trusted, now verify the signed response
 
             // Next check if the cert was issued by the responder cert
             // which was set locally.
             } else if (cert.getIssuerX500Principal().equals(
-                responderCert.getSubjectX500Principal())) {
+                       responderCert.getSubjectX500Principal())) {
 
                 // Check for the OCSPSigning key purpose
                 try {
@@ -380,12 +421,12 @@
 
                 // check the validity
                 try {
-                    if (dateCheckedAgainst == null) {
+                    if (date == null) {
                         cert.checkValidity();
                     } else {
-                        cert.checkValidity(dateCheckedAgainst);
+                        cert.checkValidity(date);
                     }
-                } catch (GeneralSecurityException e) {
+                } catch (CertificateException e) {
                     throw new CertPathValidatorException(
                         "Responder's certificate not within the " +
                         "validity period", e);
@@ -401,8 +442,8 @@
                 Extension noCheck =
                     cert.getExtension(PKIXExtensions.OCSPNoCheck_Id);
                 if (noCheck != null) {
-                    if (DEBUG != null) {
-                        DEBUG.println("Responder's certificate includes " +
+                    if (debug != null) {
+                        debug.println("Responder's certificate includes " +
                             "the extension id-pkix-ocsp-nocheck.");
                     }
                 } else {
@@ -433,15 +474,44 @@
             // "jdk.certpath.disabledAlgorithms".
             AlgorithmChecker.check(responderCert.getPublicKey(), sigAlgId);
 
-            if (!verifyResponse(responseDataDer, responderCert,
-                sigAlgId, signature)) {
+            if (!verifySignature(responderCert)) {
                 throw new CertPathValidatorException(
-                    "Error verifying OCSP Responder's signature");
+                    "Error verifying OCSP Response's signature");
             }
         } else {
             // Need responder's cert in order to verify the signature
             throw new CertPathValidatorException(
-                "Unable to verify OCSP Responder's signature");
+                "Unable to verify OCSP Response's signature");
+        }
+
+        // Check freshness of OCSPResponse
+        if (nonce != null) {
+            if (responseNonce != null && !Arrays.equals(nonce, responseNonce)) {
+                throw new CertPathValidatorException("Nonces don't match");
+            }
+        }
+
+        long now = (date == null) ? System.currentTimeMillis() : date.getTime();
+        Date nowPlusSkew = new Date(now + MAX_CLOCK_SKEW);
+        Date nowMinusSkew = new Date(now - MAX_CLOCK_SKEW);
+        for (SingleResponse sr : singleResponseMap.values()) {
+            if (debug != null) {
+                String until = "";
+                if (sr.nextUpdate != null) {
+                    until = " until " + sr.nextUpdate;
+                }
+                debug.println("Response's validity interval is from " +
+                              sr.thisUpdate + until);
+            }
+
+            // Check that the test date is within the validity interval
+            if ((sr.thisUpdate != null && nowPlusSkew.before(sr.thisUpdate)) ||
+                (sr.nextUpdate != null && nowMinusSkew.after(sr.nextUpdate)))
+            {
+                throw new CertPathValidatorException(
+                                      "Response is unreliable: its validity " +
+                                      "interval is out-of-date");
+            }
         }
     }
 
@@ -456,34 +526,31 @@
      * Verify the signature of the OCSP response.
      * The responder's cert is implicitly trusted.
      */
-    private boolean verifyResponse(byte[] responseData, X509Certificate cert,
-        AlgorithmId sigAlgId, byte[] signBytes)
+    private boolean verifySignature(X509Certificate cert)
         throws CertPathValidatorException {
 
         try {
             Signature respSignature = Signature.getInstance(sigAlgId.getName());
             respSignature.initVerify(cert);
-            respSignature.update(responseData);
+            respSignature.update(tbsResponseData);
 
-            if (respSignature.verify(signBytes)) {
-                if (DEBUG != null) {
-                    DEBUG.println("Verified signature of OCSP Responder");
+            if (respSignature.verify(signature)) {
+                if (debug != null) {
+                    debug.println("Verified signature of OCSP Response");
                 }
                 return true;
 
             } else {
-                if (DEBUG != null) {
-                    DEBUG.println(
-                        "Error verifying signature of OCSP Responder");
+                if (debug != null) {
+                    debug.println(
+                        "Error verifying signature of OCSP Response");
                 }
                 return false;
             }
-        } catch (InvalidKeyException ike) {
-            throw new CertPathValidatorException(ike);
-        } catch (NoSuchAlgorithmException nsae) {
-            throw new CertPathValidatorException(nsae);
-        } catch (SignatureException se) {
-            throw new CertPathValidatorException(se);
+        } catch (InvalidKeyException | NoSuchAlgorithmException |
+                 SignatureException e)
+        {
+            throw new CertPathValidatorException(e);
         }
     }
 
@@ -537,9 +604,9 @@
                     revocationReason = CRLReason.UNSPECIFIED;
                 }
                 // RevokedInfo
-                if (DEBUG != null) {
-                    DEBUG.println("Revocation time: " + revocationTime);
-                    DEBUG.println("Revocation reason: " + revocationReason);
+                if (debug != null) {
+                    debug.println("Revocation time: " + revocationTime);
+                    debug.println("Revocation reason: " + revocationReason);
                 }
             } else {
                 revocationTime = null;
@@ -585,8 +652,8 @@
                             (singleExtDer.length);
                     for (int i = 0; i < singleExtDer.length; i++) {
                         Extension ext = new Extension(singleExtDer[i]);
-                        if (DEBUG != null) {
-                            DEBUG.println("OCSP single extension: " + ext);
+                        if (debug != null) {
+                            debug.println("OCSP single extension: " + ext);
                         }
                         // We don't support any extensions yet. Therefore, if it
                         // is critical we must throw an exception because we
@@ -604,29 +671,6 @@
             } else {
                 singleExtensions = Collections.emptyMap();
             }
-
-            long now = System.currentTimeMillis();
-            Date nowPlusSkew = new Date(now + MAX_CLOCK_SKEW);
-            Date nowMinusSkew = new Date(now - MAX_CLOCK_SKEW);
-            if (DEBUG != null) {
-                String until = "";
-                if (nextUpdate != null) {
-                    until = " until " + nextUpdate;
-                }
-                DEBUG.println("Response's validity interval is from " +
-                    thisUpdate + until);
-            }
-            // Check that the test date is within the validity interval
-            if ((thisUpdate != null && nowPlusSkew.before(thisUpdate)) ||
-                (nextUpdate != null && nowMinusSkew.after(nextUpdate))) {
-
-                if (DEBUG != null) {
-                    DEBUG.println("Response is unreliable: its validity " +
-                        "interval is out-of-date");
-                }
-                throw new IOException("Response is unreliable: its validity " +
-                    "interval is out-of-date");
-            }
         }
 
         /*
diff --git a/src/share/classes/sun/security/provider/certpath/PKIX.java b/src/share/classes/sun/security/provider/certpath/PKIX.java
new file mode 100644
index 0000000..f5076d4
--- /dev/null
+++ b/src/share/classes/sun/security/provider/certpath/PKIX.java
@@ -0,0 +1,289 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package sun.security.provider.certpath;
+
+import java.security.InvalidAlgorithmParameterException;
+import java.security.KeyStore;
+import java.security.cert.*;
+import java.util.*;
+import javax.security.auth.x500.X500Principal;
+
+import sun.security.util.Debug;
+
+/**
+ * Common utility methods and classes used by the PKIX CertPathValidator and
+ * CertPathBuilder implementation.
+ */
+class PKIX {
+
+    private static final Debug debug = Debug.getInstance("certpath");
+
+    private PKIX() { }
+
+    static ValidatorParams checkParams(CertPath cp, CertPathParameters params)
+        throws InvalidAlgorithmParameterException
+    {
+        if (!(params instanceof PKIXParameters)) {
+            throw new InvalidAlgorithmParameterException("inappropriate "
+                + "params, must be an instance of PKIXParameters");
+        }
+        return new ValidatorParams(cp, (PKIXParameters)params);
+    }
+
+    static BuilderParams checkBuilderParams(CertPathParameters params)
+        throws InvalidAlgorithmParameterException
+    {
+        if (!(params instanceof PKIXBuilderParameters)) {
+            throw new InvalidAlgorithmParameterException("inappropriate "
+                + "params, must be an instance of PKIXBuilderParameters");
+        }
+        return new BuilderParams((PKIXBuilderParameters)params);
+    }
+
+    /**
+     * PKIXParameters that are shared by the PKIX CertPathValidator
+     * implementation. Provides additional functionality and avoids
+     * unnecessary cloning.
+     */
+    static class ValidatorParams {
+        private final PKIXParameters params;
+        private CertPath certPath;
+        private List<PKIXCertPathChecker> checkers;
+        private List<CertStore> stores;
+        private boolean gotDate;
+        private Date date;
+        private Set<String> policies;
+        private boolean gotConstraints;
+        private CertSelector constraints;
+        private Set<TrustAnchor> anchors;
+        private List<X509Certificate> certs;
+
+        ValidatorParams(CertPath cp, PKIXParameters params)
+            throws InvalidAlgorithmParameterException
+        {
+            this(params);
+            if (!cp.getType().equals("X.509") && !cp.getType().equals("X509")) {
+                throw new InvalidAlgorithmParameterException("inappropriate "
+                    + "CertPath type specified, must be X.509 or X509");
+            }
+            this.certPath = cp;
+        }
+
+        ValidatorParams(PKIXParameters params)
+            throws InvalidAlgorithmParameterException
+        {
+            this.anchors = params.getTrustAnchors();
+            // Make sure that none of the trust anchors include name constraints
+            // (not supported).
+            for (TrustAnchor anchor : this.anchors) {
+                if (anchor.getNameConstraints() != null) {
+                    throw new InvalidAlgorithmParameterException
+                        ("name constraints in trust anchor not supported");
+                }
+            }
+            this.params = params;
+        }
+
+        CertPath certPath() {
+            return certPath;
+        }
+        // called by CertPathBuilder after path has been built
+        void setCertPath(CertPath cp) {
+            this.certPath = cp;
+        }
+        List<X509Certificate> certificates() {
+            if (certs == null) {
+                if (certPath == null) {
+                    certs = Collections.emptyList();
+                } else {
+                    // Reverse the ordering for validation so that the target
+                    // cert is the last certificate
+                    @SuppressWarnings("unchecked")
+                    List<X509Certificate> xc = new ArrayList<>
+                        ((List<X509Certificate>)certPath.getCertificates());
+                    Collections.reverse(xc);
+                    certs = xc;
+                }
+            }
+            return certs;
+        }
+        List<PKIXCertPathChecker> certPathCheckers() {
+            if (checkers == null)
+                checkers = params.getCertPathCheckers();
+            return checkers;
+        }
+        List<CertStore> certStores() {
+            if (stores == null)
+                stores = params.getCertStores();
+            return stores;
+        }
+        Date date() {
+            if (!gotDate) {
+                date = params.getDate();
+                if (date == null)
+                    date = new Date();
+                gotDate = true;
+            }
+            return date;
+        }
+        Set<String> initialPolicies() {
+            if (policies == null)
+                policies = params.getInitialPolicies();
+            return policies;
+        }
+        CertSelector targetCertConstraints() {
+            if (!gotConstraints) {
+                constraints = params.getTargetCertConstraints();
+                gotConstraints = true;
+            }
+            return constraints;
+        }
+        Set<TrustAnchor> trustAnchors() {
+            return anchors;
+        }
+        boolean revocationEnabled() {
+            return params.isRevocationEnabled();
+        }
+        boolean policyMappingInhibited() {
+            return params.isPolicyMappingInhibited();
+        }
+        boolean explicitPolicyRequired() {
+            return params.isExplicitPolicyRequired();
+        }
+        boolean policyQualifiersRejected() {
+            return params.getPolicyQualifiersRejected();
+        }
+        String sigProvider() { return params.getSigProvider(); }
+        boolean anyPolicyInhibited() { return params.isAnyPolicyInhibited(); }
+
+        // in rare cases we need access to the original params, for example
+        // in order to clone CertPathCheckers before building a new chain
+        PKIXParameters getPKIXParameters() {
+            return params;
+        }
+    }
+
+    static class BuilderParams extends ValidatorParams {
+        private PKIXBuilderParameters params;
+        private boolean buildForward = true;
+        private List<CertStore> stores;
+        private X500Principal targetSubject;
+
+        BuilderParams(PKIXBuilderParameters params)
+            throws InvalidAlgorithmParameterException
+        {
+            super(params);
+            checkParams(params);
+        }
+        private void checkParams(PKIXBuilderParameters params)
+            throws InvalidAlgorithmParameterException
+        {
+            CertSelector sel = targetCertConstraints();
+            if (!(sel instanceof X509CertSelector)) {
+                throw new InvalidAlgorithmParameterException("the "
+                    + "targetCertConstraints parameter must be an "
+                    + "X509CertSelector");
+            }
+            if (params instanceof SunCertPathBuilderParameters) {
+                buildForward =
+                    ((SunCertPathBuilderParameters)params).getBuildForward();
+            }
+            this.params = params;
+            this.targetSubject = getTargetSubject(
+                certStores(), (X509CertSelector)targetCertConstraints());
+        }
+        @Override List<CertStore> certStores() {
+            if (stores == null) {
+                // reorder CertStores so that local CertStores are tried first
+                stores = new ArrayList<>(params.getCertStores());
+                Collections.sort(stores, new CertStoreComparator());
+            }
+            return stores;
+        }
+        int maxPathLength() { return params.getMaxPathLength(); }
+        boolean buildForward() { return buildForward; }
+        PKIXBuilderParameters params() { return params; }
+        X500Principal targetSubject() { return targetSubject; }
+
+        /**
+         * Returns the target subject DN from the first X509Certificate that
+         * is fetched that matches the specified X509CertSelector.
+         */
+        private static X500Principal getTargetSubject(List<CertStore> stores,
+                                                      X509CertSelector sel)
+            throws InvalidAlgorithmParameterException
+        {
+            X500Principal subject = sel.getSubject();
+            if (subject != null) {
+                return subject;
+            }
+            X509Certificate cert = sel.getCertificate();
+            if (cert != null) {
+                subject = cert.getSubjectX500Principal();
+            }
+            if (subject != null) {
+                return subject;
+            }
+            for (CertStore store : stores) {
+                try {
+                    Collection<? extends Certificate> certs =
+                        (Collection<? extends Certificate>)
+                            store.getCertificates(sel);
+                    if (!certs.isEmpty()) {
+                        X509Certificate xc =
+                            (X509Certificate)certs.iterator().next();
+                        return xc.getSubjectX500Principal();
+                    }
+                } catch (CertStoreException e) {
+                    // ignore but log it
+                    if (debug != null) {
+                        debug.println("BuilderParams.getTargetSubjectDN: " +
+                            "non-fatal exception retrieving certs: " + e);
+                        e.printStackTrace();
+                    }
+                }
+            }
+            throw new InvalidAlgorithmParameterException
+                ("Could not determine unique target subject");
+        }
+    }
+
+    /**
+     * Comparator that orders CertStores so that local CertStores come before
+     * remote CertStores.
+     */
+    private static class CertStoreComparator implements Comparator<CertStore> {
+        @Override
+        public int compare(CertStore store1, CertStore store2) {
+            if (store1.getType().equals("Collection") ||
+                store1.getCertStoreParameters() instanceof
+                CollectionCertStoreParameters) {
+                return -1;
+            } else {
+                return 1;
+            }
+        }
+    }
+}
diff --git a/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java b/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java
index c3aac69..057e99e 100644
--- a/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java
+++ b/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java
@@ -25,55 +25,38 @@
 
 package sun.security.provider.certpath;
 
-import java.security.AccessController;
+import java.io.IOException;
 import java.security.InvalidAlgorithmParameterException;
-import java.security.cert.CertPath;
-import java.security.cert.CertPathParameters;
-import java.security.cert.CertPathValidatorException;
-import java.security.cert.CertPathValidatorSpi;
-import java.security.cert.CertPathValidatorResult;
-import java.security.cert.PKIXCertPathChecker;
-import java.security.cert.PKIXCertPathValidatorResult;
-import java.security.cert.PKIXParameters;
-import java.security.cert.PKIXReason;
-import java.security.cert.PolicyNode;
-import java.security.cert.TrustAnchor;
-import java.security.cert.X509Certificate;
-import java.util.Collections;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Set;
-import sun.security.action.GetBooleanSecurityPropertyAction;
-import sun.security.util.Debug;
+import java.security.cert.*;
+import java.util.*;
 
+import sun.security.provider.certpath.PKIX.ValidatorParams;
 import sun.security.x509.X509CertImpl;
-
+import sun.security.util.Debug;
 
 /**
  * This class implements the PKIX validation algorithm for certification
  * paths consisting exclusively of <code>X509Certificates</code>. It uses
  * the specified input parameter set (which must be a
- * <code>PKIXParameters</code> object) and signature provider (if any).
+ * <code>PKIXParameters</code> object).
  *
  * @since       1.4
  * @author      Yassir Elley
  */
-public class PKIXCertPathValidator extends CertPathValidatorSpi {
+public final class PKIXCertPathValidator extends CertPathValidatorSpi {
 
     private static final Debug debug = Debug.getInstance("certpath");
-    private Date testDate;
-    private List<PKIXCertPathChecker> userCheckers;
-    private String sigProvider;
-    private BasicChecker basicChecker;
-    private boolean ocspEnabled = false;
-    private boolean onlyEECert = false;
 
     /**
      * Default constructor.
      */
     public PKIXCertPathValidator() {}
 
+    @Override
+    public CertPathChecker engineGetRevocationChecker() {
+        return new RevocationChecker();
+    }
+
     /**
      * Validates a certification path consisting exclusively of
      * <code>X509Certificate</code>s using the PKIX validation algorithm,
@@ -81,98 +64,70 @@
      * The input parameter set must be a <code>PKIXParameters</code> object.
      *
      * @param cp the X509 certification path
-     * @param param the input PKIX parameter set
+     * @param params the input PKIX parameter set
      * @return the result
-     * @exception CertPathValidatorException Exception thrown if cert path
-     * does not validate.
-     * @exception InvalidAlgorithmParameterException if the specified
-     * parameters are inappropriate for this certification path validator
+     * @throws CertPathValidatorException if cert path does not validate.
+     * @throws InvalidAlgorithmParameterException if the specified
+     *         parameters are inappropriate for this CertPathValidator
      */
+    @Override
     public CertPathValidatorResult engineValidate(CertPath cp,
-        CertPathParameters param)
+                                                  CertPathParameters params)
         throws CertPathValidatorException, InvalidAlgorithmParameterException
     {
+        ValidatorParams valParams = PKIX.checkParams(cp, params);
+        return validate(valParams);
+    }
+
+    private static PKIXCertPathValidatorResult validate(ValidatorParams params)
+        throws CertPathValidatorException
+    {
         if (debug != null)
             debug.println("PKIXCertPathValidator.engineValidate()...");
 
-        if (!(param instanceof PKIXParameters)) {
-            throw new InvalidAlgorithmParameterException("inappropriate "
-                + "parameters, must be an instance of PKIXParameters");
-        }
-
-        if (!cp.getType().equals("X.509") && !cp.getType().equals("X509")) {
-            throw new InvalidAlgorithmParameterException("inappropriate "
-                + "certification path type specified, must be X.509 or X509");
-        }
-
-        PKIXParameters pkixParam = (PKIXParameters) param;
-
-        // Make sure that none of the trust anchors include name constraints
-        // (not supported).
-        Set<TrustAnchor> anchors = pkixParam.getTrustAnchors();
-        for (TrustAnchor anchor : anchors) {
-            if (anchor.getNameConstraints() != null) {
-                throw new InvalidAlgorithmParameterException
-                    ("name constraints in trust anchor not supported");
-            }
-        }
-
-        // the certpath which has been passed in (cp)
-        // has the target cert as the first certificate - we
-        // need to keep this cp so we can return it
-        // in case of an exception and for policy qualifier
-        // processing - however, for certpath validation,
-        // we need to create a reversed path, where we reverse the
-        // ordering so that the target cert is the last certificate
-
-        // Must copy elements of certList into a new modifiable List before
-        // calling Collections.reverse().
-        // If cp is not an X.509 or X509 certpath, an
-        // InvalidAlgorithmParameterException will have been thrown by now.
-        @SuppressWarnings("unchecked")
-        ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>
-            ((List<X509Certificate>)cp.getCertificates());
-        if (debug != null) {
-            if (certList.isEmpty()) {
-                debug.println("PKIXCertPathValidator.engineValidate() "
-                    + "certList is empty");
-            }
-            debug.println("PKIXCertPathValidator.engineValidate() "
-                + "reversing certpath...");
-        }
-        Collections.reverse(certList);
-
-        // now certList has the target cert as the last cert and we
-        // can proceed with normal validation
-
-        populateVariables(pkixParam);
-
         // Retrieve the first certificate in the certpath
         // (to be used later in pre-screening)
-        X509Certificate firstCert = null;
+        AdaptableX509CertSelector selector = null;
+        List<X509Certificate> certList = params.certificates();
         if (!certList.isEmpty()) {
-            firstCert = certList.get(0);
+            selector = new AdaptableX509CertSelector();
+            X509Certificate firstCert = certList.get(0);
+            // check trusted certificate's subject
+            selector.setSubject(firstCert.getIssuerX500Principal());
+            // check the validity period
+            selector.setValidityPeriod(firstCert.getNotBefore(),
+                                       firstCert.getNotAfter());
+            /*
+             * Facilitate certification path construction with authority
+             * key identifier and subject key identifier.
+             */
+            try {
+                X509CertImpl firstCertImpl = X509CertImpl.toImpl(firstCert);
+                selector.parseAuthorityKeyIdentifierExtension(
+                            firstCertImpl.getAuthorityKeyIdentifierExtension());
+            } catch (CertificateException | IOException e) {
+                // ignore
+            }
         }
 
         CertPathValidatorException lastException = null;
 
         // We iterate through the set of trust anchors until we find
         // one that works at which time we stop iterating
-        for (TrustAnchor anchor : anchors) {
+        for (TrustAnchor anchor : params.trustAnchors()) {
             X509Certificate trustedCert = anchor.getTrustedCert();
             if (trustedCert != null) {
-                if (debug != null) {
-                    debug.println("PKIXCertPathValidator.engineValidate() "
-                        + "anchor.getTrustedCert() != null");
-                }
-
                 // if this trust anchor is not worth trying,
                 // we move on to the next one
-                if (!isWorthTrying(trustedCert, firstCert)) {
+                if (selector != null && !selector.match(trustedCert)) {
+                    if (debug != null) {
+                        debug.println("NO - don't try this trustedCert");
+                    }
                     continue;
                 }
 
                 if (debug != null) {
+                    debug.println("YES - try this trustedCert");
                     debug.println("anchor.getTrustedCert()."
                         + "getSubjectX500Principal() = "
                         + trustedCert.getSubjectX500Principal());
@@ -185,14 +140,7 @@
             }
 
             try {
-                PolicyNodeImpl rootNode = new PolicyNodeImpl(null,
-                    PolicyChecker.ANY_POLICY, null, false,
-                    Collections.singleton(PolicyChecker.ANY_POLICY), false);
-                PolicyNode policyTree =
-                    doValidate(anchor, cp, certList, pkixParam, rootNode);
-                // if this anchor works, return success
-                return new PKIXCertPathValidatorResult(anchor, policyTree,
-                    basicChecker.getPublicKey());
+                return validate(anchor, params);
             } catch (CertPathValidatorException cpe) {
                 // remember this exception
                 lastException = cpe;
@@ -210,146 +158,60 @@
              null, null, -1, PKIXReason.NO_TRUST_ANCHOR);
     }
 
-    /**
-     * Internal method to do some simple checks to see if a given cert is
-     * worth trying to validate in the chain.
-     */
-    private boolean isWorthTrying(X509Certificate trustedCert,
-          X509Certificate firstCert) {
-
-        boolean worthy = false;
-
-        if (debug != null) {
-            debug.println("PKIXCertPathValidator.isWorthTrying() checking "
-                + "if this trusted cert is worth trying ...");
-        }
-
-        if (firstCert == null) {
-            return true;
-        }
-
-        AdaptableX509CertSelector issuerSelector =
-                        new AdaptableX509CertSelector();
-
-        // check trusted certificate's subject
-        issuerSelector.setSubject(firstCert.getIssuerX500Principal());
-
-        // check the validity period
-        issuerSelector.setValidityPeriod(firstCert.getNotBefore(),
-                                                firstCert.getNotAfter());
-
-        /*
-         * Facilitate certification path construction with authority
-         * key identifier and subject key identifier.
-         */
-        try {
-            X509CertImpl firstCertImpl = X509CertImpl.toImpl(firstCert);
-            issuerSelector.parseAuthorityKeyIdentifierExtension(
-                        firstCertImpl.getAuthorityKeyIdentifierExtension());
-
-            worthy = issuerSelector.match(trustedCert);
-        } catch (Exception e) {
-            // It is not worth trying.
-        }
-
-        if (debug != null) {
-            if (worthy) {
-                debug.println("YES - try this trustedCert");
-            } else {
-                debug.println("NO - don't try this trustedCert");
-            }
-        }
-
-        return worthy;
-    }
-
-    /**
-     * Internal method to setup the internal state
-     */
-    private void populateVariables(PKIXParameters pkixParam)
+    private static PKIXCertPathValidatorResult validate(TrustAnchor anchor,
+                                                        ValidatorParams params)
+        throws CertPathValidatorException
     {
-        // default value for testDate is current time
-        testDate = pkixParam.getDate();
-        if (testDate == null) {
-            testDate = new Date(System.currentTimeMillis());
-        }
+        int certPathLen = params.certificates().size();
 
-        userCheckers = pkixParam.getCertPathCheckers();
-        sigProvider = pkixParam.getSigProvider();
-
-        if (pkixParam.isRevocationEnabled()) {
-            // Examine OCSP security property
-            ocspEnabled = AccessController.doPrivileged(
-                new GetBooleanSecurityPropertyAction
-                    (OCSPChecker.OCSP_ENABLE_PROP));
-            onlyEECert = AccessController.doPrivileged(
-                new GetBooleanSecurityPropertyAction
-                    ("com.sun.security.onlyCheckRevocationOfEECert"));
-        }
-    }
-
-    /**
-     * Internal method to actually validate a constructed path.
-     *
-     * @return the valid policy tree
-     */
-    private PolicyNode doValidate(
-            TrustAnchor anchor, CertPath cpOriginal,
-            ArrayList<X509Certificate> certList, PKIXParameters pkixParam,
-            PolicyNodeImpl rootNode) throws CertPathValidatorException
-    {
-        int certPathLen = certList.size();
-
-        basicChecker = new BasicChecker(anchor, testDate, sigProvider, false);
-        AlgorithmChecker algorithmChecker = new AlgorithmChecker(anchor);
-        KeyChecker keyChecker = new KeyChecker(certPathLen,
-            pkixParam.getTargetCertConstraints());
-        ConstraintsChecker constraintsChecker =
-            new ConstraintsChecker(certPathLen);
-
-        PolicyChecker policyChecker =
-            new PolicyChecker(pkixParam.getInitialPolicies(), certPathLen,
-                              pkixParam.isExplicitPolicyRequired(),
-                              pkixParam.isPolicyMappingInhibited(),
-                              pkixParam.isAnyPolicyInhibited(),
-                              pkixParam.getPolicyQualifiersRejected(),
-                              rootNode);
-        UntrustedChecker untrustedChecker = new UntrustedChecker();
-
-        ArrayList<PKIXCertPathChecker> certPathCheckers =
-            new ArrayList<PKIXCertPathChecker>();
+        // create PKIXCertPathCheckers
+        List<PKIXCertPathChecker> certPathCheckers = new ArrayList<>();
         // add standard checkers that we will be using
-        certPathCheckers.add(untrustedChecker);
-        certPathCheckers.add(algorithmChecker);
-        certPathCheckers.add(keyChecker);
-        certPathCheckers.add(constraintsChecker);
-        certPathCheckers.add(policyChecker);
-        certPathCheckers.add(basicChecker);
+        certPathCheckers.add(new UntrustedChecker());
+        certPathCheckers.add(new AlgorithmChecker(anchor));
+        certPathCheckers.add(new KeyChecker(certPathLen,
+                                            params.targetCertConstraints()));
+        certPathCheckers.add(new ConstraintsChecker(certPathLen));
+        PolicyNodeImpl rootNode =
+            new PolicyNodeImpl(null, PolicyChecker.ANY_POLICY, null, false,
+                               Collections.singleton(PolicyChecker.ANY_POLICY),
+                               false);
+        PolicyChecker pc = new PolicyChecker(params.initialPolicies(),
+                                             certPathLen,
+                                             params.explicitPolicyRequired(),
+                                             params.policyMappingInhibited(),
+                                             params.anyPolicyInhibited(),
+                                             params.policyQualifiersRejected(),
+                                             rootNode);
+        certPathCheckers.add(pc);
+        // default value for date is current time
+        BasicChecker bc = new BasicChecker(anchor, params.date(),
+                                           params.sigProvider(), false);
+        certPathCheckers.add(bc);
 
-        // only add a revocationChecker if revocation is enabled
-        if (pkixParam.isRevocationEnabled()) {
-
-            // Use OCSP if it has been enabled
-            if (ocspEnabled) {
-                OCSPChecker ocspChecker =
-                    new OCSPChecker(cpOriginal, pkixParam, onlyEECert);
-                certPathCheckers.add(ocspChecker);
+        boolean revCheckerAdded = false;
+        List<PKIXCertPathChecker> checkers = params.certPathCheckers();
+        for (PKIXCertPathChecker checker : checkers) {
+            if (checker instanceof PKIXRevocationChecker) {
+                revCheckerAdded = true;
+                // if it's our own, initialize it
+                if (checker instanceof RevocationChecker)
+                    ((RevocationChecker)checker).init(anchor, params);
             }
-
-            // Always use CRLs
-            CrlRevocationChecker revocationChecker = new
-                CrlRevocationChecker(anchor, pkixParam, certList, onlyEECert);
-            certPathCheckers.add(revocationChecker);
         }
-
+        // only add a RevocationChecker if revocation is enabled and
+        // a PKIXRevocationChecker has not already been added
+        if (params.revocationEnabled() && !revCheckerAdded) {
+            certPathCheckers.add(new RevocationChecker(anchor, params));
+        }
         // add user-specified checkers
-        certPathCheckers.addAll(userCheckers);
+        certPathCheckers.addAll(checkers);
 
-        PKIXMasterCertPathValidator masterValidator =
-            new PKIXMasterCertPathValidator(certPathCheckers);
+        PKIXMasterCertPathValidator.validate(params.certPath(),
+                                             params.certificates(),
+                                             certPathCheckers);
 
-        masterValidator.validate(cpOriginal, certList);
-
-        return policyChecker.getPolicyTree();
+        return new PKIXCertPathValidatorResult(anchor, pc.getPolicyTree(),
+                                               bc.getPublicKey());
     }
 }
diff --git a/src/share/classes/sun/security/provider/certpath/PKIXMasterCertPathValidator.java b/src/share/classes/sun/security/provider/certpath/PKIXMasterCertPathValidator.java
index e825b84..db5edda 100644
--- a/src/share/classes/sun/security/provider/certpath/PKIXMasterCertPathValidator.java
+++ b/src/share/classes/sun/security/provider/certpath/PKIXMasterCertPathValidator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,10 +30,8 @@
 import java.util.Collections;
 import java.util.List;
 import java.util.Set;
-import java.security.cert.CertificateRevokedException;
 import java.security.cert.CertPath;
 import java.security.cert.CertPathValidatorException;
-import java.security.cert.CertPathValidatorException.BasicReason;
 import java.security.cert.PKIXCertPathChecker;
 import java.security.cert.PKIXReason;
 import java.security.cert.X509Certificate;
@@ -49,32 +47,22 @@
 class PKIXMasterCertPathValidator {
 
     private static final Debug debug = Debug.getInstance("certpath");
-    private List<PKIXCertPathChecker> certPathCheckers;
-
-    /**
-     * Initializes the list of PKIXCertPathCheckers whose checks
-     * will be performed on each certificate in the certpath.
-     *
-     * @param certPathCheckers a List of checkers to use
-     */
-    PKIXMasterCertPathValidator(List<PKIXCertPathChecker> certPathCheckers) {
-        this.certPathCheckers = certPathCheckers;
-    }
 
     /**
      * Validates a certification path consisting exclusively of
-     * <code>X509Certificate</code>s using the
-     * <code>PKIXCertPathChecker</code>s specified
-     * in the constructor. It is assumed that the
+     * <code>X509Certificate</code>s using the specified
+     * <code>PKIXCertPathChecker</code>s. It is assumed that the
      * <code>PKIXCertPathChecker</code>s
      * have been initialized with any input parameters they may need.
      *
      * @param cpOriginal the original X509 CertPath passed in by the user
      * @param reversedCertList the reversed X509 CertPath (as a List)
-     * @exception CertPathValidatorException Exception thrown if cert
-     * path does not validate.
+     * @param certPathCheckers the PKIXCertPathCheckers
+     * @throws CertPathValidatorException if cert path does not validate
      */
-    void validate(CertPath cpOriginal, List<X509Certificate> reversedCertList)
+    static void validate(CertPath cpOriginal,
+                         List<X509Certificate> reversedCertList,
+                         List<PKIXCertPathChecker> certPathCheckers)
         throws CertPathValidatorException
     {
         // we actually process reversedCertList, but we keep cpOriginal because
@@ -104,20 +92,18 @@
                 debug.println("Checking cert" + (i+1) + " ...");
 
             X509Certificate currCert = reversedCertList.get(i);
-            Set<String> unresolvedCritExts =
-                                        currCert.getCriticalExtensionOIDs();
-            if (unresolvedCritExts == null) {
-                unresolvedCritExts = Collections.<String>emptySet();
+            Set<String> unresCritExts = currCert.getCriticalExtensionOIDs();
+            if (unresCritExts == null) {
+                unresCritExts = Collections.<String>emptySet();
             }
 
-            if (debug != null && !unresolvedCritExts.isEmpty()) {
+            if (debug != null && !unresCritExts.isEmpty()) {
                 debug.println("Set of critical extensions:");
-                for (String oid : unresolvedCritExts) {
+                for (String oid : unresCritExts) {
                     debug.println(oid);
                 }
             }
 
-            CertPathValidatorException ocspCause = null;
             for (int j = 0; j < certPathCheckers.size(); j++) {
 
                 PKIXCertPathChecker currChecker = certPathCheckers.get(j);
@@ -130,65 +116,21 @@
                     currChecker.init(false);
 
                 try {
-                    currChecker.check(currCert, unresolvedCritExts);
+                    currChecker.check(currCert, unresCritExts);
 
-                    // OCSP has validated the cert so skip the CRL check
-                    if (isRevocationCheck(currChecker, j, certPathCheckers)) {
-                        if (debug != null) {
-                            debug.println("-checker" + (j + 1) +
-                                " validation succeeded");
-                        }
-                        j++;
-                        continue; // skip
+                    if (debug != null) {
+                        debug.println("-checker" + (j + 1) +
+                            " validation succeeded");
                     }
 
                 } catch (CertPathValidatorException cpve) {
-                    // Throw the saved OCSP exception unless the CRL
-                    // checker has determined that the cert is revoked
-                    if (ocspCause != null &&
-                            currChecker instanceof CrlRevocationChecker) {
-                        if (cpve.getReason() == BasicReason.REVOKED) {
-                            throw cpve;
-                        } else {
-                            throw ocspCause;
-                        }
-                    }
-                    /*
-                     * Handle failover from OCSP to CRLs
-                     */
-                    CertPathValidatorException currentCause =
-                        new CertPathValidatorException(cpve.getMessage(),
-                            cpve.getCause(), cpOriginal, cpSize - (i + 1),
-                            cpve.getReason());
-
-                    // Check if OCSP has confirmed that the cert was revoked
-                    if (cpve.getReason() == BasicReason.REVOKED) {
-                        throw currentCause;
-                    }
-                    // Check if it is appropriate to failover
-                    if (! isRevocationCheck(currChecker, j, certPathCheckers)) {
-                        // no failover
-                        throw currentCause;
-                    }
-                    // Save the current exception
-                    // (in case the CRL check also fails)
-                    ocspCause = currentCause;
-
-                    // Otherwise, failover to CRLs
-                    if (debug != null) {
-                        debug.println(cpve.getMessage());
-                        debug.println(
-                            "preparing to failover (from OCSP to CRLs)");
-                    }
+                    throw new CertPathValidatorException(cpve.getMessage(),
+                        cpve.getCause(), cpOriginal, cpSize - (i + 1),
+                        cpve.getReason());
                 }
-
-                if (debug != null)
-                    debug.println("-checker" + (j+1) + " validation succeeded");
             }
 
-            if (debug != null)
-                debug.println("checking for unresolvedCritExts");
-            if (!unresolvedCritExts.isEmpty()) {
+            if (!unresCritExts.isEmpty()) {
                 throw new CertPathValidatorException("unrecognized " +
                     "critical extension(s)", null, cpOriginal, cpSize-(i+1),
                     PKIXReason.UNRECOGNIZED_CRIT_EXT);
@@ -200,26 +142,9 @@
 
         if (debug != null) {
             debug.println("Cert path validation succeeded. (PKIX validation "
-                    + "algorithm)");
+                          + "algorithm)");
             debug.println("-------------------------------------------------"
-                    + "-------------");
+                          + "-------------");
         }
     }
-
-    /*
-     * Examines the list of PKIX cert path checkers to determine whether
-     * both the current checker and the next checker are revocation checkers.
-     * OCSPChecker and CrlRevocationChecker are both revocation checkers.
-     */
-    private static boolean isRevocationCheck(PKIXCertPathChecker checker,
-        int index, List<PKIXCertPathChecker> checkers) {
-
-        if (checker instanceof OCSPChecker && index + 1 < checkers.size()) {
-            PKIXCertPathChecker nextChecker = checkers.get(index + 1);
-            if (nextChecker instanceof CrlRevocationChecker) {
-                return true;
-            }
-        }
-        return false;
-    }
 }
diff --git a/src/share/classes/sun/security/provider/certpath/PolicyChecker.java b/src/share/classes/sun/security/provider/certpath/PolicyChecker.java
index e5b35a7..ab82820 100644
--- a/src/share/classes/sun/security/provider/certpath/PolicyChecker.java
+++ b/src/share/classes/sun/security/provider/certpath/PolicyChecker.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,8 @@
 
 package sun.security.provider.certpath;
 
-import java.util.*;
 import java.io.IOException;
-
+import java.security.GeneralSecurityException;
 import java.security.cert.Certificate;
 import java.security.cert.CertificateException;
 import java.security.cert.CertPathValidatorException;
@@ -36,13 +35,14 @@
 import java.security.cert.PolicyNode;
 import java.security.cert.PolicyQualifierInfo;
 import java.security.cert.X509Certificate;
+import java.util.*;
 
 import sun.security.util.Debug;
 import sun.security.x509.CertificatePoliciesExtension;
 import sun.security.x509.PolicyConstraintsExtension;
 import sun.security.x509.PolicyMappingsExtension;
 import sun.security.x509.CertificatePolicyMap;
-import sun.security.x509.PKIXExtensions;
+import static sun.security.x509.PKIXExtensions.*;
 import sun.security.x509.PolicyInformation;
 import sun.security.x509.X509CertImpl;
 import sun.security.x509.InhibitAnyPolicyExtension;
@@ -88,7 +88,7 @@
     PolicyChecker(Set<String> initialPolicies, int certPathLen,
         boolean expPolicyRequired, boolean polMappingInhibited,
         boolean anyPolicyInhibited, boolean rejectPolicyQualifiers,
-        PolicyNodeImpl rootNode) throws CertPathValidatorException
+        PolicyNodeImpl rootNode)
     {
         if (initialPolicies.isEmpty()) {
             // if no initialPolicies are specified by user, set
@@ -104,18 +104,18 @@
         this.anyPolicyInhibited = anyPolicyInhibited;
         this.rejectPolicyQualifiers = rejectPolicyQualifiers;
         this.rootNode = rootNode;
-        init(false);
     }
 
     /**
      * Initializes the internal state of the checker from parameters
      * specified in the constructor
      *
-     * @param forward a boolean indicating whether this checker should
-     * be initialized capable of building in the forward direction
-     * @exception CertPathValidatorException Exception thrown if user
-     * wants to enable forward checking and forward checking is not supported.
+     * @param forward a boolean indicating whether this checker should be
+     *        initialized capable of building in the forward direction
+     * @throws CertPathValidatorException if user wants to enable forward
+     *         checking and forward checking is not supported.
      */
+    @Override
     public void init(boolean forward) throws CertPathValidatorException {
         if (forward) {
             throw new CertPathValidatorException
@@ -136,6 +136,7 @@
      *
      * @return true if forward checking is supported, false otherwise
      */
+    @Override
     public boolean isForwardCheckingSupported() {
         return false;
     }
@@ -150,13 +151,14 @@
      * @return the Set of extensions supported by this PKIXCertPathChecker,
      * or null if no extensions are supported
      */
+    @Override
     public Set<String> getSupportedExtensions() {
         if (supportedExts == null) {
-            supportedExts = new HashSet<String>();
-            supportedExts.add(PKIXExtensions.CertificatePolicies_Id.toString());
-            supportedExts.add(PKIXExtensions.PolicyMappings_Id.toString());
-            supportedExts.add(PKIXExtensions.PolicyConstraints_Id.toString());
-            supportedExts.add(PKIXExtensions.InhibitAnyPolicy_Id.toString());
+            supportedExts = new HashSet<String>(4);
+            supportedExts.add(CertificatePolicies_Id.toString());
+            supportedExts.add(PolicyMappings_Id.toString());
+            supportedExts.add(PolicyConstraints_Id.toString());
+            supportedExts.add(InhibitAnyPolicy_Id.toString());
             supportedExts = Collections.unmodifiableSet(supportedExts);
         }
         return supportedExts;
@@ -168,9 +170,9 @@
      *
      * @param cert the Certificate to be processed
      * @param unresCritExts the unresolved critical extensions
-     * @exception CertPathValidatorException Exception thrown if
-     * the certificate does not verify.
+     * @throws CertPathValidatorException if the certificate does not verify
      */
+    @Override
     public void check(Certificate cert, Collection<String> unresCritExts)
         throws CertPathValidatorException
     {
@@ -178,10 +180,10 @@
         checkPolicy((X509Certificate) cert);
 
         if (unresCritExts != null && !unresCritExts.isEmpty()) {
-            unresCritExts.remove(PKIXExtensions.CertificatePolicies_Id.toString());
-            unresCritExts.remove(PKIXExtensions.PolicyMappings_Id.toString());
-            unresCritExts.remove(PKIXExtensions.PolicyConstraints_Id.toString());
-            unresCritExts.remove(PKIXExtensions.InhibitAnyPolicy_Id.toString());
+            unresCritExts.remove(CertificatePolicies_Id.toString());
+            unresCritExts.remove(PolicyMappings_Id.toString());
+            unresCritExts.remove(PolicyConstraints_Id.toString());
+            unresCritExts.remove(InhibitAnyPolicy_Id.toString());
         }
     }
 
@@ -290,7 +292,7 @@
                 if (require == 0)
                     explicitPolicy = require;
             }
-        } catch (Exception e) {
+        } catch (IOException e) {
             if (debug != null) {
                 debug.println("PolicyChecker.mergeExplicitPolicy "
                               + "unexpected exception");
@@ -339,7 +341,7 @@
                     policyMapping = inhibit;
                 }
             }
-        } catch (Exception e) {
+        } catch (IOException e) {
             if (debug != null) {
                 debug.println("PolicyChecker.mergePolicyMapping "
                               + "unexpected exception");
@@ -372,7 +374,7 @@
 
         try {
             InhibitAnyPolicyExtension inhAnyPolExt = (InhibitAnyPolicyExtension)
-                currCert.getExtension(PKIXExtensions.InhibitAnyPolicy_Id);
+                currCert.getExtension(InhibitAnyPolicy_Id);
             if (inhAnyPolExt == null)
                 return inhibitAnyPolicy;
 
@@ -387,7 +389,7 @@
                     inhibitAnyPolicy = skipCerts;
                 }
             }
-        } catch (Exception e) {
+        } catch (IOException e) {
             if (debug != null) {
                 debug.println("PolicyChecker.mergeInhibitAnyPolicy "
                               + "unexpected exception");
@@ -429,7 +431,7 @@
         boolean policiesCritical = false;
         List<PolicyInformation> policyInfo;
         PolicyNodeImpl rootNode = null;
-        Set<PolicyQualifierInfo> anyQuals = new HashSet<PolicyQualifierInfo>();
+        Set<PolicyQualifierInfo> anyQuals = new HashSet<>();
 
         if (origRootNode == null)
             rootNode = null;
@@ -600,7 +602,7 @@
         PolicyNodeImpl parentNode = (PolicyNodeImpl)anyNode.getParent();
         parentNode.deleteChild(anyNode);
         // see if there are any initialPolicies not represented by leaf nodes
-        Set<String> initial = new HashSet<String>(initPolicies);
+        Set<String> initial = new HashSet<>(initPolicies);
         for (PolicyNodeImpl node : rootNode.getPolicyNodes(certIndex)) {
             initial.remove(node.getValidPolicy());
         }
@@ -697,7 +699,7 @@
                         }
                     }
 
-                    Set<String> expPols = new HashSet<String>();
+                    Set<String> expPols = new HashSet<>();
                     expPols.add(curParExpPol);
 
                     curNode = new PolicyNodeImpl
@@ -762,8 +764,7 @@
         }
 
         boolean childDeleted = false;
-        for (int j = 0; j < maps.size(); j++) {
-            CertificatePolicyMap polMap = maps.get(j);
+        for (CertificatePolicyMap polMap : maps) {
             String issuerDomain
                 = polMap.getIssuerIdentifier().getIdentifier().toString();
             String subjectDomain
@@ -816,7 +817,7 @@
                         PolicyNodeImpl curAnyNodeParent =
                             (PolicyNodeImpl) curAnyNode.getParent();
 
-                        Set<String> expPols = new HashSet<String>();
+                        Set<String> expPols = new HashSet<>();
                         expPols.add(subjectDomain);
 
                         PolicyNodeImpl curNode = new PolicyNodeImpl
diff --git a/src/share/classes/sun/security/provider/certpath/PolicyNodeImpl.java b/src/share/classes/sun/security/provider/certpath/PolicyNodeImpl.java
index 13234db..02109d4 100644
--- a/src/share/classes/sun/security/provider/certpath/PolicyNodeImpl.java
+++ b/src/share/classes/sun/security/provider/certpath/PolicyNodeImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -134,30 +134,37 @@
              node.mCriticalityIndicator, node.mExpectedPolicySet, false);
     }
 
+    @Override
     public PolicyNode getParent() {
         return mParent;
     }
 
+    @Override
     public Iterator<PolicyNodeImpl> getChildren() {
         return Collections.unmodifiableSet(mChildren).iterator();
     }
 
+    @Override
     public int getDepth() {
         return mDepth;
     }
 
+    @Override
     public String getValidPolicy() {
         return mValidPolicy;
     }
 
+    @Override
     public Set<PolicyQualifierInfo> getPolicyQualifiers() {
         return Collections.unmodifiableSet(mQualifierSet);
     }
 
+    @Override
     public Set<String> getExpectedPolicies() {
         return Collections.unmodifiableSet(mExpectedPolicySet);
     }
 
+    @Override
     public boolean isCritical() {
         return mCriticalityIndicator;
     }
@@ -169,12 +176,12 @@
      *
      * @return a String describing the contents of the Policy Node
      */
+    @Override
     public String toString() {
-        StringBuffer buffer = new StringBuffer(this.asString());
+        StringBuilder buffer = new StringBuilder(this.asString());
 
-        Iterator<PolicyNodeImpl> it = getChildren();
-        while (it.hasNext()) {
-            buffer.append(it.next());
+        for (PolicyNodeImpl node : mChildren) {
+            buffer.append(node);
         }
         return buffer.toString();
     }
@@ -293,7 +300,7 @@
      * @return a <code>Set</code> of all nodes at the specified depth
      */
     Set<PolicyNodeImpl> getPolicyNodes(int depth) {
-        Set<PolicyNodeImpl> set = new HashSet<PolicyNodeImpl>();
+        Set<PolicyNodeImpl> set = new HashSet<>();
         getPolicyNodes(depth, set);
         return set;
     }
@@ -337,7 +344,7 @@
     private Set<PolicyNodeImpl> getPolicyNodesExpectedHelper(int depth,
         String expectedOID, boolean matchAny) {
 
-        HashSet<PolicyNodeImpl> set = new HashSet<PolicyNodeImpl>();
+        HashSet<PolicyNodeImpl> set = new HashSet<>();
 
         if (mDepth < depth) {
             for (PolicyNodeImpl node : mChildren) {
@@ -367,7 +374,7 @@
      * @return a Set of matched <code>PolicyNode</code>s
      */
     Set<PolicyNodeImpl> getPolicyNodesValid(int depth, String validOID) {
-        HashSet<PolicyNodeImpl> set = new HashSet<PolicyNodeImpl>();
+        HashSet<PolicyNodeImpl> set = new HashSet<>();
 
         if (mDepth < depth) {
             for (PolicyNodeImpl node : mChildren) {
@@ -396,7 +403,7 @@
         if (mParent == null) {
             return "anyPolicy  ROOT\n";
         } else {
-            StringBuffer sb = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
             for (int i = 0, n = getDepth(); i < n; i++) {
                 sb.append("  ");
             }
diff --git a/src/share/classes/sun/security/provider/certpath/ReverseBuilder.java b/src/share/classes/sun/security/provider/certpath/ReverseBuilder.java
index 1babd0f..8bae67c 100644
--- a/src/share/classes/sun/security/provider/certpath/ReverseBuilder.java
+++ b/src/share/classes/sun/security/provider/certpath/ReverseBuilder.java
@@ -51,9 +51,10 @@
 
 import javax.security.auth.x500.X500Principal;
 
+import sun.security.provider.certpath.PKIX.BuilderParams;
 import sun.security.util.Debug;
 import sun.security.x509.Extension;
-import sun.security.x509.PKIXExtensions;
+import static sun.security.x509.PKIXExtensions.*;
 import sun.security.x509.X500Name;
 import sun.security.x509.X509CertImpl;
 import sun.security.x509.PolicyMappingsExtension;
@@ -72,28 +73,24 @@
 
     private Debug debug = Debug.getInstance("certpath");
 
-    Set<String> initPolicies;
+    private final Set<String> initPolicies;
 
     /**
      * Initialize the builder with the input parameters.
      *
      * @param params the parameter set used to build a certification path
      */
-    ReverseBuilder(PKIXBuilderParameters buildParams,
-        X500Principal targetSubjectDN) {
+    ReverseBuilder(BuilderParams buildParams) {
+        super(buildParams);
 
-        super(buildParams, targetSubjectDN);
-
-        Set<String> initialPolicies = buildParams.getInitialPolicies();
+        Set<String> initialPolicies = buildParams.initialPolicies();
         initPolicies = new HashSet<String>();
         if (initialPolicies.isEmpty()) {
             // if no initialPolicies are specified by user, set
             // initPolicies to be anyPolicy by default
             initPolicies.add(PolicyChecker.ANY_POLICY);
         } else {
-            for (String policy : initialPolicies) {
-                initPolicies.add(policy);
-            }
+            initPolicies.addAll(initialPolicies);
         }
     }
 
@@ -106,6 +103,7 @@
      *        Must be an instance of <code>ReverseState</code>
      * @param certStores list of CertStores
      */
+    @Override
     Collection<X509Certificate> getMatchingCerts
         (State currState, List<CertStore> certStores)
         throws CertStoreException, CertificateException, IOException
@@ -138,56 +136,56 @@
         (ReverseState currentState, List<CertStore> certStores)
         throws CertStoreException, CertificateException, IOException {
 
-      /*
-       * Compose a CertSelector to filter out
-       * certs which do not satisfy requirements.
-       *
-       * First, retrieve clone of current target cert constraints,
-       * and then add more selection criteria based on current validation state.
-       */
-      X509CertSelector sel = (X509CertSelector) targetCertConstraints.clone();
+        /*
+         * Compose a CertSelector to filter out
+         * certs which do not satisfy requirements.
+         *
+         * First, retrieve clone of current target cert constraints, and
+         * then add more selection criteria based on current validation state.
+         */
+        X509CertSelector sel = (X509CertSelector) targetCertConstraints.clone();
 
-      /*
-       * Match on issuer (subject of previous cert)
-       */
-      sel.setIssuer(currentState.subjectDN);
+        /*
+         * Match on issuer (subject of previous cert)
+         */
+        sel.setIssuer(currentState.subjectDN);
 
-      /*
-       * Match on certificate validity date.
-       */
-      sel.setCertificateValid(date);
+        /*
+         * Match on certificate validity date.
+         */
+        sel.setCertificateValid(buildParams.date());
 
-      /*
-       * Policy processing optimizations
-       */
-      if (currentState.explicitPolicy == 0)
-          sel.setPolicy(getMatchingPolicies());
+        /*
+         * Policy processing optimizations
+         */
+        if (currentState.explicitPolicy == 0)
+            sel.setPolicy(getMatchingPolicies());
 
-      /*
-       * If previous cert has a subject key identifier extension,
-       * use it to match on authority key identifier extension.
-       */
-      /*if (currentState.subjKeyId != null) {
-        AuthorityKeyIdentifierExtension authKeyId = new AuthorityKeyIdentifierExtension(
+        /*
+         * If previous cert has a subject key identifier extension,
+         * use it to match on authority key identifier extension.
+         */
+        /*if (currentState.subjKeyId != null) {
+          AuthorityKeyIdentifierExtension authKeyId = new AuthorityKeyIdentifierExtension(
                 (KeyIdentifier) currentState.subjKeyId.get(SubjectKeyIdentifierExtension.KEY_ID),
                 null, null);
         sel.setAuthorityKeyIdentifier(authKeyId.getExtensionValue());
-      }*/
+        }*/
 
-      /*
-       * Require EE certs
-       */
-      sel.setBasicConstraints(-2);
+        /*
+         * Require EE certs
+         */
+        sel.setBasicConstraints(-2);
 
-      /* Retrieve matching certs from CertStores */
-      HashSet<X509Certificate> eeCerts = new HashSet<X509Certificate>();
-      addMatchingCerts(sel, certStores, eeCerts, true);
+        /* Retrieve matching certs from CertStores */
+        HashSet<X509Certificate> eeCerts = new HashSet<>();
+        addMatchingCerts(sel, certStores, eeCerts, true);
 
-      if (debug != null) {
-        debug.println("ReverseBuilder.getMatchingEECerts got " + eeCerts.size()
-                    + " certs.");
-      }
-      return eeCerts;
+        if (debug != null) {
+            debug.println("ReverseBuilder.getMatchingEECerts got "
+                          + eeCerts.size() + " certs.");
+        }
+        return eeCerts;
     }
 
     /*
@@ -198,63 +196,71 @@
         (ReverseState currentState, List<CertStore> certStores)
         throws CertificateException, CertStoreException, IOException {
 
-      /*
-       * Compose a CertSelector to filter out
-       * certs which do not satisfy requirements.
-       */
-      X509CertSelector sel = new X509CertSelector();
+        /*
+         * Compose a CertSelector to filter out
+         * certs which do not satisfy requirements.
+         */
+        X509CertSelector sel = new X509CertSelector();
 
-      /*
-       * Match on issuer (subject of previous cert)
-       */
-      sel.setIssuer(currentState.subjectDN);
+        /*
+         * Match on issuer (subject of previous cert)
+         */
+        sel.setIssuer(currentState.subjectDN);
 
-      /*
-       * Match on certificate validity date.
-       */
-      sel.setCertificateValid(date);
+        /*
+         * Match on certificate validity date.
+         */
+        sel.setCertificateValid(buildParams.date());
 
-      /*
-       * Match on target subject name (checks that current cert's
-       * name constraints permit it to certify target).
-       * (4 is the integer type for DIRECTORY name).
-       */
-      sel.addPathToName(4, targetCertConstraints.getSubjectAsBytes());
+        /*
+         * Match on target subject name (checks that current cert's
+         * name constraints permit it to certify target).
+         * (4 is the integer type for DIRECTORY name).
+         */
+        byte[] subject = targetCertConstraints.getSubjectAsBytes();
+        if (subject != null) {
+            sel.addPathToName(4, subject);
+        } else {
+            X509Certificate cert = targetCertConstraints.getCertificate();
+            if (cert != null) {
+                sel.addPathToName(4,
+                                  cert.getSubjectX500Principal().getEncoded());
+            }
+        }
 
-      /*
-       * Policy processing optimizations
-       */
-      if (currentState.explicitPolicy == 0)
-          sel.setPolicy(getMatchingPolicies());
+        /*
+         * Policy processing optimizations
+         */
+        if (currentState.explicitPolicy == 0)
+            sel.setPolicy(getMatchingPolicies());
 
-      /*
-       * If previous cert has a subject key identifier extension,
-       * use it to match on authority key identifier extension.
-       */
-      /*if (currentState.subjKeyId != null) {
-        AuthorityKeyIdentifierExtension authKeyId = new AuthorityKeyIdentifierExtension(
+        /*
+         * If previous cert has a subject key identifier extension,
+         * use it to match on authority key identifier extension.
+         */
+        /*if (currentState.subjKeyId != null) {
+          AuthorityKeyIdentifierExtension authKeyId = new AuthorityKeyIdentifierExtension(
                 (KeyIdentifier) currentState.subjKeyId.get(SubjectKeyIdentifierExtension.KEY_ID),
                                 null, null);
-        sel.setAuthorityKeyIdentifier(authKeyId.getExtensionValue());
-      }*/
+          sel.setAuthorityKeyIdentifier(authKeyId.getExtensionValue());
+        }*/
 
-      /*
-       * Require CA certs
-       */
-      sel.setBasicConstraints(0);
+        /*
+         * Require CA certs
+         */
+        sel.setBasicConstraints(0);
 
-      /* Retrieve matching certs from CertStores */
-      ArrayList<X509Certificate> reverseCerts =
-          new ArrayList<X509Certificate>();
-      addMatchingCerts(sel, certStores, reverseCerts, true);
+        /* Retrieve matching certs from CertStores */
+        ArrayList<X509Certificate> reverseCerts = new ArrayList<>();
+        addMatchingCerts(sel, certStores, reverseCerts, true);
 
-      /* Sort remaining certs using name constraints */
-      Collections.sort(reverseCerts, new PKIXCertComparator());
+        /* Sort remaining certs using name constraints */
+        Collections.sort(reverseCerts, new PKIXCertComparator());
 
-      if (debug != null)
-        debug.println("ReverseBuilder.getMatchingCACerts got " +
-                    reverseCerts.size() + " certs.");
-      return reverseCerts;
+        if (debug != null)
+            debug.println("ReverseBuilder.getMatchingCACerts got " +
+                          reverseCerts.size() + " certs.");
+        return reverseCerts;
     }
 
     /*
@@ -269,23 +275,25 @@
 
         private Debug debug = Debug.getInstance("certpath");
 
+        @Override
         public int compare(X509Certificate cert1, X509Certificate cert2) {
 
             /*
              * if either cert certifies the target, always
              * put at head of list.
              */
-            if (cert1.getSubjectX500Principal().equals(targetSubjectDN)) {
+            X500Principal targetSubject = buildParams.targetSubject();
+            if (cert1.getSubjectX500Principal().equals(targetSubject)) {
                 return -1;
             }
-            if (cert2.getSubjectX500Principal().equals(targetSubjectDN)) {
+            if (cert2.getSubjectX500Principal().equals(targetSubject)) {
                 return 1;
             }
 
             int targetDist1;
             int targetDist2;
             try {
-                X500Name targetSubjectName = X500Name.asX500Name(targetSubjectDN);
+                X500Name targetSubjectName = X500Name.asX500Name(targetSubject);
                 targetDist1 = Builder.targetDistance(
                     null, cert1, targetSubjectName);
                 targetDist2 = Builder.targetDistance(
@@ -330,6 +338,7 @@
      * @param currentState the current state against which the cert is verified
      * @param certPathList the certPathList generated thus far
      */
+    @Override
     void verifyCert(X509Certificate cert, State currState,
         List<X509Certificate> certPathList)
         throws GeneralSecurityException
@@ -362,8 +371,7 @@
          * of the same certificate, we reverse the certpathlist first
          */
         if ((certPathList != null) && (!certPathList.isEmpty())) {
-            List<X509Certificate> reverseCertList =
-                new ArrayList<X509Certificate>();
+            List<X509Certificate> reverseCertList = new ArrayList<>();
             for (X509Certificate c : certPathList) {
                 reverseCertList.add(0, c);
             }
@@ -378,8 +386,8 @@
                 }
                 if (debug != null)
                     debug.println("policyMappingFound = " + policyMappingFound);
-                if (cert.equals(cpListCert)){
-                    if ((buildParams.isPolicyMappingInhibited()) ||
+                if (cert.equals(cpListCert)) {
+                    if ((buildParams.policyMappingInhibited()) ||
                         (!policyMappingFound)){
                         if (debug != null)
                             debug.println("loop detected!!");
@@ -390,7 +398,7 @@
         }
 
         /* check if target cert */
-        boolean finalCert = cert.getSubjectX500Principal().equals(targetSubjectDN);
+        boolean finalCert = cert.getSubjectX500Principal().equals(buildParams.targetSubject());
 
         /* check if CA cert */
         boolean caCert = (cert.getBasicConstraints() != -1 ? true : false);
@@ -431,23 +439,20 @@
         /*
          * Check revocation.
          */
-        if (buildParams.isRevocationEnabled()) {
-
-            currentState.crlChecker.check(cert,
-                                          currentState.pubKey,
-                                          currentState.crlSign);
+        if (buildParams.revocationEnabled() && currentState.revChecker != null) {
+            currentState.revChecker.check(cert, Collections.<String>emptySet());
         }
 
         /* Check name constraints if this is not a self-issued cert */
         if (finalCert || !X509CertImpl.isSelfIssued(cert)){
-            if (currentState.nc != null){
+            if (currentState.nc != null) {
                 try {
                     if (!currentState.nc.verify(cert)){
                         throw new CertPathValidatorException
                             ("name constraints check failed", null, null, -1,
                              PKIXReason.INVALID_NAME);
                     }
-                } catch (IOException ioe){
+                } catch (IOException ioe) {
                     throw new CertPathValidatorException(ioe);
                 }
             }
@@ -461,7 +466,7 @@
             (currentState.certIndex, initPolicies,
             currentState.explicitPolicy, currentState.policyMapping,
             currentState.inhibitAnyPolicy,
-            buildParams.getPolicyQualifiersRejected(), currentState.rootNode,
+            buildParams.policyQualifiersRejected(), currentState.rootNode,
             certImpl, finalCert);
 
         /*
@@ -486,15 +491,15 @@
          * already checked. If there are any left, throw an exception!
          */
         if (!unresolvedCritExts.isEmpty()) {
-            unresolvedCritExts.remove(PKIXExtensions.BasicConstraints_Id.toString());
-            unresolvedCritExts.remove(PKIXExtensions.NameConstraints_Id.toString());
-            unresolvedCritExts.remove(PKIXExtensions.CertificatePolicies_Id.toString());
-            unresolvedCritExts.remove(PKIXExtensions.PolicyMappings_Id.toString());
-            unresolvedCritExts.remove(PKIXExtensions.PolicyConstraints_Id.toString());
-            unresolvedCritExts.remove(PKIXExtensions.InhibitAnyPolicy_Id.toString());
-            unresolvedCritExts.remove(PKIXExtensions.SubjectAlternativeName_Id.toString());
-            unresolvedCritExts.remove(PKIXExtensions.KeyUsage_Id.toString());
-            unresolvedCritExts.remove(PKIXExtensions.ExtendedKeyUsage_Id.toString());
+            unresolvedCritExts.remove(BasicConstraints_Id.toString());
+            unresolvedCritExts.remove(NameConstraints_Id.toString());
+            unresolvedCritExts.remove(CertificatePolicies_Id.toString());
+            unresolvedCritExts.remove(PolicyMappings_Id.toString());
+            unresolvedCritExts.remove(PolicyConstraints_Id.toString());
+            unresolvedCritExts.remove(InhibitAnyPolicy_Id.toString());
+            unresolvedCritExts.remove(SubjectAlternativeName_Id.toString());
+            unresolvedCritExts.remove(KeyUsage_Id.toString());
+            unresolvedCritExts.remove(ExtendedKeyUsage_Id.toString());
 
             if (!unresolvedCritExts.isEmpty())
                 throw new CertPathValidatorException
@@ -505,8 +510,8 @@
         /*
          * Check signature.
          */
-        if (buildParams.getSigProvider() != null) {
-            cert.verify(currentState.pubKey, buildParams.getSigProvider());
+        if (buildParams.sigProvider() != null) {
+            cert.verify(currentState.pubKey, buildParams.sigProvider());
         } else {
             cert.verify(currentState.pubKey);
         }
@@ -519,8 +524,9 @@
      * @param cert the certificate to test
      * @return a boolean value indicating whether the cert completes the path.
      */
+    @Override
     boolean isPathCompleted(X509Certificate cert) {
-        return cert.getSubjectX500Principal().equals(targetSubjectDN);
+        return cert.getSubjectX500Principal().equals(buildParams.targetSubject());
     }
 
     /** Adds the certificate to the certPathList
@@ -528,6 +534,7 @@
      * @param cert the certificate to be added
      * @param certPathList the certification path list
      */
+    @Override
     void addCertToPath(X509Certificate cert,
         LinkedList<X509Certificate> certPathList) {
         certPathList.addLast(cert);
@@ -537,6 +544,7 @@
      *
      * @param certPathList the certification path list
      */
+    @Override
     void removeFinalCertFromPath(LinkedList<X509Certificate> certPathList) {
         certPathList.removeLast();
     }
diff --git a/src/share/classes/sun/security/provider/certpath/ReverseState.java b/src/share/classes/sun/security/provider/certpath/ReverseState.java
index ed4f135..31e32b6 100644
--- a/src/share/classes/sun/security/provider/certpath/ReverseState.java
+++ b/src/share/classes/sun/security/provider/certpath/ReverseState.java
@@ -40,6 +40,7 @@
 import java.util.Set;
 import javax.security.auth.x500.X500Principal;
 
+import sun.security.provider.certpath.PKIX.BuilderParams;
 import sun.security.util.Debug;
 import sun.security.x509.NameConstraintsExtension;
 import sun.security.x509.SubjectKeyIdentifierExtension;
@@ -94,7 +95,7 @@
     private boolean init = true;
 
     /* the checker used for revocation status */
-    public CrlRevocationChecker crlChecker;
+    RevocationChecker revChecker;
 
     /* the algorithm checker */
     AlgorithmChecker algorithmChecker;
@@ -108,7 +109,7 @@
     /* Flag indicating if current cert can vouch for the CRL for
      * the next cert
      */
-    public boolean crlSign = true;
+    boolean crlSign = true;
 
     /**
      * Returns a boolean flag indicating if the state is initial
@@ -116,6 +117,7 @@
      *
      * @return boolean flag indicating if the state is initial (just starting)
      */
+    @Override
     public boolean isInitial() {
         return init;
     }
@@ -123,44 +125,32 @@
     /**
      * Display state for debugging purposes
      */
+    @Override
     public String toString() {
-        StringBuffer sb = new StringBuffer();
-        try {
-            sb.append("State [");
-            sb.append("\n  subjectDN of last cert: " + subjectDN);
-            sb.append("\n  subjectKeyIdentifier: " + String.valueOf(subjKeyId));
-            sb.append("\n  nameConstraints: " + String.valueOf(nc));
-            sb.append("\n  certIndex: " + certIndex);
-            sb.append("\n  explicitPolicy: " + explicitPolicy);
-            sb.append("\n  policyMapping:  " + policyMapping);
-            sb.append("\n  inhibitAnyPolicy:  " + inhibitAnyPolicy);
-            sb.append("\n  rootNode: " + rootNode);
-            sb.append("\n  remainingCACerts: " + remainingCACerts);
-            sb.append("\n  crlSign: " + crlSign);
-            sb.append("\n  init: " + init);
-            sb.append("\n]\n");
-        } catch (Exception e) {
-            if (debug != null) {
-                debug.println("ReverseState.toString() unexpected exception");
-                e.printStackTrace();
-            }
-        }
+        StringBuilder sb = new StringBuilder();
+        sb.append("State [");
+        sb.append("\n  subjectDN of last cert: ").append(subjectDN);
+        sb.append("\n  subjectKeyIdentifier: ").append
+                 (String.valueOf(subjKeyId));
+        sb.append("\n  nameConstraints: ").append(String.valueOf(nc));
+        sb.append("\n  certIndex: ").append(certIndex);
+        sb.append("\n  explicitPolicy: ").append(explicitPolicy);
+        sb.append("\n  policyMapping:  ").append(policyMapping);
+        sb.append("\n  inhibitAnyPolicy:  ").append(inhibitAnyPolicy);
+        sb.append("\n  rootNode: ").append(rootNode);
+        sb.append("\n  remainingCACerts: ").append(remainingCACerts);
+        sb.append("\n  crlSign: ").append(crlSign);
+        sb.append("\n  init: ").append(init);
+        sb.append("\n]\n");
         return sb.toString();
     }
 
     /**
      * Initialize the state.
      *
-     * @param maxPathLen The maximum number of CA certs in a path, where -1
-     * means unlimited and 0 means only a single EE cert is allowed.
-     * @param explicitPolicyRequired True, if explicit policy is required.
-     * @param policyMappingInhibited True, if policy mapping is inhibited.
-     * @param anyPolicyInhibited True, if any policy is inhibited.
-     * @param certPathCheckers the list of user-defined PKIXCertPathCheckers
+     * @param buildParams builder parameters
      */
-    public void initState(int maxPathLen, boolean explicitPolicyRequired,
-        boolean policyMappingInhibited, boolean anyPolicyInhibited,
-        List<PKIXCertPathChecker> certPathCheckers)
+    public void initState(BuilderParams buildParams)
         throws CertPathValidatorException
     {
         /*
@@ -168,60 +158,52 @@
          * Note that -1 maxPathLen implies unlimited.
          * 0 implies only an EE cert is acceptable.
          */
-        remainingCACerts = (maxPathLen == -1 ? Integer.MAX_VALUE : maxPathLen);
+        int maxPathLen = buildParams.maxPathLength();
+        remainingCACerts = (maxPathLen == -1) ? Integer.MAX_VALUE
+                                              : maxPathLen;
 
         /* Initialize explicit policy state variable */
-        if (explicitPolicyRequired) {
+        if (buildParams.explicitPolicyRequired()) {
             explicitPolicy = 0;
         } else {
             // unconstrained if maxPathLen is -1,
             // otherwise, we want to initialize this to the value of the
             // longest possible path + 1 (i.e. maxpathlen + finalcert + 1)
-            explicitPolicy = (maxPathLen == -1)
-                ? maxPathLen
-                : maxPathLen + 2;
+            explicitPolicy = (maxPathLen == -1) ? maxPathLen : maxPathLen + 2;
         }
 
         /* Initialize policy mapping state variable */
-        if (policyMappingInhibited) {
+        if (buildParams.policyMappingInhibited()) {
             policyMapping = 0;
         } else {
-            policyMapping = (maxPathLen == -1)
-                ? maxPathLen
-                : maxPathLen + 2;
+            policyMapping = (maxPathLen == -1) ? maxPathLen : maxPathLen + 2;
         }
 
         /* Initialize inhibit any policy state variable */
-        if (anyPolicyInhibited) {
+        if (buildParams.anyPolicyInhibited()) {
             inhibitAnyPolicy = 0;
         } else {
-            inhibitAnyPolicy = (maxPathLen == -1)
-                ? maxPathLen
-                : maxPathLen + 2;
+            inhibitAnyPolicy = (maxPathLen == -1) ? maxPathLen : maxPathLen + 2;
         }
 
         /* Initialize certIndex */
         certIndex = 1;
 
         /* Initialize policy tree */
-        Set<String> initExpPolSet = new HashSet<String>(1);
+        Set<String> initExpPolSet = new HashSet<>(1);
         initExpPolSet.add(PolicyChecker.ANY_POLICY);
 
-        rootNode = new PolicyNodeImpl
-            (null, PolicyChecker.ANY_POLICY, null, false, initExpPolSet, false);
+        rootNode = new PolicyNodeImpl(null, PolicyChecker.ANY_POLICY, null,
+                                      false, initExpPolSet, false);
 
         /*
          * Initialize each user-defined checker
+         * Shallow copy the checkers
          */
-        if (certPathCheckers != null) {
-            /* Shallow copy the checkers */
-            userCheckers = new ArrayList<PKIXCertPathChecker>(certPathCheckers);
-            /* initialize each checker (just in case) */
-            for (PKIXCertPathChecker checker : certPathCheckers) {
-                checker.init(false);
-            }
-        } else {
-            userCheckers = new ArrayList<PKIXCertPathChecker>();
+        userCheckers = new ArrayList<>(buildParams.certPathCheckers());
+        /* initialize each checker (just in case) */
+        for (PKIXCertPathChecker checker : userCheckers) {
+            checker.init(false);
         }
 
         /* Start by trusting the cert to sign CRLs */
@@ -234,8 +216,9 @@
      * Update the state with the specified trust anchor.
      *
      * @param anchor the most-trusted CA
+     * @param buildParams builder parameters
      */
-    public void updateState(TrustAnchor anchor)
+    public void updateState(TrustAnchor anchor, BuilderParams buildParams)
         throws CertificateException, IOException, CertPathValidatorException
     {
         trustAnchor = anchor;
@@ -247,14 +230,26 @@
             updateState(anchor.getCAPublicKey(), caName);
         }
 
-        // The user specified AlgorithmChecker may not be
+        // The user specified AlgorithmChecker and RevocationChecker may not be
         // able to set the trust anchor until now.
+        boolean revCheckerAdded = false;
         for (PKIXCertPathChecker checker : userCheckers) {
             if (checker instanceof AlgorithmChecker) {
                 ((AlgorithmChecker)checker).trySetTrustAnchor(anchor);
+            } else if (checker instanceof RevocationChecker) {
+                ((RevocationChecker)checker).init(anchor, buildParams);
+                ((RevocationChecker)checker).init(false);
+                revCheckerAdded = true;
             }
         }
 
+        // only create a RevocationChecker if revocation is enabled and
+        // a PKIXRevocationChecker has not already been added
+        if (buildParams.revocationEnabled() && !revCheckerAdded) {
+            revChecker = new RevocationChecker(anchor, buildParams);
+            revChecker.init(false);
+        }
+
         init = false;
     }
 
@@ -313,7 +308,7 @@
         subjKeyId = icert.getSubjectKeyIdentifierExtension();
 
         /* update crlSign */
-        crlSign = CrlRevocationChecker.certCanSignCrl(cert);
+        crlSign = RevocationChecker.certCanSignCrl(cert);
 
         /* update current name constraints */
         if (nc != null) {
@@ -352,6 +347,7 @@
      *
      * @return boolean flag indicating if key lacking parameters encountered.
      */
+    @Override
     public boolean keyParamsNeeded() {
         /* when building in reverse, we immediately get parameters needed
          * or else throw an exception
@@ -368,6 +364,7 @@
      * because some of them (e.g., subjKeyId) will
      * not have their contents modified by subsequent calls to updateState.
      */
+    @Override
     @SuppressWarnings("unchecked") // Safe casts assuming clone() works correctly
     public Object clone() {
         try {
diff --git a/src/share/classes/sun/security/provider/certpath/RevocationChecker.java b/src/share/classes/sun/security/provider/certpath/RevocationChecker.java
new file mode 100644
index 0000000..e34f5a1
--- /dev/null
+++ b/src/share/classes/sun/security/provider/certpath/RevocationChecker.java
@@ -0,0 +1,1095 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.security.provider.certpath;
+
+import java.io.IOException;
+import java.math.BigInteger;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.security.AccessController;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.NoSuchAlgorithmException;
+import java.security.PrivilegedAction;
+import java.security.PublicKey;
+import java.security.Security;
+import java.security.cert.CertPathValidatorException.BasicReason;
+import java.security.cert.Extension;
+import java.security.cert.*;
+import java.security.interfaces.DSAPublicKey;
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import javax.security.auth.x500.X500Principal;
+
+import static sun.security.provider.certpath.OCSP.*;
+import sun.security.provider.certpath.PKIX.ValidatorParams;
+import sun.security.action.GetPropertyAction;
+import sun.security.x509.*;
+import static sun.security.x509.PKIXExtensions.*;
+import sun.security.util.Debug;
+
+class RevocationChecker extends PKIXRevocationChecker {
+
+    private static final Debug debug = Debug.getInstance("certpath");
+
+    private TrustAnchor anchor;
+    private ValidatorParams params;
+    private boolean onlyEE;
+    private boolean softFail;
+    private boolean crlDP;
+    private URI responderURI;
+    private X509Certificate responderCert;
+    private List<CertStore> certStores;
+    private Map<X509Certificate, byte[]> ocspStapled;
+    private List<Extension> ocspExtensions;
+    private boolean legacy;
+
+    // state variables
+    private X509Certificate issuerCert;
+    private PublicKey prevPubKey;
+    private boolean crlSignFlag;
+
+    private enum Mode { PREFER_OCSP, PREFER_CRLS, ONLY_CRLS };
+    private Mode mode = Mode.PREFER_OCSP;
+
+    private static class RevocationProperties {
+        boolean onlyEE;
+        boolean ocspEnabled;
+        boolean crlDPEnabled;
+        String ocspUrl;
+        String ocspSubject;
+        String ocspIssuer;
+        String ocspSerial;
+    }
+
+    RevocationChecker() {
+        legacy = false;
+    }
+
+    RevocationChecker(TrustAnchor anchor, ValidatorParams params)
+        throws CertPathValidatorException
+    {
+        legacy = true;
+        init(anchor, params);
+    }
+
+    void init(TrustAnchor anchor, ValidatorParams params)
+        throws CertPathValidatorException
+    {
+        RevocationProperties rp = getRevocationProperties();
+        URI uri = getOCSPResponder();
+        responderURI = (uri == null) ? toURI(rp.ocspUrl) : uri;
+        X509Certificate cert = getOCSPResponderCert();
+        responderCert = (cert == null)
+                        ? getResponderCert(rp, params.trustAnchors(),
+                                           params.certStores())
+                        : cert;
+        Set<Option> options = getOptions();
+        for (Option option : options) {
+            switch (option) {
+            case ONLY_END_ENTITY:
+            case PREFER_CRLS:
+            case SOFT_FAIL:
+                break;
+            default:
+                throw new CertPathValidatorException(
+                    "Unrecognized revocation parameter option: " + option);
+            }
+        }
+
+        // set mode, only end entity flag
+        if (legacy) {
+            mode = (rp.ocspEnabled) ? Mode.PREFER_OCSP : Mode.ONLY_CRLS;
+            onlyEE = rp.onlyEE;
+        } else {
+            if (options.contains(Option.PREFER_CRLS)) {
+                mode = Mode.PREFER_CRLS;
+            }
+            onlyEE = options.contains(Option.ONLY_END_ENTITY);
+        }
+        softFail = options.contains(Option.SOFT_FAIL);
+        if (legacy) {
+            crlDP = rp.crlDPEnabled;
+        } else {
+            crlDP = true;
+        }
+        ocspStapled = getOCSPStapledResponses();
+        ocspExtensions = getOCSPExtensions();
+
+        this.anchor = anchor;
+        this.params = params;
+        this.certStores = new ArrayList<>(params.certStores());
+        try {
+            this.certStores.add(CertStore.getInstance("Collection",
+                new CollectionCertStoreParameters(params.certificates())));
+        } catch (InvalidAlgorithmParameterException |
+                 NoSuchAlgorithmException e) {
+            // should never occur but not necessarily fatal, so log it,
+            // ignore and continue
+            if (debug != null) {
+                debug.println("RevocationChecker: " +
+                              "error creating Collection CertStore: " + e);
+            }
+        }
+    }
+
+    private static URI toURI(String uriString)
+        throws CertPathValidatorException
+    {
+        try {
+            if (uriString != null) {
+                return new URI(uriString);
+            }
+            return null;
+        } catch (URISyntaxException e) {
+            throw new CertPathValidatorException(
+                "cannot parse ocsp.responderURL property", e);
+        }
+    }
+
+    private static RevocationProperties getRevocationProperties() {
+        return AccessController.doPrivileged(
+            new PrivilegedAction<RevocationProperties>() {
+                public RevocationProperties run() {
+                    RevocationProperties rp = new RevocationProperties();
+                    String onlyEE = Security.getProperty(
+                        "com.sun.security.onlyCheckRevocationOfEECert");
+                    rp.onlyEE = onlyEE != null
+                                && onlyEE.equalsIgnoreCase("true");
+                    String ocspEnabled = Security.getProperty("ocsp.enable");
+                    rp.ocspEnabled = ocspEnabled != null
+                                     && ocspEnabled.equalsIgnoreCase("true");
+                    rp.ocspUrl = Security.getProperty("ocsp.responderURL");
+                    rp.ocspSubject
+                        = Security.getProperty("ocsp.responderCertSubjectName");
+                    rp.ocspIssuer
+                        = Security.getProperty("ocsp.responderCertIssuerName");
+                    rp.ocspSerial
+                        = Security.getProperty("ocsp.responderCertSerialNumber");
+                    rp.crlDPEnabled
+                        = Boolean.getBoolean("com.sun.security.enableCRLDP");
+                    return rp;
+                }
+            }
+        );
+    }
+
+    private static X509Certificate getResponderCert(RevocationProperties rp,
+                                                    Set<TrustAnchor> anchors,
+                                                    List<CertStore> stores)
+        throws CertPathValidatorException
+    {
+        if (rp.ocspSubject != null) {
+            return getResponderCert(rp.ocspSubject, anchors, stores);
+        } else if (rp.ocspIssuer != null && rp.ocspSerial != null) {
+            return getResponderCert(rp.ocspIssuer, rp.ocspSerial,
+                                    anchors, stores);
+        } else if (rp.ocspIssuer != null || rp.ocspSerial != null) {
+            throw new CertPathValidatorException(
+                "Must specify both ocsp.responderCertIssuerName and " +
+                "ocsp.responderCertSerialNumber properties");
+        }
+        return null;
+    }
+
+    private static X509Certificate getResponderCert(String subject,
+                                                    Set<TrustAnchor> anchors,
+                                                    List<CertStore> stores)
+        throws CertPathValidatorException
+    {
+        X509CertSelector sel = new X509CertSelector();
+        try {
+            sel.setSubject(new X500Principal(subject));
+        } catch (IllegalArgumentException e) {
+            throw new CertPathValidatorException(
+                "cannot parse ocsp.responderCertSubjectName property", e);
+        }
+        return getResponderCert(sel, anchors, stores);
+    }
+
+    private static X509Certificate getResponderCert(String issuer,
+                                                    String serial,
+                                                    Set<TrustAnchor> anchors,
+                                                    List<CertStore> stores)
+        throws CertPathValidatorException
+    {
+        X509CertSelector sel = new X509CertSelector();
+        try {
+            sel.setIssuer(new X500Principal(issuer));
+        } catch (IllegalArgumentException e) {
+            throw new CertPathValidatorException(
+                "cannot parse ocsp.responderCertIssuerName property", e);
+        }
+        try {
+            sel.setSerialNumber(new BigInteger(stripOutSeparators(serial), 16));
+        } catch (NumberFormatException e) {
+            throw new CertPathValidatorException(
+                "cannot parse ocsp.responderCertSerialNumber property", e);
+        }
+        return getResponderCert(sel, anchors, stores);
+    }
+
+    private static X509Certificate getResponderCert(X509CertSelector sel,
+                                                    Set<TrustAnchor> anchors,
+                                                    List<CertStore> stores)
+        throws CertPathValidatorException
+    {
+        // first check TrustAnchors
+        for (TrustAnchor anchor : anchors) {
+            X509Certificate cert = anchor.getTrustedCert();
+            if (cert == null) {
+                continue;
+            }
+            if (sel.match(cert)) {
+                return cert;
+            }
+        }
+        // now check CertStores
+        for (CertStore store : stores) {
+            try {
+                Collection<? extends Certificate> certs =
+                    store.getCertificates(sel);
+                if (!certs.isEmpty()) {
+                    return (X509Certificate)certs.iterator().next();
+                }
+            } catch (CertStoreException e) {
+                // ignore and try next CertStore
+                if (debug != null) {
+                    debug.println("CertStore exception:" + e);
+                }
+                continue;
+            }
+        }
+        throw new CertPathValidatorException(
+            "Cannot find the responder's certificate " +
+            "(set using the OCSP security properties).");
+    }
+
+    @Override
+    public void init(boolean forward) throws CertPathValidatorException {
+        if (forward) {
+            throw new
+                CertPathValidatorException("forward checking not supported");
+        } else {
+            if (anchor != null) {
+                issuerCert = anchor.getTrustedCert();
+                prevPubKey = (issuerCert != null) ? issuerCert.getPublicKey()
+                                                  : anchor.getCAPublicKey();
+            }
+            crlSignFlag = true;
+        }
+    }
+
+    @Override
+    public boolean isForwardCheckingSupported() {
+        return false;
+    }
+
+    @Override
+    public Set<String> getSupportedExtensions() {
+        return null;
+    }
+
+    @Override
+    public void check(Certificate cert, Collection<String> unresolvedCritExts)
+        throws CertPathValidatorException
+    {
+        X509Certificate xcert = (X509Certificate)cert;
+        if (onlyEE && xcert.getBasicConstraints() != -1) {
+            if (debug != null) {
+                debug.println("Skipping revocation check, not end entity cert");
+            }
+        } else {
+            check(xcert, unresolvedCritExts, prevPubKey, crlSignFlag);
+        }
+        updateState(xcert);
+    }
+
+    void check(X509Certificate xcert, Collection<String> unresolvedCritExts,
+               PublicKey pubKey, boolean crlSignFlag)
+        throws CertPathValidatorException
+    {
+        try {
+            switch (mode) {
+                case PREFER_OCSP:
+                    checkOCSP(xcert, unresolvedCritExts);
+                    break;
+                case PREFER_CRLS:
+                case ONLY_CRLS:
+                    checkCRLs(xcert, unresolvedCritExts, null,
+                              pubKey, crlSignFlag);
+                    break;
+            }
+        } catch (CertPathValidatorException e) {
+            if (e.getReason() == BasicReason.REVOKED) {
+                throw e;
+            }
+            CertPathValidatorException cause = e;
+            if (softFail && e instanceof NetworkFailureException) {
+                if (mode == Mode.ONLY_CRLS) return;
+            }
+            // Rethrow the exception if ONLY_CRLS
+            if (mode == Mode.ONLY_CRLS) {
+                throw e;
+            }
+            // Otherwise, failover
+            if (debug != null) {
+                debug.println("RevocationChecker.check() " + e.getMessage());
+                debug.println("RevocationChecker.check() preparing to failover");
+            }
+            try {
+                switch (mode) {
+                    case PREFER_OCSP:
+                        checkCRLs(xcert, unresolvedCritExts, null,
+                                  pubKey, crlSignFlag);
+                        break;
+                    case PREFER_CRLS:
+                        checkOCSP(xcert, unresolvedCritExts);
+                        break;
+                }
+            } catch (CertPathValidatorException x) {
+                if (debug != null) {
+                    debug.println("RevocationChecker.check() failover failed");
+                    debug.println("RevocationChecker.check() " + x.getMessage());
+                }
+                if (x.getReason() == BasicReason.REVOKED) {
+                    throw x;
+                }
+                if (cause != null) {
+                    if (softFail && cause instanceof NetworkFailureException) {
+                        return;
+                    } else {
+                        cause.addSuppressed(x);
+                        throw cause;
+                    }
+                }
+                if (softFail && x instanceof NetworkFailureException) {
+                    return;
+                }
+                throw x;
+            }
+        }
+    }
+
+    private void updateState(X509Certificate cert)
+        throws CertPathValidatorException
+    {
+        issuerCert = cert;
+
+        // Make new public key if parameters are missing
+        PublicKey pubKey = cert.getPublicKey();
+        if (pubKey instanceof DSAPublicKey &&
+            ((DSAPublicKey)pubKey).getParams() == null) {
+            // pubKey needs to inherit DSA parameters from prev key
+            pubKey = BasicChecker.makeInheritedParamsKey(pubKey, prevPubKey);
+        }
+        prevPubKey = pubKey;
+        crlSignFlag = certCanSignCrl(cert);
+    }
+
+    // Maximum clock skew in milliseconds (15 minutes) allowed when checking
+    // validity of CRLs
+    private static final long MAX_CLOCK_SKEW = 900000;
+    private void checkCRLs(X509Certificate cert,
+                           Collection<String> unresolvedCritExts,
+                           Set<X509Certificate> stackedCerts,
+                           PublicKey pubKey, boolean signFlag)
+        throws CertPathValidatorException
+    {
+        checkCRLs(cert, pubKey, signFlag, true,
+                  stackedCerts, params.trustAnchors());
+    }
+
+    private void checkCRLs(X509Certificate cert, PublicKey prevKey,
+                           boolean signFlag, boolean allowSeparateKey,
+                           Set<X509Certificate> stackedCerts,
+                           Set<TrustAnchor> anchors)
+        throws CertPathValidatorException
+    {
+        if (debug != null) {
+            debug.println("RevocationChecker.checkCRLs()" +
+                          " ---checking revocation status ...");
+        }
+
+        // reject circular dependencies - RFC 3280 is not explicit on how
+        // to handle this, so we feel it is safest to reject them until
+        // the issue is resolved in the PKIX WG.
+        if (stackedCerts != null && stackedCerts.contains(cert)) {
+            if (debug != null) {
+                debug.println("RevocationChecker.checkCRLs()" +
+                              " circular dependency");
+            }
+            throw new CertPathValidatorException
+                ("Could not determine revocation status", null, null, -1,
+                 BasicReason.UNDETERMINED_REVOCATION_STATUS);
+        }
+
+        Set<X509CRL> possibleCRLs = new HashSet<>();
+        Set<X509CRL> approvedCRLs = new HashSet<>();
+        X509CRLSelector sel = new X509CRLSelector();
+        sel.setCertificateChecking(cert);
+        CertPathHelper.setDateAndTime(sel, params.date(), MAX_CLOCK_SKEW);
+
+        // First, check cached CRLs
+        for (CertStore store : certStores) {
+            try {
+                for (CRL crl : store.getCRLs(sel)) {
+                    possibleCRLs.add((X509CRL)crl);
+                }
+            } catch (CertStoreException e) {
+                // XXX ignore?
+            }
+        }
+
+        if (debug != null) {
+            debug.println("RevocationChecker.checkCRLs() " +
+                          "possible crls.size() = " + possibleCRLs.size());
+        }
+        boolean[] reasonsMask = new boolean[9];
+        if (!possibleCRLs.isEmpty()) {
+            // Now that we have a list of possible CRLs, see which ones can
+            // be approved
+            approvedCRLs.addAll(verifyPossibleCRLs(possibleCRLs, cert, prevKey,
+                                                   signFlag, reasonsMask,
+                                                   anchors));
+        }
+
+        if (debug != null) {
+            debug.println("RevocationChecker.checkCRLs() " +
+                          "approved crls.size() = " + approvedCRLs.size());
+        }
+
+        // make sure that we have at least one CRL that _could_ cover
+        // the certificate in question and all reasons are covered
+        if (!approvedCRLs.isEmpty() &&
+            Arrays.equals(reasonsMask, ALL_REASONS))
+        {
+            checkApprovedCRLs(cert, approvedCRLs);
+        } else {
+            // Check Distribution Points
+            // all CRLs returned by the DP Fetcher have also been verified
+            try {
+                if (crlDP) {
+                    approvedCRLs.addAll(DistributionPointFetcher.getCRLs(
+                                        sel, signFlag, prevKey,
+                                        params.sigProvider(), certStores,
+                                        reasonsMask, anchors, params.date()));
+                }
+            } catch (CertStoreException e) {
+                if (debug != null) {
+                    debug.println("RevocationChecker.checkCRLs() " +
+                                  "unexpected exception: " + e.getMessage());
+                }
+                throw new CertPathValidatorException(e);
+            }
+            if (!approvedCRLs.isEmpty() &&
+                Arrays.equals(reasonsMask, ALL_REASONS))
+            {
+                checkApprovedCRLs(cert, approvedCRLs);
+            } else {
+                if (allowSeparateKey) {
+                    verifyWithSeparateSigningKey(cert, prevKey, signFlag,
+                                                 stackedCerts);
+                    return;
+                } else {
+                    throw new CertPathValidatorException
+                    ("Could not determine revocation status", null, null, -1,
+                     BasicReason.UNDETERMINED_REVOCATION_STATUS);
+                }
+            }
+        }
+    }
+
+    private void checkApprovedCRLs(X509Certificate cert,
+                                   Set<X509CRL> approvedCRLs)
+        throws CertPathValidatorException
+    {
+        // See if the cert is in the set of approved crls.
+        if (debug != null) {
+            BigInteger sn = cert.getSerialNumber();
+            debug.println("RevocationChecker.checkApprovedCRLs() " +
+                          "starting the final sweep...");
+            debug.println("RevocationChecker.checkApprovedCRLs()" +
+                          " cert SN: " + sn.toString());
+        }
+
+        CRLReason reasonCode = CRLReason.UNSPECIFIED;
+        X509CRLEntryImpl entry = null;
+        for (X509CRL crl : approvedCRLs) {
+            X509CRLEntry e = crl.getRevokedCertificate(cert);
+            if (e != null) {
+                try {
+                    entry = X509CRLEntryImpl.toImpl(e);
+                } catch (CRLException ce) {
+                    throw new CertPathValidatorException(ce);
+                }
+                if (debug != null) {
+                    debug.println("RevocationChecker.checkApprovedCRLs()"
+                        + " CRL entry: " + entry.toString());
+                }
+
+                /*
+                 * Abort CRL validation and throw exception if there are any
+                 * unrecognized critical CRL entry extensions (see section
+                 * 5.3 of RFC 3280).
+                 */
+                Set<String> unresCritExts = entry.getCriticalExtensionOIDs();
+                if (unresCritExts != null && !unresCritExts.isEmpty()) {
+                    /* remove any that we will process */
+                    unresCritExts.remove(ReasonCode_Id.toString());
+                    unresCritExts.remove(CertificateIssuer_Id.toString());
+                    if (!unresCritExts.isEmpty()) {
+                        if (debug != null) {
+                            debug.println("Unrecognized "
+                            + "critical extension(s) in revoked CRL entry: "
+                            + unresCritExts);
+                        }
+                        throw new CertPathValidatorException
+                        ("Could not determine revocation status", null, null,
+                         -1, BasicReason.UNDETERMINED_REVOCATION_STATUS);
+                    }
+                }
+
+                reasonCode = entry.getRevocationReason();
+                if (reasonCode == null) {
+                    reasonCode = CRLReason.UNSPECIFIED;
+                }
+                Throwable t = new CertificateRevokedException
+                    (entry.getRevocationDate(), reasonCode,
+                     crl.getIssuerX500Principal(), entry.getExtensions());
+                throw new CertPathValidatorException(t.getMessage(), t,
+                    null, -1, BasicReason.REVOKED);
+            }
+        }
+    }
+
+    private void checkOCSP(X509Certificate cert,
+                           Collection<String> unresolvedCritExts)
+        throws CertPathValidatorException
+    {
+        X509CertImpl currCert = null;
+        try {
+            currCert = X509CertImpl.toImpl(cert);
+        } catch (CertificateException ce) {
+            throw new CertPathValidatorException(ce);
+        }
+
+        URI responderURI = (this.responderURI != null)
+                           ? this.responderURI : getOCSPServerURI(currCert);
+
+        X509Certificate respCert = (responderCert == null) ? issuerCert
+                                                           : responderCert;
+
+        // The algorithm constraints of the OCSP trusted responder certificate
+        // does not need to be checked in this code. The constraints will be
+        // checked when the responder's certificate is validated.
+
+        OCSPResponse response = null;
+        CertId certId = null;
+        try {
+            certId = new CertId(issuerCert, currCert.getSerialNumberObject());
+
+            // check if there is a stapled OCSP response available
+            byte[] responseBytes = ocspStapled.get(cert);
+            if (responseBytes != null) {
+                if (debug != null) {
+                    debug.println("Found stapled OCSP response");
+                }
+                response = new OCSPResponse(responseBytes);
+
+                // verify the response
+                byte[] nonce = null;
+                for (Extension ext : ocspExtensions) {
+                    if (ext.getId().equals("1.3.6.1.5.5.7.48.1.2")) {
+                        nonce = ext.getValue();
+                    }
+                }
+                response.verify(Collections.singletonList(certId), respCert,
+                                params.date(), nonce);
+
+            } else {
+                response = OCSP.check(Collections.singletonList(certId),
+                                      responderURI, respCert, params.date(),
+                                      ocspExtensions);
+            }
+        } catch (IOException e) {
+            throw new CertPathValidatorException(e);
+        }
+
+        RevocationStatus rs =
+            (RevocationStatus)response.getSingleResponse(certId);
+        RevocationStatus.CertStatus certStatus = rs.getCertStatus();
+        if (certStatus == RevocationStatus.CertStatus.REVOKED) {
+            Throwable t = new CertificateRevokedException(
+                rs.getRevocationTime(), rs.getRevocationReason(),
+                respCert.getSubjectX500Principal(), rs.getSingleExtensions());
+            throw new CertPathValidatorException(t.getMessage(), t, null,
+                                                 -1, BasicReason.REVOKED);
+        } else if (certStatus == RevocationStatus.CertStatus.UNKNOWN) {
+            throw new CertPathValidatorException(
+                "Certificate's revocation status is unknown", null,
+                params.certPath(), -1,
+                BasicReason.UNDETERMINED_REVOCATION_STATUS);
+        }
+    }
+
+    /*
+     * Removes any non-hexadecimal characters from a string.
+     */
+    private static final String HEX_DIGITS = "0123456789ABCDEFabcdef";
+    private static String stripOutSeparators(String value) {
+        char[] chars = value.toCharArray();
+        StringBuilder hexNumber = new StringBuilder();
+        for (int i = 0; i < chars.length; i++) {
+            if (HEX_DIGITS.indexOf(chars[i]) != -1) {
+                hexNumber.append(chars[i]);
+            }
+        }
+        return hexNumber.toString();
+    }
+
+    private static URI getOCSPServerURI(X509CertImpl cert)
+        throws CertPathValidatorException
+    {
+        // Examine the certificate's AuthorityInfoAccess extension
+        AuthorityInfoAccessExtension aia =
+            cert.getAuthorityInfoAccessExtension();
+        if (aia == null) {
+            throw new CertPathValidatorException(
+                "Must specify the location of an OCSP Responder");
+        }
+
+        List<AccessDescription> descriptions = aia.getAccessDescriptions();
+        for (AccessDescription description : descriptions) {
+            if (description.getAccessMethod().equals((Object)
+                AccessDescription.Ad_OCSP_Id)) {
+
+                GeneralName generalName = description.getAccessLocation();
+                if (generalName.getType() == GeneralNameInterface.NAME_URI) {
+                    URIName uri = (URIName)generalName.getName();
+                    return uri.getURI();
+                }
+            }
+        }
+
+        throw new CertPathValidatorException(
+            "Cannot find the location of the OCSP Responder");
+    }
+
+    /**
+     * Checks that a cert can be used to verify a CRL.
+     *
+     * @param cert an X509Certificate to check
+     * @return a boolean specifying if the cert is allowed to vouch for the
+     *         validity of a CRL
+     */
+    static boolean certCanSignCrl(X509Certificate cert) {
+        // if the cert doesn't include the key usage ext, or
+        // the key usage ext asserts cRLSigning, return true,
+        // otherwise return false.
+        boolean[] keyUsage = cert.getKeyUsage();
+        if (keyUsage != null) {
+            return keyUsage[6];
+        }
+        return false;
+    }
+
+    /**
+     * Internal method that verifies a set of possible_crls,
+     * and sees if each is approved, based on the cert.
+     *
+     * @param crls a set of possible CRLs to test for acceptability
+     * @param cert the certificate whose revocation status is being checked
+     * @param signFlag <code>true</code> if prevKey was trusted to sign CRLs
+     * @param prevKey the public key of the issuer of cert
+     * @param reasonsMask the reason code mask
+     * @param trustAnchors a <code>Set</code> of <code>TrustAnchor</code>s>
+     * @return a collection of approved crls (or an empty collection)
+     */
+    private static final boolean[] ALL_REASONS =
+        {true, true, true, true, true, true, true, true, true};
+    private Collection<X509CRL> verifyPossibleCRLs(Set<X509CRL> crls,
+                                                   X509Certificate cert,
+                                                   PublicKey prevKey,
+                                                   boolean signFlag,
+                                                   boolean[] reasonsMask,
+                                                   Set<TrustAnchor> anchors)
+        throws CertPathValidatorException
+    {
+        try {
+            X509CertImpl certImpl = X509CertImpl.toImpl(cert);
+            if (debug != null) {
+                debug.println("RevocationChecker.verifyPossibleCRLs: " +
+                              "Checking CRLDPs for "
+                              + certImpl.getSubjectX500Principal());
+            }
+            CRLDistributionPointsExtension ext =
+                certImpl.getCRLDistributionPointsExtension();
+            List<DistributionPoint> points = null;
+            if (ext == null) {
+                // assume a DP with reasons and CRLIssuer fields omitted
+                // and a DP name of the cert issuer.
+                // TODO add issuerAltName too
+                X500Name certIssuer = (X500Name)certImpl.getIssuerDN();
+                DistributionPoint point = new DistributionPoint(
+                     new GeneralNames().add(new GeneralName(certIssuer)),
+                     null, null);
+                points = Collections.singletonList(point);
+            } else {
+                points = ext.get(CRLDistributionPointsExtension.POINTS);
+            }
+            Set<X509CRL> results = new HashSet<>();
+            for (DistributionPoint point : points) {
+                for (X509CRL crl : crls) {
+                    if (DistributionPointFetcher.verifyCRL(
+                            certImpl, point, crl, reasonsMask, signFlag,
+                            prevKey, params.sigProvider(), anchors,
+                            certStores, params.date()))
+                    {
+                        results.add(crl);
+                    }
+                }
+                if (Arrays.equals(reasonsMask, ALL_REASONS))
+                    break;
+            }
+            return results;
+        } catch (CertificateException | CRLException | IOException e) {
+            if (debug != null) {
+                debug.println("Exception while verifying CRL: "+e.getMessage());
+                e.printStackTrace();
+            }
+            return Collections.emptySet();
+        }
+    }
+
+    /**
+     * We have a cert whose revocation status couldn't be verified by
+     * a CRL issued by the cert that issued the CRL. See if we can
+     * find a valid CRL issued by a separate key that can verify the
+     * revocation status of this certificate.
+     * <p>
+     * Note that this does not provide support for indirect CRLs,
+     * only CRLs signed with a different key (but the same issuer
+     * name) as the certificate being checked.
+     *
+     * @param currCert the <code>X509Certificate</code> to be checked
+     * @param prevKey the <code>PublicKey</code> that failed
+     * @param signFlag <code>true</code> if that key was trusted to sign CRLs
+     * @param stackedCerts a <code>Set</code> of <code>X509Certificate</code>s>
+     *                     whose revocation status depends on the
+     *                     non-revoked status of this cert. To avoid
+     *                     circular dependencies, we assume they're
+     *                     revoked while checking the revocation
+     *                     status of this cert.
+     * @throws CertPathValidatorException if the cert's revocation status
+     *         cannot be verified successfully with another key
+     */
+    private void verifyWithSeparateSigningKey(X509Certificate cert,
+                                              PublicKey prevKey,
+                                              boolean signFlag,
+                                              Set<X509Certificate> stackedCerts)
+        throws CertPathValidatorException
+    {
+        String msg = "revocation status";
+        if (debug != null) {
+            debug.println(
+                "RevocationChecker.verifyWithSeparateSigningKey()" +
+                " ---checking " + msg + "...");
+        }
+
+        // reject circular dependencies - RFC 3280 is not explicit on how
+        // to handle this, so we feel it is safest to reject them until
+        // the issue is resolved in the PKIX WG.
+        if ((stackedCerts != null) && stackedCerts.contains(cert)) {
+            if (debug != null) {
+                debug.println(
+                    "RevocationChecker.verifyWithSeparateSigningKey()" +
+                    " circular dependency");
+            }
+            throw new CertPathValidatorException
+                ("Could not determine revocation status", null, null,
+                 -1, BasicReason.UNDETERMINED_REVOCATION_STATUS);
+        }
+
+        // Try to find another key that might be able to sign
+        // CRLs vouching for this cert.
+        // If prevKey wasn't trusted, maybe we just didn't have the right
+        // path to it. Don't rule that key out.
+        if (!signFlag) {
+            buildToNewKey(cert, null, stackedCerts);
+        } else {
+            buildToNewKey(cert, prevKey, stackedCerts);
+        }
+    }
+
+    /**
+     * Tries to find a CertPath that establishes a key that can be
+     * used to verify the revocation status of a given certificate.
+     * Ignores keys that have previously been tried. Throws a
+     * CertPathValidatorException if no such key could be found.
+     *
+     * @param currCert the <code>X509Certificate</code> to be checked
+     * @param prevKey the <code>PublicKey</code> of the certificate whose key
+     *    cannot be used to vouch for the CRL and should be ignored
+     * @param stackedCerts a <code>Set</code> of <code>X509Certificate</code>s>
+     *                     whose revocation status depends on the
+     *                     establishment of this path.
+     * @throws CertPathValidatorException on failure
+     */
+    private static final boolean [] CRL_SIGN_USAGE =
+        { false, false, false, false, false, false, true };
+    private void buildToNewKey(X509Certificate currCert,
+                               PublicKey prevKey,
+                               Set<X509Certificate> stackedCerts)
+        throws CertPathValidatorException
+    {
+
+        if (debug != null) {
+            debug.println("RevocationChecker.buildToNewKey()" +
+                          " starting work");
+        }
+        Set<PublicKey> badKeys = new HashSet<>();
+        if (prevKey != null) {
+            badKeys.add(prevKey);
+        }
+        X509CertSelector certSel = new RejectKeySelector(badKeys);
+        certSel.setSubject(currCert.getIssuerX500Principal());
+        certSel.setKeyUsage(CRL_SIGN_USAGE);
+
+        Set<TrustAnchor> newAnchors = anchor == null ?
+                                      params.trustAnchors() :
+                                      Collections.singleton(anchor);
+
+        PKIXBuilderParameters builderParams;
+        try {
+            builderParams = new PKIXBuilderParameters(newAnchors, certSel);
+        } catch (InvalidAlgorithmParameterException iape) {
+            throw new RuntimeException(iape); // should never occur
+        }
+        builderParams.setInitialPolicies(params.initialPolicies());
+        builderParams.setCertStores(certStores);
+        builderParams.setExplicitPolicyRequired
+            (params.explicitPolicyRequired());
+        builderParams.setPolicyMappingInhibited
+            (params.policyMappingInhibited());
+        builderParams.setAnyPolicyInhibited(params.anyPolicyInhibited());
+        // Policy qualifiers must be rejected, since we don't have
+        // any way to convey them back to the application.
+        // That's the default, so no need to write code.
+        builderParams.setDate(params.date());
+        // CertPathCheckers need to be cloned to start from fresh state
+        builderParams.setCertPathCheckers(
+            params.getPKIXParameters().getCertPathCheckers());
+        builderParams.setSigProvider(params.sigProvider());
+
+        // Skip revocation during this build to detect circular
+        // references. But check revocation afterwards, using the
+        // key (or any other that works).
+        builderParams.setRevocationEnabled(false);
+
+        // check for AuthorityInformationAccess extension
+        if (Builder.USE_AIA == true) {
+            X509CertImpl currCertImpl = null;
+            try {
+                currCertImpl = X509CertImpl.toImpl(currCert);
+            } catch (CertificateException ce) {
+                // ignore but log it
+                if (debug != null) {
+                    debug.println("RevocationChecker.buildToNewKey: " +
+                                  "error decoding cert: " + ce);
+                }
+            }
+            AuthorityInfoAccessExtension aiaExt = null;
+            if (currCertImpl != null) {
+                aiaExt = currCertImpl.getAuthorityInfoAccessExtension();
+            }
+            if (aiaExt != null) {
+                List<AccessDescription> adList = aiaExt.getAccessDescriptions();
+                if (adList != null) {
+                    for (AccessDescription ad : adList) {
+                        CertStore cs = URICertStore.getInstance(ad);
+                        if (cs != null) {
+                            if (debug != null) {
+                                debug.println("adding AIAext CertStore");
+                            }
+                            builderParams.addCertStore(cs);
+                        }
+                    }
+                }
+            }
+        }
+
+        CertPathBuilder builder = null;
+        try {
+            builder = CertPathBuilder.getInstance("PKIX");
+        } catch (NoSuchAlgorithmException nsae) {
+            throw new CertPathValidatorException(nsae);
+        }
+        while (true) {
+            try {
+                if (debug != null) {
+                    debug.println("RevocationChecker.buildToNewKey()" +
+                                  " about to try build ...");
+                }
+                PKIXCertPathBuilderResult cpbr =
+                    (PKIXCertPathBuilderResult)builder.build(builderParams);
+
+                if (debug != null) {
+                    debug.println("RevocationChecker.buildToNewKey()" +
+                                  " about to check revocation ...");
+                }
+                // Now check revocation of all certs in path, assuming that
+                // the stackedCerts are revoked.
+                if (stackedCerts == null) {
+                    stackedCerts = new HashSet<X509Certificate>();
+                }
+                stackedCerts.add(currCert);
+                TrustAnchor ta = cpbr.getTrustAnchor();
+                PublicKey prevKey2 = ta.getCAPublicKey();
+                if (prevKey2 == null) {
+                    prevKey2 = ta.getTrustedCert().getPublicKey();
+                }
+                boolean signFlag = true;
+                List<? extends Certificate> cpList =
+                    cpbr.getCertPath().getCertificates();
+                try {
+                    for (int i = cpList.size()-1; i >= 0; i-- ) {
+                        X509Certificate cert = (X509Certificate)cpList.get(i);
+
+                        if (debug != null) {
+                            debug.println("RevocationChecker.buildToNewKey()"
+                                          + " index " + i + " checking "
+                                          + cert);
+                        }
+                        checkCRLs(cert, prevKey2, signFlag, true,
+                                  stackedCerts, newAnchors);
+                        signFlag = certCanSignCrl(cert);
+                        prevKey2 = cert.getPublicKey();
+                    }
+                } catch (CertPathValidatorException cpve) {
+                    // ignore it and try to get another key
+                    badKeys.add(cpbr.getPublicKey());
+                    continue;
+                }
+
+                if (debug != null) {
+                    debug.println("RevocationChecker.buildToNewKey()" +
+                                  " got key " + cpbr.getPublicKey());
+                }
+                // Now check revocation on the current cert using that key.
+                // If it doesn't check out, try to find a different key.
+                // And if we can't find a key, then return false.
+                PublicKey newKey = cpbr.getPublicKey();
+                try {
+                    checkCRLs(currCert, newKey, true, false, null,
+                              params.trustAnchors());
+                    // If that passed, the cert is OK!
+                    return;
+                } catch (CertPathValidatorException cpve) {
+                    // If it is revoked, rethrow exception
+                    if (cpve.getReason() == BasicReason.REVOKED) {
+                        throw cpve;
+                    }
+                    // Otherwise, ignore the exception and
+                    // try to get another key.
+                }
+                badKeys.add(newKey);
+            } catch (InvalidAlgorithmParameterException iape) {
+                throw new CertPathValidatorException(iape);
+            } catch (CertPathBuilderException cpbe) {
+                throw new CertPathValidatorException
+                    ("Could not determine revocation status", null, null,
+                     -1, BasicReason.UNDETERMINED_REVOCATION_STATUS);
+            }
+        }
+    }
+
+    /*
+     * This inner class extends the X509CertSelector to add an additional
+     * check to make sure the subject public key isn't on a particular list.
+     * This class is used by buildToNewKey() to make sure the builder doesn't
+     * end up with a CertPath to a public key that has already been rejected.
+     */
+    private static class RejectKeySelector extends X509CertSelector {
+        private final Set<PublicKey> badKeySet;
+
+        /**
+         * Creates a new <code>RejectKeySelector</code>.
+         *
+         * @param badPublicKeys a <code>Set</code> of
+         *                      <code>PublicKey</code>s that
+         *                      should be rejected (or <code>null</code>
+         *                      if no such check should be done)
+         */
+        RejectKeySelector(Set<PublicKey> badPublicKeys) {
+            this.badKeySet = badPublicKeys;
+        }
+
+        /**
+         * Decides whether a <code>Certificate</code> should be selected.
+         *
+         * @param cert the <code>Certificate</code> to be checked
+         * @return <code>true</code> if the <code>Certificate</code> should be
+         *         selected, <code>false</code> otherwise
+         */
+        @Override
+        public boolean match(Certificate cert) {
+            if (!super.match(cert))
+                return(false);
+
+            if (badKeySet.contains(cert.getPublicKey())) {
+                if (debug != null)
+                    debug.println("RejectKeySelector.match: bad key");
+                return false;
+            }
+
+            if (debug != null)
+                debug.println("RejectKeySelector.match: returning true");
+            return true;
+        }
+
+        /**
+         * Return a printable representation of the <code>CertSelector</code>.
+         *
+         * @return a <code>String</code> describing the contents of the
+         *         <code>CertSelector</code>
+         */
+        @Override
+        public String toString() {
+            StringBuilder sb = new StringBuilder();
+            sb.append("RejectKeySelector: [\n");
+            sb.append(super.toString());
+            sb.append(badKeySet);
+            sb.append("]");
+            return sb.toString();
+        }
+    }
+}
diff --git a/src/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java b/src/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java
index b3daf34..eebf9b3 100644
--- a/src/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java
+++ b/src/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java
@@ -26,10 +26,8 @@
 package sun.security.provider.certpath;
 
 import java.io.IOException;
-import java.security.AccessController;
 import java.security.GeneralSecurityException;
 import java.security.InvalidAlgorithmParameterException;
-import java.security.Principal;
 import java.security.PublicKey;
 import java.security.cert.*;
 import java.security.cert.PKIXReason;
@@ -37,7 +35,6 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
@@ -45,9 +42,8 @@
 import java.util.Set;
 import javax.security.auth.x500.X500Principal;
 
-import sun.security.action.GetBooleanSecurityPropertyAction;
-import sun.security.x509.X500Name;
-import sun.security.x509.PKIXExtensions;
+import sun.security.provider.certpath.PKIX.BuilderParams;
+import static sun.security.x509.PKIXExtensions.*;
 import sun.security.util.Debug;
 
 /**
@@ -78,16 +74,12 @@
     /*
      * private objects shared by methods
      */
-    private PKIXBuilderParameters buildParams;
+    private BuilderParams buildParams;
     private CertificateFactory cf;
     private boolean pathCompleted = false;
-    private X500Principal targetSubjectDN;
     private PolicyNode policyTreeResult;
     private TrustAnchor trustAnchor;
     private PublicKey finalPublicKey;
-    private X509CertSelector targetSel;
-    private List<CertStore> orderedCertStores;
-    private boolean onlyEECert = false;
 
     /**
      * Create an instance of <code>SunCertPathBuilder</code>.
@@ -100,9 +92,11 @@
         } catch (CertificateException e) {
             throw new CertPathBuilderException(e);
         }
-        onlyEECert = AccessController.doPrivileged(
-            new GetBooleanSecurityPropertyAction
-                ("com.sun.security.onlyCheckRevocationOfEECert"));
+    }
+
+    @Override
+    public CertPathChecker engineGetRevocationChecker() {
+        return new RevocationChecker();
     }
 
     /**
@@ -125,6 +119,7 @@
      * @throws InvalidAlgorithmParameterException if the given parameters are
      *  inappropriate for this certification path builder.
      */
+    @Override
     public CertPathBuilderResult engineBuild(CertPathParameters params)
         throws CertPathBuilderException, InvalidAlgorithmParameterException {
 
@@ -132,66 +127,20 @@
             debug.println("SunCertPathBuilder.engineBuild(" + params + ")");
         }
 
-        if (!(params instanceof PKIXBuilderParameters)) {
-            throw new InvalidAlgorithmParameterException("inappropriate " +
-                "parameter type, must be an instance of PKIXBuilderParameters");
-        }
+        buildParams = PKIX.checkBuilderParams(params);
+        return build();
+    }
 
-        boolean buildForward = true;
-        if (params instanceof SunCertPathBuilderParameters) {
-            buildForward =
-                ((SunCertPathBuilderParameters)params).getBuildForward();
-        }
-
-        buildParams = (PKIXBuilderParameters)params;
-
-        /* Check mandatory parameters */
-
-        // Make sure that none of the trust anchors include name constraints
-        // (not supported).
-        for (TrustAnchor anchor : buildParams.getTrustAnchors()) {
-            if (anchor.getNameConstraints() != null) {
-                throw new InvalidAlgorithmParameterException
-                    ("name constraints in trust anchor not supported");
-            }
-        }
-
-        CertSelector sel = buildParams.getTargetCertConstraints();
-        if (!(sel instanceof X509CertSelector)) {
-            throw new InvalidAlgorithmParameterException("the "
-                + "targetCertConstraints parameter must be an "
-                + "X509CertSelector");
-        }
-        targetSel = (X509CertSelector)sel;
-        targetSubjectDN = targetSel.getSubject();
-        if (targetSubjectDN == null) {
-            X509Certificate targetCert = targetSel.getCertificate();
-            if (targetCert != null) {
-                targetSubjectDN = targetCert.getSubjectX500Principal();
-            }
-        }
-        // reorder CertStores so that local CertStores are tried first
-        orderedCertStores =
-            new ArrayList<CertStore>(buildParams.getCertStores());
-        Collections.sort(orderedCertStores, new CertStoreComparator());
-        if (targetSubjectDN == null) {
-            targetSubjectDN = getTargetSubjectDN(orderedCertStores, targetSel);
-        }
-        if (targetSubjectDN == null) {
-            throw new InvalidAlgorithmParameterException
-                ("Could not determine unique target subject");
-        }
-
-        List<List<Vertex>> adjList = new ArrayList<List<Vertex>>();
-        CertPathBuilderResult result =
-            buildCertPath(buildForward, false, adjList);
+    private PKIXCertPathBuilderResult build() throws CertPathBuilderException {
+        List<List<Vertex>> adjList = new ArrayList<>();
+        PKIXCertPathBuilderResult result = buildCertPath(false, adjList);
         if (result == null) {
             if (debug != null) {
                 debug.println("SunCertPathBuilder.engineBuild: 2nd pass");
             }
             // try again
             adjList.clear();
-            result = buildCertPath(buildForward, true, adjList);
+            result = buildCertPath(true, adjList);
             if (result == null) {
                 throw new SunCertPathBuilderException("unable to find valid "
                     + "certification path to requested target",
@@ -201,24 +150,23 @@
         return result;
     }
 
-    private CertPathBuilderResult buildCertPath(boolean buildForward,
-        boolean searchAllCertStores, List<List<Vertex>> adjList)
-        throws CertPathBuilderException {
-
+    private PKIXCertPathBuilderResult buildCertPath(boolean searchAllCertStores,
+                                                    List<List<Vertex>> adjList)
+        throws CertPathBuilderException
+    {
         // Init shared variables and build certification path
         pathCompleted = false;
         trustAnchor = null;
         finalPublicKey = null;
         policyTreeResult = null;
-        LinkedList<X509Certificate> certPathList =
-            new LinkedList<X509Certificate>();
+        LinkedList<X509Certificate> certPathList = new LinkedList<>();
         try {
-            if (buildForward) {
+            if (buildParams.buildForward()) {
                 buildForward(adjList, certPathList, searchAllCertStores);
             } else {
                 buildReverse(adjList, certPathList);
             }
-        } catch (Exception e) {
+        } catch (GeneralSecurityException | IOException e) {
             if (debug != null) {
                 debug.println("SunCertPathBuilder.engineBuild() exception in "
                     + "build");
@@ -242,11 +190,11 @@
                 Collections.reverse(certPathList);
 
                 return new SunCertPathBuilderResult(
-                    cf.generateCertPath(certPathList), this.trustAnchor,
+                    cf.generateCertPath(certPathList), trustAnchor,
                     policyTreeResult, finalPublicKey,
                     new AdjacencyList(adjList));
             }
-        } catch (Exception e) {
+        } catch (CertificateException e) {
             if (debug != null) {
                 debug.println("SunCertPathBuilder.engineBuild() exception "
                               + "in wrap-up");
@@ -264,12 +212,13 @@
      * Private build reverse method.
      */
     private void buildReverse(List<List<Vertex>> adjacencyList,
-        LinkedList<X509Certificate> certPathList) throws Exception
+                              LinkedList<X509Certificate> certPathList)
+        throws GeneralSecurityException, IOException
     {
         if (debug != null) {
             debug.println("SunCertPathBuilder.buildReverse()...");
             debug.println("SunCertPathBuilder.buildReverse() InitialPolicies: "
-                + buildParams.getInitialPolicies());
+                + buildParams.initialPolicies());
         }
 
         ReverseState currentState = new ReverseState();
@@ -281,12 +230,12 @@
          * Perform a search using each trust anchor, until a valid
          * path is found
          */
-        Iterator<TrustAnchor> iter = buildParams.getTrustAnchors().iterator();
+        Iterator<TrustAnchor> iter = buildParams.trustAnchors().iterator();
         while (iter.hasNext()) {
             TrustAnchor anchor = iter.next();
 
             /* check if anchor satisfies target constraints */
-            if (anchorIsTarget(anchor, targetSel)) {
+            if (anchorIsTarget(anchor, buildParams.targetCertConstraints())) {
                 this.trustAnchor = anchor;
                 this.pathCompleted = true;
                 this.finalPublicKey = anchor.getTrustedCert().getPublicKey();
@@ -294,22 +243,16 @@
             }
 
             /* Initialize current state */
-            currentState.initState(buildParams.getMaxPathLength(),
-                       buildParams.isExplicitPolicyRequired(),
-                       buildParams.isPolicyMappingInhibited(),
-                       buildParams.isAnyPolicyInhibited(),
-                       buildParams.getCertPathCheckers());
-            currentState.updateState(anchor);
-            // init the crl checker
-            currentState.crlChecker =
-                new CrlRevocationChecker(null, buildParams, null, onlyEECert);
+            currentState.initState(buildParams);
+            currentState.updateState(anchor, buildParams);
+
             currentState.algorithmChecker = new AlgorithmChecker(anchor);
             currentState.untrustedChecker = new UntrustedChecker();
             try {
                 depthFirstSearchReverse(null, currentState,
-                new ReverseBuilder(buildParams, targetSubjectDN), adjacencyList,
-                certPathList);
-            } catch (Exception e) {
+                                        new ReverseBuilder(buildParams),
+                                        adjacencyList, certPathList);
+            } catch (GeneralSecurityException | IOException e) {
                 // continue on error if more anchors to try
                 if (iter.hasNext())
                     continue;
@@ -335,7 +278,8 @@
      * Private build forward method.
      */
     private void buildForward(List<List<Vertex>> adjacencyList,
-        LinkedList<X509Certificate> certPathList, boolean searchAllCertStores)
+                              LinkedList<X509Certificate> certPathList,
+                              boolean searchAllCertStores)
         throws GeneralSecurityException, IOException
     {
         if (debug != null) {
@@ -344,21 +288,18 @@
 
         /* Initialize current state */
         ForwardState currentState = new ForwardState();
-        currentState.initState(buildParams.getCertPathCheckers());
+        currentState.initState(buildParams.certPathCheckers());
 
         /* Initialize adjacency list */
         adjacencyList.clear();
         adjacencyList.add(new LinkedList<Vertex>());
 
-        // init the crl checker
-        currentState.crlChecker
-            = new CrlRevocationChecker(null, buildParams, null, onlyEECert);
         currentState.untrustedChecker = new UntrustedChecker();
 
-        depthFirstSearchForward(targetSubjectDN, currentState,
-          new ForwardBuilder
-              (buildParams, targetSubjectDN, searchAllCertStores, onlyEECert),
-          adjacencyList, certPathList);
+        depthFirstSearchForward(buildParams.targetSubject(), currentState,
+                                new ForwardBuilder(buildParams,
+                                                   searchAllCertStores),
+                                adjacencyList, certPathList);
     }
 
     /*
@@ -376,27 +317,28 @@
      * @param dN the distinguished name being currently searched for certs
      * @param currentState the current PKIX validation state
      */
-    void depthFirstSearchForward(X500Principal dN, ForwardState currentState,
-        ForwardBuilder builder, List<List<Vertex>> adjList,
-        LinkedList<X509Certificate> certPathList)
+    private void depthFirstSearchForward(X500Principal dN,
+                                         ForwardState currentState,
+                                         ForwardBuilder builder,
+                                         List<List<Vertex>> adjList,
+                                         LinkedList<X509Certificate> cpList)
         throws GeneralSecurityException, IOException
     {
-        //XXX This method should probably catch & handle exceptions
-
         if (debug != null) {
             debug.println("SunCertPathBuilder.depthFirstSearchForward(" + dN
-                + ", " + currentState.toString() + ")");
+                          + ", " + currentState.toString() + ")");
         }
 
         /*
          * Find all the certificates issued to dN which
          * satisfy the PKIX certification path constraints.
          */
-        List<Vertex> vertices = addVertices
-           (builder.getMatchingCerts(currentState, orderedCertStores), adjList);
+        Collection<X509Certificate> certs =
+            builder.getMatchingCerts(currentState, buildParams.certStores());
+        List<Vertex> vertices = addVertices(certs, adjList);
         if (debug != null) {
             debug.println("SunCertPathBuilder.depthFirstSearchForward(): "
-                + "certs.size=" + vertices.size());
+                          + "certs.size=" + vertices.size());
         }
 
         /*
@@ -416,14 +358,14 @@
              * the next matching cert is tried.
              */
             ForwardState nextState = (ForwardState) currentState.clone();
-            X509Certificate cert = (X509Certificate) vertex.getCertificate();
+            X509Certificate cert = vertex.getCertificate();
 
             try {
-                builder.verifyCert(cert, nextState, certPathList);
+                builder.verifyCert(cert, nextState, cpList);
             } catch (GeneralSecurityException gse) {
                 if (debug != null) {
                     debug.println("SunCertPathBuilder.depthFirstSearchForward()"
-                        + ": validation failed: " + gse);
+                                  + ": validation failed: " + gse);
                     gse.printStackTrace();
                 }
                 vertex.setThrowable(gse);
@@ -441,51 +383,44 @@
              */
             if (builder.isPathCompleted(cert)) {
 
-                BasicChecker basicChecker = null;
                 if (debug != null)
                     debug.println("SunCertPathBuilder.depthFirstSearchForward()"
-                        + ": commencing final verification");
+                                  + ": commencing final verification");
 
-                ArrayList<X509Certificate> appendedCerts =
-                    new ArrayList<X509Certificate>(certPathList);
+                List<X509Certificate> appendedCerts = new ArrayList<>(cpList);
 
                 /*
                  * if the trust anchor selected is specified as a trusted
                  * public key rather than a trusted cert, then verify this
                  * cert (which is signed by the trusted public key), but
-                 * don't add it yet to the certPathList
+                 * don't add it yet to the cpList
                  */
                 if (builder.trustAnchor.getTrustedCert() == null) {
                     appendedCerts.add(0, cert);
                 }
 
-                HashSet<String> initExpPolSet = new HashSet<String>(1);
-                initExpPolSet.add(PolicyChecker.ANY_POLICY);
+                Set<String> initExpPolSet =
+                    Collections.singleton(PolicyChecker.ANY_POLICY);
 
                 PolicyNodeImpl rootNode = new PolicyNodeImpl(null,
                     PolicyChecker.ANY_POLICY, null, false, initExpPolSet, false);
 
+                List<PKIXCertPathChecker> checkers = new ArrayList<>();
                 PolicyChecker policyChecker
-                    = new PolicyChecker(buildParams.getInitialPolicies(),
-                                appendedCerts.size(),
-                                buildParams.isExplicitPolicyRequired(),
-                                buildParams.isPolicyMappingInhibited(),
-                                buildParams.isAnyPolicyInhibited(),
-                                buildParams.getPolicyQualifiersRejected(),
-                                rootNode);
+                    = new PolicyChecker(buildParams.initialPolicies(),
+                                        appendedCerts.size(),
+                                        buildParams.explicitPolicyRequired(),
+                                        buildParams.policyMappingInhibited(),
+                                        buildParams.anyPolicyInhibited(),
+                                        buildParams.policyQualifiersRejected(),
+                                        rootNode);
 
-                List<PKIXCertPathChecker> userCheckers = new
-                    ArrayList<PKIXCertPathChecker>
-                        (buildParams.getCertPathCheckers());
-                int mustCheck = 0;
-                userCheckers.add(mustCheck, policyChecker);
-                mustCheck++;
+                checkers.add(policyChecker);
 
                 // add the algorithm checker
-                userCheckers.add(mustCheck,
-                        new AlgorithmChecker(builder.trustAnchor));
-                mustCheck++;
+                checkers.add(new AlgorithmChecker(builder.trustAnchor));
 
+                BasicChecker basicChecker = null;
                 if (nextState.keyParamsNeeded()) {
                     PublicKey rootKey = cert.getPublicKey();
                     if (builder.trustAnchor.getTrustedCert() == null) {
@@ -500,24 +435,38 @@
                         (cert.getSubjectX500Principal(), rootKey, null);
 
                     // add the basic checker
-                    basicChecker = new BasicChecker(anchor,
-                                           builder.date,
-                                           buildParams.getSigProvider(),
-                                           true);
-                    userCheckers.add(mustCheck, basicChecker);
-                    mustCheck++;
+                    basicChecker = new BasicChecker(anchor, buildParams.date(),
+                                                    buildParams.sigProvider(),
+                                                    true);
+                    checkers.add(basicChecker);
+                }
 
-                    // add the crl revocation checker
-                    if (buildParams.isRevocationEnabled()) {
-                        userCheckers.add(mustCheck, new CrlRevocationChecker
-                            (anchor, buildParams, null, onlyEECert));
-                        mustCheck++;
+                buildParams.setCertPath(cf.generateCertPath(appendedCerts));
+
+                boolean revCheckerAdded = false;
+                List<PKIXCertPathChecker> ckrs = buildParams.certPathCheckers();
+                for (PKIXCertPathChecker ckr : ckrs) {
+                    if (ckr instanceof PKIXRevocationChecker) {
+                        revCheckerAdded = true;
+                        // if it's our own, initialize it
+                        if (ckr instanceof RevocationChecker)
+                            ((RevocationChecker)ckr).init(builder.trustAnchor,
+                                                          buildParams);
                     }
                 }
-                // Why we don't need BasicChecker and CrlRevocationChecker
+                // only add a RevocationChecker if revocation is enabled and
+                // a PKIXRevocationChecker has not already been added
+                if (buildParams.revocationEnabled() && !revCheckerAdded) {
+                    checkers.add(new RevocationChecker(builder.trustAnchor,
+                                                       buildParams));
+                }
+
+                checkers.addAll(ckrs);
+
+                // Why we don't need BasicChecker and RevocationChecker
                 // if nextState.keyParamsNeeded() is false?
 
-                for (int i=0; i<appendedCerts.size(); i++) {
+                for (int i = 0; i < appendedCerts.size(); i++) {
                     X509Certificate currCert = appendedCerts.get(i);
                     if (debug != null)
                         debug.println("current subject = "
@@ -528,18 +477,15 @@
                         unresCritExts = Collections.<String>emptySet();
                     }
 
-                    for (int j=0; j<userCheckers.size(); j++) {
-                        PKIXCertPathChecker currChecker = userCheckers.get(j);
-                        if (j < mustCheck ||
-                            !currChecker.isForwardCheckingSupported()) {
+                    for (PKIXCertPathChecker currChecker : checkers) {
+                        if (!currChecker.isForwardCheckingSupported()) {
                             if (i == 0) {
                                 currChecker.init(false);
 
                                 // The user specified
                                 // AlgorithmChecker may not be
                                 // able to set the trust anchor until now.
-                                if (j >= mustCheck &&
-                                    currChecker instanceof AlgorithmChecker) {
+                                if (currChecker instanceof AlgorithmChecker) {
                                     ((AlgorithmChecker)currChecker).
                                         trySetTrustAnchor(builder.trustAnchor);
                                 }
@@ -565,7 +511,7 @@
                      * are capable of processing.
                      */
                     for (PKIXCertPathChecker checker :
-                         buildParams.getCertPathCheckers())
+                         buildParams.certPathCheckers())
                     {
                         if (checker.isForwardCheckingSupported()) {
                             Set<String> suppExts =
@@ -577,24 +523,16 @@
                     }
 
                     if (!unresCritExts.isEmpty()) {
-                        unresCritExts.remove
-                            (PKIXExtensions.BasicConstraints_Id.toString());
-                        unresCritExts.remove
-                            (PKIXExtensions.NameConstraints_Id.toString());
-                        unresCritExts.remove
-                            (PKIXExtensions.CertificatePolicies_Id.toString());
-                        unresCritExts.remove
-                            (PKIXExtensions.PolicyMappings_Id.toString());
-                        unresCritExts.remove
-                            (PKIXExtensions.PolicyConstraints_Id.toString());
-                        unresCritExts.remove
-                            (PKIXExtensions.InhibitAnyPolicy_Id.toString());
-                        unresCritExts.remove(PKIXExtensions.
+                        unresCritExts.remove(BasicConstraints_Id.toString());
+                        unresCritExts.remove(NameConstraints_Id.toString());
+                        unresCritExts.remove(CertificatePolicies_Id.toString());
+                        unresCritExts.remove(PolicyMappings_Id.toString());
+                        unresCritExts.remove(PolicyConstraints_Id.toString());
+                        unresCritExts.remove(InhibitAnyPolicy_Id.toString());
+                        unresCritExts.remove(
                             SubjectAlternativeName_Id.toString());
-                        unresCritExts.remove
-                            (PKIXExtensions.KeyUsage_Id.toString());
-                        unresCritExts.remove
-                            (PKIXExtensions.ExtendedKeyUsage_Id.toString());
+                        unresCritExts.remove(KeyUsage_Id.toString());
+                        unresCritExts.remove(ExtendedKeyUsage_Id.toString());
 
                         if (!unresCritExts.isEmpty()) {
                             throw new CertPathValidatorException
@@ -611,10 +549,10 @@
                 /*
                  * if the user specified a trusted public key rather than
                  * trusted certs, then add this cert (which is signed by
-                 * the trusted public key) to the certPathList
+                 * the trusted public key) to the cpList
                  */
                 if (builder.trustAnchor.getTrustedCert() == null)
-                    builder.addCertToPath(cert, certPathList);
+                    builder.addCertToPath(cert, cpList);
                 // Save the trust anchor
                 this.trustAnchor = builder.trustAnchor;
 
@@ -625,10 +563,10 @@
                     finalPublicKey = basicChecker.getPublicKey();
                 } else {
                     Certificate finalCert;
-                    if (certPathList.size() == 0) {
+                    if (cpList.isEmpty()) {
                         finalCert = builder.trustAnchor.getTrustedCert();
                     } else {
-                        finalCert = certPathList.get(certPathList.size()-1);
+                        finalCert = cpList.getLast();
                     }
                     finalPublicKey = finalCert.getPublicKey();
                 }
@@ -636,7 +574,7 @@
                 policyTreeResult = policyChecker.getPolicyTree();
                 return;
             } else {
-                builder.addCertToPath(cert, certPathList);
+                builder.addCertToPath(cert, cpList);
             }
 
             /* Update the PKIX state */
@@ -650,8 +588,8 @@
             vertex.setIndex(adjList.size() - 1);
 
             /* recursively search for matching certs at next dN */
-            depthFirstSearchForward(cert.getIssuerX500Principal(),
-                                    nextState, builder, adjList, certPathList);
+            depthFirstSearchForward(cert.getIssuerX500Principal(), nextState,
+                                    builder, adjList, cpList);
 
             /*
              * If path has been completed, return ASAP!
@@ -667,8 +605,8 @@
                  */
                 if (debug != null)
                     debug.println("SunCertPathBuilder.depthFirstSearchForward()"
-                        + ": backtracking");
-                builder.removeFinalCertFromPath(certPathList);
+                                  + ": backtracking");
+                builder.removeFinalCertFromPath(cpList);
             }
         }
     }
@@ -688,9 +626,11 @@
      * @param dN the distinguished name being currently searched for certs
      * @param currentState the current PKIX validation state
      */
-    void depthFirstSearchReverse(X500Principal dN, ReverseState currentState,
-        ReverseBuilder builder, List<List<Vertex>> adjList,
-        LinkedList<X509Certificate> certPathList)
+    private void depthFirstSearchReverse(X500Principal dN,
+                                         ReverseState currentState,
+                                         ReverseBuilder builder,
+                                         List<List<Vertex>> adjList,
+                                         LinkedList<X509Certificate> cpList)
         throws GeneralSecurityException, IOException
     {
         if (debug != null)
@@ -701,8 +641,9 @@
          * Find all the certificates issued by dN which
          * satisfy the PKIX certification path constraints.
          */
-        List<Vertex> vertices = addVertices
-           (builder.getMatchingCerts(currentState, orderedCertStores), adjList);
+        Collection<X509Certificate> certs =
+            builder.getMatchingCerts(currentState, buildParams.certStores());
+        List<Vertex> vertices = addVertices(certs, adjList);
         if (debug != null)
             debug.println("SunCertPathBuilder.depthFirstSearchReverse(): "
                 + "certs.size=" + vertices.size());
@@ -722,9 +663,9 @@
              * the next matching cert is tried.
              */
             ReverseState nextState = (ReverseState) currentState.clone();
-            X509Certificate cert = (X509Certificate) vertex.getCertificate();
+            X509Certificate cert = vertex.getCertificate();
             try {
-                builder.verifyCert(cert, nextState, certPathList);
+                builder.verifyCert(cert, nextState, cpList);
             } catch (GeneralSecurityException gse) {
                 if (debug != null)
                     debug.println("SunCertPathBuilder.depthFirstSearchReverse()"
@@ -738,7 +679,7 @@
              * self-signed cert) and update state
              */
             if (!currentState.isInitial())
-                builder.addCertToPath(cert, certPathList);
+                builder.addCertToPath(cert, cpList);
             // save trust anchor
             this.trustAnchor = currentState.trustAnchor;
 
@@ -787,7 +728,7 @@
 
             /* recursively search for matching certs at next dN */
             depthFirstSearchReverse(cert.getSubjectX500Principal(), nextState,
-                builder, adjList, certPathList);
+                                    builder, adjList, cpList);
 
             /*
              * If path has been completed, return ASAP!
@@ -805,7 +746,7 @@
                     debug.println("SunCertPathBuilder.depthFirstSearchReverse()"
                         + ": backtracking");
                 if (!currentState.isInitial())
-                    builder.removeFinalCertFromPath(certPathList);
+                    builder.removeFinalCertFromPath(cpList);
             }
         }
         if (debug != null)
@@ -817,13 +758,14 @@
      * Adds a collection of matching certificates to the
      * adjacency list.
      */
-    private List<Vertex> addVertices(Collection<X509Certificate> certs,
-        List<List<Vertex>> adjList) {
+    private static List<Vertex> addVertices(Collection<X509Certificate> certs,
+                                            List<List<Vertex>> adjList)
+    {
         List<Vertex> l = adjList.get(adjList.size() - 1);
 
         for (X509Certificate cert : certs) {
-           Vertex v = new Vertex(cert);
-           l.add(v);
+            Vertex v = new Vertex(cert);
+            l.add(v);
         }
 
         return l;
@@ -833,53 +775,13 @@
      * Returns true if trust anchor certificate matches specified
      * certificate constraints.
      */
-    private boolean anchorIsTarget(TrustAnchor anchor, X509CertSelector sel) {
+    private static boolean anchorIsTarget(TrustAnchor anchor,
+                                          CertSelector sel)
+    {
         X509Certificate anchorCert = anchor.getTrustedCert();
         if (anchorCert != null) {
             return sel.match(anchorCert);
         }
         return false;
     }
-
-    /**
-     * Comparator that orders CertStores so that local CertStores come before
-     * remote CertStores.
-     */
-    private static class CertStoreComparator implements Comparator<CertStore> {
-        public int compare(CertStore store1, CertStore store2) {
-            if (Builder.isLocalCertStore(store1)) {
-                return -1;
-            } else {
-                return 1;
-            }
-        }
-    }
-
-    /**
-     * Returns the target subject DN from the first X509Certificate that
-     * is fetched that matches the specified X509CertSelector.
-     */
-    private X500Principal getTargetSubjectDN(List<CertStore> stores,
-        X509CertSelector targetSel) {
-        for (CertStore store : stores) {
-            try {
-                Collection<? extends Certificate> targetCerts =
-                    (Collection<? extends Certificate>)
-                        store.getCertificates(targetSel);
-                if (!targetCerts.isEmpty()) {
-                    X509Certificate targetCert =
-                        (X509Certificate)targetCerts.iterator().next();
-                    return targetCert.getSubjectX500Principal();
-                }
-            } catch (CertStoreException e) {
-                // ignore but log it
-                if (debug != null) {
-                    debug.println("SunCertPathBuilder.getTargetSubjectDN: " +
-                        "non-fatal exception retrieving certs: " + e);
-                    e.printStackTrace();
-                }
-            }
-        }
-        return null;
-    }
 }
diff --git a/src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java b/src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java
index 11f9f8c..186e252 100644
--- a/src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java
+++ b/src/share/classes/sun/security/provider/certpath/SunCertPathBuilderParameters.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,12 +25,11 @@
 
 package sun.security.provider.certpath;
 
-import java.util.Set;
-
 import java.security.InvalidAlgorithmParameterException;
 import java.security.KeyStore;
 import java.security.KeyStoreException;
 import java.security.cert.*;
+import java.util.Set;
 
 /**
  * This class specifies the set of parameters used as input for the Sun
@@ -120,8 +119,9 @@
      *
      * @return a formatted string describing the parameters.
      */
+    @Override
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("[\n");
         sb.append(super.toString());
         sb.append("  Build Forward Flag: " + String.valueOf(buildForward) + "\n");
diff --git a/src/share/classes/sun/security/provider/certpath/URICertStore.java b/src/share/classes/sun/security/provider/certpath/URICertStore.java
index 6fb7bc7..485a8b2 100644
--- a/src/share/classes/sun/security/provider/certpath/URICertStore.java
+++ b/src/share/classes/sun/security/provider/certpath/URICertStore.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -213,6 +213,7 @@
      *         match the specified selector
      * @throws CertStoreException if an exception occurs
      */
+    @Override
     @SuppressWarnings("unchecked")
     public synchronized Collection<X509Certificate> engineGetCertificates
         (CertSelector selector) throws CertStoreException {
@@ -322,6 +323,7 @@
      *         match the specified selector
      * @throws CertStoreException if an exception occurs
      */
+    @Override
     @SuppressWarnings("unchecked")
     public synchronized Collection<X509CRL> engineGetCRLs(CRLSelector selector)
         throws CertStoreException {
@@ -418,14 +420,14 @@
         URICertStoreParameters(URI uri) {
             this.uri = uri;
         }
-        public boolean equals(Object obj) {
+        @Override public boolean equals(Object obj) {
             if (!(obj instanceof URICertStoreParameters)) {
                 return false;
             }
             URICertStoreParameters params = (URICertStoreParameters) obj;
             return uri.equals(params.uri);
         }
-        public int hashCode() {
+        @Override public int hashCode() {
             if (hashCode == 0) {
                 int result = 17;
                 result = 37*result + uri.hashCode();
@@ -433,7 +435,7 @@
             }
             return hashCode;
         }
-        public Object clone() {
+        @Override public Object clone() {
             try {
                 return super.clone();
             } catch (CloneNotSupportedException e) {
diff --git a/src/share/classes/sun/security/provider/certpath/Vertex.java b/src/share/classes/sun/security/provider/certpath/Vertex.java
index cfc5c2f..e2503f0 100644
--- a/src/share/classes/sun/security/provider/certpath/Vertex.java
+++ b/src/share/classes/sun/security/provider/certpath/Vertex.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,12 +25,11 @@
 
 package sun.security.provider.certpath;
 
-import sun.security.util.Debug;
-
-import java.security.cert.Certificate;
+import java.io.IOException;
 import java.security.cert.CertificateException;
 import java.security.cert.X509Certificate;
 
+import sun.security.util.Debug;
 import sun.security.x509.AuthorityKeyIdentifierExtension;
 import sun.security.x509.KeyIdentifier;
 import sun.security.x509.SubjectKeyIdentifierExtension;
@@ -50,17 +49,17 @@
 public class Vertex {
 
     private static final Debug debug = Debug.getInstance("certpath");
-    private Certificate cert;
-    private int         index;
-    private Throwable   throwable;
+    private X509Certificate cert;
+    private int index;
+    private Throwable throwable;
 
     /**
      * Constructor; creates vertex with index of -1
      * Use setIndex method to set another index.
      *
-     * @param cert Certificate associated with vertex
+     * @param cert X509Certificate associated with vertex
      */
-    Vertex(Certificate cert) {
+    Vertex(X509Certificate cert) {
         this.cert = cert;
         this.index = -1;
     }
@@ -68,9 +67,9 @@
     /**
      * return the certificate for this vertex
      *
-     * @returns Certificate
+     * @returns X509Certificate
      */
-    public Certificate getCertificate() {
+    public X509Certificate getCertificate() {
         return cert;
     }
 
@@ -121,6 +120,7 @@
      *
      * @returns String representation of vertex
      */
+    @Override
     public String toString() {
         return certToString() + throwableToString() + indexToString();
     }
@@ -132,70 +132,65 @@
      * @returns String representation of certificate info
      */
     public String certToString() {
-        String out = "";
-        if (cert == null || ! (cert instanceof X509Certificate))
-            return "Cert:       Not an X509Certificate\n";
+        StringBuilder sb = new StringBuilder();
 
         X509CertImpl x509Cert = null;
         try {
-            x509Cert = X509CertImpl.toImpl((X509Certificate)cert);
+            x509Cert = X509CertImpl.toImpl(cert);
         } catch (CertificateException ce) {
             if (debug != null) {
                 debug.println("Vertex.certToString() unexpected exception");
                 ce.printStackTrace();
             }
-            return out;
+            return sb.toString();
         }
 
-        out =       "Issuer:     " + x509Cert.getIssuerX500Principal() + "\n";
-        out = out + "Subject:    " + x509Cert.getSubjectX500Principal() + "\n";
-        out = out + "SerialNum:  " + (x509Cert.getSerialNumber()).toString(16) + "\n";
-        out = out + "Expires:    " + x509Cert.getNotAfter().toString() + "\n";
+        sb.append("Issuer:     ").append
+                 (x509Cert.getIssuerX500Principal()).append("\n");
+        sb.append("Subject:    ").append
+                 (x509Cert.getSubjectX500Principal()).append("\n");
+        sb.append("SerialNum:  ").append
+                 (x509Cert.getSerialNumber().toString(16)).append("\n");
+        sb.append("Expires:    ").append
+                 (x509Cert.getNotAfter().toString()).append("\n");
         boolean[] iUID = x509Cert.getIssuerUniqueID();
         if (iUID != null) {
-            out = out + "IssuerUID:  ";
-            for (int i=0; i < iUID.length; i++) {
-                out = out + (iUID[i]?1:0);
+            sb.append("IssuerUID:  ");
+            for (boolean b : iUID) {
+                sb.append(b ? 1 : 0);
             }
-            out = out + "\n";
+            sb.append("\n");
         }
         boolean[] sUID = x509Cert.getSubjectUniqueID();
         if (sUID != null) {
-            out = out + "SubjectUID: ";
-            for (int i=0; i< sUID.length; i++) {
-                out = out + (sUID[i]?1:0);
+            sb.append("SubjectUID: ");
+            for (boolean b : sUID) {
+                sb.append(b ? 1 : 0);
             }
-            out = out + "\n";
+            sb.append("\n");
         }
-        SubjectKeyIdentifierExtension sKeyID = null;
         try {
-            sKeyID = x509Cert.getSubjectKeyIdentifierExtension();
+            SubjectKeyIdentifierExtension sKeyID =
+                x509Cert.getSubjectKeyIdentifierExtension();
             if (sKeyID != null) {
                 KeyIdentifier keyID = sKeyID.get(
                         SubjectKeyIdentifierExtension.KEY_ID);
-                out = out + "SubjKeyID:  " + keyID.toString();
+                sb.append("SubjKeyID:  ").append(keyID.toString());
             }
-        } catch (Exception e) {
+            AuthorityKeyIdentifierExtension aKeyID =
+                x509Cert.getAuthorityKeyIdentifierExtension();
+            if (aKeyID != null) {
+                KeyIdentifier keyID = (KeyIdentifier)aKeyID.get(
+                        AuthorityKeyIdentifierExtension.KEY_ID);
+                sb.append("AuthKeyID:  ").append(keyID.toString());
+            }
+        } catch (IOException e) {
             if (debug != null) {
                 debug.println("Vertex.certToString() unexpected exception");
                 e.printStackTrace();
             }
         }
-        AuthorityKeyIdentifierExtension aKeyID = null;
-        try {
-            aKeyID = x509Cert.getAuthorityKeyIdentifierExtension();
-            if (aKeyID != null) {
-                KeyIdentifier keyID = (KeyIdentifier)aKeyID.get(
-                        AuthorityKeyIdentifierExtension.KEY_ID);
-                out = out + "AuthKeyID:  " + keyID.toString();
-            }
-        } catch (Exception e) {
-            if (debug != null) {
-                debug.println("Vertex.certToString() 2 unexpected exception");
-                e.printStackTrace();
-            }
-        }
-        return out;
+        return sb.toString();
     }
 
     /**
@@ -205,13 +200,13 @@
      * @returns String form of exception (or "none")
      */
     public String throwableToString() {
-        String out = "Exception:  ";
+        StringBuilder sb = new StringBuilder("Exception:  ");
         if (throwable != null)
-            out = out + throwable.toString();
+            sb.append(throwable.toString());
         else
-            out = out + "null";
-        out = out + "\n";
-        return out;
+            sb.append("null");
+        sb.append("\n");
+        return sb.toString();
     }
 
     /**
@@ -222,10 +217,10 @@
      * @returns String form of index as "Last cert?  [Yes/No]
      */
     public String moreToString() {
-        String out = "Last cert?  ";
-        out = out + ((index == -1)?"Yes":"No");
-        out = out + "\n";
-        return out;
+        StringBuilder sb = new StringBuilder("Last cert?  ");
+        sb.append((index == -1) ? "Yes" : "No");
+        sb.append("\n");
+        return sb.toString();
     }
 
     /**
@@ -235,7 +230,6 @@
      * @returns String form of index as "Index:     [numeric index]"
      */
     public String indexToString() {
-        String out = "Index:      " + index + "\n";
-        return out;
+        return "Index:      " + index + "\n";
     }
 }
diff --git a/src/share/classes/sun/security/provider/certpath/X509CertPath.java b/src/share/classes/sun/security/provider/certpath/X509CertPath.java
index 9180a50..f738b5f 100644
--- a/src/share/classes/sun/security/provider/certpath/X509CertPath.java
+++ b/src/share/classes/sun/security/provider/certpath/X509CertPath.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,9 +33,10 @@
 import java.security.cert.Certificate;
 import java.security.cert.CertificateException;
 import java.security.cert.CertificateFactory;
+import java.security.cert.CertPath;
 import java.security.cert.X509Certificate;
 import java.util.*;
-import java.security.cert.CertPath;
+
 import sun.security.pkcs.ContentInfo;
 import sun.security.pkcs.PKCS7;
 import sun.security.pkcs.SignerInfo;
@@ -44,7 +45,6 @@
 import sun.security.util.DerOutputStream;
 import sun.security.util.DerInputStream;
 
-
 /**
  * A {@link java.security.cert.CertPath CertPath} (certification path)
  * consisting exclusively of
@@ -83,7 +83,7 @@
     private static final Collection<String> encodingList;
 
     static {
-        List<String> list = new ArrayList<String>(2);
+        List<String> list = new ArrayList<>(2);
         list.add(PKIPATH_ENCODING);
         list.add(PKCS7_ENCODING);
         encodingList = Collections.unmodifiableCollection(list);
@@ -272,6 +272,7 @@
      * @return the encoded bytes
      * @exception CertificateEncodingException if an encoding error occurs
      */
+    @Override
     public byte[] getEncoded() throws CertificateEncodingException {
         // @@@ Should cache the encoded form
         return encodePKIPATH();
@@ -342,6 +343,7 @@
      * @exception CertificateEncodingException if an encoding error occurs or
      *   the encoding requested is not supported
      */
+    @Override
     public byte[] getEncoded(String encoding)
             throws CertificateEncodingException {
         switch (encoding) {
@@ -376,6 +378,7 @@
      * @return an <code>Iterator</code> over the names of the supported
      *         encodings (as Strings)
      */
+    @Override
     public Iterator<String> getEncodings() {
         return getEncodingsStatic();
     }
@@ -387,6 +390,7 @@
      * @return an immutable <code>List</code> of <code>X509Certificate</code>s
      *         (may be empty, but not null)
      */
+    @Override
     public List<X509Certificate> getCertificates() {
         return certs;
     }
diff --git a/src/share/classes/sun/security/provider/certpath/X509CertificatePair.java b/src/share/classes/sun/security/provider/certpath/X509CertificatePair.java
index 3228b7e..ea139dd 100644
--- a/src/share/classes/sun/security/provider/certpath/X509CertificatePair.java
+++ b/src/share/classes/sun/security/provider/certpath/X509CertificatePair.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -207,13 +207,14 @@
      *
      * @return A String describing the contents of the pair.
      */
+    @Override
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("X.509 Certificate Pair: [\n");
         if (forward != null)
-            sb.append("  Forward: " + forward + "\n");
+            sb.append("  Forward: ").append(forward).append("\n");
         if (reverse != null)
-            sb.append("  Reverse: " + reverse + "\n");
+            sb.append("  Reverse: ").append(reverse).append("\n");
         sb.append("]");
         return sb.toString();
     }
diff --git a/src/share/classes/sun/security/ssl/SSLContextImpl.java b/src/share/classes/sun/security/ssl/SSLContextImpl.java
index 1a5a8cf..db465f1 100644
--- a/src/share/classes/sun/security/ssl/SSLContextImpl.java
+++ b/src/share/classes/sun/security/ssl/SSLContextImpl.java
@@ -144,7 +144,7 @@
             throws KeyManagementException {
         for (int i = 0; kms != null && i < kms.length; i++) {
             KeyManager km = kms[i];
-            if (km instanceof X509KeyManager == false) {
+            if (!(km instanceof X509KeyManager)) {
                 continue;
             }
             if (SunJSSE.isFIPS()) {
@@ -331,11 +331,11 @@
         Collection<CipherSuite> allowedCipherSuites =
                                     CipherSuite.allowedCipherSuites();
 
-        ArrayList<CipherSuite> suites = new ArrayList<>();
+        TreeSet<CipherSuite> suites = new TreeSet<>();
         if (!(protocols.collection().isEmpty()) &&
                 protocols.min.v != ProtocolVersion.NONE.v) {
             for (CipherSuite suite : allowedCipherSuites) {
-                if (suite.allowed == false || suite.priority < minPriority) {
+                if (!suite.allowed || suite.priority < minPriority) {
                     continue;
                 }
 
diff --git a/src/share/classes/sun/security/ssl/ServerHandshaker.java b/src/share/classes/sun/security/ssl/ServerHandshaker.java
index 223494c..8b10f8a 100644
--- a/src/share/classes/sun/security/ssl/ServerHandshaker.java
+++ b/src/share/classes/sun/security/ssl/ServerHandshaker.java
@@ -1313,7 +1313,7 @@
                    return false;
                 }
             }
-            return (kerberosKeys != null);
+            return (kerberosKeys != null && kerberosKeys.length > 0);
         } catch (PrivilegedActionException e) {
             // Likely exception here is LoginExceptin
             if (debug != null && Debug.isOn("handshake")) {
diff --git a/src/share/classes/sun/security/ssl/krb5/Krb5ProxyImpl.java b/src/share/classes/sun/security/ssl/krb5/Krb5ProxyImpl.java
index 652268e..bc22a77 100644
--- a/src/share/classes/sun/security/ssl/krb5/Krb5ProxyImpl.java
+++ b/src/share/classes/sun/security/ssl/krb5/Krb5ProxyImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -62,7 +62,10 @@
     @Override
     public SecretKey[] getServerKeys(AccessControlContext acc)
             throws LoginException {
-        return Krb5Util.getServiceCreds(GSSCaller.CALLER_SSL_SERVER, null, acc).getKKeys();
+        Krb5Util.ServiceCreds serviceCreds =
+            Krb5Util.getServiceCreds(GSSCaller.CALLER_SSL_SERVER, null, acc);
+        return serviceCreds != null ? serviceCreds.getKKeys() :
+                                        new KerberosKey[0];
     }
 
     @Override
diff --git a/src/share/classes/sun/security/timestamp/HttpTimestamper.java b/src/share/classes/sun/security/timestamp/HttpTimestamper.java
index a4a1921..50cef6e 100644
--- a/src/share/classes/sun/security/timestamp/HttpTimestamper.java
+++ b/src/share/classes/sun/security/timestamp/HttpTimestamper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -68,12 +68,15 @@
     /**
      * Creates a timestamper that connects to the specified TSA.
      *
-     * @param tsa The location of the TSA. It must be an HTTP URI.
-     * @throws IllegalArgumentException if tsaURI is not an HTTP URI
+     * @param tsa The location of the TSA. It must be an HTTP or HTTPS URI.
+     * @throws IllegalArgumentException if tsaURI is not an HTTP or HTTPS URI
      */
     public HttpTimestamper(URI tsaURI) {
-        if (!tsaURI.getScheme().equalsIgnoreCase("http"))
-            throw new IllegalArgumentException("TSA must be an HTTP URI");
+        if (!tsaURI.getScheme().equalsIgnoreCase("http") &&
+                !tsaURI.getScheme().equalsIgnoreCase("https")) {
+            throw new IllegalArgumentException(
+                    "TSA must be an HTTP or HTTPS URI");
+        }
         this.tsaURI = tsaURI;
     }
 
@@ -144,13 +147,12 @@
             }
             verifyMimeType(connection.getContentType());
 
-            int total = 0;
             int contentLength = connection.getContentLength();
             replyBuffer = IOUtils.readFully(input, contentLength, false);
 
             if (debug != null) {
                 debug.println("received timestamp response (length=" +
-                        total + ")");
+                        replyBuffer.length + ")");
             }
         } finally {
             if (input != null) {
diff --git a/src/share/classes/sun/security/x509/X509CRLEntryImpl.java b/src/share/classes/sun/security/x509/X509CRLEntryImpl.java
index 26f344b..a273119 100644
--- a/src/share/classes/sun/security/x509/X509CRLEntryImpl.java
+++ b/src/share/classes/sun/security/x509/X509CRLEntryImpl.java
@@ -31,6 +31,7 @@
 import java.security.cert.X509CRLEntry;
 import java.math.BigInteger;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Date;
 import java.util.Enumeration;
 import java.util.HashMap;
@@ -500,6 +501,9 @@
     }
 
     public Map<String, java.security.cert.Extension> getExtensions() {
+        if (extensions == null) {
+            return Collections.emptyMap();
+        }
         Collection<Extension> exts = extensions.getAllExtensions();
         HashMap<String, java.security.cert.Extension> map =
             new HashMap<String, java.security.cert.Extension>(exts.size());
diff --git a/src/share/classes/sun/text/resources/FormatData_sl.java b/src/share/classes/sun/text/resources/FormatData_sl.java
index e51b739..949d750 100644
--- a/src/share/classes/sun/text/resources/FormatData_sl.java
+++ b/src/share/classes/sun/text/resources/FormatData_sl.java
@@ -131,8 +131,8 @@
                     "H:mm:ss z", // long time pattern
                     "H:mm:ss", // medium time pattern
                     "H:mm", // short time pattern
-                    "EEEE, d MMMM yyyy", // full date pattern
-                    "EEEE, d MMMM yyyy", // long date pattern
+                    "EEEE, dd. MMMM y", // full date pattern
+                    "dd. MMMM y", // long date pattern
                     "d.M.yyyy", // medium date pattern
                     "d.M.y", // short date pattern
                     "{1} {0}" // date-time pattern
diff --git a/src/share/classes/sun/tools/jconsole/AboutDialog.java b/src/share/classes/sun/tools/jconsole/AboutDialog.java
index f6b7c5a..1d91d53 100644
--- a/src/share/classes/sun/tools/jconsole/AboutDialog.java
+++ b/src/share/classes/sun/tools/jconsole/AboutDialog.java
@@ -30,13 +30,12 @@
 import java.beans.PropertyVetoException;
 import java.net.URI;
 
-import javax.accessibility.*;
 import javax.swing.*;
 import javax.swing.border.*;
 import javax.swing.event.*;
 
+
 import static java.awt.BorderLayout.*;
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
@@ -47,7 +46,7 @@
     private static final Color borderColor   = Color.black;
 
     private Icon mastheadIcon =
-        new MastheadIcon(getText("Help.AboutDialog.masthead.title"));
+        new MastheadIcon(Messages.HELP_ABOUT_DIALOG_MASTHEAD_TITLE);
 
     private static AboutDialog aboutDialog;
 
@@ -55,10 +54,9 @@
     private Action closeAction;
 
     public AboutDialog(JConsole jConsole) {
-        super(jConsole, Resources.getText("Help.AboutDialog.title"), false);
+        super(jConsole, Messages.HELP_ABOUT_DIALOG_TITLE, false);
 
-        setAccessibleDescription(this,
-                                 getText("Help.AboutDialog.accessibleDescription"));
+        setAccessibleDescription(this, Messages.HELP_ABOUT_DIALOG_ACCESSIBLE_DESCRIPTION);
         setDefaultCloseOperation(HIDE_ON_CLOSE);
         setResizable(false);
         JComponent cp = (JComponent)getContentPane();
@@ -67,7 +65,7 @@
 
         JLabel mastheadLabel = new JLabel(mastheadIcon);
         setAccessibleName(mastheadLabel,
-                          getText("Help.AboutDialog.masthead.accessibleName"));
+                Messages.HELP_ABOUT_DIALOG_MASTHEAD_ACCESSIBLE_NAME);
 
         JPanel mainPanel = new TPanel(0, 0);
         mainPanel.add(mastheadLabel, NORTH);
@@ -75,7 +73,7 @@
         String jConsoleVersion = Version.getVersion();
         String vmName = System.getProperty("java.vm.name");
         String vmVersion = System.getProperty("java.vm.version");
-        String urlStr = getText("Help.AboutDialog.userGuideLink.url");
+        String urlStr = Messages.HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL;
         if (isBrowseSupported()) {
             urlStr = "<a style='color:#35556b' href=\"" + urlStr + "\">" + urlStr + "</a>";
         }
@@ -86,9 +84,9 @@
         String colorStr = String.format("%06x", textColor.getRGB() & 0xFFFFFF);
         JEditorPane helpLink = new JEditorPane("text/html",
                                 "<html><font color=#"+ colorStr + ">" +
-                        getText("Help.AboutDialog.jConsoleVersion", jConsoleVersion) +
-                "<p>" + getText("Help.AboutDialog.javaVersion", (vmName +", "+ vmVersion)) +
-                "<p>" + getText("Help.AboutDialog.userGuideLink", urlStr) +
+                        Resources.format(Messages.HELP_ABOUT_DIALOG_JCONSOLE_VERSION, jConsoleVersion) +
+                "<p>" + Resources.format(Messages.HELP_ABOUT_DIALOG_JAVA_VERSION, (vmName +", "+ vmVersion)) +
+                "<p>" + Resources.format(Messages.HELP_ABOUT_DIALOG_USER_GUIDE_LINK, urlStr) +
                                                  "</html>");
         helpLink.setOpaque(false);
         helpLink.setEditable(false);
@@ -155,7 +153,7 @@
     }
 
     static void browseUserGuide(JConsole jConsole) {
-        getAboutDialog(jConsole).browse(getText("Help.AboutDialog.userGuideLink.url"));
+        getAboutDialog(jConsole).browse(Messages.HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL);
     }
 
     static boolean isBrowseSupported() {
@@ -176,7 +174,7 @@
     }
 
     private void createActions() {
-        closeAction = new AbstractAction(getText("Close")) {
+        closeAction = new AbstractAction(Messages.CLOSE) {
             public void actionPerformed(ActionEvent ev) {
                 setVisible(false);
                 statusBar.setText("");
diff --git a/src/share/classes/sun/tools/jconsole/BorderedComponent.java b/src/share/classes/sun/tools/jconsole/BorderedComponent.java
index 5b45d74..57549ec 100644
--- a/src/share/classes/sun/tools/jconsole/BorderedComponent.java
+++ b/src/share/classes/sun/tools/jconsole/BorderedComponent.java
@@ -33,11 +33,10 @@
 import javax.swing.plaf.*;
 import javax.swing.plaf.basic.BasicGraphicsUtils;
 
+
 import static javax.swing.SwingConstants.*;
 
 import static sun.tools.jconsole.JConsole.*;
-import static sun.tools.jconsole.Resources.*;
-import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
 public class BorderedComponent extends JPanel implements ActionListener {
@@ -47,8 +46,6 @@
     JComponent comp;
     boolean collapsed = false;
 
-    private JPopupMenu popupMenu;
-
     private Icon collapseIcon;
     private Icon expandIcon;
 
@@ -100,7 +97,7 @@
                 moreOrLessButton.setMargin(new Insets(0, 0, 0, 0));
                 moreOrLessButton.addActionListener(this);
                 String toolTip =
-                    getText("BorderedComponent.moreOrLessButton.toolTip");
+                    Messages.BORDERED_COMPONENT_MORE_OR_LESS_BUTTON_TOOLTIP;
                 moreOrLessButton.setToolTipText(toolTip);
                 borderLabel.add(moreOrLessButton);
                 borderLabel.setSize(borderLabel.getPreferredSize());
@@ -136,7 +133,8 @@
     public void setValueLabel(String str) {
         this.valueLabelStr = str;
         if (label != null) {
-            label.setText(Resources.getText("Current value",valueLabelStr));
+            label.setText(Resources.format(Messages.CURRENT_VALUE,
+                                           valueLabelStr));
         }
     }
 
@@ -151,8 +149,8 @@
             remove(comp);
             if (valueLabelStr != null) {
                 if (label == null) {
-                    label = new JLabel(Resources.getText("Current value",
-                                                         valueLabelStr));
+                    label = new JLabel(Resources.format(Messages.CURRENT_VALUE,
+                                                        valueLabelStr));
                 }
                 add(label);
             }
@@ -439,8 +437,6 @@
          * @param insets the object to be reinitialized
          */
         public Insets getBorderInsets(Component c, Insets insets) {
-            int height = 16;
-
             Border border = getBorder();
             if (border != null) {
                 if (border instanceof AbstractBorder) {
diff --git a/src/share/classes/sun/tools/jconsole/ClassTab.java b/src/share/classes/sun/tools/jconsole/ClassTab.java
index c47ccbc..b192b9f 100644
--- a/src/share/classes/sun/tools/jconsole/ClassTab.java
+++ b/src/share/classes/sun/tools/jconsole/ClassTab.java
@@ -33,17 +33,11 @@
 
 import javax.swing.*;
 import javax.swing.border.*;
-import javax.swing.event.*;
-import javax.swing.text.*;
 
-import java.util.*;
-import java.util.List;
+
 import java.util.concurrent.*;
 
-import sun.awt.*;
-
 import static sun.tools.jconsole.Formatter.*;
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 
@@ -58,13 +52,9 @@
 
     private static final String loadedPlotterKey        = "loaded";
     private static final String totalLoadedPlotterKey   = "totalLoaded";
-    private static final String loadedPlotterName       = Resources.getText("Loaded");
-    private static final String totalLoadedPlotterName  = Resources.getText("Total Loaded");
     private static final Color  loadedPlotterColor      = Plotter.defaultColor;
     private static final Color  totalLoadedPlotterColor = Color.red;
 
-    private static final String infoLabelFormat = "ClassTab.infoLabelFormat";
-
     /*
       Hierarchy of panels and layouts for this tab:
 
@@ -88,7 +78,7 @@
     */
 
     public static String getTabName() {
-        return Resources.getText("Classes");
+        return Messages.CLASSES;
     }
 
     public ClassTab(VMPanel vmPanel) {
@@ -108,40 +98,40 @@
         JPanel controlPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 20, 5));
         topPanel.add(controlPanel, BorderLayout.CENTER);
 
-        verboseCheckBox = new JCheckBox(Resources.getText("Verbose Output"));
+        verboseCheckBox = new JCheckBox(Messages.VERBOSE_OUTPUT);
         verboseCheckBox.addActionListener(this);
-        verboseCheckBox.setToolTipText(getText("Verbose Output.toolTip"));
+        verboseCheckBox.setToolTipText(Messages.VERBOSE_OUTPUT_TOOLTIP);
         JPanel topRightPanel = new JPanel();
         topRightPanel.setBorder(new EmptyBorder(0, 65-8, 0, 70));
         topRightPanel.add(verboseCheckBox);
         topPanel.add(topRightPanel, BorderLayout.AFTER_LINE_ENDS);
 
-        loadedClassesMeter = new PlotterPanel(Resources.getText("Number of Loaded Classes"),
+        loadedClassesMeter = new PlotterPanel(Messages.NUMBER_OF_LOADED_CLASSES,
                                               Plotter.Unit.NONE, false);
         loadedClassesMeter.plotter.createSequence(loadedPlotterKey,
-                                                  loadedPlotterName,
+                                                  Messages.LOADED,
                                                   loadedPlotterColor,
                                                   true);
         loadedClassesMeter.plotter.createSequence(totalLoadedPlotterKey,
-                                                  totalLoadedPlotterName,
+                                                  Messages.TOTAL_LOADED,
                                                   totalLoadedPlotterColor,
                                                   true);
         setAccessibleName(loadedClassesMeter.plotter,
-                          getText("ClassTab.loadedClassesPlotter.accessibleName"));
+                          Messages.CLASS_TAB_LOADED_CLASSES_PLOTTER_ACCESSIBLE_NAME);
         plotterPanel.add(loadedClassesMeter);
 
         timeComboBox = new TimeComboBox(loadedClassesMeter.plotter);
-        controlPanel.add(new LabeledComponent(Resources.getText("Time Range:"),
-                                              getMnemonicInt("Time Range:"),
+        controlPanel.add(new LabeledComponent(Messages.TIME_RANGE_COLON,
+                                              Resources.getMnemonicInt(Messages.TIME_RANGE_COLON),
                                               timeComboBox));
 
         LabeledComponent.layout(plotterPanel);
 
-        bottomPanel.setBorder(new CompoundBorder(new TitledBorder(Resources.getText("Details")),
-                                                  new EmptyBorder(10, 10, 10, 10)));
+        bottomPanel.setBorder(new CompoundBorder(new TitledBorder(Messages.DETAILS),
+                                                 new EmptyBorder(10, 10, 10, 10)));
 
         details = new HTMLPane();
-        setAccessibleName(details, getText("Details"));
+        setAccessibleName(details, Messages.DETAILS);
         JScrollPane scrollPane = new JScrollPane(details);
         scrollPane.setPreferredSize(new Dimension(0, 150));
         bottomPanel.add(scrollPane, BorderLayout.SOUTH);
@@ -226,10 +216,10 @@
 
                 long time = System.currentTimeMillis();
                 String timeStamp = formatDateTime(time);
-                text += newRow(Resources.getText("Time"), timeStamp);
-                text += newRow(Resources.getText("Current classes loaded"), justify(clCount, 5));
-                text += newRow(Resources.getText("Total classes loaded"),   justify(ctCount, 5));
-                text += newRow(Resources.getText("Total classes unloaded"), justify(cuCount, 5));
+                text += newRow(Messages.TIME, timeStamp);
+                text += newRow(Messages.CURRENT_CLASSES_LOADED, justify(clCount, 5));
+                text += newRow(Messages.TOTAL_CLASSES_LOADED,   justify(ctCount, 5));
+                text += newRow(Messages.TOTAL_CLASSES_UNLOADED, justify(cuCount, 5));
 
                 return text;
             }
@@ -246,12 +236,13 @@
 
     private static class ClassOverviewPanel extends OverviewPanel {
         ClassOverviewPanel() {
-            super(getText("Classes"), loadedPlotterKey, loadedPlotterName, null);
+            super(Messages.CLASSES, loadedPlotterKey, Messages.LOADED, null);
         }
 
         private void updateClassInfo(long total, long loaded) {
             long unloaded = (total - loaded);
-            getInfoLabel().setText(getText(infoLabelFormat, loaded, unloaded, total));
+            getInfoLabel().setText(Resources.format(Messages.CLASS_TAB_INFO_LABEL_FORMAT,
+                                   loaded, unloaded, total));
         }
     }
 }
diff --git a/src/share/classes/sun/tools/jconsole/ConnectDialog.java b/src/share/classes/sun/tools/jconsole/ConnectDialog.java
index 2bdd501..ea63667 100644
--- a/src/share/classes/sun/tools/jconsole/ConnectDialog.java
+++ b/src/share/classes/sun/tools/jconsole/ConnectDialog.java
@@ -29,23 +29,17 @@
 import java.awt.*;
 import java.awt.event.*;
 import java.util.*;
-import java.net.MalformedURLException;
-import java.io.IOException;
 
-import javax.accessibility.*;
 import javax.swing.*;
-import javax.swing.Timer;
 import javax.swing.border.*;
 import javax.swing.event.*;
 import javax.swing.plaf.basic.BasicRadioButtonUI;
 import javax.swing.table.*;
 
-import javax.management.remote.JMXServiceURL;
-import javax.management.remote.JMXConnector;
+
 
 import static java.awt.BorderLayout.*;
 import static javax.swing.ListSelectionModel.*;
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
@@ -66,7 +60,7 @@
     JPanel radioButtonPanel;
 
     private Icon mastheadIcon =
-        new MastheadIcon(getText("ConnectDialog.masthead.title"));
+        new MastheadIcon(Messages.CONNECT_DIALOG_MASTHEAD_TITLE);
     private Color hintTextColor, disabledTableCellColor;
 
     // The table of managed VM (local process)
@@ -79,11 +73,11 @@
 
 
     public ConnectDialog(JConsole jConsole) {
-        super(jConsole, Resources.getText("ConnectDialog.title"), true);
+        super(jConsole, Messages.CONNECT_DIALOG_TITLE, true);
 
         this.jConsole = jConsole;
         setAccessibleDescription(this,
-                                 getText("ConnectDialog.accessibleDescription"));
+                                 Messages.CONNECT_DIALOG_ACCESSIBLE_DESCRIPTION);
         setDefaultCloseOperation(HIDE_ON_CLOSE);
         setResizable(false);
         Container cp = (JComponent)getContentPane();
@@ -95,7 +89,7 @@
 
         statusBar = new JLabel(" ", JLabel.CENTER);
         setAccessibleName(statusBar,
-                          getText("ConnectDialog.statusBar.accessibleName"));
+                          Messages.CONNECT_DIALOG_STATUS_BAR_ACCESSIBLE_NAME);
 
         Font normalLabelFont = statusBar.getFont();
         Font boldLabelFont = normalLabelFont.deriveFont(Font.BOLD);
@@ -103,7 +97,7 @@
 
         JLabel mastheadLabel = new JLabel(mastheadIcon);
         setAccessibleName(mastheadLabel,
-                          getText("ConnectDialog.masthead.accessibleName"));
+                          Messages.CONNECT_DIALOG_MASTHEAD_ACCESSIBLE_NAME);
 
         cp.add(mastheadLabel, NORTH);
         cp.add(radioButtonPanel, CENTER);
@@ -117,7 +111,7 @@
         remoteTF.addFocusListener(this);
         remoteTF.setPreferredSize(remoteTF.getPreferredSize());
         setAccessibleName(remoteTF,
-                          getText("Remote Process.textField.accessibleName"));
+                          Messages.REMOTE_PROCESS_TEXT_FIELD_ACCESSIBLE_NAME);
 
         //
         // If the VM supports the local attach mechanism (is: Sun
@@ -141,8 +135,8 @@
             TableColumn cmdLineColumn = columnModel.getColumn(COL_NAME);
             cmdLineColumn.setResizable(false);
 
-            localRadioButton = new JRadioButton(getText("Local Process:"));
-            localRadioButton.setMnemonic(getMnemonicInt("Local Process:"));
+            localRadioButton = new JRadioButton(Messages.LOCAL_PROCESS_COLON);
+            localRadioButton.setMnemonic(Resources.getMnemonicInt(Messages.LOCAL_PROCESS_COLON));
             localRadioButton.setFont(boldLabelFont);
             localRadioButton.addItemListener(this);
             radioButtonGroup.add(localRadioButton);
@@ -167,8 +161,8 @@
             localTablePanel.add(localMessageLabel, SOUTH);
         }
 
-        remoteRadioButton = new JRadioButton(getText("Remote Process:"));
-        remoteRadioButton.setMnemonic(getMnemonicInt("Remote Process:"));
+        remoteRadioButton = new JRadioButton(Messages.REMOTE_PROCESS_COLON);
+        remoteRadioButton.setMnemonic(Resources.getMnemonicInt(Messages.REMOTE_PROCESS_COLON));
         remoteRadioButton.setFont(boldLabelFont);
         radioButtonGroup.add(remoteRadioButton);
 
@@ -207,7 +201,7 @@
 
         remoteTFPanel.add(remoteTF, NORTH);
 
-        remoteMessageLabel = new JLabel("<html>" + getText("remoteTF.usage"));
+        remoteMessageLabel = new JLabel("<html>" + Messages.REMOTE_TF_USAGE + "</html>");
         remoteMessageLabel.setFont(smallLabelFont);
         remoteMessageLabel.setForeground(hintTextColor);
         remoteTFPanel.add(remoteMessageLabel, CENTER);
@@ -222,11 +216,10 @@
         userNameTF.getDocument().addDocumentListener(this);
         userNameTF.addFocusListener(this);
         setAccessibleName(userNameTF,
-                          getText("Username.accessibleName"));
-        String labelKey = "Username: ";
+            Messages.USERNAME_ACCESSIBLE_NAME);
         LabeledComponent lc;
-        lc = new LabeledComponent(getText(labelKey),
-                                  getMnemonicInt(labelKey),
+        lc = new LabeledComponent(Messages.USERNAME_COLON_,
+                                  Resources.getMnemonicInt(Messages.USERNAME_COLON_),
                                   userNameTF);
         lc.label.setFont(boldLabelFont);
         userPwdPanel.add(lc);
@@ -238,10 +231,10 @@
         passwordTF.getDocument().addDocumentListener(this);
         passwordTF.addFocusListener(this);
         setAccessibleName(passwordTF,
-                          getText("Password.accessibleName"));
-        labelKey = "Password: ";
-        lc = new LabeledComponent(getText(labelKey),
-                                  getMnemonicInt(labelKey),
+            Messages.PASSWORD_ACCESSIBLE_NAME);
+
+        lc = new LabeledComponent(Messages.PASSWORD_COLON_,
+                                  Resources.getMnemonicInt(Messages.PASSWORD_COLON_),
                                   passwordTF);
         lc.setBorder(new EmptyBorder(0, 12, 0, 0)); // Left padding
         lc.label.setFont(boldLabelFont);
@@ -250,7 +243,7 @@
         remoteTFPanel.add(userPwdPanel, SOUTH);
 
         String connectButtonToolTipText =
-            getText("ConnectDialog.connectButton.toolTip");
+            Messages.CONNECT_DIALOG_CONNECT_BUTTON_TOOLTIP;
         connectButton = new JButton(connectAction);
         connectButton.setToolTipText(connectButtonToolTipText);
 
@@ -288,7 +281,7 @@
             String colorStr =
                 String.format("%06x", hintTextColor.getRGB() & 0xFFFFFF);
             remoteMessageLabel.setText("<html><font color=#" + colorStr + ">" +
-                                       getText("remoteTF.usage"));
+                                       Messages.REMOTE_TF_USAGE);
         }
         if (localMessageLabel != null) {
             localMessageLabel.setForeground(hintTextColor);
@@ -300,9 +293,9 @@
     }
 
     private void createActions() {
-        connectAction = new AbstractAction(getText("Connect")) {
+        connectAction = new AbstractAction(Messages.CONNECT) {
             /* init */ {
-                putValue(Action.MNEMONIC_KEY, getMnemonicInt("Connect"));
+                putValue(Action.MNEMONIC_KEY, Resources.getMnemonicInt(Messages.CONNECT));
             }
 
             public void actionPerformed(ActionEvent ev) {
@@ -321,7 +314,6 @@
                     try {
                         if (txt.startsWith(JConsole.ROOT_URL)) {
                             String url = txt;
-                            String msg = null;
                             jConsole.addUrl(url, userName, password, false);
                             remoteTF.setText(JConsole.ROOT_URL);
                             return;
@@ -361,7 +353,7 @@
             }
         };
 
-        cancelAction = new AbstractAction(getText("Cancel")) {
+        cancelAction = new AbstractAction(Messages.CANCEL) {
             public void actionPerformed(ActionEvent ev) {
                 setVisible(false);
                 statusBar.setText("");
@@ -588,9 +580,9 @@
             LocalVirtualMachine lvm = vmModel.vmAt(row);
             if (!lvm.isManageable()) {
                 if (lvm.isAttachable()) {
-                    labelText = getText("Management Will Be Enabled");
+                    labelText = Messages.MANAGEMENT_WILL_BE_ENABLED;
                 } else {
-                    labelText = getText("Management Not Enabled");
+                    labelText = Messages.MANAGEMENT_NOT_ENABLED;
                 }
             }
         }
@@ -650,8 +642,8 @@
     // Represents the list of managed VMs as a tabular data model.
     private static class ManagedVmTableModel extends AbstractTableModel {
         private static String[] columnNames = {
-            Resources.getText("Column.Name"),
-            Resources.getText("Column.PID"),
+            Messages.COLUMN_NAME,
+            Messages.COLUMN_PID,
         };
 
         private List<LocalVirtualMachine> vmList;
@@ -678,7 +670,7 @@
             }
         }
 
-        public Class getColumnClass(int column) {
+        public Class<?> getColumnClass(int column) {
             switch (column) {
                 case COL_NAME: return String.class;
                 case COL_PID:  return Integer.class;
@@ -706,13 +698,6 @@
         }
     }
 
-
-    // Convenience method
-    private static String getText(String key) {
-        return Resources.getText(key);
-    }
-
-
     // A blank component that takes up as much space as the
     // button part of a JRadioButton.
     private static class Padder extends JPanel {
@@ -721,7 +706,7 @@
         Padder(JRadioButton radioButton) {
             this.radioButton = radioButton;
 
-            setAccessibleName(this, getText("Blank"));
+            setAccessibleName(this, Messages.BLANK);
         }
 
         public Dimension getPreferredSize() {
@@ -758,7 +743,6 @@
             if (g == null) {
                 return null;
             }
-            String clippedText =
                 SwingUtilities.layoutCompoundLabel(button,
                                                    g.getFontMetrics(),
                                                    text,
diff --git a/src/share/classes/sun/tools/jconsole/CreateMBeanDialog.java b/src/share/classes/sun/tools/jconsole/CreateMBeanDialog.java
index 75c784b..7d391b8 100644
--- a/src/share/classes/sun/tools/jconsole/CreateMBeanDialog.java
+++ b/src/share/classes/sun/tools/jconsole/CreateMBeanDialog.java
@@ -32,23 +32,21 @@
 import java.util.Comparator;
 
 import javax.swing.*;
-import javax.swing.Timer;
 import javax.swing.border.*;
-import javax.swing.event.*;
 
 import javax.management.MBeanServerConnection;
 import javax.management.ObjectName;
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.InstanceNotFoundException;
 
-import static sun.tools.jconsole.Resources.*;
+
 import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
 public class CreateMBeanDialog extends InternalDialog
                 implements ActionListener {
     JConsole jConsole;
-    JComboBox connections;
+    JComboBox<ProxyClient> connections;
     JButton createMBeanButton, unregisterMBeanButton, cancelButton;
 
     private static final String HOTSPOT_MBEAN =
@@ -60,7 +58,7 @@
 
         this.jConsole = jConsole;
         setAccessibleDescription(this,
-                                 getText("Hotspot MBeans.dialog.accessibleDescription"));
+                                 Messages.HOTSPOT_MBEANS_DIALOG_ACCESSIBLE_DESCRIPTION);
         Container cp = getContentPane();
         ((JComponent)cp).setBorder(new EmptyBorder(10, 10, 4, 10));
 
@@ -71,12 +69,10 @@
                                                         false,
                                                         true));
         cp.add(centerPanel, BorderLayout.CENTER);
-        connections = new JComboBox();
+        connections = new JComboBox<ProxyClient>();
         updateConnections();
 
-        centerPanel.add(new LabeledComponent(Resources.
-                                             getText("Manage Hotspot MBeans "+
-                                                     "in: "),
+        centerPanel.add(new LabeledComponent(Resources.format(Messages.MANAGE_HOTSPOT_MBEANS_IN_COLON_),
                                              connections));
 
         JPanel bottomPanel = new JPanel(new BorderLayout());
@@ -85,11 +81,11 @@
         JPanel buttonPanel = new JPanel();
         bottomPanel.add(buttonPanel, BorderLayout.NORTH);
         buttonPanel.add(createMBeanButton =
-                        new JButton(Resources.getText("Create")));
+                        new JButton(Messages.CREATE));
         buttonPanel.add(unregisterMBeanButton =
-                        new JButton(Resources.getText("Unregister")));
+                        new JButton(Messages.UNREGISTER));
         buttonPanel.add(cancelButton =
-                        new JButton(Resources.getText("Cancel")));
+                        new JButton(Messages.CANCEL));
 
         statusBar = new JLabel(" ", JLabel.CENTER);
         bottomPanel.add(statusBar, BorderLayout.SOUTH);
@@ -133,7 +129,8 @@
             }
         }
         connections.invalidate();
-        connections.setModel(new DefaultComboBoxModel(data.toArray()));
+        connections.setModel(new DefaultComboBoxModel<ProxyClient>
+            (data.toArray(new ProxyClient[data.size()])));
         connections.validate();
     }
 
@@ -144,7 +141,6 @@
             new Thread("CreateMBeanDialog.actionPerformed") {
                     public void run() {
                         try {
-                            StringBuffer buff = null;
                             Object c = connections.getSelectedItem();
                             if(c == null) return;
                             if(ev.getSource() == createMBeanButton) {
@@ -163,13 +159,9 @@
                             }
                             return;
                         } catch(InstanceAlreadyExistsException e) {
-                            statusBar.setText(Resources.
-                                              getText("Error: MBeans already "
-                                                      + "exist"));
+                            statusBar.setText(Messages.ERROR_COLON_MBEANS_ALREADY_EXIST);
                         } catch(InstanceNotFoundException e) {
-                            statusBar.setText(Resources.
-                                              getText("Error: MBeans do not "
-                                                      + "exist"));
+                            statusBar.setText(Messages.ERROR_COLON_MBEANS_DO_NOT_EXIST);
                         } catch(Exception e) {
                             statusBar.setText(e.toString());
                         }
diff --git a/src/share/classes/sun/tools/jconsole/Formatter.java b/src/share/classes/sun/tools/jconsole/Formatter.java
index 46f6c0e..1192341 100644
--- a/src/share/classes/sun/tools/jconsole/Formatter.java
+++ b/src/share/classes/sun/tools/jconsole/Formatter.java
@@ -28,7 +28,6 @@
 import java.text.*;
 import java.util.*;
 
-import static sun.tools.jconsole.Resources.*;
 
 class Formatter {
     final static long SECOND = 1000;
@@ -48,7 +47,7 @@
         String str;
         if (t < 1 * MINUTE) {
             String seconds = String.format("%.3f", t / (double)SECOND);
-            str = Resources.getText("DurationSeconds", seconds);
+            str = Resources.format(Messages.DURATION_SECONDS, seconds);
         } else {
             long remaining = t;
             long days = remaining / DAY;
@@ -58,13 +57,13 @@
             long minutes = remaining / MINUTE;
 
             if (t >= 1 * DAY) {
-                str = Resources.getText("DurationDaysHoursMinutes",
-                                        days, hours, minutes);
+                str = Resources.format(Messages.DURATION_DAYS_HOURS_MINUTES,
+                                       days, hours, minutes);
             } else if (t >= 1 * HOUR) {
-                str = Resources.getText("DurationHoursMinutes",
-                                        hours, minutes);
+                str = Resources.format(Messages.DURATION_HOURS_MINUTES,
+                                       hours, minutes);
             } else {
-                str = Resources.getText("DurationMinutes", minutes);
+                str = Resources.format(Messages.DURATION_MINUTES, minutes);
             }
         }
         return str;
@@ -88,8 +87,7 @@
         return dateDF.format(time) + " " + timeWithSecondsDF.format(time);
     }
 
-    static DateFormat getDateTimeFormat(String key) {
-        String dtfStr = getText(key);
+    static DateFormat getDateTimeFormat(String dtfStr) {
         int dateStyle = -1;
         int timeStyle = -1;
 
@@ -153,18 +151,18 @@
         }
         String[] strings = formatLongs(bytes);
         for (int i = 0; i < n; i++) {
-            strings[i] = getText("kbytes", strings[i]);
+            strings[i] = Resources.format(Messages.KBYTES, strings[i]);
         }
         return strings;
     }
 
     static String formatKBytes(long bytes) {
         if (bytes == -1) {
-            return getText("kbytes", "-1");
+            return Resources.format(Messages.KBYTES, "-1");
         }
 
         long kb = bytes / 1024;
-        return getText("kbytes", justify(kb, 10));
+        return Resources.format(Messages.KBYTES, justify(kb, 10));
     }
 
 
@@ -182,13 +180,13 @@
         int exp = (int)Math.log10((double)vMax);
 
         if (exp < 3) {
-            s = Resources.getText("Size Bytes", v);
+            s = Resources.format(Messages.SIZE_BYTES, v);
         } else if (exp < 6) {
-            s = Resources.getText("Size Kb", trimDouble(v / Math.pow(10.0, 3)));
+            s = Resources.format(Messages.SIZE_KB, trimDouble(v / Math.pow(10.0, 3)));
         } else if (exp < 9) {
-            s = Resources.getText("Size Mb", trimDouble(v / Math.pow(10.0, 6)));
+            s = Resources.format(Messages.SIZE_MB, trimDouble(v / Math.pow(10.0, 6)));
         } else {
-            s = Resources.getText("Size Gb", trimDouble(v / Math.pow(10.0, 9)));
+            s = Resources.format(Messages.SIZE_GB, trimDouble(v / Math.pow(10.0, 9)));
         }
         if (html) {
             s = s.replace(" ", "&nbsp;");
diff --git a/src/share/classes/sun/tools/jconsole/HTMLPane.java b/src/share/classes/sun/tools/jconsole/HTMLPane.java
index f92623a..34c3c9b 100644
--- a/src/share/classes/sun/tools/jconsole/HTMLPane.java
+++ b/src/share/classes/sun/tools/jconsole/HTMLPane.java
@@ -25,8 +25,6 @@
 
 package sun.tools.jconsole;
 
-import java.awt.Color;
-
 import javax.swing.*;
 import javax.swing.event.*;
 import javax.swing.text.*;
diff --git a/src/share/classes/sun/tools/jconsole/InternalDialog.java b/src/share/classes/sun/tools/jconsole/InternalDialog.java
index 736cb2f..703e626 100644
--- a/src/share/classes/sun/tools/jconsole/InternalDialog.java
+++ b/src/share/classes/sun/tools/jconsole/InternalDialog.java
@@ -30,8 +30,8 @@
 
 import javax.swing.*;
 
+
 import static javax.swing.JLayeredPane.*;
-import static sun.tools.jconsole.Resources.*;
 
 /**
  * Used instead of JDialog in a JDesktopPane/JInternalFrame environment.
@@ -73,7 +73,7 @@
         private ImageIcon rightIcon =
             new ImageIcon(InternalDialog.class.getResource("resources/masthead-right.png"));
 
-        private Font font = Font.decode(getText("Masthead.font"));
+        private Font font = Font.decode(Messages.MASTHEAD_FONT);
         private int gap = 10;
         private String title;
 
diff --git a/src/share/classes/sun/tools/jconsole/JConsole.java b/src/share/classes/sun/tools/jconsole/JConsole.java
index bc4aa1d..443ae80 100644
--- a/src/share/classes/sun/tools/jconsole/JConsole.java
+++ b/src/share/classes/sun/tools/jconsole/JConsole.java
@@ -29,7 +29,6 @@
 import java.awt.event.*;
 import java.beans.*;
 import java.io.*;
-import java.lang.reflect.InvocationTargetException;
 import java.net.*;
 import java.util.*;
 import java.util.List;
@@ -38,8 +37,6 @@
 import javax.swing.border.*;
 import javax.swing.event.*;
 import javax.swing.plaf.*;
-import javax.management.remote.JMXServiceURL;
-import javax.management.remote.JMXConnector;
 import javax.security.auth.login.FailedLoginException;
 import javax.net.ssl.SSLHandshakeException;
 
@@ -47,7 +44,6 @@
 
 import sun.net.util.IPAddressUtil;
 
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
@@ -68,7 +64,7 @@
                 try {
                     UIManager.setLookAndFeel(systemLaF);
                 } catch (Exception e) {
-                    System.err.println(Resources.getText("JConsole: ", e.getMessage()));
+                    System.err.println(Resources.format(Messages.JCONSOLE_COLON_, e.getMessage()));
                 }
             }
         }
@@ -87,7 +83,7 @@
 
 
     private final static String title =
-        Resources.getText("Java Monitoring & Management Console");
+        Messages.JAVA_MONITORING___MANAGEMENT_CONSOLE;
     public final static String ROOT_URL =
         "service:jmx:";
 
@@ -116,7 +112,7 @@
 
         setRootPane(new FixedJRootPane());
         setAccessibleDescription(this,
-                                 getText("JConsole.accessibleDescription"));
+                                 Messages.JCONSOLE_ACCESSIBLE_DESCRIPTION);
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 
         menuBar = new JMenuBar();
@@ -124,12 +120,12 @@
 
         // TODO: Use Actions !
 
-        JMenu connectionMenu = new JMenu(getText("Connection"));
-        connectionMenu.setMnemonic(getMnemonicInt("Connection"));
+        JMenu connectionMenu = new JMenu(Messages.CONNECTION);
+        connectionMenu.setMnemonic(Resources.getMnemonicInt(Messages.CONNECTION));
         menuBar.add(connectionMenu);
         if(hotspot) {
-            hotspotMI = new JMenuItem(getText("Hotspot MBeans..."));
-            hotspotMI.setMnemonic(getMnemonicInt("Hotspot MBeans..."));
+            hotspotMI = new JMenuItem(Messages.HOTSPOT_MBEANS_ELLIPSIS);
+            hotspotMI.setMnemonic(Resources.getMnemonicInt(Messages.HOTSPOT_MBEANS_ELLIPSIS));
             hotspotMI.setAccelerator(KeyStroke.
                                      getKeyStroke(KeyEvent.VK_H,
                                                   InputEvent.CTRL_MASK));
@@ -139,8 +135,8 @@
             connectionMenu.addSeparator();
         }
 
-        connectMI = new JMenuItem(Resources.getText("New Connection..."));
-        connectMI.setMnemonic(getMnemonicInt("New Connection..."));
+        connectMI = new JMenuItem(Messages.NEW_CONNECTION_ELLIPSIS);
+        connectMI.setMnemonic(Resources.getMnemonicInt(Messages.NEW_CONNECTION_ELLIPSIS));
         connectMI.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N,
                                                         InputEvent.CTRL_MASK));
         connectMI.addActionListener(this);
@@ -148,27 +144,27 @@
 
         connectionMenu.addSeparator();
 
-        exitMI = new JMenuItem(Resources.getText("Exit"));
-        exitMI.setMnemonic(getMnemonicInt("Exit"));
+        exitMI = new JMenuItem(Messages.EXIT);
+        exitMI.setMnemonic(Resources.getMnemonicInt(Messages.EXIT));
         exitMI.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F4,
                                                      InputEvent.ALT_MASK));
         exitMI.addActionListener(this);
         connectionMenu.add(exitMI);
 
 
-        JMenu helpMenu = new JMenu(getText("HelpMenu.title"));
-        helpMenu.setMnemonic(getMnemonicInt("HelpMenu.title"));
+        JMenu helpMenu = new JMenu(Messages.HELP_MENU_TITLE);
+        helpMenu.setMnemonic(Resources.getMnemonicInt(Messages.HELP_MENU_TITLE));
         menuBar.add(helpMenu);
 
         if (AboutDialog.isBrowseSupported()) {
-            userGuideMI = new JMenuItem(getText("HelpMenu.UserGuide.title"));
-            userGuideMI.setMnemonic(getMnemonicInt("HelpMenu.UserGuide.title"));
+            userGuideMI = new JMenuItem(Messages.HELP_MENU_USER_GUIDE_TITLE);
+            userGuideMI.setMnemonic(Resources.getMnemonicInt(Messages.HELP_MENU_USER_GUIDE_TITLE));
             userGuideMI.addActionListener(this);
             helpMenu.add(userGuideMI);
             helpMenu.addSeparator();
         }
-        aboutMI = new JMenuItem(getText("HelpMenu.About.title"));
-        aboutMI.setMnemonic(getMnemonicInt("HelpMenu.About.title"));
+        aboutMI = new JMenuItem(Messages.HELP_MENU_ABOUT_TITLE);
+        aboutMI.setMnemonic(Resources.getMnemonicInt(Messages.HELP_MENU_ABOUT_TITLE));
         aboutMI.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0));
         aboutMI.addActionListener(this);
         helpMenu.add(aboutMI);
@@ -191,8 +187,8 @@
             ((BorderLayout)cp.getLayout()).
             getLayoutComponent(BorderLayout.CENTER);
 
-        windowMenu = new WindowMenu(Resources.getText("Window"));
-        windowMenu.setMnemonic(getMnemonicInt("Window"));
+        windowMenu = new WindowMenu(Messages.WINDOW);
+        windowMenu.setMnemonic(Resources.getMnemonicInt(Messages.WINDOW));
         // Add Window menu before Help menu
         menuBar.add(windowMenu, menuBar.getComponentCount() - 1);
 
@@ -219,25 +215,25 @@
         WindowMenu(String text) {
             super(text);
 
-            cascadeMI = new JMenuItem(Resources.getText("Cascade"));
-            cascadeMI.setMnemonic(getMnemonicInt("Cascade"));
+            cascadeMI = new JMenuItem(Messages.CASCADE);
+            cascadeMI.setMnemonic(Resources.getMnemonicInt(Messages.CASCADE));
             cascadeMI.addActionListener(JConsole.this);
             add(cascadeMI);
 
-            tileMI = new JMenuItem(Resources.getText("Tile"));
-            tileMI.setMnemonic(getMnemonicInt("Tile"));
+            tileMI = new JMenuItem(Messages.TILE);
+            tileMI.setMnemonic(Resources.getMnemonicInt(Messages.TILE));
             tileMI.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T,
                                                          InputEvent.CTRL_MASK));
             tileMI.addActionListener(JConsole.this);
             add(tileMI);
 
-            minimizeAllMI = new JMenuItem(Resources.getText("Minimize All"));
-            minimizeAllMI.setMnemonic(getMnemonicInt("Minimize All"));
+            minimizeAllMI = new JMenuItem(Messages.MINIMIZE_ALL);
+            minimizeAllMI.setMnemonic(Resources.getMnemonicInt(Messages.MINIMIZE_ALL));
             minimizeAllMI.addActionListener(JConsole.this);
             add(minimizeAllMI);
 
-            restoreAllMI = new JMenuItem(Resources.getText("Restore All"));
-            restoreAllMI.setMnemonic(getMnemonicInt("Restore All"));
+            restoreAllMI = new JMenuItem(Messages.RESTORE_ALL);
+            restoreAllMI.setMnemonic(Resources.getMnemonicInt(Messages.RESTORE_ALL));
             restoreAllMI.addActionListener(JConsole.this);
             add(restoreAllMI);
 
@@ -721,7 +717,7 @@
     }
 
     private String errorMessage(Exception ex) {
-       String msg = Resources.getText("Connection failed");
+       String msg = Messages.CONNECTION_FAILED;
        if (ex instanceof IOException || ex instanceof SecurityException) {
            Throwable cause = null;
            Throwable c = ex.getCause();
@@ -732,7 +728,7 @@
            if (cause instanceof ConnectException) {
                return msg + ": " + cause.getMessage();
            } else if (cause instanceof UnknownHostException) {
-               return Resources.getText("Unknown Host", cause.getMessage());
+               return Resources.format(Messages.UNKNOWN_HOST, cause.getMessage());
            } else if (cause instanceof NoRouteToHostException) {
                return msg + ": " + cause.getMessage();
            } else if (cause instanceof FailedLoginException) {
@@ -741,7 +737,7 @@
                return msg + ": "+ cause.getMessage();
            }
         } else if (ex instanceof MalformedURLException) {
-           return Resources.getText("Invalid URL", ex.getMessage());
+           return Resources.format(Messages.INVALID_URL, ex.getMessage());
         }
         return msg + ": " + ex.getMessage();
     }
@@ -770,7 +766,7 @@
 
 
     private static void usage() {
-        System.err.println(Resources.getText("zz usage text", "jconsole"));
+        System.err.println(Resources.format(Messages.ZZ_USAGE_TEXT, "jconsole"));
     }
 
     private static void mainInit(final List<String> urls,
@@ -1003,13 +999,13 @@
                 pluginService = plugins;
             } catch (ServiceConfigurationError e) {
                 // Error occurs during initialization of plugin
-                System.out.println(Resources.getText("Fail to load plugin",
+                System.out.println(Resources.format(Messages.FAIL_TO_LOAD_PLUGIN,
                                    e.getMessage()));
             } catch (MalformedURLException e) {
                 if (JConsole.isDebug()) {
                     e.printStackTrace();
                 }
-                System.out.println(Resources.getText("Invalid plugin path",
+                System.out.println(Resources.format(Messages.INVALID_PLUGIN_PATH,
                                    e.getMessage()));
             }
         }
diff --git a/src/share/classes/sun/tools/jconsole/LabeledComponent.java b/src/share/classes/sun/tools/jconsole/LabeledComponent.java
index 81953f4..ce045e8 100644
--- a/src/share/classes/sun/tools/jconsole/LabeledComponent.java
+++ b/src/share/classes/sun/tools/jconsole/LabeledComponent.java
@@ -26,7 +26,6 @@
 package sun.tools.jconsole;
 
 import java.awt.*;
-import java.awt.event.*;
 
 import javax.swing.*;
 
diff --git a/src/share/classes/sun/tools/jconsole/LocalVirtualMachine.java b/src/share/classes/sun/tools/jconsole/LocalVirtualMachine.java
index c99f99f..4982c0e 100644
--- a/src/share/classes/sun/tools/jconsole/LocalVirtualMachine.java
+++ b/src/share/classes/sun/tools/jconsole/LocalVirtualMachine.java
@@ -39,7 +39,6 @@
 // Sun private
 import sun.management.ConnectorAddressLink;
 import sun.jvmstat.monitor.HostIdentifier;
-import sun.jvmstat.monitor.Monitor;
 import sun.jvmstat.monitor.MonitoredHost;
 import sun.jvmstat.monitor.MonitoredVm;
 import sun.jvmstat.monitor.MonitoredVmUtil;
@@ -131,7 +130,7 @@
 
     private static void getMonitoredVMs(Map<Integer, LocalVirtualMachine> map) {
         MonitoredHost host;
-        Set vms;
+        Set<Integer> vms;
         try {
             host = MonitoredHost.getMonitoredHost(new HostIdentifier((String)null));
             vms = host.activeVms();
diff --git a/src/share/classes/sun/tools/jconsole/MBeansTab.java b/src/share/classes/sun/tools/jconsole/MBeansTab.java
index abd5de7..cb5bcc1 100644
--- a/src/share/classes/sun/tools/jconsole/MBeansTab.java
+++ b/src/share/classes/sun/tools/jconsole/MBeansTab.java
@@ -52,7 +52,7 @@
     private XDataViewer viewer;
 
     public static String getTabName() {
-        return Resources.getText("MBeans");
+        return Messages.MBEANS;
     }
 
     public MBeansTab(final VMPanel vmPanel) {
diff --git a/src/share/classes/sun/tools/jconsole/MaximizableInternalFrame.java b/src/share/classes/sun/tools/jconsole/MaximizableInternalFrame.java
index da2b91f..ab2c1bf 100644
--- a/src/share/classes/sun/tools/jconsole/MaximizableInternalFrame.java
+++ b/src/share/classes/sun/tools/jconsole/MaximizableInternalFrame.java
@@ -222,7 +222,7 @@
     static {
         if (JConsole.IS_WIN) {
             try {
-                Class Part =
+                Class<?> Part =
                     Class.forName("com.sun.java.swing.plaf.windows.TMSchema$Part");
                 if (Part != null) {
                     WP_MINBUTTON        = Part.getField("WP_MINBUTTON").get(null);
diff --git a/src/share/classes/sun/tools/jconsole/MemoryPoolProxy.java b/src/share/classes/sun/tools/jconsole/MemoryPoolProxy.java
index bc6925f..a796db0 100644
--- a/src/share/classes/sun/tools/jconsole/MemoryPoolProxy.java
+++ b/src/share/classes/sun/tools/jconsole/MemoryPoolProxy.java
@@ -26,7 +26,6 @@
 package sun.tools.jconsole;
 
 import javax.management.ObjectName;
-import java.lang.management.ManagementFactory;
 import java.lang.management.MemoryPoolMXBean;
 import java.lang.management.MemoryUsage;
 import com.sun.management.GarbageCollectorMXBean;
@@ -34,21 +33,18 @@
 import java.util.HashMap;
 import java.util.Set;
 import java.util.Map;
-import java.util.Map.Entry;
 
 import static java.lang.management.ManagementFactory.*;
 
 public class MemoryPoolProxy {
     private String poolName;
     private ProxyClient client;
-    private ObjectName  objName;
     private MemoryPoolMXBean pool;
     private Map<ObjectName,Long> gcMBeans;
     private GcInfo lastGcInfo;
 
     public MemoryPoolProxy(ProxyClient client, ObjectName poolName) throws java.io.IOException {
         this.client = client;
-        this.objName = objName;
         this.pool = client.getMXBean(poolName, MemoryPoolMXBean.class);
         this.poolName = this.pool.getName();
         this.gcMBeans = new HashMap<ObjectName,Long>();
@@ -73,10 +69,6 @@
         return (gcMBeans.size() != 0);
     }
 
-    public ObjectName getObjectName() {
-        return objName;
-    }
-
     public MemoryPoolStat getStat() throws java.io.IOException {
         long usageThreshold = (pool.isUsageThresholdSupported()
                                   ? pool.getUsageThreshold()
diff --git a/src/share/classes/sun/tools/jconsole/MemoryPoolStat.java b/src/share/classes/sun/tools/jconsole/MemoryPoolStat.java
index 86cb997..869c44e 100644
--- a/src/share/classes/sun/tools/jconsole/MemoryPoolStat.java
+++ b/src/share/classes/sun/tools/jconsole/MemoryPoolStat.java
@@ -129,6 +129,6 @@
      * null if no GC occurs.
      */
     public MemoryUsage getAfterGcUsage() {
-        return beforeGcUsage;
+        return afterGcUsage;
     }
 }
diff --git a/src/share/classes/sun/tools/jconsole/MemoryTab.java b/src/share/classes/sun/tools/jconsole/MemoryTab.java
index 03e2f84..756fa18 100644
--- a/src/share/classes/sun/tools/jconsole/MemoryTab.java
+++ b/src/share/classes/sun/tools/jconsole/MemoryTab.java
@@ -38,18 +38,14 @@
 import javax.management.openmbean.CompositeData;
 import javax.swing.*;
 import javax.swing.border.*;
-import javax.swing.text.*;
 
-import sun.management.*;
 
 import static sun.tools.jconsole.Formatter.*;
-import static sun.tools.jconsole.OverviewPanel.*;
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
 class MemoryTab extends Tab implements ActionListener, ItemListener {
-    JComboBox plotterChoice;
+    JComboBox<Plotter> plotterChoice;
     TimeComboBox timeComboBox;
     JButton gcButton;
 
@@ -67,19 +63,11 @@
     private static final String committedKey   = "committed";
     private static final String maxKey         = "max";
     private static final String thresholdKey   = "threshold";
-
-    private static final String usedName        = Resources.getText("Used");
-    private static final String committedName   = Resources.getText("Committed");
-    private static final String maxName         = Resources.getText("Max");
-    private static final String thresholdName   = Resources.getText("Threshold");
-
     private static final Color  usedColor      = Plotter.defaultColor;
     private static final Color  committedColor = null;
     private static final Color  maxColor       = null;
     private static final Color  thresholdColor = Color.red;
 
-    private static final String infoLabelFormat = "MemoryTab.infoLabelFormat";
-
     /*
       Hierarchy of panels and layouts for this tab:
 
@@ -105,7 +93,7 @@
 
 
     public static String getTabName() {
-        return getText("Memory");
+        return Messages.MEMORY;
     }
 
     public MemoryTab(VMPanel vmPanel) {
@@ -125,32 +113,32 @@
         topPanel.add(controlPanel, BorderLayout.CENTER);
 
         // Plotter choice
-        plotterChoice = new JComboBox();
+        plotterChoice = new JComboBox<Plotter>();
         plotterChoice.addItemListener(this);
-        controlPanel.add(new LabeledComponent(getText("Chart:"),
-                                              getMnemonicInt("Chart:"),
+        controlPanel.add(new LabeledComponent(Messages.CHART_COLON,
+                                              Resources.getMnemonicInt(Messages.CHART_COLON),
                                               plotterChoice));
 
         // Range control
         timeComboBox = new TimeComboBox();
-        controlPanel.add(new LabeledComponent(getText("Time Range:"),
-                                              getMnemonicInt("Time Range:"),
+        controlPanel.add(new LabeledComponent(Messages.TIME_RANGE_COLON,
+                                              Resources.getMnemonicInt(Messages.TIME_RANGE_COLON),
                                               timeComboBox));
 
-        gcButton = new JButton(getText("Perform GC"));
-        gcButton.setMnemonic(getMnemonicInt("Perform GC"));
+        gcButton = new JButton(Messages.PERFORM_GC);
+        gcButton.setMnemonic(Resources.getMnemonicInt(Messages.PERFORM_GC));
         gcButton.addActionListener(this);
-        gcButton.setToolTipText(getText("Perform GC.toolTip"));
+        gcButton.setToolTipText(Messages.PERFORM_GC_TOOLTIP);
         JPanel topRightPanel = new JPanel();
         topRightPanel.setBorder(new EmptyBorder(0, 65-8, 0, 70));
         topRightPanel.add(gcButton);
         topPanel.add(topRightPanel, BorderLayout.AFTER_LINE_ENDS);
 
-        bottomPanel.setBorder(new CompoundBorder(new TitledBorder(getText("Details")),
+        bottomPanel.setBorder(new CompoundBorder(new TitledBorder(Messages.DETAILS),
                                                   new EmptyBorder(10, 10, 10, 10)));
 
         details = new HTMLPane();
-        setAccessibleName(details, getText("Details"));
+        setAccessibleName(details, Messages.DETAILS);
         bottomPanel.add(new JScrollPane(details), BorderLayout.CENTER);
 
         poolChart = new PoolChart();
@@ -165,31 +153,31 @@
 
         heapPlotter = new Plotter(Plotter.Unit.BYTES) {
             public String toString() {
-                return Resources.getText("Heap Memory Usage");
+                return Messages.HEAP_MEMORY_USAGE;
             }
         };
         proxyClient.addWeakPropertyChangeListener(heapPlotter);
 
         nonHeapPlotter = new Plotter(Plotter.Unit.BYTES) {
             public String toString() {
-                return Resources.getText("Non-Heap Memory Usage");
+                return Messages.NON_HEAP_MEMORY_USAGE;
             }
         };
 
         setAccessibleName(heapPlotter,
-                          getText("MemoryTab.heapPlotter.accessibleName"));
+                          Messages.MEMORY_TAB_HEAP_PLOTTER_ACCESSIBLE_NAME);
         setAccessibleName(nonHeapPlotter,
-                          getText("MemoryTab.nonHeapPlotter.accessibleName"));
+                          Messages.MEMORY_TAB_NON_HEAP_PLOTTER_ACCESSIBLE_NAME);
 
         proxyClient.addWeakPropertyChangeListener(nonHeapPlotter);
 
-        heapPlotter.createSequence(usedKey,         usedName,      usedColor,      true);
-        heapPlotter.createSequence(committedKey,    committedName, committedColor, false);
-        heapPlotter.createSequence(maxKey,          maxName,       maxColor,       false);
+        heapPlotter.createSequence(usedKey,         Messages.USED,      usedColor,      true);
+        heapPlotter.createSequence(committedKey,    Messages.COMMITTED, committedColor, false);
+        heapPlotter.createSequence(maxKey,          Messages.MAX,       maxColor,       false);
 
-        nonHeapPlotter.createSequence(usedKey,      usedName,      usedColor,      true);
-        nonHeapPlotter.createSequence(committedKey, committedName, committedColor, false);
-        nonHeapPlotter.createSequence(maxKey,       maxName,       maxColor,       false);
+        nonHeapPlotter.createSequence(usedKey,      Messages.USED,      usedColor,      true);
+        nonHeapPlotter.createSequence(committedKey, Messages.COMMITTED, committedColor, false);
+        nonHeapPlotter.createSequence(maxKey,       Messages.MAX,       maxColor,       false);
 
         plotterList.add(heapPlotter);
         plotterList.add(nonHeapPlotter);
@@ -202,8 +190,8 @@
         for (ObjectName objectName : objectNames) {
             String type = objectName.getKeyProperty("type");
             if (type.equals("MemoryPool")) {
-                String name = getText("MemoryPoolLabel",
-                                      objectName.getKeyProperty("name"));
+                String name = Resources.format(Messages.MEMORY_POOL_LABEL,
+                                               objectName.getKeyProperty("name"));
                 // Heap or non-heap?
                 boolean isHeap = false;
                 AttributeList al =
@@ -215,10 +203,10 @@
                 PoolPlotter poolPlotter = new PoolPlotter(objectName, name, isHeap);
                 proxyClient.addWeakPropertyChangeListener(poolPlotter);
 
-                poolPlotter.createSequence(usedKey,      usedName,      usedColor,      true);
-                poolPlotter.createSequence(committedKey, committedName, committedColor, false);
-                poolPlotter.createSequence(maxKey,       maxName,       maxColor,       false);
-                poolPlotter.createSequence(thresholdKey, thresholdName, thresholdColor, false);
+                poolPlotter.createSequence(usedKey,      Messages.USED,      usedColor,      true);
+                poolPlotter.createSequence(committedKey, Messages.COMMITTED, committedColor, false);
+                poolPlotter.createSequence(maxKey,       Messages.MAX,       maxColor,       false);
+                poolPlotter.createSequence(thresholdKey, Messages.THRESHOLD, thresholdColor, false);
                 poolPlotter.setUseDashedTransitions(thresholdKey, true);
 
                 if (isHeap) {
@@ -286,7 +274,6 @@
                 max       = new long[n];
                 threshold = new long[n];
                 timeStamp = System.currentTimeMillis();
-                int poolCount = 0;
 
                 for (int i = 0; i < n; i++) {
                     Plotter plotter = plotterList.get(i);
@@ -400,22 +387,22 @@
         //long time = plotter.getLastTimeStamp();
         long time = System.currentTimeMillis();
         String timeStamp = formatDateTime(time);
-        text += newRow(getText("Time"), timeStamp);
+        text += newRow(Messages.TIME, timeStamp);
 
         long used = plotter.getLastValue(usedKey);
         long committed = plotter.getLastValue(committedKey);
         long max = plotter.getLastValue(maxKey);
         long threshold = plotter.getLastValue(thresholdKey);
 
-        text += newRow(getText("Used"), formatKBytes(used));
+        text += newRow(Messages.USED, formatKBytes(used));
         if (committed > 0L) {
-            text += newRow(getText("Committed"), formatKBytes(committed));
+            text += newRow(Messages.COMMITTED, formatKBytes(committed));
         }
         if (max > 0L) {
-            text += newRow(getText("Max"), formatKBytes(max));
+            text += newRow(Messages.MAX, formatKBytes(max));
         }
         if (threshold > 0L) {
-            text += newRow(getText("Usage Threshold"), formatKBytes(threshold));
+            text += newRow(Messages.USAGE_THRESHOLD, formatKBytes(threshold));
         }
 
         try {
@@ -427,11 +414,11 @@
                 String gcName = garbageCollectorMBean.getName();
                 long gcCount = garbageCollectorMBean.getCollectionCount();
                 long gcTime = garbageCollectorMBean.getCollectionTime();
-                String str = getText("GC time details", justify(formatTime(gcTime), 14),
-                                     gcName,
-                                     String.format("%,d",gcCount));
+                String str = Resources.format(Messages.GC_TIME_DETAILS, justify(formatTime(gcTime), 14),
+                                              gcName,
+                                              String.format("%,d",gcCount));
                 if (!descPrinted) {
-                    text += newRow(getText("GC time"), str);
+                    text += newRow(Messages.GC_TIME, str);
                     descPrinted = true;
                 } else {
                     text += newRow(null, str);
@@ -465,8 +452,8 @@
             this.isHeap     = isHeap;
 
             setAccessibleName(this,
-                              getText("MemoryTab.poolPlotter.accessibleName",
-                                      name));
+                              Resources.format(Messages.MEMORY_TAB_POOL_PLOTTER_ACCESSIBLE_NAME,
+                                               name));
         }
 
 
@@ -627,7 +614,7 @@
             g.setColor(nonHeapColor);
             g.fillRect(nonHeapRect.x + 1, nonHeapRect.y + 1, nonHeapRect.width - 1, nonHeapRect.height - 1);
 
-            String str = getText("Heap");
+            String str = Messages.HEAP;
             int stringWidth = fm.stringWidth(str);
             int x = heapRect.x + (heapRect.width - stringWidth) / 2;
             int y = heapRect.y + heapRect.height - 6;
@@ -639,7 +626,7 @@
             g.setColor(Color.black);
             g.drawString(str, x, y);
 
-            str = getText("Non-Heap");
+            str = Messages.NON_HEAP;
             stringWidth = fm.stringWidth(str);
             x = nonHeapRect.x + (nonHeapRect.width - stringWidth) / 2;
             y = nonHeapRect.y + nonHeapRect.height - 6;
@@ -728,26 +715,26 @@
 
         protected class AccessiblePoolChart extends AccessibleJPanel {
             public String getAccessibleName() {
-                String name = getText("MemoryTab.poolChart.accessibleName");
+                String name = Messages.MEMORY_TAB_POOL_CHART_ACCESSIBLE_NAME;
 
                 String keyValueList = "";
                 for (PoolPlotter poolPlotter : poolPlotters) {
                     String value = (poolPlotter.value * 100 / poolPlotter.max) + "%";
                     // Assume format string ends with newline
                     keyValueList +=
-                        getText("Plotter.accessibleName.keyAndValue",
-                                poolPlotter.toString(), value);
+                        Resources.format(Messages.PLOTTER_ACCESSIBLE_NAME_KEY_AND_VALUE,
+                                         poolPlotter.toString(), value);
                     if (poolPlotter.threshold > 0L) {
                         String threshold =
                             (poolPlotter.threshold * 100 / poolPlotter.max) + "%";
                         if (poolPlotter.value > poolPlotter.threshold) {
                             keyValueList +=
-                                getText("MemoryTab.poolChart.aboveThreshold",
-                                        threshold);
+                               Resources.format(Messages.MEMORY_TAB_POOL_CHART_ABOVE_THRESHOLD,
+                                                threshold);
                         } else {
                             keyValueList +=
-                                getText("MemoryTab.poolChart.belowThreshold",
-                                        threshold);
+                                    Resources.format(Messages.MEMORY_TAB_POOL_CHART_BELOW_THRESHOLD,
+                                                     threshold);
                         }
                     }
                 }
@@ -767,14 +754,14 @@
 
     private static class MemoryOverviewPanel extends OverviewPanel {
         MemoryOverviewPanel() {
-            super(getText("Heap Memory Usage"), usedKey, usedName, Plotter.Unit.BYTES);
+            super(Messages.HEAP_MEMORY_USAGE, usedKey, Messages.USED, Plotter.Unit.BYTES);
         }
 
         private void updateMemoryInfo(long used, long committed, long max) {
-            getInfoLabel().setText(getText(infoLabelFormat,
-                                           formatBytes(used, true),
-                                           formatBytes(committed, true),
-                                           formatBytes(max, true)));
+            getInfoLabel().setText(Resources.format(Messages.MEMORY_TAB_INFO_LABEL_FORMAT,
+                                                    formatBytes(used, true),
+                                                    formatBytes(committed, true),
+                                                    formatBytes(max, true)));
         }
     }
 }
diff --git a/src/share/classes/sun/tools/jconsole/Messages.java b/src/share/classes/sun/tools/jconsole/Messages.java
new file mode 100644
index 0000000..27001f2
--- /dev/null
+++ b/src/share/classes/sun/tools/jconsole/Messages.java
@@ -0,0 +1,316 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package sun.tools.jconsole;
+
+
+/**
+ * Class that contains localized messages.
+ *
+ */
+final public class Messages {
+    private static final String BUNDLE_NAME = "sun.tools.jconsole.resources.messages";
+
+    static {
+        Resources.initializeMessages(Messages.class, BUNDLE_NAME);
+    }
+    // TODO:
+    // The names of some of the constants below looks strange.
+    // That's because they  were generated programmatically
+    // from the messages. They should be cleaned up,
+    // ___ should be removed etc.
+    public static String ONE_DAY;
+    public static String ONE_HOUR;
+    public static String ONE_MIN;
+    public static String ONE_MONTH;
+    public static String ONE_YEAR;
+    public static String TWO_HOURS;
+    public static String THREE_HOURS;
+    public static String THREE_MONTHS;
+    public static String FIVE_MIN;
+    public static String SIX_HOURS;
+    public static String SIX_MONTHS;
+    public static String SEVEN_DAYS;
+    public static String TEN_MIN;
+    public static String TWELVE_HOURS;
+    public static String THIRTY_MIN;
+    public static String LESS_THAN;
+    public static String A_LOT_LESS_THAN;
+    public static String GREATER_THAN;
+    public static String ACTION_CAPITALIZED;
+    public static String ACTION_INFO_CAPITALIZED;
+    public static String ALL;
+    public static String ARCHITECTURE;
+    public static String ATTRIBUTE;
+    public static String ATTRIBUTE_VALUE;
+    public static String ATTRIBUTE_VALUES;
+    public static String ATTRIBUTES;
+    public static String BLANK;
+    public static String BLOCKED_COUNT_WAITED_COUNT;
+    public static String BOOT_CLASS_PATH;
+    public static String BORDERED_COMPONENT_MORE_OR_LESS_BUTTON_TOOLTIP;
+    public static String CPU_USAGE;
+    public static String CPU_USAGE_FORMAT;
+    public static String CANCEL;
+    public static String CASCADE;
+    public static String CHART_COLON;
+    public static String CLASS_PATH;
+    public static String CLASS_NAME;
+    public static String CLASS_TAB_INFO_LABEL_FORMAT;
+    public static String CLASS_TAB_LOADED_CLASSES_PLOTTER_ACCESSIBLE_NAME;
+    public static String CLASSES;
+    public static String CLOSE;
+    public static String COLUMN_NAME;
+    public static String COLUMN_PID;
+    public static String COMMITTED_MEMORY;
+    public static String COMMITTED_VIRTUAL_MEMORY;
+    public static String COMMITTED;
+    public static String CONNECT;
+    public static String CONNECT_DIALOG_CONNECT_BUTTON_TOOLTIP;
+    public static String CONNECT_DIALOG_ACCESSIBLE_DESCRIPTION;
+    public static String CONNECT_DIALOG_MASTHEAD_ACCESSIBLE_NAME;
+    public static String CONNECT_DIALOG_MASTHEAD_TITLE;
+    public static String CONNECT_DIALOG_STATUS_BAR_ACCESSIBLE_NAME;
+    public static String CONNECT_DIALOG_TITLE;
+    public static String CONNECTED_PUNCTUATION_CLICK_TO_DISCONNECT_;
+    public static String CONNECTION_FAILED;
+    public static String CONNECTION;
+    public static String CONNECTION_NAME;
+    public static String CONNECTION_NAME__DISCONNECTED_;
+    public static String CONSTRUCTOR;
+    public static String CURRENT_CLASSES_LOADED;
+    public static String CURRENT_HEAP_SIZE;
+    public static String CURRENT_VALUE;
+    public static String CREATE;
+    public static String DAEMON_THREADS;
+    public static String DISCONNECTED_PUNCTUATION_CLICK_TO_CONNECT_;
+    public static String DOUBLE_CLICK_TO_EXPAND_FORWARD_SLASH_COLLAPSE;
+    public static String DOUBLE_CLICK_TO_VISUALIZE;
+    public static String DESCRIPTION;
+    public static String DESCRIPTOR;
+    public static String DETAILS;
+    public static String DETECT_DEADLOCK;
+    public static String DETECT_DEADLOCK_TOOLTIP;
+    public static String DIMENSION_IS_NOT_SUPPORTED_COLON;
+    public static String DISCARD_CHART;
+    public static String DURATION_DAYS_HOURS_MINUTES;
+    public static String DURATION_HOURS_MINUTES;
+    public static String DURATION_MINUTES;
+    public static String DURATION_SECONDS;
+    public static String EMPTY_ARRAY;
+    public static String ERROR;
+    public static String ERROR_COLON_MBEANS_ALREADY_EXIST;
+    public static String ERROR_COLON_MBEANS_DO_NOT_EXIST;
+    public static String EVENT;
+    public static String EXIT;
+    public static String FAIL_TO_LOAD_PLUGIN;
+    public static String FILE_CHOOSER_FILE_EXISTS_CANCEL_OPTION;
+    public static String FILE_CHOOSER_FILE_EXISTS_MESSAGE;
+    public static String FILE_CHOOSER_FILE_EXISTS_OK_OPTION;
+    public static String FILE_CHOOSER_FILE_EXISTS_TITLE;
+    public static String FILE_CHOOSER_SAVED_FILE;
+    public static String FILE_CHOOSER_SAVE_FAILED_MESSAGE;
+    public static String FILE_CHOOSER_SAVE_FAILED_TITLE;
+    public static String FREE_PHYSICAL_MEMORY;
+    public static String FREE_SWAP_SPACE;
+    public static String GARBAGE_COLLECTOR;
+    public static String GC_INFO;
+    public static String GC_TIME;
+    public static String GC_TIME_DETAILS;
+    public static String HEAP_MEMORY_USAGE;
+    public static String HEAP;
+    public static String HELP_ABOUT_DIALOG_ACCESSIBLE_DESCRIPTION;
+    public static String HELP_ABOUT_DIALOG_JCONSOLE_VERSION;
+    public static String HELP_ABOUT_DIALOG_JAVA_VERSION;
+    public static String HELP_ABOUT_DIALOG_MASTHEAD_ACCESSIBLE_NAME;
+    public static String HELP_ABOUT_DIALOG_MASTHEAD_TITLE;
+    public static String HELP_ABOUT_DIALOG_TITLE;
+    public static String HELP_ABOUT_DIALOG_USER_GUIDE_LINK;
+    public static String HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL;
+    public static String HELP_MENU_ABOUT_TITLE;
+    public static String HELP_MENU_USER_GUIDE_TITLE;
+    public static String HELP_MENU_TITLE;
+    public static String HOTSPOT_MBEANS_ELLIPSIS;
+    public static String HOTSPOT_MBEANS_DIALOG_ACCESSIBLE_DESCRIPTION;
+    public static String IMPACT;
+    public static String INFO;
+    public static String INFO_CAPITALIZED;
+    public static String INVALID_PLUGIN_PATH;
+    public static String INVALID_URL;
+    public static String IS;
+    public static String JAVA_MONITORING___MANAGEMENT_CONSOLE;
+    public static String JCONSOLE_COLON_;
+    public static String JCONSOLE_VERSION; // in version template
+    public static String JCONSOLE_ACCESSIBLE_DESCRIPTION;
+    public static String JIT_COMPILER;
+    public static String LIBRARY_PATH;
+    public static String LIVE_THREADS;
+    public static String LOADED;
+    public static String LOCAL_PROCESS_COLON;
+    public static String MASTHEAD_FONT;
+    public static String MANAGEMENT_NOT_ENABLED;
+    public static String MANAGEMENT_WILL_BE_ENABLED;
+    public static String MBEAN_ATTRIBUTE_INFO;
+    public static String MBEAN_INFO;
+    public static String MBEAN_NOTIFICATION_INFO;
+    public static String MBEAN_OPERATION_INFO;
+    public static String MBEANS;
+    public static String MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON;
+    public static String MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON_TOOLTIP;
+    public static String MBEANS_TAB_COMPOSITE_NAVIGATION_MULTIPLE;
+    public static String MBEANS_TAB_COMPOSITE_NAVIGATION_SINGLE;
+    public static String MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON;
+    public static String MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON_TOOLTIP;
+    public static String MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON;
+    public static String MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON_TOOLTIP;
+    public static String MBEANS_TAB_TABULAR_NAVIGATION_MULTIPLE;
+    public static String MBEANS_TAB_TABULAR_NAVIGATION_SINGLE;
+    public static String MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON;
+    public static String MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON_TOOLTIP;
+    public static String MANAGE_HOTSPOT_MBEANS_IN_COLON_;
+    public static String MAX;
+    public static String MAXIMUM_HEAP_SIZE;
+    public static String MEMORY;
+    public static String MEMORY_POOL_LABEL;
+    public static String MEMORY_TAB_HEAP_PLOTTER_ACCESSIBLE_NAME;
+    public static String MEMORY_TAB_INFO_LABEL_FORMAT;
+    public static String MEMORY_TAB_NON_HEAP_PLOTTER_ACCESSIBLE_NAME;
+    public static String MEMORY_TAB_POOL_CHART_ABOVE_THRESHOLD;
+    public static String MEMORY_TAB_POOL_CHART_ACCESSIBLE_NAME;
+    public static String MEMORY_TAB_POOL_CHART_BELOW_THRESHOLD;
+    public static String MEMORY_TAB_POOL_PLOTTER_ACCESSIBLE_NAME;
+    public static String MESSAGE;
+    public static String METHOD_SUCCESSFULLY_INVOKED;
+    public static String MINIMIZE_ALL;
+    public static String MONITOR_LOCKED;
+    public static String NAME;
+    public static String NAME_STATE;
+    public static String NAME_STATE_LOCK_NAME;
+    public static String NAME_STATE_LOCK_NAME_LOCK_OWNER;
+    public static String NAME_AND_BUILD;// in version template
+    public static String NEW_CONNECTION_ELLIPSIS;
+    public static String NO_DEADLOCK_DETECTED;
+    public static String NON_HEAP_MEMORY_USAGE;
+    public static String NON_HEAP;
+    public static String NOTIFICATION;
+    public static String NOTIFICATION_BUFFER;
+    public static String NOTIFICATIONS;
+    public static String NOTIF_TYPES;
+    public static String NUMBER_OF_THREADS;
+    public static String NUMBER_OF_LOADED_CLASSES;
+    public static String NUMBER_OF_PROCESSORS;
+    public static String OBJECT_NAME;
+    public static String OPERATING_SYSTEM;
+    public static String OPERATION;
+    public static String OPERATION_INVOCATION;
+    public static String OPERATION_RETURN_VALUE;
+    public static String OPERATIONS;
+    public static String OVERVIEW;
+    public static String OVERVIEW_PANEL_PLOTTER_ACCESSIBLE_NAME;
+    public static String PARAMETER;
+    public static String PASSWORD_COLON_;
+    public static String PASSWORD_ACCESSIBLE_NAME;
+    public static String PEAK;
+    public static String PERFORM_GC;
+    public static String PERFORM_GC_TOOLTIP;
+    public static String PLOTTER_ACCESSIBLE_NAME;
+    public static String PLOTTER_ACCESSIBLE_NAME_KEY_AND_VALUE;
+    public static String PLOTTER_ACCESSIBLE_NAME_NO_DATA;
+    public static String PLOTTER_SAVE_AS_MENU_ITEM;
+    public static String PLOTTER_TIME_RANGE_MENU;
+    public static String PROBLEM_ADDING_LISTENER;
+    public static String PROBLEM_DISPLAYING_MBEAN;
+    public static String PROBLEM_INVOKING;
+    public static String PROBLEM_REMOVING_LISTENER;
+    public static String PROBLEM_SETTING_ATTRIBUTE;
+    public static String PROCESS_CPU_TIME;
+    public static String READABLE;
+    public static String RECONNECT;
+    public static String REMOTE_PROCESS_COLON;
+    public static String REMOTE_PROCESS_TEXT_FIELD_ACCESSIBLE_NAME;
+    public static String RESTORE_ALL;
+    public static String RETURN_TYPE;
+    public static String SEQ_NUM;
+    public static String SIZE_BYTES;
+    public static String SIZE_GB;
+    public static String SIZE_KB;
+    public static String SIZE_MB;
+    public static String SOURCE;
+    public static String STACK_TRACE;
+    public static String SUMMARY_TAB_HEADER_DATE_TIME_FORMAT;
+    public static String SUMMARY_TAB_PENDING_FINALIZATION_LABEL;
+    public static String SUMMARY_TAB_PENDING_FINALIZATION_VALUE;
+    public static String SUMMARY_TAB_TAB_NAME;
+    public static String SUMMARY_TAB_VM_VERSION;
+    public static String THREADS;
+    public static String THREAD_TAB_THREAD_INFO_ACCESSIBLE_NAME;
+    public static String THREAD_TAB_THREAD_PLOTTER_ACCESSIBLE_NAME;
+    public static String THRESHOLD;
+    public static String TILE;
+    public static String TIME_RANGE_COLON;
+    public static String TIME;
+    public static String TIME_STAMP;
+    public static String TOTAL_LOADED;
+    public static String TOTAL_CLASSES_LOADED;
+    public static String TOTAL_CLASSES_UNLOADED;
+    public static String TOTAL_COMPILE_TIME;
+    public static String TOTAL_PHYSICAL_MEMORY;
+    public static String TOTAL_THREADS_STARTED;
+    public static String TOTAL_SWAP_SPACE;
+    public static String TYPE;
+    public static String UNAVAILABLE;
+    public static String UNKNOWN_CAPITALIZED;
+    public static String UNKNOWN_HOST;
+    public static String UNREGISTER;
+    public static String UPTIME;
+    public static String USAGE_THRESHOLD;
+    public static String REMOTE_TF_USAGE;
+    public static String USED;
+    public static String USERNAME_COLON_;
+    public static String USERNAME_ACCESSIBLE_NAME;
+    public static String USER_DATA;
+    public static String VIRTUAL_MACHINE;
+    public static String VM_ARGUMENTS;
+    public static String VMINTERNAL_FRAME_ACCESSIBLE_DESCRIPTION;
+    public static String VALUE;
+    public static String VENDOR;
+    public static String VERBOSE_OUTPUT;
+    public static String VERBOSE_OUTPUT_TOOLTIP;
+    public static String VIEW;
+    public static String WINDOW;
+    public static String WINDOWS;
+    public static String WRITABLE;
+    public static String CONNECTION_FAILED1;
+    public static String CONNECTION_FAILED2;
+    public static String CONNECTION_LOST1;
+    public static String CONNECTING_TO1;
+    public static String CONNECTING_TO2;
+    public static String DEADLOCK_TAB;
+    public static String DEADLOCK_TAB_N;
+    public static String EXPAND;
+    public static String KBYTES;
+    public static String PLOT;
+    public static String VISUALIZE;
+    public static String ZZ_USAGE_TEXT;
+}
diff --git a/src/share/classes/sun/tools/jconsole/OverviewPanel.java b/src/share/classes/sun/tools/jconsole/OverviewPanel.java
index 4603b97..269dbd2 100644
--- a/src/share/classes/sun/tools/jconsole/OverviewPanel.java
+++ b/src/share/classes/sun/tools/jconsole/OverviewPanel.java
@@ -26,14 +26,12 @@
 package sun.tools.jconsole;
 
 import java.awt.*;
-import java.awt.event.*;
 
 import javax.swing.*;
-import javax.swing.border.*;
+
 
 import static javax.swing.SwingConstants.*;
 import static sun.tools.jconsole.JConsole.*;
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 
@@ -68,7 +66,7 @@
             }
             plotter.createSequence(plotterKey, plotterName, PLOTTER_COLOR, true);
             setAccessibleName(plotter,
-                              getText("OverviewPanel.plotter.accessibleName",
+                              Resources.format(Messages.OVERVIEW_PANEL_PLOTTER_ACCESSIBLE_NAME,
                                       title));
             setPlotter(plotter);
         }
diff --git a/src/share/classes/sun/tools/jconsole/OverviewTab.java b/src/share/classes/sun/tools/jconsole/OverviewTab.java
index 74a14ec..3b89f6e 100644
--- a/src/share/classes/sun/tools/jconsole/OverviewTab.java
+++ b/src/share/classes/sun/tools/jconsole/OverviewTab.java
@@ -26,15 +26,11 @@
 package sun.tools.jconsole;
 
 import java.awt.*;
-import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
 
 import javax.swing.*;
 import javax.swing.border.*;
 
-import static sun.tools.jconsole.JConsole.*;
-import static sun.tools.jconsole.Resources.*;
-
 
 @SuppressWarnings("serial")
 class OverviewTab extends Tab {
@@ -42,7 +38,7 @@
     TimeComboBox timeComboBox;
 
     public static String getTabName() {
-        return getText("Overview");
+        return Messages.OVERVIEW;
     }
 
     public OverviewTab(VMPanel vmPanel) {
@@ -58,8 +54,8 @@
         topPanel.add(controlPanel, BorderLayout.CENTER);
 
         timeComboBox = new TimeComboBox();
-        LabeledComponent lc = new LabeledComponent(Resources.getText("Time Range:"),
-                                                   getMnemonicInt("Time Range:"),
+        LabeledComponent lc = new LabeledComponent(Messages.TIME_RANGE_COLON,
+                                                   Resources.getMnemonicInt(Messages.TIME_RANGE_COLON),
                                                    timeComboBox);
         controlPanel.add(lc);
 
diff --git a/src/share/classes/sun/tools/jconsole/Plotter.java b/src/share/classes/sun/tools/jconsole/Plotter.java
index 351187e..a9dbece 100644
--- a/src/share/classes/sun/tools/jconsole/Plotter.java
+++ b/src/share/classes/sun/tools/jconsole/Plotter.java
@@ -38,14 +38,11 @@
 import javax.swing.filechooser.*;
 import javax.swing.filechooser.FileFilter;
 
-import com.sun.tools.jconsole.JConsoleContext;
 
-import static com.sun.tools.jconsole.JConsoleContext.ConnectionState.*;
+import com.sun.tools.jconsole.JConsoleContext;
 
 import static sun.tools.jconsole.Formatter.*;
 import static sun.tools.jconsole.ProxyClient.*;
-import static sun.tools.jconsole.Resources.*;
-import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
 public class Plotter extends JComponent
@@ -56,22 +53,22 @@
     }
 
     static final String[] rangeNames = {
-        Resources.getText(" 1 min"),
-        Resources.getText(" 5 min"),
-        Resources.getText("10 min"),
-        Resources.getText("30 min"),
-        Resources.getText(" 1 hour"),
-        Resources.getText(" 2 hours"),
-        Resources.getText(" 3 hours"),
-        Resources.getText(" 6 hours"),
-        Resources.getText("12 hours"),
-        Resources.getText(" 1 day"),
-        Resources.getText(" 7 days"),
-        Resources.getText(" 1 month"),
-        Resources.getText(" 3 months"),
-        Resources.getText(" 6 months"),
-        Resources.getText(" 1 year"),
-        Resources.getText("All")
+        Messages.ONE_MIN,
+        Messages.FIVE_MIN,
+        Messages.TEN_MIN,
+        Messages.THIRTY_MIN,
+        Messages.ONE_HOUR,
+        Messages.TWO_HOURS,
+        Messages.THREE_HOURS,
+        Messages.SIX_HOURS,
+        Messages.TWELVE_HOURS,
+        Messages.ONE_DAY,
+        Messages.SEVEN_DAYS,
+        Messages.ONE_MONTH,
+        Messages.THREE_MONTHS,
+        Messages.SIX_MONTHS,
+        Messages.ONE_YEAR,
+        Messages.ALL
     };
 
     static final int[] rangeValues = {
@@ -247,9 +244,9 @@
     @Override
     public JPopupMenu getComponentPopupMenu() {
         if (popupMenu == null) {
-            popupMenu = new JPopupMenu(Resources.getText("Chart:"));
-            timeRangeMenu = new JMenu(Resources.getText("Plotter.timeRangeMenu"));
-            timeRangeMenu.setMnemonic(getMnemonicInt("Plotter.timeRangeMenu"));
+            popupMenu = new JPopupMenu(Messages.CHART_COLON);
+            timeRangeMenu = new JMenu(Messages.PLOTTER_TIME_RANGE_MENU);
+            timeRangeMenu.setMnemonic(Resources.getMnemonicInt(Messages.PLOTTER_TIME_RANGE_MENU));
             popupMenu.add(timeRangeMenu);
             menuRBs = new JRadioButtonMenuItem[rangeNames.length];
             ButtonGroup rbGroup = new ButtonGroup();
@@ -265,8 +262,8 @@
 
             popupMenu.addSeparator();
 
-            saveAsMI = new JMenuItem(getText("Plotter.saveAsMenuItem"));
-            saveAsMI.setMnemonic(getMnemonicInt("Plotter.saveAsMenuItem"));
+            saveAsMI = new JMenuItem(Messages.PLOTTER_SAVE_AS_MENU_ITEM);
+            saveAsMI.setMnemonic(Resources.getMnemonicInt(Messages.PLOTTER_SAVE_AS_MENU_ITEM));
             saveAsMI.addActionListener(this);
             popupMenu.add(saveAsMI);
         }
@@ -318,9 +315,9 @@
 
             out.close();
             JOptionPane.showMessageDialog(this,
-                                          getText("FileChooser.savedFile",
-                                                  file.getAbsolutePath(),
-                                                  file.length()));
+                                          Resources.format(Messages.FILE_CHOOSER_SAVED_FILE,
+                                                           file.getAbsolutePath(),
+                                                           file.length()));
         } catch (IOException ex) {
             String msg = ex.getLocalizedMessage();
             String path = file.getAbsolutePath();
@@ -328,9 +325,10 @@
                 msg = msg.substring(path.length()).trim();
             }
             JOptionPane.showMessageDialog(this,
-                                          getText("FileChooser.saveFailed.message",
-                                                  path, msg),
-                                          getText("FileChooser.saveFailed.title"),
+                                          Resources.format(Messages.FILE_CHOOSER_SAVE_FAILED_MESSAGE,
+                                                           path,
+                                                           msg),
+                                          Messages.FILE_CHOOSER_SAVE_FAILED_TITLE,
                                           JOptionPane.ERROR_MESSAGE);
         }
     }
@@ -1020,13 +1018,13 @@
                 }
 
                 if (file.exists()) {
-                    String okStr = getText("FileChooser.fileExists.okOption");
-                    String cancelStr = getText("FileChooser.fileExists.cancelOption");
+                    String okStr = Messages.FILE_CHOOSER_FILE_EXISTS_OK_OPTION;
+                    String cancelStr = Messages.FILE_CHOOSER_FILE_EXISTS_CANCEL_OPTION;
                     int ret =
                         JOptionPane.showOptionDialog(this,
-                                                     getText("FileChooser.fileExists.message",
-                                                             file.getName()),
-                                                     getText("FileChooser.fileExists.title"),
+                                                     Resources.format(Messages.FILE_CHOOSER_FILE_EXISTS_MESSAGE,
+                                                                      file.getName()),
+                                                     Messages.FILE_CHOOSER_FILE_EXISTS_TITLE,
                                                      JOptionPane.OK_CANCEL_OPTION,
                                                      JOptionPane.WARNING_MESSAGE,
                                                      null,
@@ -1053,7 +1051,7 @@
     protected class AccessiblePlotter extends AccessibleJComponent {
         private static final long serialVersionUID = -3847205410473510922L;
         protected AccessiblePlotter() {
-            setAccessibleName(getText("Plotter.accessibleName"));
+            setAccessibleName(Messages.PLOTTER_ACCESSIBLE_NAME);
         }
 
         @Override
@@ -1067,7 +1065,7 @@
                         String value = "null";
                         if (seq.size > 0) {
                             if (unit == Unit.BYTES) {
-                                value = getText("Size Bytes", seq.value(seq.size - 1));
+                                value = Resources.format(Messages.SIZE_BYTES, seq.value(seq.size - 1));
                             } else {
                                 value =
                                     getFormattedValue(seq.value(seq.size - 1), false) +
@@ -1076,13 +1074,13 @@
                         }
                         // Assume format string ends with newline
                         keyValueList +=
-                            getText("Plotter.accessibleName.keyAndValue",
+                            Resources.format(Messages.PLOTTER_ACCESSIBLE_NAME_KEY_AND_VALUE,
                                     seq.key, value);
                     }
                 }
                 name += "\n" + keyValueList + ".";
             } else {
-                name += "\n" + getText("Plotter.accessibleName.noData");
+                name += "\n" + Messages.PLOTTER_ACCESSIBLE_NAME_NO_DATA;
             }
             return name;
         }
diff --git a/src/share/classes/sun/tools/jconsole/PlotterPanel.java b/src/share/classes/sun/tools/jconsole/PlotterPanel.java
index f9cc125..da6b2cc 100644
--- a/src/share/classes/sun/tools/jconsole/PlotterPanel.java
+++ b/src/share/classes/sun/tools/jconsole/PlotterPanel.java
@@ -25,7 +25,6 @@
 
 package sun.tools.jconsole;
 
-import java.awt.*;
 import java.awt.event.*;
 
 import javax.accessibility.*;
diff --git a/src/share/classes/sun/tools/jconsole/ProxyClient.java b/src/share/classes/sun/tools/jconsole/ProxyClient.java
index 6e129fd..d98d489 100644
--- a/src/share/classes/sun/tools/jconsole/ProxyClient.java
+++ b/src/share/classes/sun/tools/jconsole/ProxyClient.java
@@ -27,7 +27,6 @@
 
 import com.sun.management.HotSpotDiagnosticMXBean;
 import com.sun.tools.jconsole.JConsoleContext;
-import com.sun.tools.jconsole.JConsoleContext.ConnectionState;
 import java.beans.PropertyChangeListener;
 import java.beans.PropertyChangeEvent;
 import java.io.IOException;
@@ -504,7 +503,7 @@
 
     public String toString() {
         if (!isConnected()) {
-            return Resources.getText("ConnectionName (disconnected)", displayName);
+            return Resources.format(Messages.CONNECTION_NAME__DISCONNECTED_, displayName);
         } else {
             return displayName;
         }
@@ -595,10 +594,10 @@
                 assert(false);
             }
         }
-        Set mbeans = server.queryNames(name, null);
+        Set<ObjectName> mbeans = server.queryNames(name, null);
         Map<ObjectName,MBeanInfo> result =
             new HashMap<ObjectName,MBeanInfo>(mbeans.size());
-        Iterator iterator = mbeans.iterator();
+        Iterator<ObjectName> iterator = mbeans.iterator();
         while (iterator.hasNext()) {
             Object object = iterator.next();
             if (object instanceof ObjectName) {
@@ -704,10 +703,10 @@
                 // should not reach here
                 assert(false);
             }
-            Set mbeans = server.queryNames(poolName, null);
+            Set<ObjectName> mbeans = server.queryNames(poolName, null);
             if (mbeans != null) {
                 memoryPoolProxies = new ArrayList<MemoryPoolProxy>();
-                Iterator iterator = mbeans.iterator();
+                Iterator<ObjectName> iterator = mbeans.iterator();
                 while (iterator.hasNext()) {
                     ObjectName objName = (ObjectName) iterator.next();
                     MemoryPoolProxy p = new MemoryPoolProxy(this, objName);
@@ -730,10 +729,10 @@
                 // should not reach here
                 assert(false);
             }
-            Set mbeans = server.queryNames(gcName, null);
+            Set<ObjectName> mbeans = server.queryNames(gcName, null);
             if (mbeans != null) {
                 garbageCollectorMBeans = new ArrayList<GarbageCollectorMXBean>();
-                Iterator iterator = mbeans.iterator();
+                Iterator<ObjectName> iterator = mbeans.iterator();
                 while (iterator.hasNext()) {
                     ObjectName on = (ObjectName) iterator.next();
                     String name = GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE +
diff --git a/src/share/classes/sun/tools/jconsole/Resources.java b/src/share/classes/sun/tools/jconsole/Resources.java
index 26e768b..e7ced47 100644
--- a/src/share/classes/sun/tools/jconsole/Resources.java
+++ b/src/share/classes/sun/tools/jconsole/Resources.java
@@ -25,89 +25,185 @@
 
 package sun.tools.jconsole;
 
+import java.awt.event.KeyEvent;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
 import java.text.MessageFormat;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 
-import sun.tools.jconsole.resources.JConsoleResources;
-
 /**
- * Provides resource support for jconsole.
+ * Toolkit that provides resource support for JConsole.
  */
 public final class Resources {
+    private static Map<String, Integer> MNEMONIC_LOOKUP = Collections
+            .synchronizedMap(new HashMap<String, Integer>());
 
-    private static final Object lock = new Object();
-    private static JConsoleResources resources = null;
-    static {
+    private Resources() {
+        throw new AssertionError();
+    }
+
+    /**
+     * Convenience method for {@link MessageFormat#format(String, Object...)}.
+     *
+     * @param pattern the pattern
+     * @param objects the arguments for the pattern
+     *
+     * @return a formatted string
+     */
+    public static String format(String pattern, Object... arguments) {
+            return MessageFormat.format(pattern, arguments);
+    }
+
+    /**
+     * Returns the mnemonic for a message.
+     *
+     * @param message the message
+     *
+     * @return the mnemonic <code>int</code>
+     */
+    public static int getMnemonicInt(String message) {
+        Integer integer = MNEMONIC_LOOKUP.get(message);
+        if (integer != null) {
+            return integer.intValue();
+        }
+        return 0;
+    }
+
+    /**
+     * Initializes all non-final public static fields in the given class with
+     * messages from a {@link ResourceBundle}.
+     *
+     * @param clazz the class containing the fields
+     */
+    public static void initializeMessages(Class<?> clazz, String rbName) {
+        ResourceBundle rb = null;
         try {
-            resources =
-                (JConsoleResources)ResourceBundle.getBundle("sun.tools.jconsole.resources.JConsoleResources");
-        } catch (MissingResourceException e) {
-            // gracefully handle this later
+            rb = ResourceBundle.getBundle(rbName);
+        } catch (MissingResourceException mre) {
+            // fall through, handled later
+        }
+        for (Field field : clazz.getFields()) {
+            if (isWritableField(field)) {
+                String key = field.getName();
+                String message = getMessage(rb, key);
+                int mnemonicInt = findMnemonicInt(message);
+                message = removeMnemonicAmpersand(message);
+                message = replaceWithPlatformLineFeed(message);
+                setFieldValue(field, message);
+                MNEMONIC_LOOKUP.put(message, mnemonicInt);
+            }
         }
     }
 
-    private Resources() { throw new AssertionError(); }
-
-    /**
-     * Returns the text of the jconsole resource for the specified key
-     * formatted with the specified arguments.
-     *
-     */
-    public static String getText(String key, Object... args) {
-        String format = getString(key);
-        if (format == null) {
-            format = "missing resource key: key = \"" + key + "\", " +
-                "arguments = \"{0}\", \"{1}\", \"{2}\"";
-        }
-        return formatMessage(format, args);
-    }
-
-    static String formatMessage(String format, Object... args) {
-        String ss = null;
-        synchronized (lock) {
-            /*
-             * External synchronization required for safe use of
-             * java.text.MessageFormat:
-             */
-            ss = MessageFormat.format(format, args);
-        }
-        return ss;
+    private static boolean isWritableField(Field field) {
+        int modifiers = field.getModifiers();
+        return Modifier.isPublic(modifiers) && Modifier.isStatic(modifiers)
+                && !Modifier.isFinal(modifiers);
     }
 
     /**
-     * Returns the mnemonic keycode int of the jconsole resource for the specified key.
+     * Returns the message corresponding to the key in the bundle or a text
+     * describing it's missing.
      *
+     * @param rb the resource bundle
+     * @param key the key
+     *
+     * @return the message
      */
-    public static int getMnemonicInt(String key) {
-        int mnemonic = 0;
-        if (resources != null) {
-            Object obj = resources.getObject(key+".mnemonic");
-            if (obj instanceof Character) {
-                mnemonic = (int)(Character)obj;
-                if (mnemonic >= 'a' && mnemonic <='z') {
-                    mnemonic -= ('a' - 'A');
+    private static String getMessage(ResourceBundle rb, String key) {
+        if (rb == null) {
+            return "missing resource bundle";
+        }
+        try {
+            return rb.getString(key);
+        } catch (MissingResourceException mre) {
+            return "missing message for key = \"" + key
+                    + "\" in resource bundle ";
+        }
+    }
+
+    private static void setFieldValue(Field field, String value) {
+        try {
+            field.set(null, value);
+        } catch (IllegalArgumentException | IllegalAccessException e) {
+            throw new Error("Unable to access or set message for field " + field.getName());
+        }
+    }
+
+    /**
+     * Returns a {@link String} where all <code>\n</code> in the <text> have
+     * been replaced with the line separator for the platform.
+     *
+     * @param text the to be replaced
+     *
+     * @return the replaced text
+     */
+    private static String replaceWithPlatformLineFeed(String text) {
+        return text.replace("\n", System.getProperty("line.separator"));
+    }
+
+    /**
+     * Removes the mnemonic identifier (<code>&</code>) from a string unless
+     * it's escaped by <code>&&</code> or placed at the end.
+     *
+     * @param message the message
+     *
+     * @return a message with the mnemonic identifier removed
+     */
+    private static String removeMnemonicAmpersand(String message) {
+        StringBuilder s = new StringBuilder();
+        for (int i = 0; i < message.length(); i++) {
+            char current = message.charAt(i);
+            if (current != '&' || i == message.length() - 1
+                    || message.charAt(i + 1) == '&') {
+                s.append(current);
+            }
+        }
+        return s.toString();
+    }
+
+    /**
+     * Finds the mnemonic character in a message.
+     *
+     * The mnemonic character is the first character followed by the first
+     * <code>&</code> that is not followed by another <code>&</code>.
+     *
+     * @return the mnemonic as an <code>int</code>, or <code>0</code> if it
+     *         can't be found.
+     */
+    private static int findMnemonicInt(String s) {
+        for (int i = 0; i < s.length() - 1; i++) {
+            if (s.charAt(i) == '&') {
+                if (s.charAt(i + 1) != '&') {
+                    return lookupMnemonicInt(s.substring(i + 1, i + 2));
+                } else {
+                    i++;
                 }
-            } else if (obj instanceof Integer) {
-                mnemonic = (Integer)obj;
             }
         }
-        return mnemonic;
+        return 0;
     }
 
     /**
-     * Returns the jconsole resource string for the specified key.
+     * Lookups the mnemonic for a key in the {@link KeyEvent} class.
      *
+     * @param c the character to lookup
+     *
+     * @return the mnemonic as an <code>int</code>, or <code>0</code> if it
+     *         can't be found.
      */
-    private static String getString(String key) {
-        if (resources != null) {
-            try {
-                return resources.getString(key);
-            } catch (MissingResourceException e) {
-                return null;
-            }
+    private static int lookupMnemonicInt(String c) {
+        try {
+            return KeyEvent.class.getDeclaredField("VK_" + c.toUpperCase())
+                    .getInt(null);
+        } catch (IllegalArgumentException | IllegalAccessException
+                | NoSuchFieldException | SecurityException e) {
+            // Missing VK is okay
+            return 0;
         }
-        return "missing resource bundle: key = \"" + key + "\", " +
-            "arguments = \"{0}\", \"{1}\", \"{2}\"";
     }
 }
diff --git a/src/share/classes/sun/tools/jconsole/SummaryTab.java b/src/share/classes/sun/tools/jconsole/SummaryTab.java
index 5e1907f..e511100 100644
--- a/src/share/classes/sun/tools/jconsole/SummaryTab.java
+++ b/src/share/classes/sun/tools/jconsole/SummaryTab.java
@@ -29,24 +29,19 @@
 import java.io.*;
 import java.lang.management.*;
 import java.lang.reflect.*;
-import java.net.URL;
 import java.text.*;
 import java.util.*;
 import java.util.concurrent.*;
 
 import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.text.*;
+
 
 import static sun.tools.jconsole.Formatter.*;
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
 class SummaryTab extends Tab {
     private static final String cpuUsageKey = "cpu";
-    private static final String cpuUsageName = getText("CPU Usage");
-    private static final String cpuUsageFormat = "CPUUsageFormat";
 
     private static final String newDivider =   "<tr><td colspan=4><font size =-1><hr>";
     private static final String newTable =     "<tr><td colspan=4 align=left><table cellpadding=1>";
@@ -70,7 +65,7 @@
     }
 
     public static String getTabName() {
-        return Resources.getText("SummaryTab.tabName");
+        return Messages.SUMMARY_TAB_TAB_NAME;
     }
 
     public SummaryTab(VMPanel vmPanel) {
@@ -83,7 +78,7 @@
         add(new JScrollPane(info));
 
         headerDateTimeFormat =
-            getDateTimeFormat("SummaryTab.headerDateTimeFormat");
+            Formatter.getDateTimeFormat(Messages.SUMMARY_TAB_HEADER_DATE_TIME_FORMAT);
     }
 
     public SwingWorker<?, ?> newSwingWorker() {
@@ -138,7 +133,7 @@
                proxyClient.getSunOperatingSystemMXBean();
 
             append("<tr><td colspan=4>");
-            append("<center><b>" + getText("SummaryTab.tabName") + "</b></center>");
+            append("<center><b>" + Messages.SUMMARY_TAB_TAB_NAME + "</b></center>");
             String dateTime =
                 headerDateTimeFormat.format(System.currentTimeMillis());
             append("<center>" + dateTime + "</center>");
@@ -147,30 +142,30 @@
 
             {  // VM info
                 append(newLeftTable);
-                append("Connection name", vmPanel.getDisplayName());
-                append("Virtual Machine",
-                       getText("SummaryTab.vmVersion",
-                               rmBean.getVmName(), rmBean.getVmVersion()));
-                append("Vendor", rmBean.getVmVendor());
-                append("Name", rmBean.getName());
+                append(Messages.CONNECTION_NAME, vmPanel.getDisplayName());
+                append(Messages.VIRTUAL_MACHINE,
+                       Resources.format(Messages.SUMMARY_TAB_VM_VERSION,
+                                        rmBean.getVmName(), rmBean.getVmVersion()));
+                append(Messages.VENDOR, rmBean.getVmVendor());
+                append(Messages.NAME, rmBean.getName());
                 append(endTable);
 
                 append(newRightTable);
                 result.upTime = rmBean.getUptime();
-                append("Uptime", formatTime(result.upTime));
+                append(Messages.UPTIME, formatTime(result.upTime));
                 if (sunOSMBean != null) {
                     result.processCpuTime = sunOSMBean.getProcessCpuTime();
-                    append("Process CPU time", formatNanoTime(result.processCpuTime));
+                    append(Messages.PROCESS_CPU_TIME, formatNanoTime(result.processCpuTime));
                 }
 
                 if (cmpMBean != null) {
-                    append("JIT compiler", cmpMBean.getName());
-                    append("Total compile time",
+                    append(Messages.JIT_COMPILER, cmpMBean.getName());
+                    append(Messages.TOTAL_COMPILE_TIME,
                            cmpMBean.isCompilationTimeMonitoringSupported()
                                     ? formatTime(cmpMBean.getTotalCompilationTime())
-                                    : getText("Unavailable"));
+                                    : Messages.UNAVAILABLE);
                 } else {
-                    append("JIT compiler", getText("Unavailable"));
+                    append(Messages.JIT_COMPILER, Messages.UNAVAILABLE);
                 }
                 append(endTable);
             }
@@ -185,10 +180,10 @@
                 long ttCount = tmBean.getTotalStartedThreadCount();
                 String[] strings1 = formatLongs(tlCount, tpCount,
                                                 tdCount, ttCount);
-                append("Live Threads",          strings1[0]);
-                append("Peak",                  strings1[1]);
-                append("Daemon threads",        strings1[2]);
-                append("Total threads started", strings1[3]);
+                append(Messages.LIVE_THREADS, strings1[0]);
+                append(Messages.PEAK, strings1[1]);
+                append(Messages.DAEMON_THREADS, strings1[2]);
+                append(Messages.TOTAL_THREADS_STARTED, strings1[3]);
                 append(endTable);
 
                 append(newRightTable);
@@ -196,9 +191,9 @@
                 long cuCount = clMBean.getUnloadedClassCount();
                 long ctCount = clMBean.getTotalLoadedClassCount();
                 String[] strings2 = formatLongs(clCount, cuCount, ctCount);
-                append("Current classes loaded", strings2[0]);
-                append("Total classes loaded",   strings2[2]);
-                append("Total classes unloaded", strings2[1]);
+                append(Messages.CURRENT_CLASSES_LOADED, strings2[0]);
+                append(Messages.TOTAL_CLASSES_LOADED, strings2[2]);
+                append(Messages.TOTAL_CLASSES_UNLOADED, strings2[1]);
                 append(null, "");
                 append(endTable);
             }
@@ -210,16 +205,16 @@
 
                 append(newLeftTable);
                 String[] strings1 = formatKByteStrings(u.getUsed(), u.getMax());
-                append("Current heap size", strings1[0]);
-                append("Maximum heap size", strings1[1]);
+                append(Messages.CURRENT_HEAP_SIZE, strings1[0]);
+                append(Messages.MAXIMUM_HEAP_SIZE, strings1[1]);
                 append(endTable);
 
                 append(newRightTable);
                 String[] strings2 = formatKByteStrings(u.getCommitted());
-                append("Committed memory",  strings2[0]);
-                append("SummaryTab.pendingFinalization.label",
-                       getText("SummaryTab.pendingFinalization.value",
-                               memoryBean.getObjectPendingFinalizationCount()));
+                append(Messages.COMMITTED_MEMORY,  strings2[0]);
+                append(Messages.SUMMARY_TAB_PENDING_FINALIZATION_LABEL,
+                       Messages.SUMMARY_TAB_PENDING_FINALIZATION_VALUE,
+                       memoryBean.getObjectPendingFinalizationCount());
                 append(endTable);
 
                 append(newTable);
@@ -230,10 +225,10 @@
                     long gcCount = garbageCollectorMBean.getCollectionCount();
                     long gcTime = garbageCollectorMBean.getCollectionTime();
 
-                    append("Garbage collector",
-                           getText("GcInfo", gcName, gcCount,
-                                   (gcTime >= 0) ? formatTime(gcTime)
-                                                 : getText("Unavailable")),
+                    append(Messages.GARBAGE_COLLECTOR,
+                           Resources.format(Messages.GC_INFO, gcName, gcCount,
+                                            (gcTime >= 0) ? formatTime(gcTime)
+                                                 : Messages.UNAVAILABLE),
                            4);
                 }
                 append(endTable);
@@ -247,9 +242,9 @@
                 String osVersion = osMBean.getVersion();
                 String osArch = osMBean.getArch();
                 result.nCPUs = osMBean.getAvailableProcessors();
-                append("Operating System", osName + " " + osVersion);
-                append("Architecture", osArch);
-                append("Number of processors", result.nCPUs+"");
+                append(Messages.OPERATING_SYSTEM, osName + " " + osVersion);
+                append(Messages.ARCHITECTURE, osArch);
+                append(Messages.NUMBER_OF_PROCESSORS, result.nCPUs+"");
 
                 if (pathSeparator == null) {
                     // Must use separator of remote OS, not File.pathSeparator
@@ -268,14 +263,14 @@
                                            sunOSMBean.getTotalSwapSpaceSize(),
                                            sunOSMBean.getFreeSwapSpaceSize());
 
-                    append("Committed virtual memory", kbStrings1[0]);
+                    append(Messages.COMMITTED_VIRTUAL_MEMORY, kbStrings1[0]);
                     append(endTable);
 
                     append(newRightTable);
-                    append("Total physical memory", kbStrings2[0]);
-                    append("Free physical memory",  kbStrings2[1]);
-                    append("Total swap space",      kbStrings2[2]);
-                    append("Free swap space",       kbStrings2[3]);
+                    append(Messages.TOTAL_PHYSICAL_MEMORY, kbStrings2[0]);
+                    append(Messages.FREE_PHYSICAL_MEMORY,  kbStrings2[1]);
+                    append(Messages.TOTAL_SWAP_SPACE,      kbStrings2[2]);
+                    append(Messages.FREE_SWAP_SPACE,       kbStrings2[3]);
                 }
 
                 append(endTable);
@@ -290,13 +285,13 @@
                 for (String arg : inputArguments) {
                     args += arg + " ";
                 }
-                append("VM arguments", args, 4);
-                append("Class path",   rmBean.getClassPath(), 4);
-                append("Library path", rmBean.getLibraryPath(), 4);
-                append("Boot class path",
+                append(Messages.VM_ARGUMENTS, args, 4);
+                append(Messages.CLASS_PATH,   rmBean.getClassPath(), 4);
+                append(Messages.LIBRARY_PATH, rmBean.getLibraryPath(), 4);
+                append(Messages.BOOT_CLASS_PATH,
                        rmBean.isBootClassPathSupported()
                                     ? rmBean.getBootClassPath()
-                                    : getText("Unavailable"),
+                                    : Messages.UNAVAILABLE,
                        4);
                 append(endTable);
             }
@@ -327,7 +322,7 @@
     }
 
     void append(String label, String value) {
-        append(newRow((label != null) ? getText(label) : label, value));
+        append(newRow(label, value));
     }
 
     private void append(String label, String value, int columnPerRow) {
@@ -335,13 +330,7 @@
             value = value.replace(pathSeparator,
                                   "<b></b>" + pathSeparator);
         }
-        append(newRow(getText(label), value, columnPerRow));
-    }
-
-    void append(String label1, String value1,
-                String label2, String value2) {
-        append(newRow(getText(label1), value1,
-                      getText(label2), value2));
+        append(newRow(label, value, columnPerRow));
     }
 
     OverviewPanel[] getOverviewPanels() {
@@ -355,7 +344,7 @@
         private long prevUpTime, prevProcessCpuTime;
 
         CPUOverviewPanel() {
-            super(getText("CPU Usage"), cpuUsageKey, cpuUsageName, Plotter.Unit.PERCENT);
+            super(Messages.CPU_USAGE, cpuUsageKey, Messages.CPU_USAGE, Plotter.Unit.PERCENT);
             getPlotter().setDecimals(CPU_DECIMALS);
         }
 
@@ -373,14 +362,11 @@
 
                 getPlotter().addValues(result.timeStamp,
                                 Math.round(cpuUsage * Math.pow(10.0, CPU_DECIMALS)));
-                getInfoLabel().setText(getText(cpuUsageFormat,
+                getInfoLabel().setText(Resources.format(Messages.CPU_USAGE_FORMAT,
                                                String.format("%."+CPU_DECIMALS+"f", cpuUsage)));
             }
             this.prevUpTime = result.upTime;
             this.prevProcessCpuTime = result.processCpuTime;
         }
     }
-
-
-
 }
diff --git a/src/share/classes/sun/tools/jconsole/Tab.java b/src/share/classes/sun/tools/jconsole/Tab.java
index 32ac8d6..512cc6b 100644
--- a/src/share/classes/sun/tools/jconsole/Tab.java
+++ b/src/share/classes/sun/tools/jconsole/Tab.java
@@ -26,9 +26,6 @@
 package sun.tools.jconsole;
 
 import java.awt.*;
-import java.awt.event.*;
-import java.beans.*;
-
 import javax.swing.*;
 
 public abstract class Tab extends JPanel {
diff --git a/src/share/classes/sun/tools/jconsole/ThreadTab.java b/src/share/classes/sun/tools/jconsole/ThreadTab.java
index 16a461c..d1cb677 100644
--- a/src/share/classes/sun/tools/jconsole/ThreadTab.java
+++ b/src/share/classes/sun/tools/jconsole/ThreadTab.java
@@ -35,14 +35,11 @@
 import javax.swing.border.*;
 import javax.swing.event.*;
 
+
 import java.util.*;
 import java.util.concurrent.*;
 import java.util.List;
 
-import sun.awt.*;
-
-import static sun.tools.jconsole.OverviewPanel.*;
-import static sun.tools.jconsole.Resources.*;
 import static sun.tools.jconsole.Utilities.*;
 
 
@@ -51,7 +48,7 @@
     PlotterPanel threadMeter;
     TimeComboBox timeComboBox;
     JTabbedPane threadListTabbedPane;
-    DefaultListModel listModel;
+    DefaultListModel<Long> listModel;
     JTextField filterTF;
     JLabel messageLabel;
     JSplitPane threadsSplitPane;
@@ -64,9 +61,6 @@
     private static final String threadCountKey   = "threadCount";
     private static final String peakKey          = "peak";
 
-    private static final String threadCountName   = Resources.getText("Live Threads");
-    private static final String peakName          = Resources.getText("Peak");
-
     private static final Color  threadCountColor = Plotter.defaultColor;
     private static final Color  peakColor        = Color.red;
 
@@ -93,7 +87,7 @@
 
 
     public static String getTabName() {
-        return Resources.getText("Threads");
+        return Messages.THREADS;
     }
 
     public ThreadTab(VMPanel vmPanel) {
@@ -111,28 +105,28 @@
         JPanel controlPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 20, 5));
         topPanel.add(controlPanel, BorderLayout.CENTER);
 
-        threadMeter = new PlotterPanel(Resources.getText("Number of Threads"),
+        threadMeter = new PlotterPanel(Messages.NUMBER_OF_THREADS,
                                        Plotter.Unit.NONE, true);
-        threadMeter.plotter.createSequence(threadCountKey, threadCountName,  threadCountColor, true);
-        threadMeter.plotter.createSequence(peakKey,        peakName,         peakColor,        true);
+        threadMeter.plotter.createSequence(threadCountKey, Messages.LIVE_THREADS,  threadCountColor, true);
+        threadMeter.plotter.createSequence(peakKey,        Messages.PEAK,         peakColor,        true);
         setAccessibleName(threadMeter.plotter,
-                          getText("ThreadTab.threadPlotter.accessibleName"));
+                          Messages.THREAD_TAB_THREAD_PLOTTER_ACCESSIBLE_NAME);
 
         plotterPanel.add(threadMeter);
 
         timeComboBox = new TimeComboBox(threadMeter.plotter);
-        controlPanel.add(new LabeledComponent(Resources.getText("Time Range:"),
-                                              getMnemonicInt("Time Range:"),
+        controlPanel.add(new LabeledComponent(Messages.TIME_RANGE_COLON,
+                                              Resources.getMnemonicInt(Messages.TIME_RANGE_COLON),
                                               timeComboBox));
 
-        listModel = new DefaultListModel();
+        listModel = new DefaultListModel<Long>();
 
         JTextArea textArea = new JTextArea();
         textArea.setBorder(thinEmptyBorder);
         textArea.setEditable(false);
         setAccessibleName(textArea,
-                          getText("ThreadTab.threadInfo.accessibleName"));
-        JList list = new ThreadJList(listModel, textArea);
+                          Messages.THREAD_TAB_THREAD_INFO_ACCESSIBLE_NAME);
+        ThreadJList list = new ThreadJList(listModel, textArea);
 
         Dimension di = new Dimension(super.getPreferredSize());
         di.width = Math.min(di.width, 200);
@@ -165,11 +159,11 @@
                                                  filterTF.getPreferredSize().height));
         firstTabToolPanel.add(separator);
 
-        JButton detectDeadlockButton = new JButton(Resources.getText("Detect Deadlock"));
-        detectDeadlockButton.setMnemonic(getMnemonicInt("Detect Deadlock"));
+        JButton detectDeadlockButton = new JButton(Messages.DETECT_DEADLOCK);
+        detectDeadlockButton.setMnemonic(Resources.getMnemonicInt(Messages.DETECT_DEADLOCK));
         detectDeadlockButton.setActionCommand("detectDeadlock");
         detectDeadlockButton.addActionListener(this);
-        detectDeadlockButton.setToolTipText(getText("Detect Deadlock.toolTip"));
+        detectDeadlockButton.setToolTipText(Messages.DETECT_DEADLOCK_TOOLTIP);
         firstTabToolPanel.add(detectDeadlockButton);
 
         messageLabel = new JLabel();
@@ -177,7 +171,7 @@
 
         firstTabPanel.add(threadsSplitPane, BorderLayout.CENTER);
         firstTabPanel.add(firstTabToolPanel, BorderLayout.SOUTH);
-        threadListTabbedPane.addTab(Resources.getText("Threads"), firstTabPanel);
+        threadListTabbedPane.addTab(Messages.THREADS, firstTabPanel);
 
         plotterPanel.add(threadListTabbedPane);
     }
@@ -356,32 +350,32 @@
                         }
                         if (ti != null) {
                             if (ti.getLockName() == null) {
-                                sb.append(Resources.getText("Name State",
+                                sb.append(Resources.format(Messages.NAME_STATE,
                                               ti.getThreadName(),
                                               ti.getThreadState().toString()));
                             } else if (ti.getLockOwnerName() == null) {
-                                sb.append(Resources.getText("Name State LockName",
+                                sb.append(Resources.format(Messages.NAME_STATE_LOCK_NAME,
                                               ti.getThreadName(),
                                               ti.getThreadState().toString(),
                                               ti.getLockName()));
                             } else {
-                                sb.append(Resources.getText("Name State LockName LockOwner",
+                                sb.append(Resources.format(Messages.NAME_STATE_LOCK_NAME_LOCK_OWNER,
                                               ti.getThreadName(),
                                               ti.getThreadState().toString(),
                                               ti.getLockName(),
                                               ti.getLockOwnerName()));
                             }
-                            sb.append(Resources.getText("BlockedCount WaitedCount",
+                            sb.append(Resources.format(Messages.BLOCKED_COUNT_WAITED_COUNT,
                                               ti.getBlockedCount(),
                                               ti.getWaitedCount()));
-                            sb.append(Resources.getText("Stack trace"));
+                            sb.append(Messages.STACK_TRACE);
                             int index = 0;
                             for (StackTraceElement e : ti.getStackTrace()) {
                                 sb.append(e.toString()+"\n");
                                 if (monitors != null) {
                                     for (MonitorInfo mi : monitors) {
                                         if (mi.getLockedStackDepth() == index) {
-                                            sb.append(Resources.getText("Monitor locked", mi.toString()));
+                                            sb.append(Resources.format(Messages.MONITOR_LOCKED, mi.toString()));
                                         }
                                     }
                                 }
@@ -429,7 +423,7 @@
                                 try {
                                     SwingUtilities.invokeAndWait(new Runnable() {
                                         public void run() {
-                                            String msg = Resources.getText("No deadlock detected");
+                                            String msg = Messages.NO_DEADLOCK_DETECTED;
                                             messageLabel.setText(msg);
                                             threadListTabbedPane.revalidate();
                                         }
@@ -459,13 +453,13 @@
 
                             if (deadlockedThreads != null) {
                                 for (int i = 0; i < deadlockedThreads.length; i++) {
-                                    DefaultListModel listModel = new DefaultListModel();
+                                    DefaultListModel<Long> listModel = new DefaultListModel<Long>();
                                     JTextArea textArea = new JTextArea();
                                     textArea.setBorder(thinEmptyBorder);
                                     textArea.setEditable(false);
                                     setAccessibleName(textArea,
-                                        getText("ThreadTab.threadInfo.accessibleName"));
-                                    JList list = new ThreadJList(listModel, textArea);
+                                                      Messages.THREAD_TAB_THREAD_INFO_ACCESSIBLE_NAME);
+                                    ThreadJList list = new ThreadJList(listModel, textArea);
                                     JScrollPane threadlistSP = new JScrollPane(list);
                                     JScrollPane textAreaSP = new JScrollPane(textArea);
                                     threadlistSP.setBorder(null);
@@ -477,9 +471,9 @@
                                     splitPane.setDividerLocation(threadsSplitPane.getDividerLocation());
                                     String tabName;
                                     if (deadlockedThreads.length > 1) {
-                                        tabName = Resources.getText("deadlockTabN", i+1);
+                                        tabName = Resources.format(Messages.DEADLOCK_TAB_N, i+1);
                                     } else {
-                                        tabName = Resources.getText("deadlockTab");
+                                        tabName = Messages.DEADLOCK_TAB;
                                     }
                                     threadListTabbedPane.addTab(tabName, splitPane);
 
@@ -591,10 +585,10 @@
 
 
 
-    private class ThreadJList extends JList {
+    private class ThreadJList extends JList<Long> {
         private JTextArea textArea;
 
-        ThreadJList(DefaultListModel listModel, JTextArea textArea) {
+        ThreadJList(DefaultListModel<Long> listModel, JTextArea textArea) {
             super(listModel);
 
             this.textArea = textArea;
@@ -603,7 +597,7 @@
 
             addListSelectionListener(ThreadTab.this);
             setCellRenderer(new DefaultListCellRenderer() {
-                public Component getListCellRendererComponent(JList list, Object value, int index,
+                public Component getListCellRendererComponent(JList<?> list, Object value, int index,
                                                               boolean isSelected, boolean cellHasFocus) {
                     super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
 
@@ -691,12 +685,12 @@
 
     private static class ThreadOverviewPanel extends OverviewPanel {
         ThreadOverviewPanel() {
-            super(getText("Threads"), threadCountKey, threadCountName, null);
+            super(Messages.THREADS, threadCountKey,  Messages.LIVE_THREADS, null);
         }
 
         private void updateThreadsInfo(long tlCount, long tpCount, long ttCount, long timeStamp) {
             getPlotter().addValues(timeStamp, tlCount);
-            getInfoLabel().setText(getText(infoLabelFormat, tlCount, tpCount, ttCount));
+            getInfoLabel().setText(Resources.format(infoLabelFormat, tlCount, tpCount, ttCount));
         }
     }
 }
diff --git a/src/share/classes/sun/tools/jconsole/VMInternalFrame.java b/src/share/classes/sun/tools/jconsole/VMInternalFrame.java
index cb38e8c..750d444 100644
--- a/src/share/classes/sun/tools/jconsole/VMInternalFrame.java
+++ b/src/share/classes/sun/tools/jconsole/VMInternalFrame.java
@@ -26,16 +26,9 @@
 package sun.tools.jconsole;
 
 import java.awt.*;
-import java.awt.event.*;
-import java.io.*;
-import java.util.*;
-
 import javax.swing.*;
-import javax.swing.Timer;
-import javax.swing.border.*;
-import javax.swing.event.*;
 
-import static sun.tools.jconsole.Resources.*;
+
 import static sun.tools.jconsole.Utilities.*;
 
 @SuppressWarnings("serial")
@@ -47,7 +40,7 @@
 
         this.vmPanel = vmPanel;
         setAccessibleDescription(this,
-                                 getText("VMInternalFrame.accessibleDescription"));
+                                 Messages.VMINTERNAL_FRAME_ACCESSIBLE_DESCRIPTION);
         getContentPane().add(vmPanel, BorderLayout.CENTER);
         pack();
         vmPanel.updateFrameTitle();
diff --git a/src/share/classes/sun/tools/jconsole/VMPanel.java b/src/share/classes/sun/tools/jconsole/VMPanel.java
index ebaf170..d9072b0 100644
--- a/src/share/classes/sun/tools/jconsole/VMPanel.java
+++ b/src/share/classes/sun/tools/jconsole/VMPanel.java
@@ -28,18 +28,16 @@
 import java.awt.*;
 import java.awt.event.*;
 import java.beans.*;
-import java.io.*;
 import java.lang.reflect.*;
 import java.util.*;
 import java.util.List;
 import java.util.Timer;
-
 import javax.swing.*;
 import javax.swing.plaf.*;
 
+
 import com.sun.tools.jconsole.JConsolePlugin;
 import com.sun.tools.jconsole.JConsoleContext;
-import static com.sun.tools.jconsole.JConsoleContext.ConnectionState.*;
 
 import static sun.tools.jconsole.ProxyClient.*;
 
@@ -51,13 +49,10 @@
     private int updateInterval;
     private String hostName;
     private int port;
-    private int vmid;
     private String userName;
     private String password;
     private String url;
     private VMInternalFrame vmIF = null;
-    private static final String windowsLaF =
-            "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
     private static ArrayList<TabInfo> tabInfos = new ArrayList<TabInfo>();
     private boolean wasConnected = false;
 
@@ -100,7 +95,6 @@
         this.updateInterval = updateInterval;
         this.hostName = proxyClient.getHostName();
         this.port = proxyClient.getPort();
-        this.vmid = proxyClient.getVmid();
         this.userName = proxyClient.getUserName();
         this.password = proxyClient.getPassword();
         this.url = proxyClient.getUrl();
@@ -186,9 +180,9 @@
     public String getToolTipText(MouseEvent event) {
         if (connectedIconBounds.contains(event.getPoint())) {
             if (isConnected()) {
-                return getText("Connected. Click to disconnect.");
+                return Messages.CONNECTED_PUNCTUATION_CLICK_TO_DISCONNECT_;
             } else {
-                return getText("Disconnected. Click to connect.");
+                return Messages.DISCONNECTED_PUNCTUATION_CLICK_TO_CONNECT_;
             }
         } else {
             return super.getToolTipText(event);
@@ -219,7 +213,7 @@
 
     private Tab instantiate(TabInfo tabInfo) {
         try {
-            Constructor con = tabInfo.tabClass.getConstructor(VMPanel.class);
+            Constructor<?> con = tabInfo.tabClass.getConstructor(VMPanel.class);
             return (Tab) con.newInstance(this);
         } catch (Exception ex) {
             System.err.println(ex);
@@ -354,7 +348,7 @@
     private void onConnecting() {
         time0 = System.currentTimeMillis();
 
-        final JConsole jc = (JConsole) SwingUtilities.getWindowAncestor(this);
+        SwingUtilities.getWindowAncestor(this);
 
         String connectionName = getConnectionName();
         progressBar = new JProgressBar();
@@ -363,9 +357,9 @@
         progressPanel.add(progressBar);
 
         Object[] message = {
-            "<html><h3>" + getText("connectingTo1", connectionName) + "</h3></html>",
+            "<html><h3>" + Resources.format(Messages.CONNECTING_TO1, connectionName) + "</h3></html>",
             progressPanel,
-            "<html><b>" + getText("connectingTo2", connectionName) + "</b></html>"
+            "<html><b>" + Resources.format(Messages.CONNECTING_TO2, connectionName) + "</b></html>"
         };
 
         optionPane =
@@ -373,7 +367,7 @@
                 message,
                 JOptionPane.DEFAULT_OPTION,
                 JOptionPane.INFORMATION_MESSAGE, null,
-                new String[]{getText("Cancel")},
+                new String[]{Messages.CANCEL},
                 0);
 
 
@@ -409,7 +403,7 @@
         if (vmIF != null) {
             String displayName = getDisplayName();
             if (!proxyClient.isConnected()) {
-                displayName = getText("ConnectionName (disconnected)", displayName);
+                displayName = Resources.format(Messages.CONNECTION_NAME__DISCONNECTED_, displayName);
             }
             vmIF.setTitle(displayName);
         }
@@ -458,25 +452,18 @@
     private void vmPanelDied() {
         disconnect();
 
-        final JConsole jc = (JConsole) SwingUtilities.getWindowAncestor(this);
-
         JOptionPane optionPane;
-
-        final String connectStr = getText("Connect");
-        final String reconnectStr = getText("Reconnect");
-        final String cancelStr = getText("Cancel");
-
         String msgTitle, msgExplanation, buttonStr;
 
         if (wasConnected) {
             wasConnected = false;
-            msgTitle = getText("connectionLost1");
-            msgExplanation = getText("connectionLost2", getConnectionName());
-            buttonStr = reconnectStr;
+            msgTitle = Messages.CONNECTION_LOST1;
+            msgExplanation = Resources.format(Messages.CONNECTING_TO2, getConnectionName());
+            buttonStr = Messages.RECONNECT;
         } else {
-            msgTitle = getText("connectionFailed1");
-            msgExplanation = getText("connectionFailed2", getConnectionName());
-            buttonStr = connectStr;
+            msgTitle =Messages.CONNECTION_FAILED1;
+            msgExplanation = Resources.format(Messages.CONNECTION_FAILED2, getConnectionName());
+            buttonStr = Messages.CONNECT;
         }
 
         optionPane =
@@ -485,7 +472,7 @@
                 "<b>" + msgExplanation + "</b>",
                 JOptionPane.DEFAULT_OPTION,
                 JOptionPane.WARNING_MESSAGE, null,
-                new String[]{buttonStr, cancelStr},
+                new String[]{buttonStr, Messages.CANCEL},
                 0);
 
         optionPane.addPropertyChangeListener(new PropertyChangeListener() {
@@ -494,7 +481,7 @@
                 if (event.getPropertyName().equals(JOptionPane.VALUE_PROPERTY)) {
                     Object value = event.getNewValue();
 
-                    if (value == reconnectStr || value == connectStr) {
+                    if (value == Messages.RECONNECT || value == Messages.CONNECT) {
                         connect();
                     } else if (!everConnected) {
                         try {
@@ -643,11 +630,6 @@
         }
     }
 
-    // Convenience methods
-    private static String getText(String key, Object... args) {
-        return Resources.getText(key, args);
-    }
-
     private void createPluginTabs() {
         // add plugin tabs if not done
         if (!pluginTabsAdded) {
diff --git a/src/share/classes/sun/tools/jconsole/VariableGridLayout.java b/src/share/classes/sun/tools/jconsole/VariableGridLayout.java
index 3cf55b0..2d5851c 100644
--- a/src/share/classes/sun/tools/jconsole/VariableGridLayout.java
+++ b/src/share/classes/sun/tools/jconsole/VariableGridLayout.java
@@ -26,7 +26,6 @@
 package sun.tools.jconsole;
 
 import java.awt.*;
-import java.util.*;
 
 import javax.swing.*;
 
diff --git a/src/share/classes/sun/tools/jconsole/Version.java.template b/src/share/classes/sun/tools/jconsole/Version.java.template
index b768be8..f52ac65 100644
--- a/src/share/classes/sun/tools/jconsole/Version.java.template
+++ b/src/share/classes/sun/tools/jconsole/Version.java.template
@@ -26,6 +26,7 @@
 package sun.tools.jconsole;
 
 import java.io.PrintStream;
+import sun.tools.jconsole.Messages;
 
 public class Version {
     private static final String jconsole_version =
@@ -34,19 +35,19 @@
     public static void print(PrintStream ps) {
         printFullVersion(ps);
 
-        ps.println(Resources.getText("Name and Build",
-                                     System.getProperty("java.runtime.name"),
-                                     System.getProperty("java.runtime.version")));
+        ps.println(Resources.format(Messages.NAME_AND_BUILD,
+                                    System.getProperty("java.runtime.name"),
+                                    System.getProperty("java.runtime.version")));
 
-        ps.println(Resources.getText("Name Build and Mode",
-                                     System.getProperty("java.vm.name"),
-                                     System.getProperty("java.vm.version"),
-                                     System.getProperty("java.vm.info")));
+        ps.println(Resources.format(Messages.NAME_AND_BUILD,
+                                    System.getProperty("java.vm.name"),
+                                    System.getProperty("java.vm.version"),
+                                    System.getProperty("java.vm.info")));
 
     }
 
     public static void printFullVersion(PrintStream ps) {
-        ps.println(Resources.getText("JConsole version", jconsole_version));
+        ps.println(Resources.format(Messages.JCONSOLE_VERSION, jconsole_version));
     }
 
     static String getVersion() {
diff --git a/src/share/classes/sun/tools/jconsole/inspector/OperationEntry.java b/src/share/classes/sun/tools/jconsole/inspector/OperationEntry.java
index 4ada1cd..30dde2b 100644
--- a/src/share/classes/sun/tools/jconsole/inspector/OperationEntry.java
+++ b/src/share/classes/sun/tools/jconsole/inspector/OperationEntry.java
@@ -25,30 +25,14 @@
 
 package sun.tools.jconsole.inspector;
 
-// java import
 import java.awt.*;
-import java.awt.event.*;
-import java.awt.dnd.*;
-import java.lang.reflect.*;
-import java.io.*;
-//
-
-// swing import
-import javax.swing.border.*;
-import javax.swing.event.*;
 import javax.swing.*;
-//
-
-// jmx import
 import javax.management.*;
-//
-
 
 @SuppressWarnings("serial")
 public class OperationEntry extends JPanel {
     private MBeanOperationInfo operation;
     private JComboBox sigs;
-    private Dimension preferredSize;
     private XTextField inputs[];
 
     public OperationEntry (MBeanOperationInfo operation,
@@ -61,26 +45,10 @@
         setPanel(isCallable, button, xoperations);
     }
 
-    /**
-     * This method chops off the throws exceptions, removes "java.lang".
-     */
-    private String preProcessSignature(String signature) {
-        int index;
-        if ((index=signature.indexOf(" throws"))>0) {
-            signature = signature.substring(0,index);
-        }
-        while ((index = signature.indexOf("java.lang."))>0) {
-            signature = signature.substring(0,index)+
-                signature.substring(index+10,signature.length());
-        }
-        return signature;
-    }
-
-    private void setPanel(boolean isCallable,
+     private void setPanel(boolean isCallable,
                           JButton button,
                           XOperations xoperations) {
         try {
-            String defaultVal;
             MBeanParameterInfo params[] = operation.getSignature();
             add(new JLabel("(",JLabel.CENTER));
             inputs = new XTextField[params.length];
diff --git a/src/share/classes/sun/tools/jconsole/inspector/TableSorter.java b/src/share/classes/sun/tools/jconsole/inspector/TableSorter.java
index 4894d4a..b89ab72 100644
--- a/src/share/classes/sun/tools/jconsole/inspector/TableSorter.java
+++ b/src/share/classes/sun/tools/jconsole/inspector/TableSorter.java
@@ -94,7 +94,7 @@
     @SuppressWarnings("unchecked")
     private int compare(Object o1, Object o2) {
         // take care of the case where both o1 & o2 are null. Needed to keep
-        // the method symetric. Without this quickSort gives surprising results.
+        // the method symmetric. Without this quickSort gives surprising results.
         if (o1 == o2)
             return 0;
         if (o1==null)
diff --git a/src/share/classes/sun/tools/jconsole/inspector/ThreadDialog.java b/src/share/classes/sun/tools/jconsole/inspector/ThreadDialog.java
index d7b6095..dbcdd63 100644
--- a/src/share/classes/sun/tools/jconsole/inspector/ThreadDialog.java
+++ b/src/share/classes/sun/tools/jconsole/inspector/ThreadDialog.java
@@ -28,7 +28,6 @@
 // java import
 import java.awt.*;
 import javax.swing.*;
-import java.io.*;
 //
 
 public class ThreadDialog implements Runnable {
diff --git a/src/share/classes/sun/tools/jconsole/inspector/Utils.java b/src/share/classes/sun/tools/jconsole/inspector/Utils.java
index 885af95..cc97c4e 100644
--- a/src/share/classes/sun/tools/jconsole/inspector/Utils.java
+++ b/src/share/classes/sun/tools/jconsole/inspector/Utils.java
@@ -284,7 +284,7 @@
      */
     public static Object newStringConstructor(String type, String param)
             throws Exception {
-        Constructor c = Utils.getClass(type).getConstructor(String.class);
+        Constructor<?> c = Utils.getClass(type).getConstructor(String.class);
         try {
             return c.newInstance(param);
         } catch (InvocationTargetException e) {
diff --git a/src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java b/src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java
index 8f4abfc..b42d5c6 100644
--- a/src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java
+++ b/src/share/classes/sun/tools/jconsole/inspector/XArrayDataViewer.java
@@ -46,9 +46,9 @@
         if (isViewableValue(value)) {
             Object[] arr;
             if (value instanceof Collection) {
-                arr = ((Collection) value).toArray();
+                arr = ((Collection<?>) value).toArray();
             } else if (value instanceof Map) {
-                arr = ((Map) value).entrySet().toArray();
+                arr = ((Map<?,?>) value).entrySet().toArray();
             } else if (value instanceof Object[]) {
                 arr = (Object[]) value;
             } else {
diff --git a/src/share/classes/sun/tools/jconsole/inspector/XDataViewer.java b/src/share/classes/sun/tools/jconsole/inspector/XDataViewer.java
index 0742748..c820d83 100644
--- a/src/share/classes/sun/tools/jconsole/inspector/XDataViewer.java
+++ b/src/share/classes/sun/tools/jconsole/inspector/XDataViewer.java
@@ -34,7 +34,7 @@
 import java.awt.Container;
 
 import sun.tools.jconsole.MBeansTab;
-import sun.tools.jconsole.Resources;
+import sun.tools.jconsole.Messages;
 
 public class XDataViewer {
 
@@ -100,10 +100,10 @@
     public static String getActionLabel(int type) {
         if(type == ARRAY ||
            type == OPEN)
-            return Resources.getText("visualize");
+            return Messages.VISUALIZE;
         if(type == NUMERIC)
-            return Resources.getText("plot");
-        return Resources.getText("expand");
+            return Messages.PLOT;
+        return Messages.EXPAND;
     }
 
     public Component createOperationViewer(Object value,
diff --git a/src/share/classes/sun/tools/jconsole/inspector/XMBeanAttributes.java b/src/share/classes/sun/tools/jconsole/inspector/XMBeanAttributes.java
index 0fe157f..474b928 100644
--- a/src/share/classes/sun/tools/jconsole/inspector/XMBeanAttributes.java
+++ b/src/share/classes/sun/tools/jconsole/inspector/XMBeanAttributes.java
@@ -66,9 +66,9 @@
 import javax.swing.table.TableColumnModel;
 import javax.swing.table.TableModel;
 
-import sun.tools.jconsole.Resources;
 import sun.tools.jconsole.MBeansTab;
 import sun.tools.jconsole.JConsole;
+import sun.tools.jconsole.Messages;
 import sun.tools.jconsole.ProxyClient.SnapshotMBeanServerConnection;
 
 /*IMPORTANT :
@@ -84,8 +84,8 @@
             Logger.getLogger(XMBeanAttributes.class.getPackage().getName());
 
     private final static String[] columnNames =
-    {Resources.getText("Name"),
-     Resources.getText("Value")};
+    {Messages.NAME,
+     Messages.VALUE};
 
     private XMBean mbean;
     private MBeanInfo mbeanInfo;
@@ -267,7 +267,7 @@
 
     public boolean isColumnEditable(int column) {
         if (column < getColumnCount()) {
-            return getColumnName(column).equals(Resources.getText("Value"));
+            return getColumnName(column).equals(Messages.VALUE);
         }
         else {
             return false;
@@ -313,7 +313,7 @@
             if (value != null) {
                 tip = value.toString();
                 if(isAttributeViewable(row, VALUE_COLUMN))
-                    tip = Resources.getText("Double click to expand/collapse")+
+                    tip = Messages.DOUBLE_CLICK_TO_EXPAND_FORWARD_SLASH_COLLAPSE+
                         ". " + tip;
             }
 
@@ -589,7 +589,7 @@
                               comp,
                               rowMinHeight);
 
-                    mbeansTab.getDataViewer().registerForMouseEvent(
+                    XDataViewer.registerForMouseEvent(
                             comp, mouseListener);
                 } else
                     return cell;
@@ -724,7 +724,7 @@
                         mbeansTab.getDataViewer().createAttributeViewer(
                             value, mbean, attribute, XMBeanAttributes.this);
                     cell.init(cell.getMinRenderer(), comp, cell.getMinHeight());
-                    mbeansTab.getDataViewer().registerForMouseEvent(comp, mouseListener);
+                    XDataViewer.registerForMouseEvent(comp, mouseListener);
                 }
             } else {
                 cell = new ZoomedCell(value);
@@ -735,7 +735,7 @@
         }
     }
 
-    //will be called in a synchronzed block
+    //will be called in a synchronized block
     protected void addTableData(DefaultTableModel tableModel,
                                 XMBean mbean,
                                 MBeanAttributeInfo[] attributesInfo,
@@ -749,7 +749,7 @@
         for (int i = 0; i < attributesInfo.length; i++) {
             rowData[0] = (attributesInfo[i].getName());
             if (unavailableAttributes.containsKey(rowData[0])) {
-                rowData[1] = Resources.getText("Unavailable");
+                rowData[1] = Messages.UNAVAILABLE;
             } else if (viewableAttributes.containsKey(rowData[0])) {
                 rowData[1] = viewableAttributes.get(rowData[0]);
                 if (!attributesInfo[i].isWritable() ||
@@ -811,7 +811,6 @@
         }
     }
 
-    @SuppressWarnings("serial")
     class ValueCellEditor extends XTextFieldEditor {
         // implements javax.swing.table.TableCellEditor
         @Override
@@ -866,7 +865,6 @@
         }
     }
 
-    @SuppressWarnings("serial")
     class MaximizedCellRenderer extends  DefaultTableCellRenderer {
         Component comp;
         MaximizedCellRenderer(Component comp) {
@@ -1018,7 +1016,7 @@
                             (String)tableValue);// value
                     } catch (Throwable ex) {
                         popupAndLog(ex,"tableChanged",
-                                "Problem setting attribute");
+                                    Messages.PROBLEM_SETTING_ATTRIBUTE);
                     }
                 }
                 final String attributeName = getValueName(e.getFirstRow());
@@ -1042,7 +1040,7 @@
                         }
                         mbean.setAttribute(attribute);
                     } catch (Throwable ex) {
-                        popupAndLog(ex,method,"Problem setting attribute");
+                        popupAndLog(ex,method,Messages.PROBLEM_SETTING_ATTRIBUTE);
                     }
                     return null;
                 }
@@ -1062,7 +1060,7 @@
         }
 
         // Call this outside EDT
-        private void popupAndLog(Throwable ex, String method, String key) {
+        private void popupAndLog(Throwable ex, String method, String title) {
             ex = Utils.getActualException(ex);
             if (JConsole.isDebug()) ex.printStackTrace();
 
@@ -1070,7 +1068,7 @@
                     : ex.toString();
             EventQueue.invokeLater(
                     new ThreadDialog(component, message+"\n",
-                                     Resources.getText(key),
+                                     title,
                                      JOptionPane.ERROR_MESSAGE));
         }
     }
diff --git a/src/share/classes/sun/tools/jconsole/inspector/XMBeanInfo.java b/src/share/classes/sun/tools/jconsole/inspector/XMBeanInfo.java
index c98c482..cac986a 100644
--- a/src/share/classes/sun/tools/jconsole/inspector/XMBeanInfo.java
+++ b/src/share/classes/sun/tools/jconsole/inspector/XMBeanInfo.java
@@ -35,7 +35,8 @@
 import javax.swing.border.TitledBorder;
 import javax.swing.event.*;
 import javax.swing.table.*;
-import sun.tools.jconsole.Resources;
+
+import sun.tools.jconsole.Messages;
 
 import static sun.tools.jconsole.Utilities.*;
 
@@ -43,11 +44,11 @@
 public class XMBeanInfo extends JPanel {
 
     private static final Color lightYellow = new Color(255, 255, 128);
-    private final int NAME_COLUMN = 0;
+     private final int NAME_COLUMN = 0;
     private final int VALUE_COLUMN = 1;
     private final String[] columnNames = {
-        Resources.getText("Name"),
-        Resources.getText("Value")
+        Messages.NAME,
+        Messages.VALUE
     };
     private JTable infoTable = new JTable();
     private JTable descTable = new JTable();
@@ -163,7 +164,7 @@
         descTable.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
         JScrollPane descTableScrollPane = new JScrollPane(descTable);
         descBorderPanel.setBorder(
-                BorderFactory.createTitledBorder(Resources.getText("Descriptor")));
+            BorderFactory.createTitledBorder(Messages.DESCRIPTOR));
         descBorderPanel.add(descTableScrollPane);
         // Add the two tables to the grid
         //
@@ -230,20 +231,20 @@
         emptyInfoTable();
         emptyDescTable();
         ((TitledBorder) infoBorderPanel.getBorder()).setTitle(
-                Resources.getText("MBeanInfo"));
-        String text = Resources.getText("Info") + ":";
+                Messages.MBEAN_INFO);
+        String text = Messages.INFO + ":";
         DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
         Object rowData[] = new Object[2];
         rowData[0] = new TableRowDivider(text);
         rowData[1] = new TableRowDivider("");
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("ObjectName");
+        rowData[0] = Messages.OBJECT_NAME;
         rowData[1] = mbean.getObjectName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("ClassName");
+        rowData[0] = Messages.CLASS_NAME;
         rowData[1] = mbeanInfo.getClassName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Description");
+        rowData[0] = Messages.DESCRIPTION;
         rowData[1] = mbeanInfo.getDescription();
         tableModel.addRow(rowData);
         addDescriptor(mbeanInfo.getDescriptor(), text);
@@ -252,13 +253,13 @@
         int i = 0;
         for (MBeanConstructorInfo mbci : mbeanInfo.getConstructors()) {
             addMBeanConstructorInfo(mbci,
-                    Resources.getText("Constructor") + "-" + i + ":");
+                    Messages.CONSTRUCTOR + "-" + i + ":");
             // MBeanParameterInfo
             //
             int j = 0;
             for (MBeanParameterInfo mbpi : mbci.getSignature()) {
                 addMBeanParameterInfo(mbpi,
-                        Resources.getText("Parameter") + "-" + i + "-" + j + ":");
+                        Messages.PARAMETER + "-" + i + "-" + j + ":");
                 j++;
             }
             i++;
@@ -271,29 +272,29 @@
         emptyInfoTable();
         emptyDescTable();
         ((TitledBorder) infoBorderPanel.getBorder()).setTitle(
-                Resources.getText("MBeanAttributeInfo"));
-        String text = Resources.getText("Attribute") + ":";
+                Messages.MBEAN_ATTRIBUTE_INFO);
+        String text = Messages.ATTRIBUTE + ":";
         DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
         Object rowData[] = new Object[2];
         rowData[0] = new TableRowDivider(text);
         rowData[1] = new TableRowDivider("");
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Name");
+        rowData[0] = Messages.NAME;
         rowData[1] = mbai.getName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Description");
+        rowData[0] = Messages.DESCRIPTION;
         rowData[1] = mbai.getDescription();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Readable");
+        rowData[0] = Messages.READABLE;
         rowData[1] = mbai.isReadable();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Writable");
+        rowData[0] = Messages.WRITABLE;
         rowData[1] = mbai.isWritable();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Is");
+        rowData[0] = Messages.IS;
         rowData[1] = mbai.isIs();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Type");
+        rowData[0] = Messages.TYPE;
         rowData[1] = mbai.getType();
         tableModel.addRow(rowData);
         addDescriptor(mbai.getDescriptor(), text);
@@ -305,36 +306,36 @@
         emptyInfoTable();
         emptyDescTable();
         ((TitledBorder) infoBorderPanel.getBorder()).setTitle(
-                Resources.getText("MBeanOperationInfo"));
-        String text = Resources.getText("Operation") + ":";
+                Messages.MBEAN_OPERATION_INFO);
+        String text = Messages.OPERATION + ":";
         DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
         Object rowData[] = new Object[2];
         rowData[0] = new TableRowDivider(text);
         rowData[1] = new TableRowDivider("");
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Name");
+        rowData[0] = Messages.NAME;
         rowData[1] = mboi.getName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Description");
+        rowData[0] = Messages.DESCRIPTION;
         rowData[1] = mboi.getDescription();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Impact");
+        rowData[0] = Messages.IMPACT;
         switch (mboi.getImpact()) {
             case MBeanOperationInfo.INFO:
-                rowData[1] = Resources.getText("INFO");
+                rowData[1] = Messages.INFO_CAPITALIZED;
                 break;
             case MBeanOperationInfo.ACTION:
-                rowData[1] = Resources.getText("ACTION");
+                rowData[1] = Messages.ACTION_CAPITALIZED;
                 break;
             case MBeanOperationInfo.ACTION_INFO:
-                rowData[1] = Resources.getText("ACTION_INFO");
+                rowData[1] = Messages.ACTION_INFO_CAPITALIZED;
                 break;
             case MBeanOperationInfo.UNKNOWN:
-                rowData[1] = Resources.getText("UNKNOWN");
+                rowData[1] = Messages.UNKNOWN_CAPITALIZED;
                 break;
         }
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("ReturnType");
+        rowData[0] = Messages.RETURN_TYPE;
         rowData[1] = mboi.getReturnType();
         tableModel.addRow(rowData);
         addDescriptor(mboi.getDescriptor(), text);
@@ -343,7 +344,7 @@
         int i = 0;
         for (MBeanParameterInfo mbpi : mboi.getSignature()) {
             addMBeanParameterInfo(mbpi,
-                    Resources.getText("Parameter") + "-" + i++ + ":");
+                    Messages.PARAMETER + "-" + i++ + ":");
         }
         tableModel.newDataAvailable(new TableModelEvent(tableModel));
     }
@@ -353,20 +354,20 @@
         emptyInfoTable();
         emptyDescTable();
         ((TitledBorder) infoBorderPanel.getBorder()).setTitle(
-                Resources.getText("MBeanNotificationInfo"));
-        String text = Resources.getText("Notification") + ":";
+                Messages.MBEAN_NOTIFICATION_INFO);
+        String text = Messages.NOTIFICATION + ":";
         DefaultTableModel tableModel = (DefaultTableModel) infoTable.getModel();
         Object rowData[] = new Object[2];
         rowData[0] = new TableRowDivider(text);
         rowData[1] = new TableRowDivider("");
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Name");
+        rowData[0] = Messages.NAME;
         rowData[1] = mbni.getName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Description");
+        rowData[0] = Messages.DESCRIPTION;
         rowData[1] = mbni.getDescription();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("NotifTypes");
+        rowData[0] = Messages.NOTIF_TYPES;
         rowData[1] = Arrays.toString(mbni.getNotifTypes());
         tableModel.addRow(rowData);
         addDescriptor(mbni.getDescriptor(), text);
@@ -380,10 +381,10 @@
         rowData[0] = new TableRowDivider(text);
         rowData[1] = new TableRowDivider("");
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Name");
+        rowData[0] = Messages.NAME;
         rowData[1] = mbci.getName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Description");
+        rowData[0] = Messages.DESCRIPTION;
         rowData[1] = mbci.getDescription();
         tableModel.addRow(rowData);
         addDescriptor(mbci.getDescriptor(), text);
@@ -397,13 +398,13 @@
         rowData[0] = new TableRowDivider(text);
         rowData[1] = new TableRowDivider("");
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Name");
+        rowData[0] = Messages.NAME;
         rowData[1] = mbpi.getName();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Description");
+        rowData[0] = Messages.DESCRIPTION;
         rowData[1] = mbpi.getDescription();
         tableModel.addRow(rowData);
-        rowData[0] = Resources.getText("Type");
+        rowData[0] = Messages.TYPE;
         rowData[1] = mbpi.getType();
         tableModel.addRow(rowData);
         addDescriptor(mbpi.getDescriptor(), text);
diff --git a/src/share/classes/sun/tools/jconsole/inspector/XMBeanNotifications.java b/src/share/classes/sun/tools/jconsole/inspector/XMBeanNotifications.java
index 2d11b8a..5077797 100644
--- a/src/share/classes/sun/tools/jconsole/inspector/XMBeanNotifications.java
+++ b/src/share/classes/sun/tools/jconsole/inspector/XMBeanNotifications.java
@@ -26,7 +26,6 @@
 package sun.tools.jconsole.inspector;
 
 import javax.swing.*;
-import javax.swing.event.*;
 import javax.swing.table.*;
 import javax.swing.tree.*;
 import java.awt.Font;
@@ -46,19 +45,19 @@
 import javax.management.openmbean.TabularData;
 
 import sun.tools.jconsole.JConsole;
-import sun.tools.jconsole.Resources;
+import sun.tools.jconsole.Messages;
 
 @SuppressWarnings("serial")
 public class XMBeanNotifications extends JTable implements NotificationListener {
 
     private final static String[] columnNames = {
-        Resources.getText("TimeStamp"),
-        Resources.getText("Type"),
-        Resources.getText("UserData"),
-        Resources.getText("SeqNum"),
-        Resources.getText("Message"),
-        Resources.getText("Event"),
-        Resources.getText("Source")
+        Messages.TIME_STAMP,
+        Messages.TYPE,
+        Messages.USER_DATA,
+        Messages.SEQ_NUM,
+        Messages.MESSAGE,
+        Messages.EVENT,
+        Messages.SOURCE
     };
     private HashMap<ObjectName, XMBeanNotificationsListener> listeners =
             new HashMap<ObjectName, XMBeanNotificationsListener>();
@@ -183,7 +182,7 @@
         }
 
         if (cell != null) {
-            toolTip = Resources.getText("Double click to expand/collapse") +
+            toolTip = Messages.DOUBLE_CLICK_TO_EXPAND_FORWARD_SLASH_COLLAPSE+
                     ". " + cell.toString();
         } else {
             Object val =
@@ -599,7 +598,6 @@
 
     class XMBeanNotificationsListener implements NotificationListener {
 
-        private String[] columnNames;
         private XMBean xmbean;
         private DefaultMutableTreeNode node;
         private volatile long received;
@@ -615,7 +613,6 @@
             this.notifications = notifications;
             this.xmbean = xmbean;
             this.node = node;
-            this.columnNames = columnNames;
             register(node);
         }
 
diff --git a/src/share/classes/sun/tools/jconsole/inspector/XObject.java b/src/share/classes/sun/tools/jconsole/inspector/XObject.java
index 9e56286..303090a 100644
--- a/src/share/classes/sun/tools/jconsole/inspector/XObject.java
+++ b/src/share/classes/sun/tools/jconsole/inspector/XObject.java
@@ -28,17 +28,6 @@
 // java import
 import javax.swing.*;
 
-//
-
-// java import
-import java.io.*;
-import java.awt.*;
-import java.awt.dnd.*;
-import java.awt.datatransfer.*;
-import java.net.*;
-//
-
-
 /**
  * This provides a wrapper to the Object class to allow it to be
  displayed/manipulated as a GUI object.
diff --git a/src/share/classes/sun/tools/jconsole/inspector/XOpenTypeViewer.java b/src/share/classes/sun/tools/jconsole/inspector/XOpenTypeViewer.java
index fb4ddf1..108ff7a 100644
--- a/src/share/classes/sun/tools/jconsole/inspector/XOpenTypeViewer.java
+++ b/src/share/classes/sun/tools/jconsole/inspector/XOpenTypeViewer.java
@@ -28,33 +28,21 @@
 import javax.swing.*;
 import javax.swing.event.*;
 import javax.swing.table.*;
-import javax.swing.tree.*;
-import javax.swing.border.*;
 import java.awt.BorderLayout;
-import java.awt.GridLayout;
 import java.awt.FlowLayout;
 import java.awt.Component;
-import java.awt.EventQueue;
 import java.awt.Color;
 import java.awt.Font;
-import java.awt.Rectangle;
 import java.awt.event.*;
-import java.awt.Insets;
 import java.awt.Dimension;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
 import java.util.*;
-import java.io.*;
 import java.lang.reflect.Array;
 
-import javax.management.*;
 import javax.management.openmbean.*;
 
-import sun.tools.jconsole.BorderedComponent;
 import sun.tools.jconsole.JConsole;
-import sun.tools.jconsole.LabeledComponent;
+import sun.tools.jconsole.Messages;
 import sun.tools.jconsole.Resources;
-import sun.tools.jconsole.VariableGridLayout;
 
 @SuppressWarnings("serial")
 public class XOpenTypeViewer extends JPanel implements ActionListener {
@@ -65,9 +53,9 @@
     XOpenTypeDataListener listener = new XOpenTypeDataListener();
 
     private static final String compositeNavigationSingle =
-            Resources.getText("MBeansTab.compositeNavigationSingle");
+            Messages.MBEANS_TAB_COMPOSITE_NAVIGATION_SINGLE;
     private static final String tabularNavigationSingle =
-            Resources.getText("MBeansTab.tabularNavigationSingle");
+            Messages.MBEANS_TAB_TABULAR_NAVIGATION_SINGLE;
 
     private static TableCellEditor editor =
             new Utils.ReadOnlyTableCellEditor(new JTextField());
@@ -121,7 +109,6 @@
 
     static abstract class XOpenTypeData extends JTable {
         XOpenTypeData parent;
-        private Color defaultColor;
         protected int col1Width = -1;
         protected int col2Width = -1;
         private boolean init;
@@ -139,7 +126,7 @@
                 Object value = getModel().getValueAt(row, col);
                 if (value != null) {
                     if(isClickableElement(value))
-                        return Resources.getText("Double click to visualize")
+                        return Messages.DOUBLE_CLICK_TO_VISUALIZE
                         + ". " + value.toString();
                     else
                         return value.toString();
@@ -265,7 +252,7 @@
                 Object c1 = o1.get(key);
                 Object c2 = o2.get(key);
                 if (c1 instanceof Comparable && c2 instanceof Comparable) {
-                    int result = ((Comparable) c1).compareTo(c2);
+                    int result = ((Comparable<Object>) c1).compareTo(c2);
                     if (result != 0)
                         return result;
                 }
@@ -358,7 +345,7 @@
 
     static class XCompositeData extends XOpenTypeData {
         protected final String[] columnNames = {
-            Resources.getText("Name"), Resources.getText("Value")
+            Messages.NAME, Messages.VALUE
         };
         CompositeData composite;
 
@@ -398,8 +385,8 @@
 
         private void load(CompositeData data) {
             CompositeType type = data.getCompositeType();
-            Set keys = type.keySet();
-            Iterator it = keys.iterator();
+            Set<String> keys = type.keySet();
+            Iterator<String> it = keys.iterator();
             Object[] rowData = new Object[2];
             while (it.hasNext()) {
                 String key = (String) it.next();
@@ -408,13 +395,13 @@
                 if (val == null) {
                     rowData[1] = "";
                 } else {
-                    OpenType openType = type.getType(key);
+                    OpenType<?> openType = type.getType(key);
                     if (openType instanceof CompositeType) {
                         rowData[1] =
                                 new XCompositeData(this, (CompositeData) val);
                     } else if (openType instanceof ArrayType) {
                         rowData[1] =
-                                new XArrayData(this, (ArrayType) openType, val);
+                                new XArrayData(this, (ArrayType<?>) openType, val);
                     } else if (openType instanceof SimpleType) {
                         rowData[1] = val;
                     } else if (openType instanceof TabularType) {
@@ -453,21 +440,21 @@
 
         private int dimension;
         private int size;
-        private OpenType elemType;
+        private OpenType<?> elemType;
         private Object val;
         private boolean isCompositeType;
         private boolean isTabularType;
         private int currentIndex;
         private CompositeData[] elements;
-        private final String[] arrayColumns = {Resources.getText("Value")};
+        private final String[] arrayColumns = {Messages.VALUE};
         private Font normalFont, boldFont;
 
-        XArrayData(XOpenTypeData parent, ArrayType type, Object val) {
+        XArrayData(XOpenTypeData parent, ArrayType<?> type, Object val) {
             this(parent, type.getDimension(), type.getElementOpenType(), val);
         }
 
         XArrayData(XOpenTypeData parent, int dimension,
-                OpenType elemType, Object val) {
+                OpenType<?> elemType, Object val) {
             super(parent);
             this.dimension = dimension;
             this.elemType = elemType;
@@ -486,10 +473,9 @@
 
         public void viewed(XOpenTypeViewer viewer) throws Exception {
             if (size == 0)
-                throw new Exception(Resources.getText("Empty array"));
+                throw new Exception(Messages.EMPTY_ARRAY);
             if (dimension > 1)
-                throw new Exception(Resources.getText("Dimension is not " +
-                        "supported:") +
+                throw new Exception(Messages.DIMENSION_IS_NOT_SUPPORTED_COLON +
                         dimension);
             super.viewed(viewer);
         }
@@ -565,7 +551,7 @@
 
         public String toString() {
             if (dimension > 1) {
-                return Resources.getText("Dimension is not supported:") +
+                return Messages.DIMENSION_IS_NOT_SUPPORTED_COLON +
                         dimension;
             } else {
                 return elemType.getTypeName() + "[" + size + "]";
@@ -694,7 +680,7 @@
                     tabular.canIncrement() || tabular.canDecrement();
             if (hasMoreThanOneElement) {
                 tabularLabel.setText(
-                        Resources.getText("MBeansTab.tabularNavigationMultiple",
+                        Resources.format(Messages.MBEANS_TAB_TABULAR_NAVIGATION_MULTIPLE,
                         String.format("%d", tabular.getSelectedElementIndex() + 1),
                         String.format("%d", tabular.getElementCount())));
             } else {
@@ -717,7 +703,7 @@
                     array.canIncrement() || array.canDecrement();
             if (hasMoreThanOneElement) {
                 compositeLabel.setText(
-                        Resources.getText("MBeansTab.compositeNavigationMultiple",
+                        Resources.format(Messages.MBEANS_TAB_COMPOSITE_NAVIGATION_MULTIPLE,
                         String.format("%d", array.getSelectedElementIndex() + 1),
                         String.format("%d", array.getElementCount())));
             } else {
@@ -781,8 +767,8 @@
                 JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
 
         JPanel buttons = new JPanel(new FlowLayout(FlowLayout.LEFT));
-        tabularPrev = new JButton(Resources.getText("<"));
-        tabularNext = new JButton(Resources.getText(">"));
+        tabularPrev = new JButton(Messages.LESS_THAN);
+        tabularNext = new JButton(Messages.GREATER_THAN);
         JPanel tabularButtons = new JPanel(new FlowLayout(FlowLayout.LEFT));
         tabularButtons.add(tabularPrev);
         tabularPrev.addActionListener(this);
@@ -793,13 +779,13 @@
         tabularNext.addActionListener(this);
         tabularButtons.setBackground(Color.white);
 
-        prev = new JButton(Resources.getText("<<"));
+        prev = new JButton(Messages.A_LOT_LESS_THAN);
         prev.addActionListener(this);
         buttons.add(prev);
 
-        incr = new JButton(Resources.getText(">"));
+        incr = new JButton(Messages.GREATER_THAN);
         incr.addActionListener(this);
-        decr = new JButton(Resources.getText("<"));
+        decr = new JButton(Messages.LESS_THAN);
         decr.addActionListener(this);
 
         JPanel array = new JPanel();
diff --git a/src/share/classes/sun/tools/jconsole/inspector/XOperations.java b/src/share/classes/sun/tools/jconsole/inspector/XOperations.java
index a6e7f8b..b4f24fa 100644
--- a/src/share/classes/sun/tools/jconsole/inspector/XOperations.java
+++ b/src/share/classes/sun/tools/jconsole/inspector/XOperations.java
@@ -26,22 +26,18 @@
 package sun.tools.jconsole.inspector;
 
 import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.table.*;
-import javax.swing.tree.*;
 import java.awt.BorderLayout;
 import java.awt.GridLayout;
 import java.awt.FlowLayout;
 import java.awt.Component;
 import java.awt.event.*;
 import java.util.*;
-import java.io.*;
 
 import javax.management.*;
 
-import sun.tools.jconsole.Resources;
 import sun.tools.jconsole.MBeansTab;
 import sun.tools.jconsole.JConsole;
+import sun.tools.jconsole.Messages;
 
 public abstract class XOperations extends JPanel implements ActionListener {
 
@@ -185,8 +181,8 @@
                     } else {
                         new ThreadDialog(
                                 button,
-                                Resources.getText("Method successfully invoked"),
-                                Resources.getText("Info"),
+                                Messages.METHOD_SUCCESSFULLY_INVOKED,
+                                Messages.INFO,
                                 JOptionPane.INFORMATION_MESSAGE).run();
                     }
                 } catch (Throwable t) {
@@ -196,9 +192,9 @@
                     }
                     new ThreadDialog(
                             button,
-                            Resources.getText("Problem invoking") + " " +
+                            Messages.PROBLEM_INVOKING + " " +
                             button.getText() + " : " + t.toString(),
-                            Resources.getText("Error"),
+                            Messages.ERROR,
                             JOptionPane.ERROR_MESSAGE).run();
                 }
             }
diff --git a/src/share/classes/sun/tools/jconsole/inspector/XPlotter.java b/src/share/classes/sun/tools/jconsole/inspector/XPlotter.java
index bcb34ad..00fdff8 100644
--- a/src/share/classes/sun/tools/jconsole/inspector/XPlotter.java
+++ b/src/share/classes/sun/tools/jconsole/inspector/XPlotter.java
@@ -27,7 +27,6 @@
 
 import sun.tools.jconsole.Plotter;
 import javax.swing.JTable;
-import java.awt.Graphics;
 
 @SuppressWarnings("serial")
 public class XPlotter extends Plotter {
diff --git a/src/share/classes/sun/tools/jconsole/inspector/XPlottingViewer.java b/src/share/classes/sun/tools/jconsole/inspector/XPlottingViewer.java
index 280759f..f1e768c 100644
--- a/src/share/classes/sun/tools/jconsole/inspector/XPlottingViewer.java
+++ b/src/share/classes/sun/tools/jconsole/inspector/XPlottingViewer.java
@@ -45,10 +45,7 @@
         new HashMap<String, XPlottingViewer>();
      private static HashMap<String, Timer> timerCache =
          new HashMap<String, Timer>();
-    private JPanel bordered;
-    private Number value;
     private MBeansTab tab;
-    private XMBean mbean;
     private String attributeName;
     private String key;
     private JTable table;
@@ -62,7 +59,6 @@
 
         this.tab = tab;
         this.key = key;
-        this.mbean = mbean;
         this.table = table;
         this.attributeName = attributeName;
         Plotter plotter = createPlotter(mbean, attributeName, key, table);
@@ -70,9 +66,9 @@
     }
 
     static void dispose(MBeansTab tab) {
-        Iterator it = plotterCache.keySet().iterator();
+        Iterator<String> it = plotterCache.keySet().iterator();
         while(it.hasNext()) {
-            String key = (String) it.next();
+            String key = it.next();
             if(key.startsWith(String.valueOf(tab.hashCode()))) {
                 it.remove();
             }
@@ -187,7 +183,7 @@
         final GridBagLayout gbl = new GridBagLayout();
         buttonPanel.setLayout(gbl);
         setLayout(new BorderLayout());
-        plotButton = new JButton(Resources.getText("Discard chart"));
+        plotButton = new JButton(Messages.DISCARD_CHART);
         plotButton.addActionListener(this);
         plotButton.setEnabled(true);
 
diff --git a/src/share/classes/sun/tools/jconsole/inspector/XSheet.java b/src/share/classes/sun/tools/jconsole/inspector/XSheet.java
index 3739f40..f9f5bc4 100644
--- a/src/share/classes/sun/tools/jconsole/inspector/XSheet.java
+++ b/src/share/classes/sun/tools/jconsole/inspector/XSheet.java
@@ -57,8 +57,6 @@
 import sun.tools.jconsole.*;
 import sun.tools.jconsole.inspector.XNodeInfo.Type;
 
-import static sun.tools.jconsole.Resources.*;
-
 @SuppressWarnings("serial")
 public class XSheet extends JPanel
         implements ActionListener, NotificationListener {
@@ -106,28 +104,24 @@
         southPanel = new JPanel();
         add(southPanel, BorderLayout.SOUTH);
         // create the refresh button
-        String refreshButtonKey = "MBeansTab.refreshAttributesButton";
-        refreshButton = new JButton(getText(refreshButtonKey));
-        refreshButton.setMnemonic(getMnemonicInt(refreshButtonKey));
-        refreshButton.setToolTipText(getText(refreshButtonKey + ".toolTip"));
+        refreshButton = new JButton(Messages.MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON);
+        refreshButton.setMnemonic(Resources.getMnemonicInt(Messages.MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON));
+        refreshButton.setToolTipText(Messages.MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON_TOOLTIP);
         refreshButton.addActionListener(this);
         // create the clear button
-        String clearButtonKey = "MBeansTab.clearNotificationsButton";
-        clearButton = new JButton(getText(clearButtonKey));
-        clearButton.setMnemonic(getMnemonicInt(clearButtonKey));
-        clearButton.setToolTipText(getText(clearButtonKey + ".toolTip"));
+        clearButton = new JButton(Messages.MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON);
+        clearButton.setMnemonic(Resources.getMnemonicInt(Messages.MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON));
+        clearButton.setToolTipText(Messages.MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON_TOOLTIP);
         clearButton.addActionListener(this);
         // create the subscribe button
-        String subscribeButtonKey = "MBeansTab.subscribeNotificationsButton";
-        subscribeButton = new JButton(getText(subscribeButtonKey));
-        subscribeButton.setMnemonic(getMnemonicInt(subscribeButtonKey));
-        subscribeButton.setToolTipText(getText(subscribeButtonKey + ".toolTip"));
+        subscribeButton = new JButton(Messages.MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON);
+        subscribeButton.setMnemonic(Resources.getMnemonicInt(Messages.MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON));
+        subscribeButton.setToolTipText(Messages.MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON_TOOLTIP);
         subscribeButton.addActionListener(this);
         // create the unsubscribe button
-        String unsubscribeButtonKey = "MBeansTab.unsubscribeNotificationsButton";
-        unsubscribeButton = new JButton(getText(unsubscribeButtonKey));
-        unsubscribeButton.setMnemonic(getMnemonicInt(unsubscribeButtonKey));
-        unsubscribeButton.setToolTipText(getText(unsubscribeButtonKey + ".toolTip"));
+        unsubscribeButton = new JButton(Messages.MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON);
+        unsubscribeButton.setMnemonic(Resources.getMnemonicInt(Messages.MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON));
+        unsubscribeButton.setToolTipText(Messages.MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON_TOOLTIP);
         unsubscribeButton.addActionListener(this);
         // create XMBeanAttributes container
         mbeanAttributes = new XMBeanAttributes(mbeansTab);
@@ -238,7 +232,7 @@
                         t.printStackTrace();
                     }
                     showErrorDialog(t.toString(),
-                            Resources.getText("Problem displaying MBean"));
+                            Messages.PROBLEM_DISPLAYING_MBEAN);
                 }
             }
         };
@@ -279,7 +273,7 @@
                                             new JPanel(new BorderLayout());
                                     attributeBorderPanel.setBorder(
                                             BorderFactory.createTitledBorder(
-                                            Resources.getText("Attribute value")));
+                                            Messages.ATTRIBUTE_VALUE));
                                     JPanel attributeValuePanel =
                                             new JPanel(new BorderLayout());
                                     attributeValuePanel.setBorder(
@@ -314,7 +308,7 @@
                                         t.printStackTrace();
                                     }
                                     showErrorDialog(t.toString(),
-                                            Resources.getText("Problem displaying MBean"));
+                                            Messages.PROBLEM_DISPLAYING_MBEAN);
                                 }
                             }
                         };
@@ -333,7 +327,7 @@
                 JPanel operationPanel = new JPanel(new BorderLayout());
                 JPanel operationBorderPanel = new JPanel(new BorderLayout());
                 operationBorderPanel.setBorder(BorderFactory.createTitledBorder(
-                        Resources.getText("Operation invocation")));
+                        Messages.OPERATION_INVOCATION));
                 operationBorderPanel.add(new JScrollPane(mbeanOperations));
                 operationPanel.add(operationBorderPanel, BorderLayout.NORTH);
                 mbi.addMBeanOperationInfo(mboi);
@@ -389,7 +383,7 @@
                         mainPanel.removeAll();
                         JPanel borderPanel = new JPanel(new BorderLayout());
                         borderPanel.setBorder(BorderFactory.createTitledBorder(
-                                Resources.getText("Attribute values")));
+                                Messages.ATTRIBUTE_VALUES));
                         borderPanel.add(new JScrollPane(mbeanAttributes));
                         mainPanel.add(borderPanel, BorderLayout.CENTER);
                         // add the refresh button to the south panel
@@ -409,7 +403,7 @@
                         t.printStackTrace();
                     }
                     showErrorDialog(t.toString(),
-                            Resources.getText("Problem displaying MBean"));
+                            Messages.PROBLEM_DISPLAYING_MBEAN);
                 }
             }
         };
@@ -442,7 +436,7 @@
                         mainPanel.removeAll();
                         JPanel borderPanel = new JPanel(new BorderLayout());
                         borderPanel.setBorder(BorderFactory.createTitledBorder(
-                                Resources.getText("Operation invocation")));
+                                Messages.OPERATION_INVOCATION));
                         borderPanel.add(new JScrollPane(mbeanOperations));
                         mainPanel.add(borderPanel, BorderLayout.CENTER);
                         southPanel.setVisible(false);
@@ -459,7 +453,7 @@
                         t.printStackTrace();
                     }
                     showErrorDialog(t.toString(),
-                            Resources.getText("Problem displaying MBean"));
+                            Messages.PROBLEM_DISPLAYING_MBEAN);
                 }
             }
         };
@@ -479,7 +473,7 @@
         mainPanel.removeAll();
         JPanel borderPanel = new JPanel(new BorderLayout());
         borderPanel.setBorder(BorderFactory.createTitledBorder(
-                Resources.getText("Notification buffer")));
+                Messages.NOTIFICATION_BUFFER));
         borderPanel.add(new JScrollPane(mbeanNotifications));
         mainPanel.add(borderPanel, BorderLayout.CENTER);
         // add the subscribe/unsubscribe/clear buttons to the south panel
@@ -528,7 +522,7 @@
                         t.printStackTrace();
                     }
                     showErrorDialog(t.getMessage(),
-                            Resources.getText("Problem adding listener"));
+                            Messages.PROBLEM_ADDING_LISTENER);
                 }
             }
         }.execute();
@@ -557,7 +551,7 @@
                         t.printStackTrace();
                     }
                     showErrorDialog(t.getMessage(),
-                            Resources.getText("Problem removing listener"));
+                            Messages.PROBLEM_REMOVING_LISTENER);
                 }
             }
         }.execute();
@@ -586,7 +580,7 @@
     // Call on EDT
     private void updateReceivedNotifications(
             DefaultMutableTreeNode emitter, long received, boolean bold) {
-        String text = Resources.getText("Notifications") + "[" + received + "]";
+        String text = Messages.NOTIFICATIONS + "[" + received + "]";
         DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) mbeansTab.getTree().getLastSelectedPathComponent();
         if (bold && emitter != selectedNode) {
             text = "<html><b>" + text + "</b></html>";
@@ -600,7 +594,7 @@
     // Call on EDT
     private void clearNotifications() {
         updateNotificationsNodeLabel(currentNode,
-                Resources.getText("Notifications"));
+                Messages.NOTIFICATIONS);
     }
 
     /**
@@ -609,7 +603,7 @@
     // Call on EDT
     private void clearNotifications0() {
         updateNotificationsNodeLabel(currentNode,
-                Resources.getText("Notifications") + "[0]");
+                Messages.NOTIFICATIONS + "[0]");
     }
 
     /**
@@ -712,7 +706,7 @@
             new ThreadDialog(
                     (Component) e.getSource(),
                     message,
-                    Resources.getText("Operation return value"),
+                    Messages.OPERATION_RETURN_VALUE,
                     JOptionPane.INFORMATION_MESSAGE).run();
         } // Got notification
         else if (e.getType().equals(
diff --git a/src/share/classes/sun/tools/jconsole/inspector/XTable.java b/src/share/classes/sun/tools/jconsole/inspector/XTable.java
index 3d090d6..172ded8 100644
--- a/src/share/classes/sun/tools/jconsole/inspector/XTable.java
+++ b/src/share/classes/sun/tools/jconsole/inspector/XTable.java
@@ -36,7 +36,7 @@
 public abstract class XTable extends JTable {
     static final int NAME_COLUMN = 0;
     static final int VALUE_COLUMN = 1;
-    private Color defaultColor, editableColor, droppableColor, errorColor;
+    private Color defaultColor, editableColor, errorColor;
     private Font normalFont, boldFont;
 
     public XTable () {
@@ -139,7 +139,6 @@
         if (defaultColor == null) {
             defaultColor = tcr.getForeground();
             editableColor = Color.blue;
-            droppableColor = Color.green;
             errorColor = Color.red;
             // this sometimes happens for some reason
             if (defaultColor == null) {
diff --git a/src/share/classes/sun/tools/jconsole/inspector/XTextField.java b/src/share/classes/sun/tools/jconsole/inspector/XTextField.java
index 882a427..2cb2359 100644
--- a/src/share/classes/sun/tools/jconsole/inspector/XTextField.java
+++ b/src/share/classes/sun/tools/jconsole/inspector/XTextField.java
@@ -26,12 +26,7 @@
 package sun.tools.jconsole.inspector;
 
 import java.awt.*;
-import java.awt.dnd.*;
 import java.awt.event.*;
-import java.awt.datatransfer.*;
-import java.io.*;
-import java.util.*;
-import javax.swing.plaf.*;
 import javax.swing.event.*;
 import javax.swing.*;
 
@@ -44,16 +39,8 @@
     implements DocumentListener,
                ActionListener {
 
-    private static final Color selF = Color.red;
-    private static final Color selB = Color.yellow;
-    private Color fore=null, back=null;
-    private HashMap items = null; //used for popup menu selection
     private XObject selectedObject;
-    private XObject currentObject;
-    private Class expectedClass;
-    private Object value;
     protected JTextField textField;
-    private JButton browseObjects;
 
     private static boolean allowNullSelection = false;
 
@@ -81,13 +68,12 @@
     }
 
     public XTextField(Object value,
-                      Class expectedClass,
+                      Class<?> expectedClass,
                       int colWidth,
                       boolean isCallable,
                       JButton button,
                       XOperations operation) {
         super(new BorderLayout());
-        this.expectedClass = expectedClass;
         this.button = button;
         this.operation = operation;
         add(textField = new JTextField(value.toString(),colWidth),
@@ -112,17 +98,13 @@
         return allowNullSelection;
     }
 
-    protected void init(Object value, Class expectedClass) {
-        this.expectedClass = expectedClass;
-        this.value = value;
-        boolean fieldEditable =  Utils.isEditableType(expectedClass.getName());
+    protected void init(Object value, Class<?> expectedClass) {
+         boolean fieldEditable =  Utils.isEditableType(expectedClass.getName());
         clearObject();
         if (value != null) {
-            currentObject = new XObject(value);
             textField.setText(value.toString());
         }
         else {
-            currentObject = XObject.NULL_OBJECT;
             //null String value for the moment
             textField.setText("");
         }
@@ -140,35 +122,12 @@
         }
     }
 
-
-
-
-
-    private synchronized void setObject(XObject object) {
-        clearObject();
-        selectedObject = object;
-        currentObject = object;
-        setSelectedColors();
-        textField.setText(object.getText());
-        textField.getDocument().addDocumentListener(this);
-        paintImmediately(getVisibleRect());
-    }
-
     private synchronized void clearObject() {
         textField.getDocument().removeDocumentListener(this);
         selectedObject = null;
-        currentObject = null;
         setDefaultColors();
     }
 
-    private synchronized void setSelectedColors() {
-        // fore = textField.getForeground();
-        // back = textField.getBackground();
-
-        //textField.setForeground(Color.red);
-        // textField.setBackground(Color.yellow);
-    }
-
     private synchronized void setDefaultColors() {
         //  if (fore != null) textField.setForeground(fore);
         // if (back != null)  textField.setBackground(back);
@@ -194,12 +153,6 @@
         }
     }
 
-    private JPopupMenu buildEditPopupMenu() {
-        JPopupMenu menu = new JPopupMenu();
-        return menu;
-    }
-
-
     // ACTIONLISTENER IMPLEMENTATION
     public void actionPerformed(ActionEvent e) {
         if (e.getSource() instanceof JTextField) {
diff --git a/src/share/classes/sun/tools/jconsole/inspector/XTree.java b/src/share/classes/sun/tools/jconsole/inspector/XTree.java
index f81160e..303d9dc 100644
--- a/src/share/classes/sun/tools/jconsole/inspector/XTree.java
+++ b/src/share/classes/sun/tools/jconsole/inspector/XTree.java
@@ -32,7 +32,7 @@
 import javax.swing.tree.*;
 import sun.tools.jconsole.JConsole;
 import sun.tools.jconsole.MBeansTab;
-import sun.tools.jconsole.Resources;
+import sun.tools.jconsole.Messages;
 import sun.tools.jconsole.inspector.XNodeInfo;
 import static sun.tools.jconsole.inspector.XNodeInfo.Type;
 
@@ -182,7 +182,7 @@
      * Returns true if any of the children nodes is a non MBean metadata node.
      */
     private boolean hasNonMetadataNodes(DefaultMutableTreeNode node) {
-        for (Enumeration e = node.children(); e.hasMoreElements();) {
+        for (Enumeration<?> e = node.children(); e.hasMoreElements();) {
             DefaultMutableTreeNode n = (DefaultMutableTreeNode) e.nextElement();
             Object uo = n.getUserObject();
             if (uo instanceof XNodeInfo) {
@@ -205,7 +205,7 @@
      * Returns true if any of the children nodes is an MBean metadata node.
      */
     public boolean hasMetadataNodes(DefaultMutableTreeNode node) {
-        for (Enumeration e = node.children(); e.hasMoreElements();) {
+        for (Enumeration<?> e = node.children(); e.hasMoreElements();) {
             DefaultMutableTreeNode n = (DefaultMutableTreeNode) e.nextElement();
             Object uo = n.getUserObject();
             if (uo instanceof XNodeInfo) {
@@ -251,7 +251,7 @@
         Set<DefaultMutableTreeNode> metadataNodes =
                 new HashSet<DefaultMutableTreeNode>();
         DefaultTreeModel model = (DefaultTreeModel) getModel();
-        for (Enumeration e = node.children(); e.hasMoreElements();) {
+        for (Enumeration<?> e = node.children(); e.hasMoreElements();) {
             DefaultMutableTreeNode n = (DefaultMutableTreeNode) e.nextElement();
             Object uo = n.getUserObject();
             if (uo instanceof XNodeInfo) {
@@ -596,7 +596,7 @@
             if (ai != null && ai.length > 0) {
                 DefaultMutableTreeNode attributes = new DefaultMutableTreeNode();
                 XNodeInfo attributesUO = new XNodeInfo(Type.ATTRIBUTES, mbean,
-                        Resources.getText("Attributes"), null);
+                        Messages.ATTRIBUTES, null);
                 attributes.setUserObject(attributesUO);
                 node.insert(attributes, childIndex++);
                 for (MBeanAttributeInfo mbai : ai) {
@@ -613,7 +613,7 @@
             if (oi != null && oi.length > 0) {
                 DefaultMutableTreeNode operations = new DefaultMutableTreeNode();
                 XNodeInfo operationsUO = new XNodeInfo(Type.OPERATIONS, mbean,
-                        Resources.getText("Operations"), null);
+                        Messages.OPERATIONS, null);
                 operations.setUserObject(operationsUO);
                 node.insert(operations, childIndex++);
                 for (MBeanOperationInfo mboi : oi) {
@@ -646,7 +646,7 @@
             if (isBroadcaster != null && isBroadcaster.booleanValue()) {
                 DefaultMutableTreeNode notifications = new DefaultMutableTreeNode();
                 XNodeInfo notificationsUO = new XNodeInfo(Type.NOTIFICATIONS, mbean,
-                        Resources.getText("Notifications"), null);
+                        Messages.NOTIFICATIONS, null);
                 notifications.setUserObject(notificationsUO);
                 node.insert(notifications, childIndex++);
                 if (ni != null && ni.length > 0) {
diff --git a/src/share/classes/sun/tools/jconsole/inspector/XTreeRenderer.java b/src/share/classes/sun/tools/jconsole/inspector/XTreeRenderer.java
index 62b8843..fb885d7 100644
--- a/src/share/classes/sun/tools/jconsole/inspector/XTreeRenderer.java
+++ b/src/share/classes/sun/tools/jconsole/inspector/XTreeRenderer.java
@@ -30,8 +30,6 @@
 import javax.swing.JTree;
 import javax.swing.tree.DefaultMutableTreeNode;
 import javax.swing.tree.DefaultTreeCellRenderer;
-import sun.tools.jconsole.Resources;
-import sun.tools.jconsole.inspector.XNodeInfo.Type;
 
 @SuppressWarnings("serial")
 public class XTreeRenderer extends DefaultTreeCellRenderer {
diff --git a/src/share/classes/sun/tools/jconsole/resources/JConsoleResources.java b/src/share/classes/sun/tools/jconsole/resources/JConsoleResources.java
deleted file mode 100644
index 2bbc087..0000000
--- a/src/share/classes/sun/tools/jconsole/resources/JConsoleResources.java
+++ /dev/null
@@ -1,462 +0,0 @@
-/*
- * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.tools.jconsole.resources;
-
-import java.util.*;
-
-import static java.awt.event.KeyEvent.*;
-
-/**
- * <p> This class represents the <code>ResourceBundle</code>
- * for the following package(s):
- *
- * <ol>
- * <li> sun.tools.jconsole
- * </ol>
- *
- * <P>
- * Subclasses must override <code>getContents0</code> and provide an array,
- * where each item in the array consists of a <code>String</code> key,
- * and either a <code>String</code> value associated with that key,
- * or if the keys ends with ".mnemonic", an element
- * representing a mnemomic keycode <code>int</code> or <code>char</code>.
- */
-public class JConsoleResources extends ListResourceBundle {
-
-    /**
-     * Returns the contents of this <code>ResourceBundle</code>.
-     *
-     * <p>
-     *
-     * @return the contents of this <code>ResourceBundle</code>.
-     */
-    protected Object[][] getContents0() {
-        Object[][] temp = new Object[][] {
-                // NOTE 1: The value strings in this file containing "{0}" are
-        //         processed by the java.text.MessageFormat class.  Any
-        //         single quotes appearing in these strings need to be
-        //         doubled up.
-        //
-        // NOTE 2: To make working with this file a bit easier, please
-        //         maintain these messages in ASCII sorted order by
-        //         message key.
-        //
-        // LOCALIZE THIS
-        {" 1 day"," 1 day"},
-        {" 1 hour"," 1 hour"},
-        {" 1 min"," 1 min"},
-        {" 1 month"," 1 month"},
-        {" 1 year"," 1 year"},
-        {" 2 hours"," 2 hours"},
-        {" 3 hours"," 3 hours"},
-        {" 3 months"," 3 months"},
-        {" 5 min"," 5 min"},
-        {" 6 hours"," 6 hours"},
-        {" 6 months"," 6 months"},
-        {" 7 days"," 7 days"},
-        {"10 min","10 min"},
-        {"12 hours","12 hours"},
-        {"30 min","30 min"},
-        {"<","<"},
-        {"<<","<<"},
-        {">",">"},
-        {"ACTION","ACTION"},
-        {"ACTION_INFO","ACTION_INFO"},
-        {"All","All"},
-        {"Apply","Apply"},
-        {"Architecture","Architecture"},
-        {"Array, OpenType", "Array, OpenType"},
-        {"Array, OpenType, Numeric value viewer","Array, OpenType, Numeric value viewer"},
-        {"Attribute","Attribute"},
-        {"Attribute value","Attribute value"},
-        {"Attribute values","Attribute values"},
-        {"Attributes","Attributes"},
-        {"Blank", "Blank"},
-        {"BlockedCount WaitedCount",
-             "Total blocked: {0}  Total waited: {1}\n"},
-        {"Boot class path","Boot class path"},
-        {"BorderedComponent.moreOrLessButton.toolTip", "Toggle to show more or less information"},
-        {"CPU Usage","CPU Usage"},
-        {"CPUUsageFormat","CPU Usage: {0}%"},
-        {"Cancel","Cancel"},
-        {"Cascade", "Cascade"},
-        {"Cascade.mnemonic", 'C'},
-        {"Chart:", "Chart:"},
-        {"Chart:.mnemonic", 'C'},
-        {"Class path","Class path"},
-        {"Class","Class"},
-        {"ClassName","ClassName"},
-        {"ClassTab.infoLabelFormat", "<html>Loaded: {0}    Unloaded: {1}    Total: {2}</html>"},
-        {"ClassTab.loadedClassesPlotter.accessibleName", "Chart for Loaded Classes."},
-        {"Classes","Classes"},
-        {"Close","Close"},
-        {"Column.Name", "Name"},
-        {"Column.PID", "PID"},
-        {"Committed memory","Committed memory"},
-        {"Committed virtual memory","Committed virtual memory"},
-        {"Committed", "Committed"},
-        {"Compiler","Compiler"},
-        {"CompositeData","CompositeData"},
-        {"Config","Config"},
-        {"Connect", "Connect"},
-        {"Connect.mnemonic", 'C'},
-        {"Connect...","Connect..."},
-        {"ConnectDialog.connectButton.toolTip", "Connect to Java Virtual Machine"},
-        {"ConnectDialog.accessibleDescription", "Dialog for making a new connection to a local or remote Java Virtual Machine"},
-        {"ConnectDialog.masthead.accessibleName", "Masthead Graphic"},
-        {"ConnectDialog.masthead.title", "New Connection"},
-        {"ConnectDialog.statusBar.accessibleName", "Status Bar"},
-        {"ConnectDialog.title", "JConsole: New Connection"},
-        {"Connected. Click to disconnect.","Connected. Click to disconnect."},
-        {"Connection failed","Connection failed"},
-        {"Connection", "Connection"},
-        {"Connection.mnemonic", 'C'},
-        {"Connection name", "Connection name"},
-        {"ConnectionName (disconnected)","{0} (disconnected)"},
-        {"Constructor","Constructor"},
-        {"Current classes loaded", "Current classes loaded"},
-        {"Current heap size","Current heap size"},
-        {"Current value","Current value: {0}"},
-        {"Create", "Create"},
-        {"Daemon threads","Daemon threads"},
-        {"Disconnected. Click to connect.","Disconnected. Click to connect."},
-        {"Double click to expand/collapse","Double click to expand/collapse"},
-        {"Double click to visualize", "Double click to visualize"},
-        {"Description", "Description"},
-        {"Description: ", "Description: "},
-        {"Descriptor", "Descriptor"},
-        {"Details", "Details"},
-        {"Detect Deadlock", "Detect Deadlock"},
-        {"Detect Deadlock.mnemonic", 'D'},
-        {"Detect Deadlock.toolTip", "Detect deadlocked threads"},
-        {"Dimension is not supported:","Dimension is not supported:"},
-        {"Discard chart", "Discard chart"},
-        {"DurationDaysHoursMinutes","{0,choice,1#{0,number,integer} day |1.0<{0,number,integer} days }" +
-                                    "{1,choice,0<{1,number,integer} hours |1#{1,number,integer} hour |1<{1,number,integer} hours }" +
-                                    "{2,choice,0<{2,number,integer} minutes|1#{2,number,integer} minute|1.0<{2,number,integer} minutes}"},
-
-        {"DurationHoursMinutes","{0,choice,1#{0,number,integer} hour |1<{0,number,integer} hours }" +
-                                "{1,choice,0<{1,number,integer} minutes|1#{1,number,integer} minute|1.0<{1,number,integer} minutes}"},
-
-        {"DurationMinutes","{0,choice,1#{0,number,integer} minute|1.0<{0,number,integer} minutes}"},
-        {"DurationSeconds","{0} seconds"},
-        {"Empty array", "Empty array"},
-        {"Empty opentype viewer", "Empty opentype viewer"},
-        {"Error","Error"},
-        {"Error: MBeans already exist","Error: MBeans already exist"},
-        {"Error: MBeans do not exist","Error: MBeans do not exist"},
-        {"Error:","Error:"},
-        {"Event","Event"},
-        {"Exit", "Exit"},
-        {"Exit.mnemonic", 'x'},
-        {"Fail to load plugin", "Warning: Fail to load plugin: {0}"},
-        {"FileChooser.fileExists.cancelOption", "Cancel"},
-        {"FileChooser.fileExists.message", "<html><center>File already exists:<br>{0}<br>Do you want to replace it?"},
-        {"FileChooser.fileExists.okOption", "Replace"},
-        {"FileChooser.fileExists.title", "File Exists"},
-        {"FileChooser.savedFile", "<html>Saved to file:<br>{0}<br>({1} bytes)"},
-        {"FileChooser.saveFailed.message", "<html><center>Save to file failed:<br>{0}<br>{1}"},
-        {"FileChooser.saveFailed.title", "Save Failed"},
-        {"Free physical memory","Free physical memory"},
-        {"Free swap space","Free swap space"},
-        {"Garbage collector","Garbage collector"},
-        {"GTK","GTK"},
-        {"GcInfo","Name = ''{0}'', Collections = {1,choice,-1#Unavailable|0#{1,number,integer}}, Total time spent = {2}"},
-        {"GC time","GC time"},
-        {"GC time details","{0} on {1} ({2} collections)"},
-        {"Heap Memory Usage","Heap Memory Usage"},
-        {"Heap", "Heap"},
-        {"Help.AboutDialog.accessibleDescription", "Dialog containing information about JConsole and JDK versions"},
-        {"Help.AboutDialog.jConsoleVersion", "JConsole version:<br>{0}"},
-        {"Help.AboutDialog.javaVersion", "Java VM version:<br>{0}"},
-        {"Help.AboutDialog.masthead.accessibleName", "Masthead Graphic"},
-        {"Help.AboutDialog.masthead.title", "About JConsole"},
-        {"Help.AboutDialog.title", "JConsole: About"},
-        {"Help.AboutDialog.userGuideLink", "JConsole User Guide:<br>{0}"},
-        {"Help.AboutDialog.userGuideLink.mnemonic", 'U'},
-        {"Help.AboutDialog.userGuideLink.url", "http://java.sun.com/javase/6/docs/technotes/guides/management/jconsole.html"},
-        {"HelpMenu.About.title", "About JConsole"},
-        {"HelpMenu.About.title.mnemonic", 'A'},
-        {"HelpMenu.UserGuide.title", "Online User Guide"},
-        {"HelpMenu.UserGuide.title.mnemonic", 'U'},
-        {"HelpMenu.title", "Help"},
-        {"HelpMenu.title.mnemonic", 'H'},
-        {"Hotspot MBeans...", "Hotspot MBeans..."},
-        {"Hotspot MBeans....mnemonic", 'H'},
-        {"Hotspot MBeans.dialog.accessibleDescription", "Dialog for managing Hotspot MBeans"},
-        {"Impact","Impact"},
-        {"Info","Info"},
-        {"INFO","INFO"},
-        {"Invalid plugin path", "Warning: Invalid plugin path: {0}"},
-        {"Invalid URL", "Invalid URL: {0}"},
-        {"Is","Is"},
-        {"Java Monitoring & Management Console", "Java Monitoring & Management Console"},
-        {"JConsole: ","JConsole: {0}"},
-        {"JConsole version","JConsole version \"{0}\""},
-        {"JConsole.accessibleDescription", "Java Monitoring & Management Console"},
-        {"JIT compiler","JIT compiler"},
-        {"Java Virtual Machine","Java Virtual Machine"},
-        {"Java","Java"},
-        {"Library path","Library path"},
-        {"Listeners","Listeners"},
-        {"Live Threads","Live threads"},
-        {"Loaded", "Loaded"},
-        {"Local Process:", "Local Process:"},
-        {"Local Process:.mnemonic", 'L'},
-        {"Look and Feel","Look and Feel"},
-        {"Masthead.font", "Dialog-PLAIN-25"},
-        {"Management Not Enabled","<b>Note</b>: The management agent is not enabled on this process."},
-        {"Management Will Be Enabled","<b>Note</b>: The management agent will be enabled on this process."},
-        {"MBeanAttributeInfo","MBeanAttributeInfo"},
-        {"MBeanInfo","MBeanInfo"},
-        {"MBeanNotificationInfo","MBeanNotificationInfo"},
-        {"MBeanOperationInfo","MBeanOperationInfo"},
-        {"MBeans","MBeans"},
-        {"MBeansTab.clearNotificationsButton", "Clear"},
-        {"MBeansTab.clearNotificationsButton.mnemonic", 'C'},
-        {"MBeansTab.clearNotificationsButton.toolTip", "Clear notifications"},
-        {"MBeansTab.compositeNavigationMultiple", "Composite Navigation {0}/{1}"},
-        {"MBeansTab.compositeNavigationSingle", "Composite Navigation"},
-        {"MBeansTab.refreshAttributesButton", "Refresh"},
-        {"MBeansTab.refreshAttributesButton.mnemonic", 'R'},
-        {"MBeansTab.refreshAttributesButton.toolTip", "Refresh attributes"},
-        {"MBeansTab.subscribeNotificationsButton", "Subscribe"},
-        {"MBeansTab.subscribeNotificationsButton.mnemonic", 'S'},
-        {"MBeansTab.subscribeNotificationsButton.toolTip", "Start listening for notifications"},
-        {"MBeansTab.tabularNavigationMultiple", "Tabular Navigation {0}/{1}"},
-        {"MBeansTab.tabularNavigationSingle", "Tabular Navigation"},
-        {"MBeansTab.unsubscribeNotificationsButton", "Unsubscribe"},
-        {"MBeansTab.unsubscribeNotificationsButton.mnemonic", 'U'},
-        {"MBeansTab.unsubscribeNotificationsButton.toolTip", "Stop listening for notifications"},
-        {"Manage Hotspot MBeans in: ", "Manage Hotspot MBeans in: "},
-        {"Max","Max"},
-        {"Maximum heap size","Maximum heap size"},
-        {"Memory","Memory"},
-        {"MemoryPoolLabel", "Memory Pool \"{0}\""},
-        {"MemoryTab.heapPlotter.accessibleName", "Memory usage chart for heap."},
-        {"MemoryTab.infoLabelFormat", "<html>Used: {0}    Committed: {1}    Max: {2}</html>"},
-        {"MemoryTab.nonHeapPlotter.accessibleName", "Memory usage chart for non heap."},
-        {"MemoryTab.poolChart.aboveThreshold", "which is above the threshold of {0}.\n"},
-        {"MemoryTab.poolChart.accessibleName", "Memory Pool Usage Chart."},
-        {"MemoryTab.poolChart.belowThreshold", "which is below the threshold of {0}.\n"},
-        {"MemoryTab.poolPlotter.accessibleName", "Memory usage chart for {0}."},
-        {"Message","Message"},
-        {"Method successfully invoked", "Method successfully invoked"},
-        {"Minimize All", "Minimize All"},
-        {"Minimize All.mnemonic", 'M'},
-        {"Minus Version", "This is {0} version {1}"},
-        {"Monitor locked",
-             "   - locked {0}\n"},
-        {"Motif","Motif"},
-        {"Name Build and Mode","{0} (build {1}, {2})"},
-        {"Name and Build","{0} (build {1})"},
-        {"Name","Name"},
-        {"Name: ","Name: "},
-        {"Name State",
-             "Name: {0}\n" +
-             "State: {1}\n"},
-        {"Name State LockName",
-             "Name: {0}\n" +
-             "State: {1} on {2}\n"},
-        {"Name State LockName LockOwner",
-             "Name: {0}\n" +
-             "State: {1} on {2} owned by: {3}\n"},
-        {"New Connection...", "New Connection..."},
-        {"New Connection....mnemonic", 'N'},
-        {"New value applied","New value applied"},
-        {"No attribute selected","No attribute selected"},
-        {"No deadlock detected","No deadlock detected"},
-        {"No value selected","No value selected"},
-        {"Non-Heap Memory Usage","Non-Heap Memory Usage"},
-        {"Non-Heap", "Non-Heap"},
-        {"Not Yet Implemented","Not Yet Implemented"},
-        {"Not a valid event broadcaster", "Not a valid event broadcaster"},
-        {"Notification","Notification"},
-        {"Notification buffer","Notification buffer"},
-        {"Notifications","Notifications"},
-        {"NotifTypes", "NotifTypes"},
-        {"Number of Threads","Number of Threads"},
-        {"Number of Loaded Classes","Number of Loaded Classes"},
-        {"Number of processors","Number of processors"},
-        {"ObjectName","ObjectName"},
-        {"Operating System","Operating System"},
-        {"Operation","Operation"},
-        {"Operation invocation","Operation invocation"},
-        {"Operation return value", "Operation return value"},
-        {"Operations","Operations"},
-        {"Overview","Overview"},
-        {"OverviewPanel.plotter.accessibleName", "Chart for {0}."},
-        {"Parameter", "Parameter"},
-        {"Password: ", "Password: "},
-        {"Password: .mnemonic", 'P'},
-        {"Password.accessibleName", "Password"},
-        {"Peak","Peak"},
-        {"Perform GC", "Perform GC"},
-        {"Perform GC.mnemonic", 'G'},
-        {"Perform GC.toolTip", "Request Garbage Collection"},
-        {"Plotter.accessibleName", "Chart"},
-        {"Plotter.accessibleName.keyAndValue", "{0}={1}\n"},
-        {"Plotter.accessibleName.noData", "No data plotted."},
-        {"Plotter.saveAsMenuItem", "Save data as..."},
-        {"Plotter.saveAsMenuItem.mnemonic", 'a'},
-        {"Plotter.timeRangeMenu", "Time Range"},
-        {"Plotter.timeRangeMenu.mnemonic", 'T'},
-        {"Problem adding listener","Problem adding listener"},
-        {"Problem displaying MBean", "Problem displaying MBean"},
-        {"Problem invoking", "Problem invoking"},
-        {"Problem removing listener","Problem removing listener"},
-        {"Problem setting attribute","Problem setting attribute"},
-        {"Process CPU time","Process CPU time"},
-        {"R/W","R/W"},
-        {"Readable","Readable"},
-        {"Received","Received"},
-        {"Reconnect","Reconnect"},
-        {"Remote Process:", "Remote Process:"},
-        {"Remote Process:.mnemonic", 'R'},
-        {"Remote Process.textField.accessibleName", "Remote Process"},
-        {"Remove","Remove"},
-        {"Restore All", "Restore All"},
-        {"Restore All.mnemonic", 'R'},
-        {"Return value", "Return value"},
-        {"ReturnType", "ReturnType"},
-        {"SeqNum","SeqNum"},
-        {"Size Bytes", "{0,number,integer} bytes"},
-        {"Size Gb","{0} Gb"},
-        {"Size Kb","{0} Kb"},
-        {"Size Mb","{0} Mb"},
-        {"Source","Source"},
-        {"Stack trace",
-              "\nStack trace: \n"},
-        {"Success:","Success:"},
-        // Note: SummaryTab.headerDateTimeFormat can be one the following:
-        // 1. A combination of two styles for date and time, using the
-        //    constants from class DateFormat: SHORT, MEDIUM, LONG, FULL.
-        //    Example: "MEDIUM,MEDIUM" or "FULL,SHORT"
-        // 2. An explicit string pattern used for creating an instance
-        //    of the class SimpleDateFormat.
-        //    Example: "yyyy-MM-dd HH:mm:ss" or "M/d/yyyy h:mm:ss a"
-        {"SummaryTab.headerDateTimeFormat", "FULL,FULL"},
-        {"SummaryTab.pendingFinalization.label", "Pending finalization"},
-        {"SummaryTab.pendingFinalization.value", "{0} objects"},
-        {"SummaryTab.tabName", "VM Summary"},
-        {"SummaryTab.vmVersion","{0} version {1}"},
-        {"TabularData are not supported", "TabularData are not supported"},
-        {"Threads","Threads"},
-        {"ThreadTab.infoLabelFormat", "<html>Live: {0}    Peak: {1}    Total: {2}</html>"},
-        {"ThreadTab.threadInfo.accessibleName", "Thread Information"},
-        {"ThreadTab.threadPlotter.accessibleName", "Chart for number of threads."},
-        {"Threshold","Threshold"},
-        {"Tile", "Tile"},
-        {"Tile.mnemonic", 'T'},
-        {"Time Range:", "Time Range:"},
-        {"Time Range:.mnemonic", 'T'},
-        {"Time", "Time"},
-        {"TimeStamp","TimeStamp"},
-        {"Total Loaded", "Total Loaded"},
-        {"Total classes loaded","Total classes loaded"},
-        {"Total classes unloaded","Total classes unloaded"},
-        {"Total compile time","Total compile time"},
-        {"Total physical memory","Total physical memory"},
-        {"Total threads started","Total threads started"},
-        {"Total swap space","Total swap space"},
-        {"Type","Type"},
-        {"Unavailable","Unavailable"},
-        {"UNKNOWN","UNKNOWN"},
-        {"Unknown Host","Unknown Host: {0}"},
-        {"Unregister", "Unregister"},
-        {"Uptime","Uptime"},
-        {"Uptime: ","Uptime: "},
-        {"Usage Threshold","Usage Threshold"},
-        {"remoteTF.usage","<b>Usage</b>: &lt;hostname&gt;:&lt;port&gt; OR service:jmx:&lt;protocol&gt;:&lt;sap&gt;"},
-        {"Used","Used"},
-        {"Username: ", "Username: "},
-        {"Username: .mnemonic", 'U'},
-        {"Username.accessibleName", "User Name"},
-        {"UserData","UserData"},
-        {"Virtual Machine","Virtual Machine"},
-        {"VM arguments","VM arguments"},
-        {"VM","VM"},
-        {"VMInternalFrame.accessibleDescription", "Internal frame for monitoring a Java Virtual Machine"},
-        {"Value","Value"},
-        {"Vendor", "Vendor"},
-        {"Verbose Output","Verbose Output"},
-        {"Verbose Output.toolTip", "Enable verbose output for class loading system"},
-        {"View value", "View value"},
-        {"View","View"},
-        {"Window", "Window"},
-        {"Window.mnemonic", 'W'},
-        {"Windows","Windows"},
-        {"Writable","Writable"},
-        {"You cannot drop a class here", "You cannot drop a class here"},
-        {"collapse", "collapse"},
-        {"connectionFailed1","Connection Failed: Retry?"},
-        {"connectionFailed2","The connection to {0} did not succeed.<br>" +
-                             "Would you like to try again?"},
-        {"connectionLost1","Connection Lost: Reconnect?"},
-        {"connectionLost2","The connection to {0} has been lost " +
-                           "because the remote process has been terminated.<br>" +
-                           "Would you like to reconnect?"},
-        {"connectingTo1","Connecting to {0}"},
-        {"connectingTo2","You are currently being connected to {0}.<br>" +
-                         "This will take a few moments."},
-        {"deadlockAllTab","All"},
-        {"deadlockTab","Deadlock"},
-        {"deadlockTabN","Deadlock {0}"},
-        {"expand", "expand"},
-        {"kbytes","{0} kbytes"},
-        {"operation","operation"},
-        {"plot", "plot"},
-        {"visualize","visualize"},
-        {"zz usage text",
-             "Usage: {0} [ -interval=n ] [ -notile ] [ -pluginpath <path> ] [ -version ] [ connection ... ]\n\n" +
-             "  -interval   Set the update interval to n seconds (default is 4 seconds)\n" +
-             "  -notile     Do not tile windows initially (for two or more connections)\n" +
-             "  -pluginpath Specify the path that jconsole uses to look up the plugins\n" +
-             "  -version    Print program version\n\n" +
-             "  connection = pid || host:port || JMX URL (service:jmx:<protocol>://...)\n" +
-             "  pid         The process id of a target process\n" +
-             "  host        A remote host name or IP address\n" +
-             "  port        The port number for the remote connection\n\n" +
-             "  -J          Specify the input arguments to the Java virtual machine\n" +
-             "              on which jconsole is running"},
-        // END OF MATERIAL TO LOCALIZE
-        };
-
-        String ls = System.getProperty("line.separator");
-        for(int i=0;i<temp.length;i++) {
-            if (temp[i][1] instanceof String){
-            temp[i][1] = temp[i][1].toString().replaceAll("\n",ls);
-            }
-        }
-
-        return temp;
-
-    }
-
-    public synchronized Object[][] getContents() {
-        return getContents0();
-    }
-}
diff --git a/src/share/classes/sun/tools/jconsole/resources/JConsoleResources_ja.java b/src/share/classes/sun/tools/jconsole/resources/JConsoleResources_ja.java
deleted file mode 100644
index f25e410..0000000
--- a/src/share/classes/sun/tools/jconsole/resources/JConsoleResources_ja.java
+++ /dev/null
@@ -1,442 +0,0 @@
-/*
- * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.tools.jconsole.resources;
-
-import java.util.*;
-
-import static java.awt.event.KeyEvent.*;
-
-/**
- * <p> This class represents the <code>ResourceBundle</code>
- * for the following package(s):
- *
- * <ol>
- * <li> sun.tools.jconsole
- * </ol>
- *
- * <P>
- * Subclasses must override <code>getContents0</code> and provide an array,
- * where each item in the array consists of a <code>String</code> key,
- * and either a <code>String</code> value associated with that key,
- * or if the keys ends with ".mnemonic", an element
- * representing a mnemomic keycode <code>int</code> or <code>char</code>.
- */
-public class JConsoleResources_ja extends JConsoleResources {
-
-    /**
-     * Returns the contents of this <code>ResourceBundle</code>.
-     *
-     * <p>
-     *
-     * @return the contents of this <code>ResourceBundle</code>.
-     */
-    protected Object[][] getContents0() {
-        Object[][] temp = new Object[][] {
-                // NOTE 1: The value strings in this file containing "{0}" are
-        //         processed by the java.text.MessageFormat class.  Any
-        //         single quotes appearing in these strings need to be
-        //         doubled up.
-        //
-        // NOTE 2: To make working with this file a bit easier, please
-        //         maintain these messages in ASCII sorted order by
-        //         message key.
-        //
-        // LOCALIZE THIS
-        {" 1 day"," 1\u65E5"},
-        {" 1 hour"," 1\u6642\u9593"},
-        {" 1 min"," 1\u5206"},
-        {" 1 month"," 1\u304B\u6708"},
-        {" 1 year"," 1\u5E74"},
-        {" 2 hours"," 2\u6642\u9593"},
-        {" 3 hours"," 3\u6642\u9593"},
-        {" 3 months"," 3\u304B\u6708"},
-        {" 5 min"," 5\u5206"},
-        {" 6 hours"," 6\u6642\u9593"},
-        {" 6 months"," 6\u304B\u6708"},
-        {" 7 days"," 7\u65E5"},
-        {"10 min","10\u5206"},
-        {"12 hours","12\u6642\u9593"},
-        {"30 min","30\u5206"},
-        {"<","<"},
-        {"<<","<<"},
-        {">",">"},
-        {"ACTION","ACTION"},
-        {"ACTION_INFO","ACTION_INFO"},
-        {"All","\u3059\u3079\u3066"},
-        {"Apply","\u9069\u7528"},
-        {"Architecture","\u30A2\u30FC\u30AD\u30C6\u30AF\u30C1\u30E3"},
-        {"Array, OpenType", "\u914D\u5217\u3001OpenType"},
-        {"Array, OpenType, Numeric value viewer","\u914D\u5217\u3001OpenType\u3001\u6570\u5024\u30D3\u30E5\u30FC\u30A2"},
-        {"Attribute","\u5C5E\u6027"},
-        {"Attribute value","\u5C5E\u6027\u5024"},
-        {"Attribute values","\u5C5E\u6027\u5024"},
-        {"Attributes","\u5C5E\u6027"},
-        {"Blank", "\u30D6\u30E9\u30F3\u30AF"},
-        {"BlockedCount WaitedCount",
-             "\u30D6\u30ED\u30C3\u30AF\u6E08\u5408\u8A08: {0}  \u5F85\u6A5F\u6E08\u5408\u8A08: {1}\n"},
-        {"Boot class path","\u30D6\u30FC\u30C8\u30FB\u30AF\u30E9\u30B9\u30D1\u30B9"},
-        {"BorderedComponent.moreOrLessButton.toolTip", "\u8868\u793A\u3059\u308B\u60C5\u5831\u91CF\u3092\u5897\u6E1B\u3059\u308B\u30C8\u30B0\u30EB"},
-        {"CPU Usage","CPU\u4F7F\u7528\u7387"},
-        {"CPUUsageFormat","CPU\u4F7F\u7528\u7387: {0}%"},
-        {"Cancel","\u53D6\u6D88"},
-        {"Cascade", "\u91CD\u306D\u3066\u8868\u793A(C)"},
-        {"Cascade.mnemonic", 'C'},
-        {"Chart:", "\u30C1\u30E3\u30FC\u30C8(C):"},
-        {"Chart:.mnemonic", 'C'},
-        {"Class path","\u30AF\u30E9\u30B9\u30D1\u30B9"},
-        {"Class","\u30AF\u30E9\u30B9"},
-        {"ClassName","ClassName"},
-        {"ClassTab.infoLabelFormat", "<html>\u30ED\u30FC\u30C9\u6E08: {0}    \u672A\u30ED\u30FC\u30C9: {1}    \u5408\u8A08: {2}</html>"},
-        {"ClassTab.loadedClassesPlotter.accessibleName", "\u30ED\u30FC\u30C9\u6E08\u30AF\u30E9\u30B9\u306E\u30C1\u30E3\u30FC\u30C8\u3002"},
-        {"Classes","\u30AF\u30E9\u30B9"},
-        {"Close","\u9589\u3058\u308B"},
-        {"Column.Name", "\u540D\u524D"},
-        {"Column.PID", "PID"},
-        {"Committed memory","\u30B3\u30DF\u30C3\u30C8\u6E08\u30E1\u30E2\u30EA\u30FC"},
-        {"Committed virtual memory","\u30B3\u30DF\u30C3\u30C8\u6E08\u4EEE\u60F3\u30E1\u30E2\u30EA\u30FC"},
-        {"Committed", "\u30B3\u30DF\u30C3\u30C8\u6E08"},
-        {"Compiler","\u30B3\u30F3\u30D1\u30A4\u30E9"},
-        {"CompositeData","CompositeData"},
-        {"Config","\u69CB\u6210"},
-        {"Connect", "\u63A5\u7D9A(C)"},
-        {"Connect.mnemonic", 'C'},
-        {"Connect...","\u63A5\u7D9A..."},
-        {"ConnectDialog.connectButton.toolTip", "Java\u4EEE\u60F3\u30DE\u30B7\u30F3\u306B\u63A5\u7D9A"},
-        {"ConnectDialog.accessibleDescription", "\u30ED\u30FC\u30AB\u30EB\u307E\u305F\u306F\u30EA\u30E2\u30FC\u30C8\u306EJava\u4EEE\u60F3\u30DE\u30B7\u30F3\u3078\u306E\u65B0\u898F\u63A5\u7D9A\u3092\u884C\u3046\u30C0\u30A4\u30A2\u30ED\u30B0"},
-        {"ConnectDialog.masthead.accessibleName", "\u30DE\u30B9\u30C8\u30D8\u30C3\u30C9\u56F3\u5F62"},
-        {"ConnectDialog.masthead.title", "\u65B0\u898F\u63A5\u7D9A"},
-        {"ConnectDialog.statusBar.accessibleName", "\u30B9\u30C6\u30FC\u30BF\u30B9\u30FB\u30D0\u30FC"},
-        {"ConnectDialog.title", "JConsole: \u65B0\u898F\u63A5\u7D9A"},
-        {"Connected. Click to disconnect.","\u63A5\u7D9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u3068\u5207\u65AD\u3057\u307E\u3059\u3002"},
-        {"Connection failed","\u63A5\u7D9A\u306B\u5931\u6557\u3057\u307E\u3057\u305F"},
-        {"Connection", "\u63A5\u7D9A(C)"},
-        {"Connection.mnemonic", 'C'},
-        {"Connection name", "\u63A5\u7D9A\u540D"},
-        {"ConnectionName (disconnected)","{0} (\u5207\u65AD\u6E08)"},
-        {"Constructor","\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF"},
-        {"Current classes loaded", "\u30ED\u30FC\u30C9\u6E08\u306E\u73FE\u5728\u306E\u30AF\u30E9\u30B9"},
-        {"Current heap size","\u73FE\u5728\u306E\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA"},
-        {"Current value","\u73FE\u5728\u5024: {0}"},
-        {"Create", "\u4F5C\u6210"},
-        {"Daemon threads","\u30C7\u30FC\u30E2\u30F3\u30FB\u30B9\u30EC\u30C3\u30C9"},
-        {"Disconnected. Click to connect.","\u5207\u65AD\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u3068\u63A5\u7D9A\u3057\u307E\u3059\u3002"},
-        {"Double click to expand/collapse","\u5C55\u958B\u307E\u305F\u306F\u7E2E\u5C0F\u3059\u308B\u306B\u306F\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u304F\u3060\u3055\u3044"},
-        {"Double click to visualize", "\u8996\u899A\u5316\u3059\u308B\u306B\u306F\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u304F\u3060\u3055\u3044"},
-        {"Description", "\u8AAC\u660E"},
-        {"Description: ", "\u8AAC\u660E: "},
-        {"Descriptor", "\u8A18\u8FF0\u5B50"},
-        {"Details", "\u8A73\u7D30"},
-        {"Detect Deadlock", "\u30C7\u30C3\u30C9\u30ED\u30C3\u30AF\u306E\u691C\u51FA(D)"},
-        {"Detect Deadlock.mnemonic", 'D'},
-        {"Detect Deadlock.toolTip", "\u30C7\u30C3\u30C9\u30ED\u30C3\u30AF\u6E08\u30B9\u30EC\u30C3\u30C9\u306E\u691C\u51FA"},
-        {"Dimension is not supported:","\u6B21\u5143\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093:"},
-        {"Discard chart", "\u30C1\u30E3\u30FC\u30C8\u306E\u7834\u68C4"},
-        {"DurationDaysHoursMinutes","{0,choice,1#{0,number,integer}\u65E5|1.0<{0,number,integer}\u65E5}{1,choice,0<{1,number,integer}\u6642\u9593|1#{1,number,integer}\u6642\u9593|1<{1,number,integer}\u6642\u9593}{2,choice,0<{2,number,integer}\u5206|1#{2,number,integer}\u5206|1.0<{2,number,integer}\u5206}"},
-
-        {"DurationHoursMinutes","{0,choice,1#{0,number,integer}\u6642\u9593|1<{0,number,integer}\u6642\u9593}{1,choice,0<{1,number,integer}\u5206|1#{1,number,integer}\u5206|1.0<{1,number,integer}\u5206}"},
-
-        {"DurationMinutes","{0,choice,1#{0,number,integer}\u5206|1.0<{0,number,integer}\u5206}"},
-        {"DurationSeconds","{0}\u79D2"},
-        {"Empty array", "\u7A7A\u306E\u914D\u5217"},
-        {"Empty opentype viewer", "\u7A7A\u306Eopentype\u30D3\u30E5\u30FC\u30A2"},
-        {"Error","\u30A8\u30E9\u30FC"},
-        {"Error: MBeans already exist","\u30A8\u30E9\u30FC: MBeans\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059"},
-        {"Error: MBeans do not exist","\u30A8\u30E9\u30FC: MBeans\u306F\u5B58\u5728\u3057\u307E\u305B\u3093"},
-        {"Error:","\u30A8\u30E9\u30FC:"},
-        {"Event","\u30A4\u30D9\u30F3\u30C8"},
-        {"Exit", "\u7D42\u4E86(X)"},
-        {"Exit.mnemonic", 'X'},
-        {"Fail to load plugin", "\u8B66\u544A: \u30D7\u30E9\u30B0\u30A4\u30F3\u306E\u30ED\u30FC\u30C9\u306B\u5931\u6557\u3057\u307E\u3057\u305F: {0}"},
-        {"FileChooser.fileExists.cancelOption", "\u53D6\u6D88"},
-        {"FileChooser.fileExists.message", "<html><center>\u30D5\u30A1\u30A4\u30EB\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u3066\u3044\u307E\u3059:<br>{0}<br>\u7F6E\u63DB\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\u3002"},
-        {"FileChooser.fileExists.okOption", "\u7F6E\u63DB"},
-        {"FileChooser.fileExists.title", "\u30D5\u30A1\u30A4\u30EB\u304C\u5B58\u5728\u3057\u3066\u3044\u307E\u3059"},
-        {"FileChooser.savedFile", "<html>\u30D5\u30A1\u30A4\u30EB\u306B\u4FDD\u5B58\u3057\u307E\u3057\u305F:<br>{0}<br>({1}\u30D0\u30A4\u30C8)"},
-        {"FileChooser.saveFailed.message", "<html><center>\u30D5\u30A1\u30A4\u30EB\u3078\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F:<br>{0}<br>{1}"},
-        {"FileChooser.saveFailed.title", "\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F"},
-        {"Free physical memory","\u7A7A\u304D\u7269\u7406\u30E1\u30E2\u30EA\u30FC"},
-        {"Free swap space","\u7A7A\u304D\u30B9\u30EF\u30C3\u30D7\u30FB\u30B9\u30DA\u30FC\u30B9"},
-        {"Garbage collector","\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30BF"},
-        {"GTK","GTK"},
-        {"GcInfo","\u540D\u524D= ''{0}''\u3001\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3= {1,choice,-1#\u3042\u308A\u307E\u305B\u3093|0#{1,number,integer}\u500B}\u3001\u5408\u8A08\u6D88\u8CBB\u6642\u9593= {2}"},
-        {"GC time","GC\u6642\u9593"},
-        {"GC time details","{1}\u3067{0} ({2}\u500B\u306E\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3)"},
-        {"Heap Memory Usage","\u30D2\u30FC\u30D7\u30FB\u30E1\u30E2\u30EA\u30FC\u4F7F\u7528\u7387"},
-        {"Heap", "\u30D2\u30FC\u30D7"},
-        {"Help.AboutDialog.accessibleDescription", "JConsole\u3068JDK\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u306B\u3064\u3044\u3066\u306E\u60C5\u5831\u3092\u542B\u3080\u30C0\u30A4\u30A2\u30ED\u30B0"},
-        {"Help.AboutDialog.jConsoleVersion", "JConsole\u30D0\u30FC\u30B8\u30E7\u30F3:<br>{0}"},
-        {"Help.AboutDialog.javaVersion", "Java VM\u30D0\u30FC\u30B8\u30E7\u30F3:<br>{0}"},
-        {"Help.AboutDialog.masthead.accessibleName", "\u30DE\u30B9\u30C8\u30D8\u30C3\u30C9\u56F3\u5F62"},
-        {"Help.AboutDialog.masthead.title", "JConsole\u306B\u3064\u3044\u3066"},
-        {"Help.AboutDialog.title", "JConsole: \u8A73\u7D30"},
-        {"Help.AboutDialog.userGuideLink", "JConsole\u30E6\u30FC\u30B6\u30FC\u30FB\u30AC\u30A4\u30C9(U):<br>{0}"},
-        {"Help.AboutDialog.userGuideLink.mnemonic", 'U'},
-        {"Help.AboutDialog.userGuideLink.url", "http://java.sun.com/javase/6/docs/technotes/guides/management/jconsole.html"},
-        {"HelpMenu.About.title", "JConsole\u306B\u3064\u3044\u3066(A)"},
-        {"HelpMenu.About.title.mnemonic", 'A'},
-        {"HelpMenu.UserGuide.title", "\u30AA\u30F3\u30E9\u30A4\u30F3\u30FB\u30E6\u30FC\u30B6\u30FC\u30FB\u30AC\u30A4\u30C9"},
-        {"HelpMenu.UserGuide.title.mnemonic", 'U'},
-        {"HelpMenu.title", "\u30D8\u30EB\u30D7(H)"},
-        {"HelpMenu.title.mnemonic", 'H'},
-        {"Hotspot MBeans...", "Hotspot MBeans(H)..."},
-        {"Hotspot MBeans....mnemonic", 'H'},
-        {"Hotspot MBeans.dialog.accessibleDescription", "Hotspot MBeans\u306E\u7BA1\u7406\u7528\u30C0\u30A4\u30A2\u30ED\u30B0"},
-        {"Impact","\u5F71\u97FF"},
-        {"Info","\u60C5\u5831"},
-        {"INFO","\u60C5\u5831"},
-        {"Invalid plugin path", "\u8B66\u544A: \u7121\u52B9\u306A\u30D7\u30E9\u30B0\u30A4\u30F3\u30FB\u30D1\u30B9: {0}"},
-        {"Invalid URL", "\u7121\u52B9\u306AURL: {0}"},
-        {"Is","\u6B21\u306B\u4E00\u81F4\u3059\u308B"},
-        {"Java Monitoring & Management Console", "Java Monitoring & Management Console"},
-        {"JConsole: ","JConsole: {0}"},
-        {"JConsole version","JConsole\u30D0\u30FC\u30B8\u30E7\u30F3\"{0}\""},
-        {"JConsole.accessibleDescription", "Java Monitoring & Management Console"},
-        {"JIT compiler","JIT\u30B3\u30F3\u30D1\u30A4\u30E9"},
-        {"Java Virtual Machine","Java\u4EEE\u60F3\u30DE\u30B7\u30F3"},
-        {"Java","Java"},
-        {"Library path","\u30E9\u30A4\u30D6\u30E9\u30EA\u30FB\u30D1\u30B9"},
-        {"Listeners","\u30EA\u30B9\u30CA\u30FC"},
-        {"Live Threads","\u5B9F\u884C\u4E2D\u306E\u30B9\u30EC\u30C3\u30C9"},
-        {"Loaded", "\u30ED\u30FC\u30C9\u6E08"},
-        {"Local Process:", "\u30ED\u30FC\u30AB\u30EB\u30FB\u30D7\u30ED\u30BB\u30B9(L):"},
-        {"Local Process:.mnemonic", 'L'},
-        {"Look and Feel","Look&Feel"},
-        {"Masthead.font", "Dialog-PLAIN-25"},
-        {"Management Not Enabled","<b>\u6CE8\u610F</b>: \u7BA1\u7406\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u306F\u3053\u306E\u30D7\u30ED\u30BB\u30B9\u3067\u306F\u6709\u52B9\u5316\u3055\u308C\u307E\u305B\u3093\u3002"},
-        {"Management Will Be Enabled","<b>\u6CE8\u610F</b>: \u7BA1\u7406\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u306F\u3053\u306E\u30D7\u30ED\u30BB\u30B9\u3067\u6709\u52B9\u5316\u3055\u308C\u307E\u3059\u3002"},
-        {"MBeanAttributeInfo","MBeanAttributeInfo"},
-        {"MBeanInfo","MBeanInfo"},
-        {"MBeanNotificationInfo","MBeanNotificationInfo"},
-        {"MBeanOperationInfo","MBeanOperationInfo"},
-        {"MBeans","MBeans"},
-        {"MBeansTab.clearNotificationsButton", "\u30AF\u30EA\u30A2(C)"},
-        {"MBeansTab.clearNotificationsButton.mnemonic", 'C'},
-        {"MBeansTab.clearNotificationsButton.toolTip", "\u901A\u77E5\u306E\u30AF\u30EA\u30A2"},
-        {"MBeansTab.compositeNavigationMultiple", "\u30B3\u30F3\u30DD\u30B8\u30C3\u30C8\u30FB\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3{0}/{1}"},
-        {"MBeansTab.compositeNavigationSingle", "\u30B3\u30F3\u30DD\u30B8\u30C3\u30C8\u30FB\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3"},
-        {"MBeansTab.refreshAttributesButton", "\u30EA\u30D5\u30EC\u30C3\u30B7\u30E5(R)"},
-        {"MBeansTab.refreshAttributesButton.mnemonic", 'R'},
-        {"MBeansTab.refreshAttributesButton.toolTip", "\u5C5E\u6027\u306E\u30EA\u30D5\u30EC\u30C3\u30B7\u30E5"},
-        {"MBeansTab.subscribeNotificationsButton", "\u30B5\u30D6\u30B9\u30AF\u30E9\u30A4\u30D6(S)"},
-        {"MBeansTab.subscribeNotificationsButton.mnemonic", 'S'},
-        {"MBeansTab.subscribeNotificationsButton.toolTip", "\u901A\u77E5\u30EA\u30B9\u30CB\u30F3\u30B0\u306E\u958B\u59CB"},
-        {"MBeansTab.tabularNavigationMultiple", "\u30BF\u30D6\u30FB\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3{0}/{1}"},
-        {"MBeansTab.tabularNavigationSingle", "\u30BF\u30D6\u30FB\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3"},
-        {"MBeansTab.unsubscribeNotificationsButton", "\u30B5\u30D6\u30B9\u30AF\u30E9\u30A4\u30D6\u89E3\u9664(U)"},
-        {"MBeansTab.unsubscribeNotificationsButton.mnemonic", 'U'},
-        {"MBeansTab.unsubscribeNotificationsButton.toolTip", "\u901A\u77E5\u30EA\u30B9\u30CB\u30F3\u30B0\u306E\u505C\u6B62"},
-        {"Manage Hotspot MBeans in: ", "Hotspot MBeans\u306E\u7BA1\u7406: "},
-        {"Max","\u6700\u5927"},
-        {"Maximum heap size","\u6700\u5927\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA"},
-        {"Memory","\u30E1\u30E2\u30EA\u30FC"},
-        {"MemoryPoolLabel", "\u30E1\u30E2\u30EA\u30FC\u30FB\u30D7\u30FC\u30EB\"{0}\""},
-        {"MemoryTab.heapPlotter.accessibleName", "\u30D2\u30FC\u30D7\u7528\u306E\u30E1\u30E2\u30EA\u30FC\u4F7F\u7528\u7387\u30C1\u30E3\u30FC\u30C8\u3002"},
-        {"MemoryTab.infoLabelFormat", "<html>\u4F7F\u7528\u6E08: {0}    \u30B3\u30DF\u30C3\u30C8\u6E08: {1}    \u6700\u5927: {2}</html>"},
-        {"MemoryTab.nonHeapPlotter.accessibleName", "\u975E\u30D2\u30FC\u30D7\u7528\u306E\u30E1\u30E2\u30EA\u30FC\u4F7F\u7528\u7387\u30C1\u30E3\u30FC\u30C8\u3002"},
-        {"MemoryTab.poolChart.aboveThreshold", "{0}\u306E\u3057\u304D\u3044\u5024\u3088\u308A\u4E0A\u3067\u3059\u3002\n"},
-        {"MemoryTab.poolChart.accessibleName", "\u30E1\u30E2\u30EA\u30FC\u30FB\u30D7\u30FC\u30EB\u4F7F\u7528\u7387\u30C1\u30E3\u30FC\u30C8\u3002"},
-        {"MemoryTab.poolChart.belowThreshold", "{0}\u306E\u3057\u304D\u3044\u5024\u3088\u308A\u4E0B\u3067\u3059\u3002\n"},
-        {"MemoryTab.poolPlotter.accessibleName", "{0}\u306E\u30E1\u30E2\u30EA\u30FC\u4F7F\u7528\u7387\u30C1\u30E3\u30FC\u30C8\u3002"},
-        {"Message","\u30E1\u30C3\u30BB\u30FC\u30B8"},
-        {"Method successfully invoked", "\u30E1\u30BD\u30C3\u30C9\u304C\u6B63\u5E38\u306B\u8D77\u52D5\u3055\u308C\u307E\u3057\u305F"},
-        {"Minimize All", "\u3059\u3079\u3066\u6700\u5C0F\u5316(M)"},
-        {"Minimize All.mnemonic", 'M'},
-        {"Minus Version", "\u3053\u308C\u306F{0}\u306E\u30D0\u30FC\u30B8\u30E7\u30F3{1}\u3067\u3059"},
-        {"Monitor locked",
-             "   - \u30ED\u30C3\u30AF\u6E08{0}\n"},
-        {"Motif","Motif"},
-        {"Name Build and Mode","{0} (\u30D3\u30EB\u30C9{1}, {2})"},
-        {"Name and Build","{0} (\u30D3\u30EB\u30C9{1})"},
-        {"Name","\u540D\u524D"},
-        {"Name: ","\u540D\u524D: "},
-        {"Name State",
-             "\u540D\u524D: {0}\n\u72B6\u614B: {1}\n"},
-        {"Name State LockName",
-             "\u540D\u524D: {0}\n\u72B6\u614B: {2}\u306E{1}\n"},
-        {"Name State LockName LockOwner",
-             "\u540D\u524D: {0}\n\u72B6\u614B: {2}\u306E{1}\u3001\u6240\u6709\u8005: {3}\n"},
-        {"New Connection...", "\u65B0\u898F\u63A5\u7D9A(N)..."},
-        {"New Connection....mnemonic", 'N'},
-        {"New value applied","\u9069\u7528\u3055\u308C\u305F\u65B0\u898F\u5024"},
-        {"No attribute selected","\u5C5E\u6027\u304C\u9078\u629E\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F"},
-        {"No deadlock detected","\u30C7\u30C3\u30C9\u30ED\u30C3\u30AF\u304C\u691C\u51FA\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F"},
-        {"No value selected","\u5024\u304C\u9078\u629E\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F"},
-        {"Non-Heap Memory Usage","\u975E\u30D2\u30FC\u30D7\u30FB\u30E1\u30E2\u30EA\u30FC\u4F7F\u7528\u7387"},
-        {"Non-Heap", "\u975E\u30D2\u30FC\u30D7"},
-        {"Not Yet Implemented","\u307E\u3060\u5B9F\u88C5\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-        {"Not a valid event broadcaster", "\u6709\u52B9\u306A\u30A4\u30D9\u30F3\u30C8\u30FB\u30D6\u30ED\u30FC\u30C9\u30AD\u30E3\u30B9\u30BF\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
-        {"Notification","\u901A\u77E5"},
-        {"Notification buffer","\u901A\u77E5\u30D0\u30C3\u30D5\u30A1"},
-        {"Notifications","\u901A\u77E5"},
-        {"NotifTypes", "NotifTypes"},
-        {"Number of Threads","\u30B9\u30EC\u30C3\u30C9\u6570"},
-        {"Number of Loaded Classes","\u30ED\u30FC\u30C9\u6E08\u30AF\u30E9\u30B9\u6570"},
-        {"Number of processors","\u30D7\u30ED\u30BB\u30C3\u30B5\u6570"},
-        {"ObjectName","ObjectName"},
-        {"Operating System","\u30AA\u30DA\u30EC\u30FC\u30C6\u30A3\u30F3\u30B0\u30FB\u30B7\u30B9\u30C6\u30E0"},
-        {"Operation","\u64CD\u4F5C"},
-        {"Operation invocation","\u64CD\u4F5C\u306E\u547C\u51FA\u3057"},
-        {"Operation return value", "\u64CD\u4F5C\u306E\u623B\u308A\u5024"},
-        {"Operations","\u64CD\u4F5C"},
-        {"Overview","\u6982\u8981"},
-        {"OverviewPanel.plotter.accessibleName", "{0}\u306E\u30C1\u30E3\u30FC\u30C8\u3002"},
-        {"Parameter", "\u30D1\u30E9\u30E1\u30FC\u30BF"},
-        {"Password: ", "\u30D1\u30B9\u30EF\u30FC\u30C9(P): "},
-        {"Password: .mnemonic", 'P'},
-        {"Password.accessibleName", "\u30D1\u30B9\u30EF\u30FC\u30C9"},
-        {"Peak","\u30D4\u30FC\u30AF"},
-        {"Perform GC", "GC\u306E\u5B9F\u884C"},
-        {"Perform GC.mnemonic", 'G'},
-        {"Perform GC.toolTip", "\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u306E\u30EA\u30AF\u30A8\u30B9\u30C8"},
-        {"Plotter.accessibleName", "\u30C1\u30E3\u30FC\u30C8"},
-        {"Plotter.accessibleName.keyAndValue", "{0}={1}\n"},
-        {"Plotter.accessibleName.noData", "\u30C7\u30FC\u30BF\u304C\u30D7\u30ED\u30C3\u30C8\u3055\u308C\u307E\u305B\u3093\u3002"},
-        {"Plotter.saveAsMenuItem", "\u540D\u524D\u3092\u4ED8\u3051\u3066\u30C7\u30FC\u30BF\u3092\u4FDD\u5B58(A)..."},
-        {"Plotter.saveAsMenuItem.mnemonic", 'A'},
-        {"Plotter.timeRangeMenu", "\u6642\u9593\u7BC4\u56F2(T)"},
-        {"Plotter.timeRangeMenu.mnemonic", 'T'},
-        {"Problem adding listener","\u30EA\u30B9\u30CA\u30FC\u8FFD\u52A0\u4E2D\u306E\u554F\u984C"},
-        {"Problem displaying MBean", "MBean\u8868\u793A\u4E2D\u306E\u554F\u984C"},
-        {"Problem invoking", "\u547C\u51FA\u3057\u4E2D\u306E\u554F\u984C"},
-        {"Problem removing listener","\u30EA\u30B9\u30CA\u30FC\u524A\u9664\u4E2D\u306E\u554F\u984C"},
-        {"Problem setting attribute","\u5C5E\u6027\u8A2D\u5B9A\u4E2D\u306E\u554F\u984C"},
-        {"Process CPU time","\u30D7\u30ED\u30BB\u30B9CPU\u6642\u9593"},
-        {"R/W","R/W"},
-        {"Readable","\u8AAD\u53D6\u308A\u53EF\u80FD"},
-        {"Received","\u53D7\u4FE1\u6E08"},
-        {"Reconnect","\u518D\u63A5\u7D9A"},
-        {"Remote Process:", "\u30EA\u30E2\u30FC\u30C8\u30FB\u30D7\u30ED\u30BB\u30B9(R):"},
-        {"Remote Process:.mnemonic", 'R'},
-        {"Remote Process.textField.accessibleName", "\u30EA\u30E2\u30FC\u30C8\u30FB\u30D7\u30ED\u30BB\u30B9"},
-        {"Remove","\u524A\u9664"},
-        {"Restore All", "\u3059\u3079\u3066\u5FA9\u5143(R)"},
-        {"Restore All.mnemonic", 'R'},
-        {"Return value", "\u623B\u308A\u5024"},
-        {"ReturnType", "ReturnType"},
-        {"SeqNum","SeqNum"},
-        {"Size Bytes", "{0,number,integer}\u30D0\u30A4\u30C8"},
-        {"Size Gb","{0} Gb"},
-        {"Size Kb","{0} Kb"},
-        {"Size Mb","{0} Mb"},
-        {"Source","\u30BD\u30FC\u30B9"},
-        {"Stack trace",
-              "\n\u30B9\u30BF\u30C3\u30AF\u30FB\u30C8\u30EC\u30FC\u30B9: \n"},
-        {"Success:","\u6210\u529F:"},
-        // Note: SummaryTab.headerDateTimeFormat can be one the following:
-        // 1. A combination of two styles for date and time, using the
-        //    constants from class DateFormat: SHORT, MEDIUM, LONG, FULL.
-        //    Example: "MEDIUM,MEDIUM" or "FULL,SHORT"
-        // 2. An explicit string pattern used for creating an instance
-        //    of the class SimpleDateFormat.
-        //    Example: "yyyy-MM-dd HH:mm:ss" or "M/d/yyyy h:mm:ss a"
-        {"SummaryTab.headerDateTimeFormat", "FULL,FULL"},
-        {"SummaryTab.pendingFinalization.label", "\u30D5\u30A1\u30A4\u30CA\u30E9\u30A4\u30BA\u306E\u30DA\u30F3\u30C7\u30A3\u30F3\u30B0"},
-        {"SummaryTab.pendingFinalization.value", "{0}\u500B\u306E\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8"},
-        {"SummaryTab.tabName", "VM\u30B5\u30DE\u30EA\u30FC"},
-        {"SummaryTab.vmVersion","{0}\u30D0\u30FC\u30B8\u30E7\u30F3{1}"},
-        {"TabularData are not supported", "TabularData \u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
-        {"Threads","\u30B9\u30EC\u30C3\u30C9"},
-        {"ThreadTab.infoLabelFormat", "<html>\u5B9F\u884C\u4E2D: {0}    \u30D4\u30FC\u30AF: {1}    \u5408\u8A08: {2}</html>"},
-        {"ThreadTab.threadInfo.accessibleName", "\u30B9\u30EC\u30C3\u30C9\u60C5\u5831"},
-        {"ThreadTab.threadPlotter.accessibleName", "\u30B9\u30EC\u30C3\u30C9\u6570\u306E\u30C1\u30E3\u30FC\u30C8\u3002"},
-        {"Threshold","\u3057\u304D\u3044\u5024"},
-        {"Tile", "\u4E26\u3079\u3066\u8868\u793A(T)"},
-        {"Tile.mnemonic", 'T'},
-        {"Time Range:", "\u6642\u9593\u7BC4\u56F2(T):"},
-        {"Time Range:.mnemonic", 'T'},
-        {"Time", "\u6642\u9593"},
-        {"TimeStamp","TimeStamp"},
-        {"Total Loaded", "\u30ED\u30FC\u30C9\u6E08\u5408\u8A08"},
-        {"Total classes loaded","\u30ED\u30FC\u30C9\u6E08\u30AF\u30E9\u30B9\u5408\u8A08"},
-        {"Total classes unloaded","\u30A2\u30F3\u30ED\u30FC\u30C9\u6E08\u30AF\u30E9\u30B9\u5408\u8A08"},
-        {"Total compile time","\u5408\u8A08\u30B3\u30F3\u30D1\u30A4\u30EB\u6642\u9593"},
-        {"Total physical memory","\u5408\u8A08\u7269\u7406\u30E1\u30E2\u30EA\u30FC"},
-        {"Total threads started","\u958B\u59CB\u6E08\u5408\u8A08\u30B9\u30EC\u30C3\u30C9"},
-        {"Total swap space","\u5408\u8A08\u30B9\u30EF\u30C3\u30D7\u30FB\u30B9\u30DA\u30FC\u30B9"},
-        {"Type","\u578B"},
-        {"Unavailable","\u5229\u7528\u4E0D\u53EF"},
-        {"UNKNOWN","UNKNOWN"},
-        {"Unknown Host","\u4E0D\u660E\u306A\u30DB\u30B9\u30C8: {0}"},
-        {"Unregister", "\u767B\u9332\u89E3\u9664"},
-        {"Uptime","\u7A3C\u50CD\u6642\u9593"},
-        {"Uptime: ","\u7A3C\u50CD\u6642\u9593: "},
-        {"Usage Threshold","\u4F7F\u7528\u3057\u304D\u3044\u5024"},
-        {"remoteTF.usage","<b>\u4F7F\u7528\u65B9\u6CD5</b>: &lt;hostname&gt;:&lt;port&gt;\u307E\u305F\u306Fservice:jmx:&lt;protocol&gt;:&lt;sap&gt;"},
-        {"Used","\u4F7F\u7528\u6E08"},
-        {"Username: ", "\u30E6\u30FC\u30B6\u30FC\u540D(U): "},
-        {"Username: .mnemonic", 'U'},
-        {"Username.accessibleName", "\u30E6\u30FC\u30B6\u30FC\u540D"},
-        {"UserData","UserData"},
-        {"Virtual Machine","\u4EEE\u60F3\u30DE\u30B7\u30F3"},
-        {"VM arguments","VM\u5F15\u6570"},
-        {"VM","VM"},
-        {"VMInternalFrame.accessibleDescription", "Java\u4EEE\u60F3\u30DE\u30B7\u30F3\u306E\u30E2\u30CB\u30BF\u30FC\u7528\u306E\u5185\u90E8\u30D5\u30EC\u30FC\u30E0"},
-        {"Value","\u5024"},
-        {"Vendor", "\u30D9\u30F3\u30C0\u30FC"},
-        {"Verbose Output","\u8A73\u7D30\u51FA\u529B"},
-        {"Verbose Output.toolTip", "\u30AF\u30E9\u30B9\u8AAD\u8FBC\u307F\u30B7\u30B9\u30C6\u30E0\u3067\u8A73\u7D30\u51FA\u529B\u3092\u6709\u52B9\u306B\u3059\u308B"},
-        {"View value", "\u5024\u306E\u8868\u793A"},
-        {"View","\u8868\u793A"},
-        {"Window", "\u30A6\u30A3\u30F3\u30C9\u30A6(W)"},
-        {"Window.mnemonic", 'W'},
-        {"Windows","\u30A6\u30A3\u30F3\u30C9\u30A6"},
-        {"Writable","\u66F8\u8FBC\u307F\u53EF\u80FD"},
-        {"You cannot drop a class here", "\u30AF\u30E9\u30B9\u3092\u3053\u3053\u306B\u30C9\u30ED\u30C3\u30D7\u3067\u304D\u307E\u305B\u3093"},
-        {"collapse", "\u7E2E\u5C0F"},
-        {"connectionFailed1","\u63A5\u7D9A\u306B\u5931\u6557\u3057\u307E\u3057\u305F: \u518D\u8A66\u884C\u3057\u307E\u3059\u304B\u3002"},
-        {"connectionFailed2","{0}\u3078\u306E\u63A5\u7D9A\u304C\u6210\u529F\u3057\u307E\u305B\u3093\u3067\u3057\u305F\u3002<br>\u3082\u3046\u4E00\u5EA6\u8A66\u3057\u307E\u3059\u304B\u3002"},
-        {"connectionLost1","\u63A5\u7D9A\u304C\u5931\u308F\u308C\u307E\u3057\u305F: \u518D\u63A5\u7D9A\u3057\u307E\u3059\u304B\u3002"},
-        {"connectionLost2","\u30EA\u30E2\u30FC\u30C8\u30FB\u30D7\u30ED\u30BB\u30B9\u304C\u7D42\u4E86\u3057\u305F\u305F\u3081{0}\u3078\u306E\u63A5\u7D9A\u304C\u5931\u308F\u308C\u307E\u3057\u305F\u3002<br>\u518D\u63A5\u7D9A\u3057\u307E\u3059\u304B\u3002"},
-        {"connectingTo1","{0}\u306B\u63A5\u7D9A\u4E2D"},
-        {"connectingTo2","{0}\u306B\u73FE\u5728\u63A5\u7D9A\u4E2D\u3067\u3059\u3002<br>\u3053\u308C\u306B\u306F\u6570\u5206\u304B\u304B\u308A\u307E\u3059\u3002"},
-        {"deadlockAllTab","\u3059\u3079\u3066"},
-        {"deadlockTab","\u30C7\u30C3\u30C9\u30ED\u30C3\u30AF"},
-        {"deadlockTabN","\u30C7\u30C3\u30C9\u30ED\u30C3\u30AF{0}"},
-        {"expand", "\u5C55\u958B"},
-        {"kbytes","{0} KB"},
-        {"operation","\u64CD\u4F5C"},
-        {"plot", "\u30D7\u30ED\u30C3\u30C8"},
-        {"visualize","\u8996\u899A\u5316"},
-        {"zz usage text",
-             "\u4F7F\u7528\u65B9\u6CD5: {0} [ -interval=n ] [ -notile ] [ -pluginpath <path> ] [ -version ] [ connection ... ]\n\n  -interval   \u66F4\u65B0\u9593\u9694\u3092n\u79D2\u306B\u8A2D\u5B9A\u3059\u308B(\u30C7\u30D5\u30A9\u30EB\u30C8\u306F4\u79D2)\n  -notile     \u30A6\u30A3\u30F3\u30C9\u30A6\u3092\u6700\u521D\u306B\u4E26\u3079\u3066\u8868\u793A\u3057\u306A\u3044(2\u3064\u4EE5\u4E0A\u306E\u63A5\u7D9A\u306B\u3064\u3044\u3066)\n  -pluginpath JConsole\u304C\u30D7\u30E9\u30B0\u30A4\u30F3\u3092\u53C2\u7167\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3059\u308B\u30D1\u30B9\u3092\u6307\u5B9A\u3059\u308B\n  -version    \u30D7\u30ED\u30B0\u30E9\u30E0\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u5370\u5237\u3059\u308B\n\n  connection = pid || host:port || JMX URL (service:jmx:<protocol>://...)\n  pid         \u30BF\u30FC\u30B2\u30C3\u30C8\u30FB\u30D7\u30ED\u30BB\u30B9\u306E\u30D7\u30ED\u30BB\u30B9ID\n  host        \u30EA\u30E2\u30FC\u30C8\u30FB\u30DB\u30B9\u30C8\u540D\u307E\u305F\u306FIP\u30A2\u30C9\u30EC\u30B9\n  port        \u30EA\u30E2\u30FC\u30C8\u63A5\u7D9A\u7528\u306E\u30DD\u30FC\u30C8\u756A\u53F7\n\n  -J          JConsole\u304C\u5B9F\u884C\u4E2D\u306EJava\u4EEE\u60F3\u30DE\u30B7\u30F3\u3078\u306E\n              \u5165\u529B\u5F15\u6570\u3092\u6307\u5B9A\u3059\u308B"},
-        // END OF MATERIAL TO LOCALIZE
-        };
-
-        String ls = System.getProperty("line.separator");
-        for(int i=0;i<temp.length;i++) {
-            if (temp[i][1] instanceof String){
-            temp[i][1] = temp[i][1].toString().replaceAll("\n",ls);
-            }
-        }
-
-        return temp;
-
-    }
-
-    public synchronized Object[][] getContents() {
-        return getContents0();
-    }
-}
diff --git a/src/share/classes/sun/tools/jconsole/resources/JConsoleResources_zh_CN.java b/src/share/classes/sun/tools/jconsole/resources/JConsoleResources_zh_CN.java
deleted file mode 100644
index 4eb63ed..0000000
--- a/src/share/classes/sun/tools/jconsole/resources/JConsoleResources_zh_CN.java
+++ /dev/null
@@ -1,442 +0,0 @@
-/*
- * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.tools.jconsole.resources;
-
-import java.util.*;
-
-import static java.awt.event.KeyEvent.*;
-
-/**
- * <p> This class represents the <code>ResourceBundle</code>
- * for the following package(s):
- *
- * <ol>
- * <li> sun.tools.jconsole
- * </ol>
- *
- * <P>
- * Subclasses must override <code>getContents0</code> and provide an array,
- * where each item in the array consists of a <code>String</code> key,
- * and either a <code>String</code> value associated with that key,
- * or if the keys ends with ".mnemonic", an element
- * representing a mnemomic keycode <code>int</code> or <code>char</code>.
- */
-public class JConsoleResources_zh_CN extends JConsoleResources {
-
-    /**
-     * Returns the contents of this <code>ResourceBundle</code>.
-     *
-     * <p>
-     *
-     * @return the contents of this <code>ResourceBundle</code>.
-     */
-    protected Object[][] getContents0() {
-        Object[][] temp = new Object[][] {
-                // NOTE 1: The value strings in this file containing "{0}" are
-        //         processed by the java.text.MessageFormat class.  Any
-        //         single quotes appearing in these strings need to be
-        //         doubled up.
-        //
-        // NOTE 2: To make working with this file a bit easier, please
-        //         maintain these messages in ASCII sorted order by
-        //         message key.
-        //
-        // LOCALIZE THIS
-        {" 1 day"," 1 \u5929"},
-        {" 1 hour"," 1 \u5C0F\u65F6"},
-        {" 1 min"," 1 \u5206\u949F"},
-        {" 1 month"," 1 \u4E2A\u6708"},
-        {" 1 year"," 1 \u5E74"},
-        {" 2 hours"," 2 \u5C0F\u65F6"},
-        {" 3 hours"," 3 \u5C0F\u65F6"},
-        {" 3 months"," 3 \u4E2A\u6708"},
-        {" 5 min"," 5 \u5206\u949F"},
-        {" 6 hours"," 6 \u5C0F\u65F6"},
-        {" 6 months"," 6 \u4E2A\u6708"},
-        {" 7 days"," 7 \u5929"},
-        {"10 min","10 \u5206\u949F"},
-        {"12 hours","12 \u5C0F\u65F6"},
-        {"30 min","30 \u5206\u949F"},
-        {"<","<"},
-        {"<<","<<"},
-        {">",">"},
-        {"ACTION","ACTION"},
-        {"ACTION_INFO","ACTION_INFO"},
-        {"All","\u5168\u90E8"},
-        {"Apply","\u5E94\u7528"},
-        {"Architecture","\u4F53\u7CFB\u7ED3\u6784"},
-        {"Array, OpenType", "\u6570\u7EC4, OpenType"},
-        {"Array, OpenType, Numeric value viewer","\u6570\u7EC4, OpenType, \u6570\u503C\u67E5\u770B\u5668"},
-        {"Attribute","\u5C5E\u6027"},
-        {"Attribute value","\u5C5E\u6027\u503C"},
-        {"Attribute values","\u5C5E\u6027\u503C"},
-        {"Attributes","\u5C5E\u6027"},
-        {"Blank", "\u7A7A\u767D"},
-        {"BlockedCount WaitedCount",
-             "\u603B\u963B\u6B62\u6570: {0}, \u603B\u7B49\u5F85\u6570: {1}\n"},
-        {"Boot class path","\u5F15\u5BFC\u7C7B\u8DEF\u5F84"},
-        {"BorderedComponent.moreOrLessButton.toolTip", "\u5207\u6362\u4EE5\u663E\u793A\u66F4\u591A\u6216\u66F4\u5C11\u4FE1\u606F"},
-        {"CPU Usage","CPU \u5360\u7528\u7387"},
-        {"CPUUsageFormat","CPU \u5360\u7528\u7387: {0}%"},
-        {"Cancel","\u53D6\u6D88"},
-        {"Cascade", "\u5C42\u53E0(C)"},
-        {"Cascade.mnemonic", 'C'},
-        {"Chart:", "\u56FE\u8868(C):"},
-        {"Chart:.mnemonic", 'C'},
-        {"Class path","\u7C7B\u8DEF\u5F84"},
-        {"Class","\u7C7B"},
-        {"ClassName","ClassName"},
-        {"ClassTab.infoLabelFormat", "<html>\u5DF2\u52A0\u8F7D: {0}    \u5DF2\u5378\u8F7D: {1}    \u603B\u8BA1: {2}</html>"},
-        {"ClassTab.loadedClassesPlotter.accessibleName", "\u5DF2\u52A0\u8F7D\u7C7B\u7684\u56FE\u8868\u3002"},
-        {"Classes","\u7C7B"},
-        {"Close","\u5173\u95ED"},
-        {"Column.Name", "\u540D\u79F0"},
-        {"Column.PID", "PID"},
-        {"Committed memory","\u63D0\u4EA4\u7684\u5185\u5B58"},
-        {"Committed virtual memory","\u63D0\u4EA4\u7684\u865A\u62DF\u5185\u5B58"},
-        {"Committed", "\u5DF2\u63D0\u4EA4"},
-        {"Compiler","\u7F16\u8BD1\u5668"},
-        {"CompositeData","CompositeData"},
-        {"Config","\u914D\u7F6E"},
-        {"Connect", "\u8FDE\u63A5(C)"},
-        {"Connect.mnemonic", 'C'},
-        {"Connect...","\u8FDE\u63A5..."},
-        {"ConnectDialog.connectButton.toolTip", "\u8FDE\u63A5\u5230 Java \u865A\u62DF\u673A"},
-        {"ConnectDialog.accessibleDescription", "\u7528\u4E8E\u4E0E\u672C\u5730\u6216\u8FDC\u7A0B Java \u865A\u62DF\u673A\u5EFA\u7ACB\u65B0\u8FDE\u63A5\u7684\u5BF9\u8BDD\u6846"},
-        {"ConnectDialog.masthead.accessibleName", "\u62A5\u5934\u56FE"},
-        {"ConnectDialog.masthead.title", "\u65B0\u5EFA\u8FDE\u63A5"},
-        {"ConnectDialog.statusBar.accessibleName", "\u72B6\u6001\u680F"},
-        {"ConnectDialog.title", "JConsole: \u65B0\u5EFA\u8FDE\u63A5"},
-        {"Connected. Click to disconnect.","\u5DF2\u8FDE\u63A5\u3002\u5355\u51FB\u53EF\u65AD\u5F00\u8FDE\u63A5\u3002"},
-        {"Connection failed","\u8FDE\u63A5\u5931\u8D25"},
-        {"Connection", "\u8FDE\u63A5(C)"},
-        {"Connection.mnemonic", 'C'},
-        {"Connection name", "\u8FDE\u63A5\u540D\u79F0"},
-        {"ConnectionName (disconnected)","{0} (\u5DF2\u65AD\u5F00\u8FDE\u63A5)"},
-        {"Constructor","\u6784\u9020\u5668"},
-        {"Current classes loaded", "\u5DF2\u52A0\u88C5\u5F53\u524D\u7C7B"},
-        {"Current heap size","\u5F53\u524D\u5806\u5927\u5C0F"},
-        {"Current value","\u5F53\u524D\u503C: {0}"},
-        {"Create", "\u521B\u5EFA"},
-        {"Daemon threads","\u5B88\u62A4\u7A0B\u5E8F\u7EBF\u7A0B"},
-        {"Disconnected. Click to connect.","\u5DF2\u65AD\u5F00\u8FDE\u63A5\u3002\u5355\u51FB\u53EF\u8FDE\u63A5\u3002"},
-        {"Double click to expand/collapse","\u53CC\u51FB\u4EE5\u5C55\u5F00/\u9690\u85CF"},
-        {"Double click to visualize", "\u53CC\u51FB\u4EE5\u4F7F\u5176\u53EF\u89C1"},
-        {"Description", "\u8BF4\u660E"},
-        {"Description: ", "\u8BF4\u660E: "},
-        {"Descriptor", "\u63CF\u8FF0\u7B26"},
-        {"Details", "\u8BE6\u7EC6\u8D44\u6599"},
-        {"Detect Deadlock", "\u68C0\u6D4B\u6B7B\u9501(D)"},
-        {"Detect Deadlock.mnemonic", 'D'},
-        {"Detect Deadlock.toolTip", "\u68C0\u6D4B\u5904\u4E8E\u6B7B\u9501\u72B6\u6001\u7684\u7EBF\u7A0B"},
-        {"Dimension is not supported:","\u4E0D\u652F\u6301\u7EF4:"},
-        {"Discard chart", "\u653E\u5F03\u56FE\u8868"},
-        {"DurationDaysHoursMinutes","{0,choice,1#{0,number,integer} \u5929 |1.0<{0,number,integer} \u5929 }{1,choice,0<{1,number,integer} \u5C0F\u65F6 |1#{1,number,integer} \u5C0F\u65F6 |1<{1,number,integer} \u5C0F\u65F6 }{2,choice,0<{2,number,integer} \u5206\u949F|1#{2,number,integer} \u5206\u949F|1.0<{2,number,integer} \u5206\u949F}"},
-
-        {"DurationHoursMinutes","{0,choice,1#{0,number,integer} \u5C0F\u65F6 |1<{0,number,integer} \u5C0F\u65F6 }{1,choice,0<{1,number,integer} \u5206\u949F|1#{1,number,integer} \u5206\u949F|1.0<{1,number,integer} \u5206\u949F}"},
-
-        {"DurationMinutes","{0,choice,1#{0,number,integer} \u5206\u949F|1.0<{0,number,integer} \u5206\u949F}"},
-        {"DurationSeconds","{0} \u79D2"},
-        {"Empty array", "\u7A7A\u6570\u7EC4"},
-        {"Empty opentype viewer", "\u7A7A opentype \u67E5\u770B\u5668"},
-        {"Error","\u9519\u8BEF"},
-        {"Error: MBeans already exist","\u9519\u8BEF: MBean \u5DF2\u5B58\u5728"},
-        {"Error: MBeans do not exist","\u9519\u8BEF: MBean \u4E0D\u5B58\u5728"},
-        {"Error:","\u9519\u8BEF:"},
-        {"Event","\u4E8B\u4EF6"},
-        {"Exit", "\u9000\u51FA(X)"},
-        {"Exit.mnemonic", 'X'},
-        {"Fail to load plugin", "\u8B66\u544A: \u65E0\u6CD5\u52A0\u8F7D\u63D2\u4EF6: {0}"},
-        {"FileChooser.fileExists.cancelOption", "\u53D6\u6D88"},
-        {"FileChooser.fileExists.message", "<html><center>\u6587\u4EF6\u5DF2\u5B58\u5728:<br>{0}<br>\u662F\u5426\u8981\u66FF\u6362?"},
-        {"FileChooser.fileExists.okOption", "\u66FF\u6362"},
-        {"FileChooser.fileExists.title", "\u6587\u4EF6\u5DF2\u5B58\u5728"},
-        {"FileChooser.savedFile", "<html>\u5DF2\u4FDD\u5B58\u5230\u6587\u4EF6:<br>{0}<br>({1} \u5B57\u8282)"},
-        {"FileChooser.saveFailed.message", "<html><center>\u672A\u80FD\u4FDD\u5B58\u5230\u6587\u4EF6:<br>{0}<br>{1}"},
-        {"FileChooser.saveFailed.title", "\u4FDD\u5B58\u5931\u8D25"},
-        {"Free physical memory","\u7A7A\u95F2\u7269\u7406\u5185\u5B58"},
-        {"Free swap space","\u7A7A\u95F2\u4EA4\u6362\u7A7A\u95F4"},
-        {"Garbage collector","\u5783\u573E\u6536\u96C6\u5668"},
-        {"GTK","GTK"},
-        {"GcInfo","\u540D\u79F0 = ''{0}'', \u6536\u96C6 = {1,choice,-1#Unavailable|0#{1,number,integer}}, \u603B\u82B1\u8D39\u65F6\u95F4 = {2}"},
-        {"GC time","GC \u65F6\u95F4"},
-        {"GC time details","{1}\u4E0A\u7684{0} ({2}\u6536\u96C6)"},
-        {"Heap Memory Usage","\u5806\u5185\u5B58\u4F7F\u7528\u91CF"},
-        {"Heap", "\u5806"},
-        {"Help.AboutDialog.accessibleDescription", "\u5305\u542B\u6709\u5173 JConsole \u548C JDK \u7248\u672C\u4FE1\u606F\u7684\u5BF9\u8BDD\u6846"},
-        {"Help.AboutDialog.jConsoleVersion", "JConsole \u7248\u672C:<br>{0}"},
-        {"Help.AboutDialog.javaVersion", "Java VM \u7248\u672C:<br>{0}"},
-        {"Help.AboutDialog.masthead.accessibleName", "\u62A5\u5934\u56FE"},
-        {"Help.AboutDialog.masthead.title", "\u5173\u4E8E JConsole"},
-        {"Help.AboutDialog.title", "JConsole: \u5173\u4E8E"},
-        {"Help.AboutDialog.userGuideLink", "JConsole \u7528\u6237\u6307\u5357(U):<br>{0}"},
-        {"Help.AboutDialog.userGuideLink.mnemonic", 'U'},
-        {"Help.AboutDialog.userGuideLink.url", "http://java.sun.com/javase/6/docs/technotes/guides/management/jconsole.html"},
-        {"HelpMenu.About.title", "\u5173\u4E8E JConsole(A)"},
-        {"HelpMenu.About.title.mnemonic", 'A'},
-        {"HelpMenu.UserGuide.title", "\u8054\u673A\u7528\u6237\u6307\u5357"},
-        {"HelpMenu.UserGuide.title.mnemonic", 'U'},
-        {"HelpMenu.title", "\u5E2E\u52A9(H)"},
-        {"HelpMenu.title.mnemonic", 'H'},
-        {"Hotspot MBeans...", "HotSpot MBean(H)..."},
-        {"Hotspot MBeans....mnemonic", 'H'},
-        {"Hotspot MBeans.dialog.accessibleDescription", "\u7528\u4E8E\u7BA1\u7406 HotSpot MBean \u7684\u5BF9\u8BDD\u6846"},
-        {"Impact","\u5F71\u54CD"},
-        {"Info","\u4FE1\u606F"},
-        {"INFO","INFO"},
-        {"Invalid plugin path", "\u8B66\u544A: \u63D2\u4EF6\u8DEF\u5F84\u65E0\u6548: {0}"},
-        {"Invalid URL", "URL \u65E0\u6548: {0}"},
-        {"Is","\u662F"},
-        {"Java Monitoring & Management Console", "Java \u76D1\u89C6\u548C\u7BA1\u7406\u63A7\u5236\u53F0"},
-        {"JConsole: ","JConsole: {0}"},
-        {"JConsole version","JConsole \u7248\u672C \"{0}\""},
-        {"JConsole.accessibleDescription", "Java \u76D1\u89C6\u548C\u7BA1\u7406\u63A7\u5236\u53F0"},
-        {"JIT compiler","JIT \u7F16\u8BD1\u5668"},
-        {"Java Virtual Machine","Java \u865A\u62DF\u673A"},
-        {"Java","Java"},
-        {"Library path","\u5E93\u8DEF\u5F84"},
-        {"Listeners","\u76D1\u542C\u7A0B\u5E8F"},
-        {"Live Threads","\u6D3B\u52A8\u7EBF\u7A0B"},
-        {"Loaded", "\u5DF2\u52A0\u8F7D"},
-        {"Local Process:", "\u672C\u5730\u8FDB\u7A0B(L):"},
-        {"Local Process:.mnemonic", 'L'},
-        {"Look and Feel","\u5916\u89C2"},
-        {"Masthead.font", "Dialog-PLAIN-25"},
-        {"Management Not Enabled","<b>\u6CE8</b>: \u672A\u5BF9\u6B64\u8FDB\u7A0B\u542F\u7528\u7BA1\u7406\u4EE3\u7406\u3002"},
-        {"Management Will Be Enabled","<b>\u6CE8</b>: \u5C06\u5BF9\u6B64\u8FDB\u7A0B\u542F\u7528\u7BA1\u7406\u4EE3\u7406\u3002"},
-        {"MBeanAttributeInfo","MBeanAttributeInfo"},
-        {"MBeanInfo","MBeanInfo"},
-        {"MBeanNotificationInfo","MBeanNotificationInfo"},
-        {"MBeanOperationInfo","MBeanOperationInfo"},
-        {"MBeans","MBean"},
-        {"MBeansTab.clearNotificationsButton", "\u6E05\u9664(C)"},
-        {"MBeansTab.clearNotificationsButton.mnemonic", 'C'},
-        {"MBeansTab.clearNotificationsButton.toolTip", "\u6E05\u9664\u901A\u77E5"},
-        {"MBeansTab.compositeNavigationMultiple", "\u7EC4\u5408\u5BFC\u822A{0}/{1}"},
-        {"MBeansTab.compositeNavigationSingle", "\u7EC4\u5408\u5BFC\u822A"},
-        {"MBeansTab.refreshAttributesButton", "\u5237\u65B0(R)"},
-        {"MBeansTab.refreshAttributesButton.mnemonic", 'R'},
-        {"MBeansTab.refreshAttributesButton.toolTip", "\u5237\u65B0\u5C5E\u6027"},
-        {"MBeansTab.subscribeNotificationsButton", "\u8BA2\u9605(S)"},
-        {"MBeansTab.subscribeNotificationsButton.mnemonic", 'S'},
-        {"MBeansTab.subscribeNotificationsButton.toolTip", "\u5F00\u59CB\u76D1\u542C\u901A\u77E5"},
-        {"MBeansTab.tabularNavigationMultiple", "\u8868\u683C\u5F0F\u5BFC\u822A{0}/{1}"},
-        {"MBeansTab.tabularNavigationSingle", "\u8868\u683C\u5F0F\u5BFC\u822A"},
-        {"MBeansTab.unsubscribeNotificationsButton", "\u53D6\u6D88\u8BA2\u9605(U)"},
-        {"MBeansTab.unsubscribeNotificationsButton.mnemonic", 'U'},
-        {"MBeansTab.unsubscribeNotificationsButton.toolTip", "\u505C\u6B62\u76D1\u542C\u901A\u77E5"},
-        {"Manage Hotspot MBeans in: ", "\u7BA1\u7406\u4EE5\u4E0B\u4F4D\u7F6E\u7684 HotSpot MBean: "},
-        {"Max","\u6700\u5927\u503C"},
-        {"Maximum heap size","\u6700\u5927\u5806\u5927\u5C0F"},
-        {"Memory","\u5185\u5B58"},
-        {"MemoryPoolLabel", "\u5185\u5B58\u6C60 \"{0}\""},
-        {"MemoryTab.heapPlotter.accessibleName", "\u5806\u7684\u5185\u5B58\u4F7F\u7528\u91CF\u56FE\u8868\u3002"},
-        {"MemoryTab.infoLabelFormat", "<html>\u5DF2\u7528: {0}    \u5DF2\u63D0\u4EA4: {1}    \u6700\u5927: {2}</html>"},
-        {"MemoryTab.nonHeapPlotter.accessibleName", "\u975E\u5806\u7684\u5185\u5B58\u4F7F\u7528\u91CF\u56FE\u8868\u3002"},
-        {"MemoryTab.poolChart.aboveThreshold", "\u5927\u4E8E{0}\u7684\u9608\u503C\u3002\n"},
-        {"MemoryTab.poolChart.accessibleName", "\u5185\u5B58\u6C60\u4F7F\u7528\u91CF\u56FE\u8868\u3002"},
-        {"MemoryTab.poolChart.belowThreshold", "\u4F4E\u4E8E{0}\u7684\u9608\u503C\u3002\n"},
-        {"MemoryTab.poolPlotter.accessibleName", "{0}\u7684\u5185\u5B58\u4F7F\u7528\u91CF\u56FE\u8868\u3002"},
-        {"Message","\u6D88\u606F"},
-        {"Method successfully invoked", "\u5DF2\u6210\u529F\u8C03\u7528\u65B9\u6CD5"},
-        {"Minimize All", "\u5168\u90E8\u6700\u5C0F\u5316(M)"},
-        {"Minimize All.mnemonic", 'M'},
-        {"Minus Version", "\u8FD9\u662F{0}\u7248\u672C {1}"},
-        {"Monitor locked",
-             "   - \u5DF2\u9501\u5B9A{0}\n"},
-        {"Motif","Motif"},
-        {"Name Build and Mode","{0} (\u5DE5\u4F5C\u7248\u672C {1}, {2})"},
-        {"Name and Build","{0} (\u5DE5\u4F5C\u7248\u672C {1})"},
-        {"Name","\u540D\u79F0"},
-        {"Name: ","\u540D\u79F0: "},
-        {"Name State",
-             "\u540D\u79F0: {0}\n\u72B6\u6001: {1}\n"},
-        {"Name State LockName",
-             "\u540D\u79F0: {0}\n\u72B6\u6001: {2}\u4E0A\u7684{1}\n"},
-        {"Name State LockName LockOwner",
-             "\u540D\u79F0: {0}\n\u72B6\u6001: {2}\u4E0A\u7684{1}, \u62E5\u6709\u8005: {3}\n"},
-        {"New Connection...", "\u65B0\u5EFA\u8FDE\u63A5(N)..."},
-        {"New Connection....mnemonic", 'N'},
-        {"New value applied","\u5DF2\u5E94\u7528\u65B0\u503C"},
-        {"No attribute selected","\u672A\u9009\u62E9\u5C5E\u6027"},
-        {"No deadlock detected","\u672A\u68C0\u6D4B\u5230\u6B7B\u9501"},
-        {"No value selected","\u672A\u9009\u62E9\u503C"},
-        {"Non-Heap Memory Usage","\u975E\u5806\u5185\u5B58\u4F7F\u7528\u91CF"},
-        {"Non-Heap", "\u975E\u5806"},
-        {"Not Yet Implemented","\u5C1A\u672A\u5B9E\u73B0"},
-        {"Not a valid event broadcaster", "\u4E0D\u662F\u6709\u6548\u7684\u4E8B\u4EF6\u5E7F\u64AD\u8005"},
-        {"Notification","\u901A\u77E5"},
-        {"Notification buffer","\u901A\u77E5\u7F13\u51B2\u533A"},
-        {"Notifications","\u901A\u77E5"},
-        {"NotifTypes", "NotifTypes"},
-        {"Number of Threads","\u7EBF\u7A0B\u6570"},
-        {"Number of Loaded Classes","\u5DF2\u52A0\u8F7D\u7C7B\u6570"},
-        {"Number of processors","\u5904\u7406\u7A0B\u5E8F\u6570"},
-        {"ObjectName","ObjectName"},
-        {"Operating System","\u64CD\u4F5C\u7CFB\u7EDF"},
-        {"Operation","\u64CD\u4F5C"},
-        {"Operation invocation","\u64CD\u4F5C\u8C03\u7528"},
-        {"Operation return value", "\u64CD\u4F5C\u8FD4\u56DE\u503C"},
-        {"Operations","\u64CD\u4F5C"},
-        {"Overview","\u6982\u89C8"},
-        {"OverviewPanel.plotter.accessibleName", "{0}\u7684\u56FE\u8868\u3002"},
-        {"Parameter", "\u53C2\u6570"},
-        {"Password: ", "\u53E3\u4EE4(P): "},
-        {"Password: .mnemonic", 'P'},
-        {"Password.accessibleName", "\u53E3\u4EE4"},
-        {"Peak","\u5CF0\u503C"},
-        {"Perform GC", "\u6267\u884C GC"},
-        {"Perform GC.mnemonic", 'G'},
-        {"Perform GC.toolTip", "\u8BF7\u6C42\u5783\u573E\u6536\u96C6"},
-        {"Plotter.accessibleName", "\u56FE\u8868"},
-        {"Plotter.accessibleName.keyAndValue", "{0}={1}\n"},
-        {"Plotter.accessibleName.noData", "\u672A\u7ED8\u5236\u6570\u636E\u3002"},
-        {"Plotter.saveAsMenuItem", "\u5C06\u6570\u636E\u53E6\u5B58\u4E3A(A)..."},
-        {"Plotter.saveAsMenuItem.mnemonic", 'A'},
-        {"Plotter.timeRangeMenu", "\u65F6\u95F4\u8303\u56F4(T)"},
-        {"Plotter.timeRangeMenu.mnemonic", 'T'},
-        {"Problem adding listener","\u6DFB\u52A0\u76D1\u542C\u7A0B\u5E8F\u65F6\u51FA\u73B0\u95EE\u9898"},
-        {"Problem displaying MBean", "\u663E\u793A MBean \u65F6\u51FA\u73B0\u95EE\u9898"},
-        {"Problem invoking", "\u8C03\u7528\u65F6\u51FA\u73B0\u95EE\u9898"},
-        {"Problem removing listener","\u5220\u9664\u76D1\u542C\u7A0B\u5E8F\u65F6\u51FA\u73B0\u95EE\u9898"},
-        {"Problem setting attribute","\u8BBE\u7F6E\u5C5E\u6027\u65F6\u51FA\u73B0\u95EE\u9898"},
-        {"Process CPU time","\u8FDB\u7A0B CPU \u65F6\u95F4"},
-        {"R/W","\u8BFB\u5199"},
-        {"Readable","\u53EF\u8BFB"},
-        {"Received","\u6536\u5230"},
-        {"Reconnect","\u91CD\u65B0\u8FDE\u63A5"},
-        {"Remote Process:", "\u8FDC\u7A0B\u8FDB\u7A0B(R):"},
-        {"Remote Process:.mnemonic", 'R'},
-        {"Remote Process.textField.accessibleName", "\u8FDC\u7A0B\u8FDB\u7A0B"},
-        {"Remove","\u5220\u9664"},
-        {"Restore All", "\u5168\u90E8\u8FD8\u539F(R)"},
-        {"Restore All.mnemonic", 'R'},
-        {"Return value", "\u8FD4\u56DE\u503C"},
-        {"ReturnType", "ReturnType"},
-        {"SeqNum","SeqNum"},
-        {"Size Bytes", "{0,number,integer} \u5B57\u8282"},
-        {"Size Gb","{0} GB"},
-        {"Size Kb","{0} KB"},
-        {"Size Mb","{0} MB"},
-        {"Source","\u6E90"},
-        {"Stack trace",
-              "\n\u5806\u6808\u8DDF\u8E2A: \n"},
-        {"Success:","\u6210\u529F:"},
-        // Note: SummaryTab.headerDateTimeFormat can be one the following:
-        // 1. A combination of two styles for date and time, using the
-        //    constants from class DateFormat: SHORT, MEDIUM, LONG, FULL.
-        //    Example: "MEDIUM,MEDIUM" or "FULL,SHORT"
-        // 2. An explicit string pattern used for creating an instance
-        //    of the class SimpleDateFormat.
-        //    Example: "yyyy-MM-dd HH:mm:ss" or "M/d/yyyy h:mm:ss a"
-        {"SummaryTab.headerDateTimeFormat", "FULL,FULL"},
-        {"SummaryTab.pendingFinalization.label", "\u6682\u6302\u6700\u7EC8\u5904\u7406"},
-        {"SummaryTab.pendingFinalization.value", "{0}\u5BF9\u8C61"},
-        {"SummaryTab.tabName", "VM \u6982\u8981"},
-        {"SummaryTab.vmVersion","{0}\u7248\u672C {1}"},
-        {"TabularData are not supported", "\u4E0D\u652F\u6301 TabularData"},
-        {"Threads","\u7EBF\u7A0B"},
-        {"ThreadTab.infoLabelFormat", "<html>\u6D3B\u52A8: {0}    \u5CF0\u503C: {1}    \u603B\u8BA1: {2}</html>"},
-        {"ThreadTab.threadInfo.accessibleName", "\u7EBF\u7A0B\u4FE1\u606F"},
-        {"ThreadTab.threadPlotter.accessibleName", "\u8868\u793A\u7EBF\u7A0B\u6570\u7684\u56FE\u8868\u3002"},
-        {"Threshold","\u9608\u503C"},
-        {"Tile", "\u5E73\u94FA(T)"},
-        {"Tile.mnemonic", 'T'},
-        {"Time Range:", "\u65F6\u95F4\u8303\u56F4(T):"},
-        {"Time Range:.mnemonic", 'T'},
-        {"Time", "\u65F6\u95F4"},
-        {"TimeStamp","TimeStamp"},
-        {"Total Loaded", "\u52A0\u8F7D\u603B\u6570"},
-        {"Total classes loaded","\u5DF2\u52A0\u8F7D\u7C7B\u603B\u6570"},
-        {"Total classes unloaded","\u5DF2\u5378\u8F7D\u7C7B\u603B\u6570"},
-        {"Total compile time","\u603B\u7F16\u8BD1\u65F6\u95F4"},
-        {"Total physical memory","\u603B\u7269\u7406\u5185\u5B58"},
-        {"Total threads started","\u542F\u52A8\u7684\u7EBF\u7A0B\u603B\u6570"},
-        {"Total swap space","\u603B\u4EA4\u6362\u7A7A\u95F4"},
-        {"Type","\u7C7B\u578B"},
-        {"Unavailable","\u4E0D\u53EF\u7528"},
-        {"UNKNOWN","UNKNOWN"},
-        {"Unknown Host","\u672A\u77E5\u4E3B\u673A: {0}"},
-        {"Unregister", "\u6CE8\u9500"},
-        {"Uptime","\u8FD0\u884C\u65F6\u95F4"},
-        {"Uptime: ","\u8FD0\u884C\u65F6\u95F4: "},
-        {"Usage Threshold","\u7528\u6CD5\u9608\u503C"},
-        {"remoteTF.usage","<b>\u7528\u6CD5</b>: &lt;hostname&gt;:&lt;port&gt; \u6216 service:jmx:&lt;protocol&gt;:&lt;sap&gt;"},
-        {"Used","\u5DF2\u7528"},
-        {"Username: ", "\u7528\u6237\u540D(U): "},
-        {"Username: .mnemonic", 'U'},
-        {"Username.accessibleName", "\u7528\u6237\u540D"},
-        {"UserData","UserData"},
-        {"Virtual Machine","\u865A\u62DF\u673A"},
-        {"VM arguments","VM \u53C2\u6570"},
-        {"VM","VM"},
-        {"VMInternalFrame.accessibleDescription", "\u7528\u4E8E\u76D1\u89C6 Java \u865A\u62DF\u673A\u7684\u5185\u90E8\u6846\u67B6"},
-        {"Value","\u503C"},
-        {"Vendor", "\u5382\u5546"},
-        {"Verbose Output","\u8BE6\u7EC6\u8F93\u51FA"},
-        {"Verbose Output.toolTip", "\u4E3A\u7C7B\u52A0\u8F7D\u7CFB\u7EDF\u542F\u7528\u8BE6\u7EC6\u8F93\u51FA"},
-        {"View value", "\u89C6\u56FE\u503C"},
-        {"View","\u89C6\u56FE"},
-        {"Window", "\u7A97\u53E3(W)"},
-        {"Window.mnemonic", 'W'},
-        {"Windows","Windows"},
-        {"Writable","\u53EF\u5199"},
-        {"You cannot drop a class here", "\u65E0\u6CD5\u5220\u9664\u6B64\u5904\u7684\u7C7B"},
-        {"collapse", "\u9690\u85CF"},
-        {"connectionFailed1","\u8FDE\u63A5\u5931\u8D25: \u662F\u5426\u91CD\u8BD5?"},
-        {"connectionFailed2","\u672A\u6210\u529F\u8FDE\u63A5\u5230{0}\u3002<br>\u662F\u5426\u8981\u91CD\u8BD5?"},
-        {"connectionLost1","\u8FDE\u63A5\u4E22\u5931: \u662F\u5426\u91CD\u65B0\u8FDE\u63A5?"},
-        {"connectionLost2","\u7531\u4E8E\u8FDC\u7A0B\u8FDB\u7A0B\u5DF2\u7EC8\u6B62, \u4E0E{0}\u7684\u8FDE\u63A5\u4E22\u5931\u3002<br>\u662F\u5426\u8981\u91CD\u65B0\u8FDE\u63A5?"},
-        {"connectingTo1","\u6B63\u5728\u8FDE\u63A5\u5230{0}"},
-        {"connectingTo2","\u60A8\u5F53\u524D\u6B63\u5728\u8FDE\u63A5\u5230{0}\u3002<br>\u8FD9\u5C06\u9700\u8981\u51E0\u5206\u949F\u7684\u65F6\u95F4\u3002"},
-        {"deadlockAllTab","\u5168\u90E8"},
-        {"deadlockTab","\u6B7B\u9501"},
-        {"deadlockTabN","\u6B7B\u9501{0}"},
-        {"expand", "\u5C55\u5F00"},
-        {"kbytes","{0} KB"},
-        {"operation","\u64CD\u4F5C"},
-        {"plot", "\u7ED8\u56FE"},
-        {"visualize","\u53EF\u89C6\u5316"},
-        {"zz usage text",
-             "\u7528\u6CD5: {0} [ -interval=n ] [ -notile ] [ -pluginpath <path> ] [ -version ] [ connection ... ]\n\n  -interval   \u5C06\u66F4\u65B0\u95F4\u9694\u8BBE\u7F6E\u4E3A n \u79D2 (\u9ED8\u8BA4\u503C\u4E3A 4 \u79D2)\n  -notile     \u521D\u59CB\u4E0D\u5E73\u94FA\u7A97\u53E3 (\u5BF9\u4E8E\u4E24\u4E2A\u6216\u591A\u4E2A\u8FDE\u63A5)\n  -pluginpath \u6307\u5B9A jconsole \u7528\u4E8E\u67E5\u627E\u63D2\u4EF6\u7684\u8DEF\u5F84\n  -version    \u8F93\u51FA\u7A0B\u5E8F\u7248\u672C\n\n  connection = pid || host:port || JMX URL (service:jmx:<\u534F\u8BAE>://...)\n  pid         \u76EE\u6807\u8FDB\u7A0B\u7684\u8FDB\u7A0B ID\n  host        \u8FDC\u7A0B\u4E3B\u673A\u540D\u6216 IP \u5730\u5740\n  port        \u8FDC\u7A0B\u8FDE\u63A5\u7684\u7AEF\u53E3\u53F7\n\n  -J          \u6307\u5B9A\u8FD0\u884C jconsole \u7684 Java \u865A\u62DF\u673A\n              \u7684\u8F93\u5165\u53C2\u6570"},
-        // END OF MATERIAL TO LOCALIZE
-        };
-
-        String ls = System.getProperty("line.separator");
-        for(int i=0;i<temp.length;i++) {
-            if (temp[i][1] instanceof String){
-            temp[i][1] = temp[i][1].toString().replaceAll("\n",ls);
-            }
-        }
-
-        return temp;
-
-    }
-
-    public synchronized Object[][] getContents() {
-        return getContents0();
-    }
-}
diff --git a/src/share/classes/sun/tools/jconsole/resources/messages.properties b/src/share/classes/sun/tools/jconsole/resources/messages.properties
new file mode 100644
index 0000000..b89146e
--- /dev/null
+++ b/src/share/classes/sun/tools/jconsole/resources/messages.properties
@@ -0,0 +1,273 @@
+ONE_DAY=\ 1 day
+ONE_HOUR=\ 1 hour
+ONE_MIN=\ 1 min
+ONE_MONTH=\ 1 month
+ONE_YEAR=\ 1 year
+TWO_HOURS=\ 2 hours
+THREE_HOURS=\ 3 hours
+THREE_MONTHS=\ 3 months
+FIVE_MIN=\ 5 min
+SIX_HOURS=\ 6 hours
+SIX_MONTHS=\ 6 months
+SEVEN_DAYS=\ 7 days
+TEN_MIN=10 min
+TWELVE_HOURS=12 hours
+THIRTY_MIN=30 min
+LESS_THAN=<
+A_LOT_LESS_THAN=<<
+GREATER_THAN=>
+ACTION_CAPITALIZED=ACTION
+ACTION_INFO_CAPITALIZED=ACTION_INFO
+ALL=All
+ARCHITECTURE=Architecture
+ATTRIBUTE=Attribute
+ATTRIBUTE_VALUE=Attribute value
+ATTRIBUTE_VALUES=Attribute values
+ATTRIBUTES=Attributes
+BLANK=Blank
+BLOCKED_COUNT_WAITED_COUNT=Total blocked: {0}  Total waited: {1}\n
+BOOT_CLASS_PATH=Boot class path
+BORDERED_COMPONENT_MORE_OR_LESS_BUTTON_TOOLTIP=Toggle to show more or less information
+CPU_USAGE=CPU Usage
+CPU_USAGE_FORMAT=CPU Usage: {0}%
+CANCEL=Cancel
+CASCADE=&Cascade
+CHART_COLON=&Chart:
+CLASS_PATH=Class path
+CLASS_NAME=ClassName
+CLASS_TAB_INFO_LABEL_FORMAT=<html>Loaded: {0}    Unloaded: {1}    Total: {2}</html>
+CLASS_TAB_LOADED_CLASSES_PLOTTER_ACCESSIBLE_NAME=Chart for Loaded Classes.
+CLASSES=Classes
+CLOSE=Close
+COLUMN_NAME=Name
+COLUMN_PID=PID
+COMMITTED_MEMORY=Committed memory
+COMMITTED_VIRTUAL_MEMORY=Committed virtual memory
+COMMITTED=Committed
+CONNECT=&Connect
+CONNECT_DIALOG_CONNECT_BUTTON_TOOLTIP=Connect to Java Virtual Machine
+CONNECT_DIALOG_ACCESSIBLE_DESCRIPTION=Dialog for making a new connection to a local or remote Java Virtual Machine
+CONNECT_DIALOG_MASTHEAD_ACCESSIBLE_NAME=Masthead Graphic
+CONNECT_DIALOG_MASTHEAD_TITLE=New Connection
+CONNECT_DIALOG_STATUS_BAR_ACCESSIBLE_NAME=Status Bar
+CONNECT_DIALOG_TITLE=JConsole: New Connection
+CONNECTED_PUNCTUATION_CLICK_TO_DISCONNECT_=Connected. Click to disconnect.
+CONNECTION_FAILED=Connection failed
+CONNECTION=&Connection
+CONNECTION_NAME=Connection name
+CONNECTION_NAME__DISCONNECTED_={0} (disconnected)
+CONSTRUCTOR=Constructor
+CURRENT_CLASSES_LOADED=Current classes loaded
+CURRENT_HEAP_SIZE=Current heap size
+CURRENT_VALUE=Current value: {0}
+CREATE=Create
+DAEMON_THREADS=Daemon threads
+DISCONNECTED_PUNCTUATION_CLICK_TO_CONNECT_=Disconnected. Click to connect.
+DOUBLE_CLICK_TO_EXPAND_FORWARD_SLASH_COLLAPSE=Double click to expand/collapse
+DOUBLE_CLICK_TO_VISUALIZE=Double click to visualize
+DESCRIPTION=Description
+DESCRIPTOR=Descriptor
+DETAILS=Details
+DETECT_DEADLOCK=&Detect Deadlock
+DETECT_DEADLOCK_TOOLTIP=Detect deadlocked threads
+DIMENSION_IS_NOT_SUPPORTED_COLON=Dimension is not supported:
+DISCARD_CHART=Discard chart
+DURATION_DAYS_HOURS_MINUTES={0,choice,1#{0,number,integer} day |1.0<{0,number,integer} days }{1,choice,0<{1,number,integer} hours |1#{1,number,integer} hour |1<{1,number,integer} hours }{2,choice,0<{2,number,integer} minutes|1#{2,number,integer} minute|1.0<{2,number,integer} minutes}
+DURATION_HOURS_MINUTES={0,choice,1#{0,number,integer} hour |1<{0,number,integer} hours }{1,choice,0<{1,number,integer} minutes|1#{1,number,integer} minute|1.0<{1,number,integer} minutes}
+DURATION_MINUTES={0,choice,1#{0,number,integer} minute|1.0<{0,number,integer} minutes}
+DURATION_SECONDS={0} seconds
+EMPTY_ARRAY=Empty array
+ERROR=Error
+ERROR_COLON_MBEANS_ALREADY_EXIST=Error: MBeans already exist
+ERROR_COLON_MBEANS_DO_NOT_EXIST=Error: MBeans do not exist
+EVENT=Event
+EXIT=E&xit
+FAIL_TO_LOAD_PLUGIN=Warning: Fail to load plugin: {0}
+FILE_CHOOSER_FILE_EXISTS_CANCEL_OPTION=Cancel
+FILE_CHOOSER_FILE_EXISTS_MESSAGE=<html><center>File already exists:<br>{0}<br>Do you want to replace it?
+FILE_CHOOSER_FILE_EXISTS_OK_OPTION=Replace
+FILE_CHOOSER_FILE_EXISTS_TITLE=File Exists
+FILE_CHOOSER_SAVED_FILE=<html>Saved to file:<br>{0}<br>({1} bytes)
+FILE_CHOOSER_SAVE_FAILED_MESSAGE=<html><center>Save to file failed:<br>{0}<br>{1}
+FILE_CHOOSER_SAVE_FAILED_TITLE=Save Failed
+FREE_PHYSICAL_MEMORY=Free physical memory
+FREE_SWAP_SPACE=Free swap space
+GARBAGE_COLLECTOR=Garbage collector
+GC_INFO=Name = ''{0}'', Collections = {1,choice,-1#Unavailable|0#{1,number,integer}}, Total time spent = {2}
+GC_TIME=GC time
+GC_TIME_DETAILS={0} on {1} ({2} collections)
+HEAP_MEMORY_USAGE=Heap Memory Usage
+HEAP=Heap
+HELP_ABOUT_DIALOG_ACCESSIBLE_DESCRIPTION=Dialog containing information about JConsole and JDK versions
+HELP_ABOUT_DIALOG_JCONSOLE_VERSION=JConsole version:<br>{0}
+HELP_ABOUT_DIALOG_JAVA_VERSION=Java VM version:<br>{0}
+HELP_ABOUT_DIALOG_MASTHEAD_ACCESSIBLE_NAME=Masthead Graphic
+HELP_ABOUT_DIALOG_MASTHEAD_TITLE=About JConsole
+HELP_ABOUT_DIALOG_TITLE=JConsole: About
+HELP_ABOUT_DIALOG_USER_GUIDE_LINK=JConsole &User Guide:<br>{0}
+HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL=http://java.sun.com/javase/6/docs/technotes/guides/management/jconsole.html
+HELP_MENU_ABOUT_TITLE=&About JConsole
+HELP_MENU_USER_GUIDE_TITLE=Online &User Guide
+HELP_MENU_TITLE=&Help
+HOTSPOT_MBEANS_ELLIPSIS=&Hotspot MBeans...
+HOTSPOT_MBEANS_DIALOG_ACCESSIBLE_DESCRIPTION=Dialog for managing Hotspot MBeans
+IMPACT=Impact
+INFO=Info
+INFO_CAPITALIZED=INFO
+INVALID_PLUGIN_PATH=Warning: Invalid plugin path: {0}
+INVALID_URL=Invalid URL: {0}
+IS=Is
+JAVA_MONITORING___MANAGEMENT_CONSOLE=Java Monitoring && Management Console
+JCONSOLE_COLON_=JConsole: {0}
+JCONSOLE_VERSION=JConsole version "{0}"
+JCONSOLE_ACCESSIBLE_DESCRIPTION=Java Monitoring && Management Console
+JIT_COMPILER=JIT compiler
+LIBRARY_PATH=Library path
+LIVE_THREADS=Live threads
+LOADED=Loaded
+LOCAL_PROCESS_COLON=&Local Process:
+MASTHEAD_FONT=Dialog-PLAIN-25
+MANAGEMENT_NOT_ENABLED=<b>Note</b>: The management agent is not enabled on this process.
+MANAGEMENT_WILL_BE_ENABLED=<b>Note</b>: The management agent will be enabled on this process.
+MBEAN_ATTRIBUTE_INFO=MBeanAttributeInfo
+MBEAN_INFO=MBeanInfo
+MBEAN_NOTIFICATION_INFO=MBeanNotificationInfo
+MBEAN_OPERATION_INFO=MBeanOperationInfo
+MBEANS=MBeans
+MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON=&Clear
+MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON_TOOLTIP=Clear notifications
+MBEANS_TAB_COMPOSITE_NAVIGATION_MULTIPLE=Composite Navigation {0}/{1}
+MBEANS_TAB_COMPOSITE_NAVIGATION_SINGLE=Composite Navigation
+MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON=&Refresh
+MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON_TOOLTIP=Refresh attributes
+MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON=&Subscribe
+MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON_TOOLTIP=Start listening for notifications
+MBEANS_TAB_TABULAR_NAVIGATION_MULTIPLE=Tabular Navigation {0}/{1}
+MBEANS_TAB_TABULAR_NAVIGATION_SINGLE=Tabular Navigation
+MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON=&Unsubscribe
+MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON_TOOLTIP=Stop listening for notifications
+MANAGE_HOTSPOT_MBEANS_IN_COLON_=Manage Hotspot MBeans in:
+MAX=Max
+MAXIMUM_HEAP_SIZE=Maximum heap size
+MEMORY=Memory
+MEMORY_POOL_LABEL=Memory Pool "{0}"
+MEMORY_TAB_HEAP_PLOTTER_ACCESSIBLE_NAME=Memory usage chart for heap.
+MEMORY_TAB_INFO_LABEL_FORMAT=<html>Used: {0}    Committed: {1}    Max: {2}</html>
+MEMORY_TAB_NON_HEAP_PLOTTER_ACCESSIBLE_NAME=Memory usage chart for non heap.
+MEMORY_TAB_POOL_CHART_ABOVE_THRESHOLD=which is above the threshold of {0}.\n
+MEMORY_TAB_POOL_CHART_ACCESSIBLE_NAME=Memory Pool Usage Chart.
+MEMORY_TAB_POOL_CHART_BELOW_THRESHOLD=which is below the threshold of {0}.\n
+MEMORY_TAB_POOL_PLOTTER_ACCESSIBLE_NAME=Memory usage chart for {0}.
+MESSAGE=Message
+METHOD_SUCCESSFULLY_INVOKED=Method successfully invoked
+MINIMIZE_ALL=&Minimize All
+MONITOR_LOCKED=\ \ \ - locked {0}\n
+NAME=Name
+NAME_AND_BUILD={0} (build {1})
+NAME_STATE=Name: {0}\nState: {1}\n
+NAME_STATE_LOCK_NAME=Name: {0}\nState: {1} on {2}\n
+NAME_STATE_LOCK_NAME_LOCK_OWNER=Name: {0}\nState: {1} on {2} owned by: {3}\n
+NEW_CONNECTION_ELLIPSIS=&New Connection...
+NO_DEADLOCK_DETECTED=No deadlock detected
+NON_HEAP_MEMORY_USAGE=Non-Heap Memory Usage
+NON_HEAP=Non-Heap
+NOTIFICATION=Notification
+NOTIFICATION_BUFFER=Notification buffer
+NOTIFICATIONS=Notifications
+NOTIF_TYPES=NotifTypes
+NUMBER_OF_THREADS=Number of Threads
+NUMBER_OF_LOADED_CLASSES=Number of Loaded Classes
+NUMBER_OF_PROCESSORS=Number of processors
+OBJECT_NAME=ObjectName
+OPERATING_SYSTEM=Operating System
+OPERATION=Operation
+OPERATION_INVOCATION=Operation invocation
+OPERATION_RETURN_VALUE=Operation return value
+OPERATIONS=Operations
+OVERVIEW=Overview
+OVERVIEW_PANEL_PLOTTER_ACCESSIBLE_NAME=Chart for {0}.
+PARAMETER=Parameter
+PASSWORD_ACCESSIBLE_NAME=Password
+PASSWORD_COLON_=&Password:
+PEAK=Peak
+PERFORM_GC=Perform &GC
+PERFORM_GC_TOOLTIP=Request Garbage Collection
+PLOTTER_ACCESSIBLE_NAME=Chart
+PLOTTER_ACCESSIBLE_NAME_KEY_AND_VALUE={0}={1}\n
+PLOTTER_ACCESSIBLE_NAME_NO_DATA=No data plotted.
+PLOTTER_SAVE_AS_MENU_ITEM=Save data &as...
+PLOTTER_TIME_RANGE_MENU=&Time Range
+PROBLEM_ADDING_LISTENER=Problem adding listener
+PROBLEM_DISPLAYING_MBEAN=Problem displaying MBean
+PROBLEM_INVOKING=Problem invoking
+PROBLEM_REMOVING_LISTENER=Problem removing listener
+PROBLEM_SETTING_ATTRIBUTE=Problem setting attribute
+PROCESS_CPU_TIME=Process CPU time
+READABLE=Readable
+RECONNECT=Reconnect
+REMOTE_PROCESS_COLON=&Remote Process:
+REMOTE_PROCESS_TEXT_FIELD_ACCESSIBLE_NAME=Remote Process
+RESTORE_ALL=&Restore All
+RETURN_TYPE=ReturnType
+SEQ_NUM=SeqNum
+SIZE_BYTES={0,number,integer} bytes
+SIZE_GB={0} Gb
+SIZE_KB={0} Kb
+SIZE_MB={0} Mb
+SOURCE=Source
+STACK_TRACE=\nStack trace: \n
+SUMMARY_TAB_HEADER_DATE_TIME_FORMAT=FULL,FULL
+SUMMARY_TAB_PENDING_FINALIZATION_LABEL=Pending finalization
+SUMMARY_TAB_PENDING_FINALIZATION_VALUE={0} objects
+SUMMARY_TAB_TAB_NAME=VM Summary
+SUMMARY_TAB_VM_VERSION={0} version {1}
+THREADS=Threads
+THREAD_TAB_THREAD_INFO_ACCESSIBLE_NAME=Thread Information
+THREAD_TAB_THREAD_PLOTTER_ACCESSIBLE_NAME=Chart for number of threads.
+THRESHOLD=Threshold
+TILE=&Tile
+TIME_RANGE_COLON=&Time Range:
+TIME=Time
+TIME_STAMP=TimeStamp
+TOTAL_LOADED=Total Loaded
+TOTAL_CLASSES_LOADED=Total classes loaded
+TOTAL_CLASSES_UNLOADED=Total classes unloaded
+TOTAL_COMPILE_TIME=Total compile time
+TOTAL_PHYSICAL_MEMORY=Total physical memory
+TOTAL_THREADS_STARTED=Total threads started
+TOTAL_SWAP_SPACE=Total swap space
+TYPE=Type
+UNAVAILABLE=Unavailable
+UNKNOWN_CAPITALIZED=UNKNOWN
+UNKNOWN_HOST=Unknown Host: {0}
+UNREGISTER=Unregister
+UPTIME=Uptime
+USAGE_THRESHOLD=Usage Threshold
+REMOTE_TF_USAGE=<b>Usage</b>: &lt;hostname&gt;:&lt;port&gt; OR service:jmx:&lt;protocol&gt;:&lt;sap&gt;
+USED=Used
+USERNAME_COLON_=&Username:
+USERNAME_ACCESSIBLE_NAME=User Name
+USER_DATA=UserData
+VIRTUAL_MACHINE=Virtual Machine
+VM_ARGUMENTS=VM arguments
+VMINTERNAL_FRAME_ACCESSIBLE_DESCRIPTION=Internal frame for monitoring a Java Virtual Machine
+VALUE=Value
+VENDOR=Vendor
+VERBOSE_OUTPUT=Verbose Output
+VERBOSE_OUTPUT_TOOLTIP=Enable verbose output for class loading system
+VIEW=View
+WINDOW=&Window
+WINDOWS=Windows
+WRITABLE=Writable
+CONNECTION_FAILED1=Connection Failed: Retry?
+CONNECTION_FAILED2=The connection to {0} did not succeed.<br>Would you like to try again?
+CONNECTION_LOST1=Connection Lost: Reconnect?
+CONNECTING_TO1=Connecting to {0}
+CONNECTING_TO2=You are currently being connected to {0}.<br>This will take a few moments.
+DEADLOCK_TAB=Deadlock
+DEADLOCK_TAB_N=Deadlock {0}
+EXPAND=expand
+KBYTES={0} kbytes
+PLOT=plot
+VISUALIZE=visualize
+ZZ_USAGE_TEXT=Usage: {0} [ -interval=n ] [ -notile ] [ -pluginpath <path> ] [ -version ] [ connection ... ]\n\n  -interval   Set the update interval to n seconds (default is 4 seconds)\n  -notile     Do not tile windows initially (for two or more connections)\n  -pluginpath Specify the path that jconsole uses to look up the plugins\n  -version    Print program version\n\n  connection = pid || host:port || JMX URL (service:jmx:<protocol>://...)\n  pid         The process id of a target process\n  host        A remote host name or IP address\n  port        The port number for the remote connection\n\n  -J          Specify the input arguments to the Java virtual machine\n              on which jconsole is running
diff --git a/src/share/classes/sun/tools/jconsole/resources/messages_ja.properties b/src/share/classes/sun/tools/jconsole/resources/messages_ja.properties
new file mode 100644
index 0000000..195a1fe
--- /dev/null
+++ b/src/share/classes/sun/tools/jconsole/resources/messages_ja.properties
@@ -0,0 +1,273 @@
+ONE_DAY=\ 1\u65e5
+ONE_HOUR=\ 1\u6642\u9593
+ONE_MIN=\ 1\u5206
+ONE_MONTH=\ 1\u304b\u6708
+ONE_YEAR=\ 1\u5e74
+TWO_HOURS=\ 2\u6642\u9593
+THREE_HOURS=\ 3\u6642\u9593
+THREE_MONTHS=\ 3\u304b\u6708
+FIVE_MIN=\ 5\u5206
+SIX_HOURS=\ 6\u6642\u9593
+SIX_MONTHS=\ 6\u304b\u6708
+SEVEN_DAYS=\ 7\u65e5
+TEN_MIN=10\u5206
+TWELVE_HOURS=12\u6642\u9593
+THIRTY_MIN=30\u5206
+LESS_THAN=<
+A_LOT_LESS_THAN=<<
+GREATER_THAN=>
+ACTION_CAPITALIZED=ACTION
+ACTION_INFO_CAPITALIZED=ACTION_INFO
+ALL=\u3059\u3079\u3066
+ARCHITECTURE=\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3
+ATTRIBUTE=\u5c5e\u6027
+ATTRIBUTE_VALUE=\u5c5e\u6027\u5024
+ATTRIBUTE_VALUES=\u5c5e\u6027\u5024
+ATTRIBUTES=\u5c5e\u6027
+BLANK=\u30d6\u30e9\u30f3\u30af
+BLOCKED_COUNT_WAITED_COUNT=\u30d6\u30ed\u30c3\u30af\u6e08\u5408\u8a08: {0}  \u5f85\u6a5f\u6e08\u5408\u8a08: {1}\n
+BOOT_CLASS_PATH=\u30d6\u30fc\u30c8\u30fb\u30af\u30e9\u30b9\u30d1\u30b9
+BORDERED_COMPONENT_MORE_OR_LESS_BUTTON_TOOLTIP=\u8868\u793a\u3059\u308b\u60c5\u5831\u91cf\u3092\u5897\u6e1b\u3059\u308b\u30c8\u30b0\u30eb
+CPU_USAGE=CPU\u4f7f\u7528\u7387
+CPU_USAGE_FORMAT=CPU\u4f7f\u7528\u7387: {0}%
+CANCEL=\u53d6\u6d88
+CASCADE=\u91cd\u306d\u3066\u8868\u793a(&C)
+CHART_COLON=\u30c1\u30e3\u30fc\u30c8(&C):
+CLASS_PATH=\u30af\u30e9\u30b9\u30d1\u30b9
+CLASS_NAME=ClassName
+CLASS_TAB_INFO_LABEL_FORMAT=<html>\u30ed\u30fc\u30c9\u6e08: {0}    \u672a\u30ed\u30fc\u30c9: {1}    \u5408\u8a08: {2}</html>
+CLASS_TAB_LOADED_CLASSES_PLOTTER_ACCESSIBLE_NAME=\u30ed\u30fc\u30c9\u6e08\u30af\u30e9\u30b9\u306e\u30c1\u30e3\u30fc\u30c8\u3002
+CLASSES=\u30af\u30e9\u30b9
+CLOSE=\u9589\u3058\u308b
+COLUMN_NAME=\u540d\u524d
+COLUMN_PID=PID
+COMMITTED_MEMORY=\u30b3\u30df\u30c3\u30c8\u6e08\u30e1\u30e2\u30ea\u30fc
+COMMITTED_VIRTUAL_MEMORY=\u30b3\u30df\u30c3\u30c8\u6e08\u4eee\u60f3\u30e1\u30e2\u30ea\u30fc
+COMMITTED=\u30b3\u30df\u30c3\u30c8\u6e08
+CONNECT=\u63a5\u7d9a(&C)
+CONNECT_DIALOG_CONNECT_BUTTON_TOOLTIP=Java\u4eee\u60f3\u30de\u30b7\u30f3\u306b\u63a5\u7d9a
+CONNECT_DIALOG_ACCESSIBLE_DESCRIPTION=\u30ed\u30fc\u30ab\u30eb\u307e\u305f\u306f\u30ea\u30e2\u30fc\u30c8\u306eJava\u4eee\u60f3\u30de\u30b7\u30f3\u3078\u306e\u65b0\u898f\u63a5\u7d9a\u3092\u884c\u3046\u30c0\u30a4\u30a2\u30ed\u30b0
+CONNECT_DIALOG_MASTHEAD_ACCESSIBLE_NAME=\u30de\u30b9\u30c8\u30d8\u30c3\u30c9\u56f3\u5f62
+CONNECT_DIALOG_MASTHEAD_TITLE=\u65b0\u898f\u63a5\u7d9a
+CONNECT_DIALOG_STATUS_BAR_ACCESSIBLE_NAME=\u30b9\u30c6\u30fc\u30bf\u30b9\u30fb\u30d0\u30fc
+CONNECT_DIALOG_TITLE=JConsole: \u65b0\u898f\u63a5\u7d9a
+CONNECTED_PUNCTUATION_CLICK_TO_DISCONNECT_=\u63a5\u7d9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u5207\u65ad\u3057\u307e\u3059\u3002
+CONNECTION_FAILED=\u63a5\u7d9a\u306b\u5931\u6557\u3057\u307e\u3057\u305f
+CONNECTION=\u63a5\u7d9a(&C)
+CONNECTION_NAME=\u63a5\u7d9a\u540d
+CONNECTION_NAME__DISCONNECTED_={0} (\u5207\u65ad\u6e08)
+CONSTRUCTOR=\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf
+CURRENT_CLASSES_LOADED=\u30ed\u30fc\u30c9\u6e08\u306e\u73fe\u5728\u306e\u30af\u30e9\u30b9
+CURRENT_HEAP_SIZE=\u73fe\u5728\u306e\u30d2\u30fc\u30d7\u30fb\u30b5\u30a4\u30ba
+CURRENT_VALUE=\u73fe\u5728\u5024: {0}
+CREATE=\u4f5c\u6210
+DAEMON_THREADS=\u30c7\u30fc\u30e2\u30f3\u30fb\u30b9\u30ec\u30c3\u30c9
+DISCONNECTED_PUNCTUATION_CLICK_TO_CONNECT_=\u5207\u65ad\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u63a5\u7d9a\u3057\u307e\u3059\u3002
+DOUBLE_CLICK_TO_EXPAND_FORWARD_SLASH_COLLAPSE=\u5c55\u958b\u307e\u305f\u306f\u7e2e\u5c0f\u3059\u308b\u306b\u306f\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044
+DOUBLE_CLICK_TO_VISUALIZE=\u8996\u899a\u5316\u3059\u308b\u306b\u306f\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044
+DESCRIPTION=\u8aac\u660e
+DESCRIPTOR=\u8a18\u8ff0\u5b50
+DETAILS=\u8a73\u7d30
+DETECT_DEADLOCK=\u30c7\u30c3\u30c9\u30ed\u30c3\u30af\u306e\u691c\u51fa(&D)
+DETECT_DEADLOCK_TOOLTIP=\u30c7\u30c3\u30c9\u30ed\u30c3\u30af\u6e08\u30b9\u30ec\u30c3\u30c9\u306e\u691c\u51fa
+DIMENSION_IS_NOT_SUPPORTED_COLON=\u6b21\u5143\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093:
+DISCARD_CHART=\u30c1\u30e3\u30fc\u30c8\u306e\u7834\u68c4
+DURATION_DAYS_HOURS_MINUTES={0,choice,1#{0,number,integer}\u65e5|1.0<{0,number,integer}\u65e5}{1,choice,0<{1,number,integer}\u6642\u9593|1#{1,number,integer}\u6642\u9593|1<{1,number,integer}\u6642\u9593}{2,choice,0<{2,number,integer}\u5206|1#{2,number,integer}\u5206|1.0<{2,number,integer}\u5206}
+DURATION_HOURS_MINUTES={0,choice,1#{0,number,integer}\u6642\u9593|1<{0,number,integer}\u6642\u9593}{1,choice,0<{1,number,integer}\u5206|1#{1,number,integer}\u5206|1.0<{1,number,integer}\u5206}
+DURATION_MINUTES={0,choice,1#{0,number,integer}\u5206|1.0<{0,number,integer}\u5206}
+DURATION_SECONDS={0}\u79d2
+EMPTY_ARRAY=\u7a7a\u306e\u914d\u5217
+ERROR=\u30a8\u30e9\u30fc
+ERROR_COLON_MBEANS_ALREADY_EXIST=\u30a8\u30e9\u30fc: MBeans\u306f\u3059\u3067\u306b\u5b58\u5728\u3057\u307e\u3059
+ERROR_COLON_MBEANS_DO_NOT_EXIST=\u30a8\u30e9\u30fc: MBeans\u306f\u5b58\u5728\u3057\u307e\u305b\u3093
+EVENT=\u30a4\u30d9\u30f3\u30c8
+EXIT=\u7d42\u4e86(&X)
+FAIL_TO_LOAD_PLUGIN=\u8b66\u544a: \u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30ed\u30fc\u30c9\u306b\u5931\u6557\u3057\u307e\u3057\u305f: {0}
+FILE_CHOOSER_FILE_EXISTS_CANCEL_OPTION=\u53d6\u6d88
+FILE_CHOOSER_FILE_EXISTS_MESSAGE=<html><center>\u30d5\u30a1\u30a4\u30eb\u306f\u3059\u3067\u306b\u5b58\u5728\u3057\u3066\u3044\u307e\u3059:<br>{0}<br>\u7f6e\u63db\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b\u3002
+FILE_CHOOSER_FILE_EXISTS_OK_OPTION=\u7f6e\u63db
+FILE_CHOOSER_FILE_EXISTS_TITLE=\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3057\u3066\u3044\u307e\u3059
+FILE_CHOOSER_SAVED_FILE=<html>\u30d5\u30a1\u30a4\u30eb\u306b\u4fdd\u5b58\u3057\u307e\u3057\u305f:<br>{0}<br>({1}\u30d0\u30a4\u30c8)
+FILE_CHOOSER_SAVE_FAILED_MESSAGE=<html><center>\u30d5\u30a1\u30a4\u30eb\u3078\u306e\u4fdd\u5b58\u306b\u5931\u6557\u3057\u307e\u3057\u305f:<br>{0}<br>{1}
+FILE_CHOOSER_SAVE_FAILED_TITLE=\u4fdd\u5b58\u306b\u5931\u6557\u3057\u307e\u3057\u305f
+FREE_PHYSICAL_MEMORY=\u7a7a\u304d\u7269\u7406\u30e1\u30e2\u30ea\u30fc
+FREE_SWAP_SPACE=\u7a7a\u304d\u30b9\u30ef\u30c3\u30d7\u30fb\u30b9\u30da\u30fc\u30b9
+GARBAGE_COLLECTOR=\u30ac\u30d9\u30fc\u30b8\u30fb\u30b3\u30ec\u30af\u30bf
+GC_INFO=\u540d\u524d= ''{0}''\u3001\u30b3\u30ec\u30af\u30b7\u30e7\u30f3= {1,choice,-1#\u3042\u308a\u307e\u305b\u3093|0#{1,number,integer}\u500b}\u3001\u5408\u8a08\u6d88\u8cbb\u6642\u9593= {2}
+GC_TIME=GC\u6642\u9593
+GC_TIME_DETAILS={1}\u3067{0} ({2}\u500b\u306e\u30b3\u30ec\u30af\u30b7\u30e7\u30f3)
+HEAP_MEMORY_USAGE=\u30d2\u30fc\u30d7\u30fb\u30e1\u30e2\u30ea\u30fc\u4f7f\u7528\u7387
+HEAP=\u30d2\u30fc\u30d7
+HELP_ABOUT_DIALOG_ACCESSIBLE_DESCRIPTION=JConsole\u3068JDK\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u3064\u3044\u3066\u306e\u60c5\u5831\u3092\u542b\u3080\u30c0\u30a4\u30a2\u30ed\u30b0
+HELP_ABOUT_DIALOG_JCONSOLE_VERSION=JConsole\u30d0\u30fc\u30b8\u30e7\u30f3:<br>{0}
+HELP_ABOUT_DIALOG_JAVA_VERSION=Java VM\u30d0\u30fc\u30b8\u30e7\u30f3:<br>{0}
+HELP_ABOUT_DIALOG_MASTHEAD_ACCESSIBLE_NAME=\u30de\u30b9\u30c8\u30d8\u30c3\u30c9\u56f3\u5f62
+HELP_ABOUT_DIALOG_MASTHEAD_TITLE=JConsole\u306b\u3064\u3044\u3066
+HELP_ABOUT_DIALOG_TITLE=JConsole: \u8a73\u7d30
+HELP_ABOUT_DIALOG_USER_GUIDE_LINK=JConsole\u30e6\u30fc\u30b6\u30fc\u30fb\u30ac\u30a4\u30c9(&U):<br>{0}
+HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL=http://java.sun.com/javase/6/docs/technotes/guides/management/jconsole.html
+HELP_MENU_ABOUT_TITLE=JConsole\u306b\u3064\u3044\u3066(&A)
+HELP_MENU_USER_GUIDE_TITLE=\u30aa\u30f3\u30e9\u30a4\u30f3\u30fb\u30e6\u30fc\u30b6\u30fc\u30fb\u30ac\u30a4\u30c9(&U)
+HELP_MENU_TITLE=\u30d8\u30eb\u30d7(&H)
+HOTSPOT_MBEANS_ELLIPSIS=Hotspot MBeans(&H)...
+HOTSPOT_MBEANS_DIALOG_ACCESSIBLE_DESCRIPTION=Hotspot MBeans\u306e\u7ba1\u7406\u7528\u30c0\u30a4\u30a2\u30ed\u30b0
+IMPACT=\u5f71\u97ff
+INFO=\u60c5\u5831
+INFO_CAPITALIZED=\u60c5\u5831
+INVALID_PLUGIN_PATH=\u8b66\u544a: \u7121\u52b9\u306a\u30d7\u30e9\u30b0\u30a4\u30f3\u30fb\u30d1\u30b9: {0}
+INVALID_URL=\u7121\u52b9\u306aURL: {0}
+IS=\u6b21\u306b\u4e00\u81f4\u3059\u308b
+JAVA_MONITORING___MANAGEMENT_CONSOLE=Java Monitoring && Management Console
+JCONSOLE_COLON_=JConsole: {0}
+JCONSOLE_VERSION=JConsole\u30d0\u30fc\u30b8\u30e7\u30f3"{0}"
+JCONSOLE_ACCESSIBLE_DESCRIPTION=Java Monitoring && Management Console
+JIT_COMPILER=JIT\u30b3\u30f3\u30d1\u30a4\u30e9
+LIBRARY_PATH=\u30e9\u30a4\u30d6\u30e9\u30ea\u30fb\u30d1\u30b9
+LIVE_THREADS=\u5b9f\u884c\u4e2d\u306e\u30b9\u30ec\u30c3\u30c9
+LOADED=\u30ed\u30fc\u30c9\u6e08
+LOCAL_PROCESS_COLON=\u30ed\u30fc\u30ab\u30eb\u30fb\u30d7\u30ed\u30bb\u30b9(&L):
+MASTHEAD_FONT=Dialog-PLAIN-25
+MANAGEMENT_NOT_ENABLED=<b>\u6ce8\u610f</b>: \u7ba1\u7406\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306f\u3053\u306e\u30d7\u30ed\u30bb\u30b9\u3067\u306f\u6709\u52b9\u5316\u3055\u308c\u307e\u305b\u3093\u3002
+MANAGEMENT_WILL_BE_ENABLED=<b>\u6ce8\u610f</b>: \u7ba1\u7406\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306f\u3053\u306e\u30d7\u30ed\u30bb\u30b9\u3067\u6709\u52b9\u5316\u3055\u308c\u307e\u3059\u3002
+MBEAN_ATTRIBUTE_INFO=MBeanAttributeInfo
+MBEAN_INFO=MBeanInfo
+MBEAN_NOTIFICATION_INFO=MBeanNotificationInfo
+MBEAN_OPERATION_INFO=MBeanOperationInfo
+MBEANS=MBeans
+MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON=\u30af\u30ea\u30a2(&C)
+MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON_TOOLTIP=\u901a\u77e5\u306e\u30af\u30ea\u30a2
+MBEANS_TAB_COMPOSITE_NAVIGATION_MULTIPLE=\u30b3\u30f3\u30dd\u30b8\u30c3\u30c8\u30fb\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3{0}/{1}
+MBEANS_TAB_COMPOSITE_NAVIGATION_SINGLE=\u30b3\u30f3\u30dd\u30b8\u30c3\u30c8\u30fb\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3
+MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON=\u30ea\u30d5\u30ec\u30c3\u30b7\u30e5(&R)
+MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON_TOOLTIP=\u5c5e\u6027\u306e\u30ea\u30d5\u30ec\u30c3\u30b7\u30e5
+MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON=\u30b5\u30d6\u30b9\u30af\u30e9\u30a4\u30d6(&S)
+MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON_TOOLTIP=\u901a\u77e5\u30ea\u30b9\u30cb\u30f3\u30b0\u306e\u958b\u59cb
+MBEANS_TAB_TABULAR_NAVIGATION_MULTIPLE=\u30bf\u30d6\u30fb\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3{0}/{1}
+MBEANS_TAB_TABULAR_NAVIGATION_SINGLE=\u30bf\u30d6\u30fb\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3
+MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON=\u30b5\u30d6\u30b9\u30af\u30e9\u30a4\u30d6\u89e3\u9664(&U)
+MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON_TOOLTIP=\u901a\u77e5\u30ea\u30b9\u30cb\u30f3\u30b0\u306e\u505c\u6b62
+MANAGE_HOTSPOT_MBEANS_IN_COLON_=Hotspot MBeans\u306e\u7ba1\u7406:
+MAX=\u6700\u5927
+MAXIMUM_HEAP_SIZE=\u6700\u5927\u30d2\u30fc\u30d7\u30fb\u30b5\u30a4\u30ba
+MEMORY=\u30e1\u30e2\u30ea\u30fc
+MEMORY_POOL_LABEL=\u30e1\u30e2\u30ea\u30fc\u30fb\u30d7\u30fc\u30eb"{0}"
+MEMORY_TAB_HEAP_PLOTTER_ACCESSIBLE_NAME=\u30d2\u30fc\u30d7\u7528\u306e\u30e1\u30e2\u30ea\u30fc\u4f7f\u7528\u7387\u30c1\u30e3\u30fc\u30c8\u3002
+MEMORY_TAB_INFO_LABEL_FORMAT=<html>\u4f7f\u7528\u6e08: {0}    \u30b3\u30df\u30c3\u30c8\u6e08: {1}    \u6700\u5927: {2}</html>
+MEMORY_TAB_NON_HEAP_PLOTTER_ACCESSIBLE_NAME=\u975e\u30d2\u30fc\u30d7\u7528\u306e\u30e1\u30e2\u30ea\u30fc\u4f7f\u7528\u7387\u30c1\u30e3\u30fc\u30c8\u3002
+MEMORY_TAB_POOL_CHART_ABOVE_THRESHOLD={0}\u306e\u3057\u304d\u3044\u5024\u3088\u308a\u4e0a\u3067\u3059\u3002\n
+MEMORY_TAB_POOL_CHART_ACCESSIBLE_NAME=\u30e1\u30e2\u30ea\u30fc\u30fb\u30d7\u30fc\u30eb\u4f7f\u7528\u7387\u30c1\u30e3\u30fc\u30c8\u3002
+MEMORY_TAB_POOL_CHART_BELOW_THRESHOLD={0}\u306e\u3057\u304d\u3044\u5024\u3088\u308a\u4e0b\u3067\u3059\u3002\n
+MEMORY_TAB_POOL_PLOTTER_ACCESSIBLE_NAME={0}\u306e\u30e1\u30e2\u30ea\u30fc\u4f7f\u7528\u7387\u30c1\u30e3\u30fc\u30c8\u3002
+MESSAGE=\u30e1\u30c3\u30bb\u30fc\u30b8
+METHOD_SUCCESSFULLY_INVOKED=\u30e1\u30bd\u30c3\u30c9\u304c\u6b63\u5e38\u306b\u8d77\u52d5\u3055\u308c\u307e\u3057\u305f
+MINIMIZE_ALL=\u3059\u3079\u3066\u6700\u5c0f\u5316(&M)
+MONITOR_LOCKED=\ \ \ - \u30ed\u30c3\u30af\u6e08{0}\n
+NAME=\u540d\u524d
+NAME_AND_BUILD={0} (\u30d3\u30eb\u30c9{1})
+NAME_STATE=\u540d\u524d: {0}\n\u72b6\u614b: {1}\n
+NAME_STATE_LOCK_NAME=\u540d\u524d: {0}\n\u72b6\u614b: {2}\u306e{1}\n
+NAME_STATE_LOCK_NAME_LOCK_OWNER=\u540d\u524d: {0}\n\u72b6\u614b: {2}\u306e{1}\u3001\u6240\u6709\u8005: {3}\n
+NEW_CONNECTION_ELLIPSIS=\u65b0\u898f\u63a5\u7d9a(&N)...
+NO_DEADLOCK_DETECTED=\u30c7\u30c3\u30c9\u30ed\u30c3\u30af\u304c\u691c\u51fa\u3055\u308c\u307e\u305b\u3093\u3067\u3057\u305f
+NON_HEAP_MEMORY_USAGE=\u975e\u30d2\u30fc\u30d7\u30fb\u30e1\u30e2\u30ea\u30fc\u4f7f\u7528\u7387
+NON_HEAP=\u975e\u30d2\u30fc\u30d7
+NOTIFICATION=\u901a\u77e5
+NOTIFICATION_BUFFER=\u901a\u77e5\u30d0\u30c3\u30d5\u30a1
+NOTIFICATIONS=\u901a\u77e5
+NOTIF_TYPES=NotifTypes
+NUMBER_OF_THREADS=\u30b9\u30ec\u30c3\u30c9\u6570
+NUMBER_OF_LOADED_CLASSES=\u30ed\u30fc\u30c9\u6e08\u30af\u30e9\u30b9\u6570
+NUMBER_OF_PROCESSORS=\u30d7\u30ed\u30bb\u30c3\u30b5\u6570
+OBJECT_NAME=ObjectName
+OPERATING_SYSTEM=\u30aa\u30da\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u30fb\u30b7\u30b9\u30c6\u30e0
+OPERATION=\u64cd\u4f5c
+OPERATION_INVOCATION=\u64cd\u4f5c\u306e\u547c\u51fa\u3057
+OPERATION_RETURN_VALUE=\u64cd\u4f5c\u306e\u623b\u308a\u5024
+OPERATIONS=\u64cd\u4f5c
+OVERVIEW=\u6982\u8981
+OVERVIEW_PANEL_PLOTTER_ACCESSIBLE_NAME={0}\u306e\u30c1\u30e3\u30fc\u30c8\u3002
+PARAMETER=\u30d1\u30e9\u30e1\u30fc\u30bf
+PASSWORD_ACCESSIBLE_NAME=\u30d1\u30b9\u30ef\u30fc\u30c9
+PASSWORD_COLON_=\u30d1\u30b9\u30ef\u30fc\u30c9(P):
+PEAK=\u30d4\u30fc\u30af
+PERFORM_GC=GC\u306e\u5b9f\u884c(G)
+PERFORM_GC_TOOLTIP=\u30ac\u30d9\u30fc\u30b8\u30fb\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u30ea\u30af\u30a8\u30b9\u30c8
+PLOTTER_ACCESSIBLE_NAME=\u30c1\u30e3\u30fc\u30c8
+PLOTTER_ACCESSIBLE_NAME_KEY_AND_VALUE={0}={1}\n
+PLOTTER_ACCESSIBLE_NAME_NO_DATA=\u30c7\u30fc\u30bf\u304c\u30d7\u30ed\u30c3\u30c8\u3055\u308c\u307e\u305b\u3093\u3002
+PLOTTER_SAVE_AS_MENU_ITEM=\u540d\u524d\u3092\u4ed8\u3051\u3066\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58(&A)...
+PLOTTER_TIME_RANGE_MENU=\u6642\u9593\u7bc4\u56f2(&T)
+PROBLEM_ADDING_LISTENER=\u30ea\u30b9\u30ca\u30fc\u8ffd\u52a0\u4e2d\u306e\u554f\u984c
+PROBLEM_DISPLAYING_MBEAN=MBean\u8868\u793a\u4e2d\u306e\u554f\u984c
+PROBLEM_INVOKING=\u547c\u51fa\u3057\u4e2d\u306e\u554f\u984c
+PROBLEM_REMOVING_LISTENER=\u30ea\u30b9\u30ca\u30fc\u524a\u9664\u4e2d\u306e\u554f\u984c
+PROBLEM_SETTING_ATTRIBUTE=\u5c5e\u6027\u8a2d\u5b9a\u4e2d\u306e\u554f\u984c
+PROCESS_CPU_TIME=\u30d7\u30ed\u30bb\u30b9CPU\u6642\u9593
+READABLE=\u8aad\u53d6\u308a\u53ef\u80fd
+RECONNECT=\u518d\u63a5\u7d9a
+REMOTE_PROCESS_COLON=\u30ea\u30e2\u30fc\u30c8\u30fb\u30d7\u30ed\u30bb\u30b9(&R):
+REMOTE_PROCESS_TEXT_FIELD_ACCESSIBLE_NAME=\u30ea\u30e2\u30fc\u30c8\u30fb\u30d7\u30ed\u30bb\u30b9
+RESTORE_ALL=\u3059\u3079\u3066\u5fa9\u5143(&R)
+RETURN_TYPE=ReturnType
+SEQ_NUM=SeqNum
+SIZE_BYTES={0,number,integer}\u30d0\u30a4\u30c8
+SIZE_GB={0} Gb
+SIZE_KB={0} Kb
+SIZE_MB={0} Mb
+SOURCE=\u30bd\u30fc\u30b9
+STACK_TRACE=\n\u30b9\u30bf\u30c3\u30af\u30fb\u30c8\u30ec\u30fc\u30b9: \n
+SUMMARY_TAB_HEADER_DATE_TIME_FORMAT=FULL,FULL
+SUMMARY_TAB_PENDING_FINALIZATION_LABEL=\u30d5\u30a1\u30a4\u30ca\u30e9\u30a4\u30ba\u306e\u30da\u30f3\u30c7\u30a3\u30f3\u30b0
+SUMMARY_TAB_PENDING_FINALIZATION_VALUE={0}\u500b\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8
+SUMMARY_TAB_TAB_NAME=VM\u30b5\u30de\u30ea\u30fc
+SUMMARY_TAB_VM_VERSION={0}\u30d0\u30fc\u30b8\u30e7\u30f3{1}
+THREADS=\u30b9\u30ec\u30c3\u30c9
+THREAD_TAB_THREAD_INFO_ACCESSIBLE_NAME=\u30b9\u30ec\u30c3\u30c9\u60c5\u5831
+THREAD_TAB_THREAD_PLOTTER_ACCESSIBLE_NAME=\u30b9\u30ec\u30c3\u30c9\u6570\u306e\u30c1\u30e3\u30fc\u30c8\u3002
+THRESHOLD=\u3057\u304d\u3044\u5024
+TILE=\u4e26\u3079\u3066\u8868\u793a(&T)
+TIME_RANGE_COLON=\u6642\u9593\u7bc4\u56f2(&T):
+TIME=\u6642\u9593
+TIME_STAMP=TimeStamp
+TOTAL_LOADED=\u30ed\u30fc\u30c9\u6e08\u5408\u8a08
+TOTAL_CLASSES_LOADED=\u30ed\u30fc\u30c9\u6e08\u30af\u30e9\u30b9\u5408\u8a08
+TOTAL_CLASSES_UNLOADED=\u30a2\u30f3\u30ed\u30fc\u30c9\u6e08\u30af\u30e9\u30b9\u5408\u8a08
+TOTAL_COMPILE_TIME=\u5408\u8a08\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u9593
+TOTAL_PHYSICAL_MEMORY=\u5408\u8a08\u7269\u7406\u30e1\u30e2\u30ea\u30fc
+TOTAL_THREADS_STARTED=\u958b\u59cb\u6e08\u5408\u8a08\u30b9\u30ec\u30c3\u30c9
+TOTAL_SWAP_SPACE=\u5408\u8a08\u30b9\u30ef\u30c3\u30d7\u30fb\u30b9\u30da\u30fc\u30b9
+TYPE=\u578b
+UNAVAILABLE=\u5229\u7528\u4e0d\u53ef
+UNKNOWN_CAPITALIZED=UNKNOWN
+UNKNOWN_HOST=\u4e0d\u660e\u306a\u30db\u30b9\u30c8: {0}
+UNREGISTER=\u767b\u9332\u89e3\u9664
+UPTIME=\u7a3c\u50cd\u6642\u9593
+USAGE_THRESHOLD=\u4f7f\u7528\u3057\u304d\u3044\u5024
+REMOTE_TF_USAGE=<b>\u4f7f\u7528\u65b9\u6cd5</b>: &lt;hostname&gt;:&lt;port&gt;\u307e\u305f\u306fservice:jmx:&lt;protocol&gt;:&lt;sap&gt;
+USED=\u4f7f\u7528\u6e08
+USERNAME_COLON_=\u30e6\u30fc\u30b6\u30fc\u540d(&U):
+USERNAME_ACCESSIBLE_NAME=\u30e6\u30fc\u30b6\u30fc\u540d
+USER_DATA=UserData
+VIRTUAL_MACHINE=\u4eee\u60f3\u30de\u30b7\u30f3
+VM_ARGUMENTS=VM\u5f15\u6570
+VMINTERNAL_FRAME_ACCESSIBLE_DESCRIPTION=Java\u4eee\u60f3\u30de\u30b7\u30f3\u306e\u30e2\u30cb\u30bf\u30fc\u7528\u306e\u5185\u90e8\u30d5\u30ec\u30fc\u30e0
+VALUE=\u5024
+VENDOR=\u30d9\u30f3\u30c0\u30fc
+VERBOSE_OUTPUT=\u8a73\u7d30\u51fa\u529b
+VERBOSE_OUTPUT_TOOLTIP=\u30af\u30e9\u30b9\u8aad\u8fbc\u307f\u30b7\u30b9\u30c6\u30e0\u3067\u8a73\u7d30\u51fa\u529b\u3092\u6709\u52b9\u306b\u3059\u308b
+VIEW=\u8868\u793a
+WINDOW=\u30a6\u30a3\u30f3\u30c9\u30a6(&W)
+WINDOWS=\u30a6\u30a3\u30f3\u30c9\u30a6
+WRITABLE=\u66f8\u8fbc\u307f\u53ef\u80fd
+CONNECTION_FAILED1=\u63a5\u7d9a\u306b\u5931\u6557\u3057\u307e\u3057\u305f: \u518d\u8a66\u884c\u3057\u307e\u3059\u304b\u3002
+CONNECTION_FAILED2={0}\u3078\u306e\u63a5\u7d9a\u304c\u6210\u529f\u3057\u307e\u305b\u3093\u3067\u3057\u305f\u3002<br>\u3082\u3046\u4e00\u5ea6\u8a66\u3057\u307e\u3059\u304b\u3002
+CONNECTION_LOST1=\u63a5\u7d9a\u304c\u5931\u308f\u308c\u307e\u3057\u305f: \u518d\u63a5\u7d9a\u3057\u307e\u3059\u304b\u3002
+CONNECTING_TO1={0}\u306b\u63a5\u7d9a\u4e2d
+CONNECTING_TO2={0}\u306b\u73fe\u5728\u63a5\u7d9a\u4e2d\u3067\u3059\u3002<br>\u3053\u308c\u306b\u306f\u6570\u5206\u304b\u304b\u308a\u307e\u3059\u3002
+DEADLOCK_TAB=\u30c7\u30c3\u30c9\u30ed\u30c3\u30af
+DEADLOCK_TAB_N=\u30c7\u30c3\u30c9\u30ed\u30c3\u30af{0}
+EXPAND=\u5c55\u958b
+KBYTES={0} KB
+PLOT=\u30d7\u30ed\u30c3\u30c8
+VISUALIZE=\u8996\u899a\u5316
+ZZ_USAGE_TEXT=\u4f7f\u7528\u65b9\u6cd5: {0} [ -interval=n ] [ -notile ] [ -pluginpath <path> ] [ -version ] [ connection ... ]\n\n  -interval   \u66f4\u65b0\u9593\u9694\u3092n\u79d2\u306b\u8a2d\u5b9a\u3059\u308b(\u30c7\u30d5\u30a9\u30eb\u30c8\u306f4\u79d2)\n  -notile     \u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u6700\u521d\u306b\u4e26\u3079\u3066\u8868\u793a\u3057\u306a\u3044(2\u3064\u4ee5\u4e0a\u306e\u63a5\u7d9a\u306b\u3064\u3044\u3066)\n  -pluginpath JConsole\u304c\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u53c2\u7167\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3059\u308b\u30d1\u30b9\u3092\u6307\u5b9a\u3059\u308b\n  -version    \u30d7\u30ed\u30b0\u30e9\u30e0\u30fb\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u5370\u5237\u3059\u308b\n\n  connection = pid || host:port || JMX URL (service:jmx:<protocol>://...)\n  pid         \u30bf\u30fc\u30b2\u30c3\u30c8\u30fb\u30d7\u30ed\u30bb\u30b9\u306e\u30d7\u30ed\u30bb\u30b9ID\n  host        \u30ea\u30e2\u30fc\u30c8\u30fb\u30db\u30b9\u30c8\u540d\u307e\u305f\u306fIP\u30a2\u30c9\u30ec\u30b9\n  port        \u30ea\u30e2\u30fc\u30c8\u63a5\u7d9a\u7528\u306e\u30dd\u30fc\u30c8\u756a\u53f7\n\n  -J          JConsole\u304c\u5b9f\u884c\u4e2d\u306eJava\u4eee\u60f3\u30de\u30b7\u30f3\u3078\u306e\n              \u5165\u529b\u5f15\u6570\u3092\u6307\u5b9a\u3059\u308b
diff --git a/src/share/classes/sun/tools/jconsole/resources/messages_zh_CN.properties b/src/share/classes/sun/tools/jconsole/resources/messages_zh_CN.properties
new file mode 100644
index 0000000..48964c7
--- /dev/null
+++ b/src/share/classes/sun/tools/jconsole/resources/messages_zh_CN.properties
@@ -0,0 +1,273 @@
+ONE_DAY=\ 1 \u5929
+ONE_HOUR=\ 1 \u5c0f\u65f6
+ONE_MIN=\ 1 \u5206\u949f
+ONE_MONTH=\ 1 \u4e2a\u6708
+ONE_YEAR=\ 1 \u5e74
+TWO_HOURS=\ 2 \u5c0f\u65f6
+THREE_HOURS=\ 3 \u5c0f\u65f6
+THREE_MONTHS=\ 3 \u4e2a\u6708
+FIVE_MIN=\ 5 \u5206\u949f
+SIX_HOURS=\ 6 \u5c0f\u65f6
+SIX_MONTHS=\ 6 \u4e2a\u6708
+SEVEN_DAYS=\ 7 \u5929
+TEN_MIN=10 \u5206\u949f
+TWELVE_HOURS=12 \u5c0f\u65f6
+THIRTY_MIN=30 \u5206\u949f
+LESS_THAN=<
+A_LOT_LESS_THAN=<<
+GREATER_THAN=>
+ACTION_CAPITALIZED=ACTION
+ACTION_INFO_CAPITALIZED=ACTION_INFO
+ALL=\u5168\u90e8
+ARCHITECTURE=\u4f53\u7cfb\u7ed3\u6784
+ATTRIBUTE=\u5c5e\u6027
+ATTRIBUTE_VALUE=\u5c5e\u6027\u503c
+ATTRIBUTE_VALUES=\u5c5e\u6027\u503c
+ATTRIBUTES=\u5c5e\u6027
+BLANK=\u7a7a\u767d
+BLOCKED_COUNT_WAITED_COUNT=\u603b\u963b\u6b62\u6570: {0}, \u603b\u7b49\u5f85\u6570: {1}\n
+BOOT_CLASS_PATH=\u5f15\u5bfc\u7c7b\u8def\u5f84
+BORDERED_COMPONENT_MORE_OR_LESS_BUTTON_TOOLTIP=\u5207\u6362\u4ee5\u663e\u793a\u66f4\u591a\u6216\u66f4\u5c11\u4fe1\u606f
+CPU_USAGE=CPU \u5360\u7528\u7387
+CPU_USAGE_FORMAT=CPU \u5360\u7528\u7387: {0}%
+CANCEL=\u53d6\u6d88
+CASCADE=\u5c42\u53e0(&C)
+CHART_COLON=\u56fe\u8868(&C):
+CLASS_PATH=\u7c7b\u8def\u5f84
+CLASS_NAME=ClassName
+CLASS_TAB_INFO_LABEL_FORMAT=<html>\u5df2\u52a0\u8f7d: {0}    \u5df2\u5378\u8f7d: {1}    \u603b\u8ba1: {2}</html>
+CLASS_TAB_LOADED_CLASSES_PLOTTER_ACCESSIBLE_NAME=\u5df2\u52a0\u8f7d\u7c7b\u7684\u56fe\u8868\u3002
+CLASSES=\u7c7b
+CLOSE=\u5173\u95ed
+COLUMN_NAME=\u540d\u79f0
+COLUMN_PID=PID
+COMMITTED_MEMORY=\u63d0\u4ea4\u7684\u5185\u5b58
+COMMITTED_VIRTUAL_MEMORY=\u63d0\u4ea4\u7684\u865a\u62df\u5185\u5b58
+COMMITTED=\u5df2\u63d0\u4ea4
+CONNECT=\u8fde\u63a5(&C)
+CONNECT_DIALOG_CONNECT_BUTTON_TOOLTIP=\u8fde\u63a5\u5230 Java \u865a\u62df\u673a
+CONNECT_DIALOG_ACCESSIBLE_DESCRIPTION=\u7528\u4e8e\u4e0e\u672c\u5730\u6216\u8fdc\u7a0b Java \u865a\u62df\u673a\u5efa\u7acb\u65b0\u8fde\u63a5\u7684\u5bf9\u8bdd\u6846
+CONNECT_DIALOG_MASTHEAD_ACCESSIBLE_NAME=\u62a5\u5934\u56fe
+CONNECT_DIALOG_MASTHEAD_TITLE=\u65b0\u5efa\u8fde\u63a5
+CONNECT_DIALOG_STATUS_BAR_ACCESSIBLE_NAME=\u72b6\u6001\u680f
+CONNECT_DIALOG_TITLE=JConsole: \u65b0\u5efa\u8fde\u63a5
+CONNECTED_PUNCTUATION_CLICK_TO_DISCONNECT_=\u5df2\u8fde\u63a5\u3002\u5355\u51fb\u53ef\u65ad\u5f00\u8fde\u63a5\u3002
+CONNECTION_FAILED=\u8fde\u63a5\u5931\u8d25
+CONNECTION=\u8fde\u63a5(&C)
+CONNECTION_NAME=\u8fde\u63a5\u540d\u79f0
+CONNECTION_NAME__DISCONNECTED_={0} (\u5df2\u65ad\u5f00\u8fde\u63a5)
+CONSTRUCTOR=\u6784\u9020\u5668
+CURRENT_CLASSES_LOADED=\u5df2\u52a0\u88c5\u5f53\u524d\u7c7b
+CURRENT_HEAP_SIZE=\u5f53\u524d\u5806\u5927\u5c0f
+CURRENT_VALUE=\u5f53\u524d\u503c: {0}
+CREATE=\u521b\u5efa
+DAEMON_THREADS=\u5b88\u62a4\u7a0b\u5e8f\u7ebf\u7a0b
+DISCONNECTED_PUNCTUATION_CLICK_TO_CONNECT_=\u5df2\u65ad\u5f00\u8fde\u63a5\u3002\u5355\u51fb\u53ef\u8fde\u63a5\u3002
+DOUBLE_CLICK_TO_EXPAND_FORWARD_SLASH_COLLAPSE=\u53cc\u51fb\u4ee5\u5c55\u5f00/\u9690\u85cf
+DOUBLE_CLICK_TO_VISUALIZE=\u53cc\u51fb\u4ee5\u4f7f\u5176\u53ef\u89c1
+DESCRIPTION=\u8bf4\u660e
+DESCRIPTOR=\u63cf\u8ff0\u7b26
+DETAILS=\u8be6\u7ec6\u8d44\u6599
+DETECT_DEADLOCK=\u68c0\u6d4b\u6b7b\u9501(&D)
+DETECT_DEADLOCK_TOOLTIP=\u68c0\u6d4b\u5904\u4e8e\u6b7b\u9501\u72b6\u6001\u7684\u7ebf\u7a0b
+DIMENSION_IS_NOT_SUPPORTED_COLON=\u4e0d\u652f\u6301\u7ef4:
+DISCARD_CHART=\u653e\u5f03\u56fe\u8868
+DURATION_DAYS_HOURS_MINUTES={0,choice,1#{0,number,integer} \u5929 |1.0<{0,number,integer} \u5929 }{1,choice,0<{1,number,integer} \u5c0f\u65f6 |1#{1,number,integer} \u5c0f\u65f6 |1<{1,number,integer} \u5c0f\u65f6 }{2,choice,0<{2,number,integer} \u5206\u949f|1#{2,number,integer} \u5206\u949f|1.0<{2,number,integer} \u5206\u949f}
+DURATION_HOURS_MINUTES={0,choice,1#{0,number,integer} \u5c0f\u65f6 |1<{0,number,integer} \u5c0f\u65f6 }{1,choice,0<{1,number,integer} \u5206\u949f|1#{1,number,integer} \u5206\u949f|1.0<{1,number,integer} \u5206\u949f}
+DURATION_MINUTES={0,choice,1#{0,number,integer} \u5206\u949f|1.0<{0,number,integer} \u5206\u949f}
+DURATION_SECONDS={0} \u79d2
+EMPTY_ARRAY=\u7a7a\u6570\u7ec4
+ERROR=\u9519\u8bef
+ERROR_COLON_MBEANS_ALREADY_EXIST=\u9519\u8bef: MBean \u5df2\u5b58\u5728
+ERROR_COLON_MBEANS_DO_NOT_EXIST=\u9519\u8bef: MBean \u4e0d\u5b58\u5728
+EVENT=\u4e8b\u4ef6
+EXIT=\u9000\u51fa(&X)
+FAIL_TO_LOAD_PLUGIN=\u8b66\u544a: \u65e0\u6cd5\u52a0\u8f7d\u63d2\u4ef6: {0}
+FILE_CHOOSER_FILE_EXISTS_CANCEL_OPTION=\u53d6\u6d88
+FILE_CHOOSER_FILE_EXISTS_MESSAGE=<html><center>\u6587\u4ef6\u5df2\u5b58\u5728:<br>{0}<br>\u662f\u5426\u8981\u66ff\u6362?
+FILE_CHOOSER_FILE_EXISTS_OK_OPTION=\u66ff\u6362
+FILE_CHOOSER_FILE_EXISTS_TITLE=\u6587\u4ef6\u5df2\u5b58\u5728
+FILE_CHOOSER_SAVED_FILE=<html>\u5df2\u4fdd\u5b58\u5230\u6587\u4ef6:<br>{0}<br>({1} \u5b57\u8282)
+FILE_CHOOSER_SAVE_FAILED_MESSAGE=<html><center>\u672a\u80fd\u4fdd\u5b58\u5230\u6587\u4ef6:<br>{0}<br>{1}
+FILE_CHOOSER_SAVE_FAILED_TITLE=\u4fdd\u5b58\u5931\u8d25
+FREE_PHYSICAL_MEMORY=\u7a7a\u95f2\u7269\u7406\u5185\u5b58
+FREE_SWAP_SPACE=\u7a7a\u95f2\u4ea4\u6362\u7a7a\u95f4
+GARBAGE_COLLECTOR=\u5783\u573e\u6536\u96c6\u5668
+GC_INFO=\u540d\u79f0 = ''{0}'', \u6536\u96c6 = {1,choice,-1#Unavailable|0#{1,number,integer}}, \u603b\u82b1\u8d39\u65f6\u95f4 = {2}
+GC_TIME=GC \u65f6\u95f4
+GC_TIME_DETAILS={1}\u4e0a\u7684{0} ({2}\u6536\u96c6)
+HEAP_MEMORY_USAGE=\u5806\u5185\u5b58\u4f7f\u7528\u91cf
+HEAP=\u5806
+HELP_ABOUT_DIALOG_ACCESSIBLE_DESCRIPTION=\u5305\u542b\u6709\u5173 JConsole \u548c JDK \u7248\u672c\u4fe1\u606f\u7684\u5bf9\u8bdd\u6846
+HELP_ABOUT_DIALOG_JCONSOLE_VERSION=JConsole \u7248\u672c:<br>{0}
+HELP_ABOUT_DIALOG_JAVA_VERSION=Java VM \u7248\u672c:<br>{0}
+HELP_ABOUT_DIALOG_MASTHEAD_ACCESSIBLE_NAME=\u62a5\u5934\u56fe
+HELP_ABOUT_DIALOG_MASTHEAD_TITLE=\u5173\u4e8e JConsole
+HELP_ABOUT_DIALOG_TITLE=JConsole: \u5173\u4e8e
+HELP_ABOUT_DIALOG_USER_GUIDE_LINK=JConsole \u7528\u6237\u6307\u5357(&U):<br>{0}
+HELP_ABOUT_DIALOG_USER_GUIDE_LINK_URL=http://java.sun.com/javase/6/docs/technotes/guides/management/jconsole.html
+HELP_MENU_ABOUT_TITLE=\u5173\u4e8e JConsole(&A)
+HELP_MENU_USER_GUIDE_TITLE=\u8054\u673a\u7528\u6237\u6307\u5357(&U)
+HELP_MENU_TITLE=\u5e2e\u52a9(&H)
+HOTSPOT_MBEANS_ELLIPSIS=HotSpot MBean(&H)...
+HOTSPOT_MBEANS_DIALOG_ACCESSIBLE_DESCRIPTION=\u7528\u4e8e\u7ba1\u7406 HotSpot MBean \u7684\u5bf9\u8bdd\u6846
+IMPACT=\u5f71\u54cd
+INFO=\u4fe1\u606f
+INFO_CAPITALIZED=INFO
+INVALID_PLUGIN_PATH=\u8b66\u544a: \u63d2\u4ef6\u8def\u5f84\u65e0\u6548: {0}
+INVALID_URL=URL \u65e0\u6548: {0}
+IS=\u662f
+JAVA_MONITORING___MANAGEMENT_CONSOLE=Java \u76d1\u89c6\u548c\u7ba1\u7406\u63a7\u5236\u53f0
+JCONSOLE_COLON_=JConsole: {0}
+JCONSOLE_VERSION=JConsole \u7248\u672c "{0}"
+JCONSOLE_ACCESSIBLE_DESCRIPTION=Java \u76d1\u89c6\u548c\u7ba1\u7406\u63a7\u5236\u53f0
+JIT_COMPILER=JIT \u7f16\u8bd1\u5668
+LIBRARY_PATH=\u5e93\u8def\u5f84
+LIVE_THREADS=\u6d3b\u52a8\u7ebf\u7a0b
+LOADED=\u5df2\u52a0\u8f7d
+LOCAL_PROCESS_COLON=\u672c\u5730\u8fdb\u7a0b(&L):
+MASTHEAD_FONT=Dialog-PLAIN-25
+MANAGEMENT_NOT_ENABLED=<b>\u6ce8</b>: \u672a\u5bf9\u6b64\u8fdb\u7a0b\u542f\u7528\u7ba1\u7406\u4ee3\u7406\u3002
+MANAGEMENT_WILL_BE_ENABLED=<b>\u6ce8</b>: \u5c06\u5bf9\u6b64\u8fdb\u7a0b\u542f\u7528\u7ba1\u7406\u4ee3\u7406\u3002
+MBEAN_ATTRIBUTE_INFO=MBeanAttributeInfo
+MBEAN_INFO=MBeanInfo
+MBEAN_NOTIFICATION_INFO=MBeanNotificationInfo
+MBEAN_OPERATION_INFO=MBeanOperationInfo
+MBEANS=MBean
+MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON=\u6e05\u9664(&C)
+MBEANS_TAB_CLEAR_NOTIFICATIONS_BUTTON_TOOLTIP=\u6e05\u9664\u901a\u77e5
+MBEANS_TAB_COMPOSITE_NAVIGATION_MULTIPLE=\u7ec4\u5408\u5bfc\u822a{0}/{1}
+MBEANS_TAB_COMPOSITE_NAVIGATION_SINGLE=\u7ec4\u5408\u5bfc\u822a
+MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON=\u5237\u65b0(&R)
+MBEANS_TAB_REFRESH_ATTRIBUTES_BUTTON_TOOLTIP=\u5237\u65b0\u5c5e\u6027
+MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON=\u8ba2\u9605(&S)
+MBEANS_TAB_SUBSCRIBE_NOTIFICATIONS_BUTTON_TOOLTIP=\u5f00\u59cb\u76d1\u542c\u901a\u77e5
+MBEANS_TAB_TABULAR_NAVIGATION_MULTIPLE=\u8868\u683c\u5f0f\u5bfc\u822a{0}/{1}
+MBEANS_TAB_TABULAR_NAVIGATION_SINGLE=\u8868\u683c\u5f0f\u5bfc\u822a
+MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON=\u53d6\u6d88\u8ba2\u9605(&U)
+MBEANS_TAB_UNSUBSCRIBE_NOTIFICATIONS_BUTTON_TOOLTIP=\u505c\u6b62\u76d1\u542c\u901a\u77e5
+MANAGE_HOTSPOT_MBEANS_IN_COLON_=\u7ba1\u7406\u4ee5\u4e0b\u4f4d\u7f6e\u7684 HotSpot MBean:
+MAX=\u6700\u5927\u503c
+MAXIMUM_HEAP_SIZE=\u6700\u5927\u5806\u5927\u5c0f
+MEMORY=\u5185\u5b58
+MEMORY_POOL_LABEL=\u5185\u5b58\u6c60 "{0}"
+MEMORY_TAB_HEAP_PLOTTER_ACCESSIBLE_NAME=\u5806\u7684\u5185\u5b58\u4f7f\u7528\u91cf\u56fe\u8868\u3002
+MEMORY_TAB_INFO_LABEL_FORMAT=<html>\u5df2\u7528: {0}    \u5df2\u63d0\u4ea4: {1}    \u6700\u5927: {2}</html>
+MEMORY_TAB_NON_HEAP_PLOTTER_ACCESSIBLE_NAME=\u975e\u5806\u7684\u5185\u5b58\u4f7f\u7528\u91cf\u56fe\u8868\u3002
+MEMORY_TAB_POOL_CHART_ABOVE_THRESHOLD=\u5927\u4e8e{0}\u7684\u9608\u503c\u3002\n
+MEMORY_TAB_POOL_CHART_ACCESSIBLE_NAME=\u5185\u5b58\u6c60\u4f7f\u7528\u91cf\u56fe\u8868\u3002
+MEMORY_TAB_POOL_CHART_BELOW_THRESHOLD=\u4f4e\u4e8e{0}\u7684\u9608\u503c\u3002\n
+MEMORY_TAB_POOL_PLOTTER_ACCESSIBLE_NAME={0}\u7684\u5185\u5b58\u4f7f\u7528\u91cf\u56fe\u8868\u3002
+MESSAGE=\u6d88\u606f
+METHOD_SUCCESSFULLY_INVOKED=\u5df2\u6210\u529f\u8c03\u7528\u65b9\u6cd5
+MINIMIZE_ALL=\u5168\u90e8\u6700\u5c0f\u5316(&M)
+MONITOR_LOCKED=\ \ \ - \u5df2\u9501\u5b9a{0}\n
+NAME=\u540d\u79f0
+NAME_AND_BUILD={0} (\u5de5\u4f5c\u7248\u672c {1})
+NAME_STATE=\u540d\u79f0: {0}\n\u72b6\u6001: {1}\n
+NAME_STATE_LOCK_NAME=\u540d\u79f0: {0}\n\u72b6\u6001: {2}\u4e0a\u7684{1}\n
+NAME_STATE_LOCK_NAME_LOCK_OWNER=\u540d\u79f0: {0}\n\u72b6\u6001: {2}\u4e0a\u7684{1}, \u62e5\u6709\u8005: {3}\n
+NEW_CONNECTION_ELLIPSIS=\u65b0\u5efa\u8fde\u63a5(&N)...
+NO_DEADLOCK_DETECTED=\u672a\u68c0\u6d4b\u5230\u6b7b\u9501
+NON_HEAP_MEMORY_USAGE=\u975e\u5806\u5185\u5b58\u4f7f\u7528\u91cf
+NON_HEAP=\u975e\u5806
+NOTIFICATION=\u901a\u77e5
+NOTIFICATION_BUFFER=\u901a\u77e5\u7f13\u51b2\u533a
+NOTIFICATIONS=\u901a\u77e5
+NOTIF_TYPES=NotifTypes
+NUMBER_OF_THREADS=\u7ebf\u7a0b\u6570
+NUMBER_OF_LOADED_CLASSES=\u5df2\u52a0\u8f7d\u7c7b\u6570
+NUMBER_OF_PROCESSORS=\u5904\u7406\u7a0b\u5e8f\u6570
+OBJECT_NAME=ObjectName
+OPERATING_SYSTEM=\u64cd\u4f5c\u7cfb\u7edf
+OPERATION=\u64cd\u4f5c
+OPERATION_INVOCATION=\u64cd\u4f5c\u8c03\u7528
+OPERATION_RETURN_VALUE=\u64cd\u4f5c\u8fd4\u56de\u503c
+OPERATIONS=\u64cd\u4f5c
+OVERVIEW=\u6982\u89c8
+OVERVIEW_PANEL_PLOTTER_ACCESSIBLE_NAME={0}\u7684\u56fe\u8868\u3002
+PARAMETER=\u53c2\u6570
+PASSWORD_ACCESSIBLE_NAME=\u53e3\u4ee4
+PASSWORD_COLON_=\u53e3\u4ee4(&P):
+PEAK=\u5cf0\u503c
+PERFORM_GC=\u6267\u884c &GC
+PERFORM_GC_TOOLTIP=\u8bf7\u6c42\u5783\u573e\u6536\u96c6
+PLOTTER_ACCESSIBLE_NAME=\u56fe\u8868
+PLOTTER_ACCESSIBLE_NAME_KEY_AND_VALUE={0}={1}\n
+PLOTTER_ACCESSIBLE_NAME_NO_DATA=\u672a\u7ed8\u5236\u6570\u636e\u3002
+PLOTTER_SAVE_AS_MENU_ITEM=\u5c06\u6570\u636e\u53e6\u5b58\u4e3a(&A)...
+PLOTTER_TIME_RANGE_MENU=\u65f6\u95f4\u8303\u56f4(&T)
+PROBLEM_ADDING_LISTENER=\u6dfb\u52a0\u76d1\u542c\u7a0b\u5e8f\u65f6\u51fa\u73b0\u95ee\u9898
+PROBLEM_DISPLAYING_MBEAN=\u663e\u793a MBean \u65f6\u51fa\u73b0\u95ee\u9898
+PROBLEM_INVOKING=\u8c03\u7528\u65f6\u51fa\u73b0\u95ee\u9898
+PROBLEM_REMOVING_LISTENER=\u5220\u9664\u76d1\u542c\u7a0b\u5e8f\u65f6\u51fa\u73b0\u95ee\u9898
+PROBLEM_SETTING_ATTRIBUTE=\u8bbe\u7f6e\u5c5e\u6027\u65f6\u51fa\u73b0\u95ee\u9898
+PROCESS_CPU_TIME=\u8fdb\u7a0b CPU \u65f6\u95f4
+READABLE=\u53ef\u8bfb
+RECONNECT=\u91cd\u65b0\u8fde\u63a5
+REMOTE_PROCESS_COLON=\u8fdc\u7a0b\u8fdb\u7a0b(&R):
+REMOTE_PROCESS_TEXT_FIELD_ACCESSIBLE_NAME=\u8fdc\u7a0b\u8fdb\u7a0b
+RESTORE_ALL=\u5168\u90e8\u8fd8\u539f(&R)
+RETURN_TYPE=ReturnType
+SEQ_NUM=SeqNum
+SIZE_BYTES={0,number,integer} \u5b57\u8282
+SIZE_GB={0} GB
+SIZE_KB={0} KB
+SIZE_MB={0} MB
+SOURCE=\u6e90
+STACK_TRACE=\n\u5806\u6808\u8ddf\u8e2a: \n
+SUMMARY_TAB_HEADER_DATE_TIME_FORMAT=FULL,FULL
+SUMMARY_TAB_PENDING_FINALIZATION_LABEL=\u6682\u6302\u6700\u7ec8\u5904\u7406
+SUMMARY_TAB_PENDING_FINALIZATION_VALUE={0}\u5bf9\u8c61
+SUMMARY_TAB_TAB_NAME=VM \u6982\u8981
+SUMMARY_TAB_VM_VERSION={0}\u7248\u672c {1}
+THREADS=\u7ebf\u7a0b
+THREAD_TAB_THREAD_INFO_ACCESSIBLE_NAME=\u7ebf\u7a0b\u4fe1\u606f
+THREAD_TAB_THREAD_PLOTTER_ACCESSIBLE_NAME=\u8868\u793a\u7ebf\u7a0b\u6570\u7684\u56fe\u8868\u3002
+THRESHOLD=\u9608\u503c
+TILE=\u5e73\u94fa(&T)
+TIME_RANGE_COLON=\u65f6\u95f4\u8303\u56f4(&T):
+TIME=\u65f6\u95f4
+TIME_STAMP=TimeStamp
+TOTAL_LOADED=\u52a0\u8f7d\u603b\u6570
+TOTAL_CLASSES_LOADED=\u5df2\u52a0\u8f7d\u7c7b\u603b\u6570
+TOTAL_CLASSES_UNLOADED=\u5df2\u5378\u8f7d\u7c7b\u603b\u6570
+TOTAL_COMPILE_TIME=\u603b\u7f16\u8bd1\u65f6\u95f4
+TOTAL_PHYSICAL_MEMORY=\u603b\u7269\u7406\u5185\u5b58
+TOTAL_THREADS_STARTED=\u542f\u52a8\u7684\u7ebf\u7a0b\u603b\u6570
+TOTAL_SWAP_SPACE=\u603b\u4ea4\u6362\u7a7a\u95f4
+TYPE=\u7c7b\u578b
+UNAVAILABLE=\u4e0d\u53ef\u7528
+UNKNOWN_CAPITALIZED=UNKNOWN
+UNKNOWN_HOST=\u672a\u77e5\u4e3b\u673a: {0}
+UNREGISTER=\u6ce8\u9500
+UPTIME=\u8fd0\u884c\u65f6\u95f4
+USAGE_THRESHOLD=\u7528\u6cd5\u9608\u503c
+REMOTE_TF_USAGE=<b>\u7528\u6cd5</b>: &lt;hostname&gt;:&lt;port&gt; \u6216 service:jmx:&lt;protocol&gt;:&lt;sap&gt;
+USED=\u5df2\u7528
+USERNAME_COLON_=\u7528\u6237\u540d(&U):
+USERNAME_ACCESSIBLE_NAME=\u7528\u6237\u540d
+USER_DATA=UserData
+VIRTUAL_MACHINE=\u865a\u62df\u673a
+VM_ARGUMENTS=VM \u53c2\u6570
+VMINTERNAL_FRAME_ACCESSIBLE_DESCRIPTION=\u7528\u4e8e\u76d1\u89c6 Java \u865a\u62df\u673a\u7684\u5185\u90e8\u6846\u67b6
+VALUE=\u503c
+VENDOR=\u5382\u5546
+VERBOSE_OUTPUT=\u8be6\u7ec6\u8f93\u51fa
+VERBOSE_OUTPUT_TOOLTIP=\u4e3a\u7c7b\u52a0\u8f7d\u7cfb\u7edf\u542f\u7528\u8be6\u7ec6\u8f93\u51fa
+VIEW=\u89c6\u56fe
+WINDOW=\u7a97\u53e3(&W)
+WINDOWS=Windows
+WRITABLE=\u53ef\u5199
+CONNECTION_FAILED1=\u8fde\u63a5\u5931\u8d25: \u662f\u5426\u91cd\u8bd5?
+CONNECTION_FAILED2=\u672a\u6210\u529f\u8fde\u63a5\u5230{0}\u3002<br>\u662f\u5426\u8981\u91cd\u8bd5?
+CONNECTION_LOST1=\u8fde\u63a5\u4e22\u5931: \u662f\u5426\u91cd\u65b0\u8fde\u63a5?
+CONNECTING_TO1=\u6b63\u5728\u8fde\u63a5\u5230{0}
+CONNECTING_TO2=\u60a8\u5f53\u524d\u6b63\u5728\u8fde\u63a5\u5230{0}\u3002<br>\u8fd9\u5c06\u9700\u8981\u51e0\u5206\u949f\u7684\u65f6\u95f4\u3002
+DEADLOCK_TAB=\u6b7b\u9501
+DEADLOCK_TAB_N=\u6b7b\u9501{0}
+EXPAND=\u5c55\u5f00
+KBYTES={0} KB
+PLOT=\u7ed8\u56fe
+VISUALIZE=\u53ef\u89c6\u5316
+ZZ_USAGE_TEXT=\u7528\u6cd5: {0} [ -interval=n ] [ -notile ] [ -pluginpath <path> ] [ -version ] [ connection ... ]\n\n  -interval   \u5c06\u66f4\u65b0\u95f4\u9694\u8bbe\u7f6e\u4e3a n \u79d2 (\u9ed8\u8ba4\u503c\u4e3a 4 \u79d2)\n  -notile     \u521d\u59cb\u4e0d\u5e73\u94fa\u7a97\u53e3 (\u5bf9\u4e8e\u4e24\u4e2a\u6216\u591a\u4e2a\u8fde\u63a5)\n  -pluginpath \u6307\u5b9a jconsole \u7528\u4e8e\u67e5\u627e\u63d2\u4ef6\u7684\u8def\u5f84\n  -version    \u8f93\u51fa\u7a0b\u5e8f\u7248\u672c\n\n  connection = pid || host:port || JMX URL (service:jmx:<\u534f\u8bae>://...)\n  pid         \u76ee\u6807\u8fdb\u7a0b\u7684\u8fdb\u7a0b ID\n  host        \u8fdc\u7a0b\u4e3b\u673a\u540d\u6216 IP \u5730\u5740\n  port        \u8fdc\u7a0b\u8fde\u63a5\u7684\u7aef\u53e3\u53f7\n\n  -J          \u6307\u5b9a\u8fd0\u884c jconsole \u7684 Java \u865a\u62df\u673a\n              \u7684\u8f93\u5165\u53c2\u6570
diff --git a/src/share/demo/jfc/TransparentRuler/transparentruler/Ruler.java b/src/share/demo/jfc/TransparentRuler/transparentruler/Ruler.java
index 9e93bd2..b8f2719 100644
--- a/src/share/demo/jfc/TransparentRuler/transparentruler/Ruler.java
+++ b/src/share/demo/jfc/TransparentRuler/transparentruler/Ruler.java
@@ -134,6 +134,9 @@
 
     {
         jPopupMenu.add(new JMenuItem(exitAction));
+
+        // To avoid popup cutting by main window shape forbid light-weight popups
+        jPopupMenu.setLightWeightPopupEnabled(false);
     }
 
     /**
diff --git a/src/share/demo/jvmti/java_crw_demo/java_crw_demo.c b/src/share/demo/jvmti/java_crw_demo/java_crw_demo.c
index 28ef3b6..1da0e55 100644
--- a/src/share/demo/jvmti/java_crw_demo/java_crw_demo.c
+++ b/src/share/demo/jvmti/java_crw_demo/java_crw_demo.c
@@ -89,6 +89,12 @@
                          (ci)->input_position <= (ci)->input_len && \
                          (ci)->output_position <= (ci)->output_len) )
 
+#define BUFSIZE 256
+
+#ifdef _WIN32
+#define snprintf(buffer, count, format, ...) _snprintf_s(buffer, count, _TRUNCATE, format, ##__VA_ARGS__)
+#endif
+
 /* Typedefs for various integral numbers, just for code clarity */
 
 typedef unsigned       ClassOpcode;             /* One opcode */
@@ -651,6 +657,7 @@
         unsigned int    index2;
         unsigned        len;
         char *          utf8;
+        char message[BUFSIZE];
 
         ipos    = i;
         index1  = 0;
@@ -689,8 +696,20 @@
                 utf8[len] = 0;
                 write_bytes(ci, (void*)utf8, len);
                 break;
+            case JVM_CONSTANT_MethodType:
+                index1 = copyU2(ci);
+                break;
+            case JVM_CONSTANT_MethodHandle:
+                index1 = copyU1(ci);
+                index2 = copyU2(ci);
+                break;
+            case JVM_CONSTANT_InvokeDynamic:
+                index1 = copyU2(ci);
+                index2 = copyU2(ci);
+                break;
             default:
-                CRW_FATAL(ci, "Unknown constant");
+                snprintf(message, BUFSIZE, "Unknown tag: %d, at ipos %hu", tag, ipos);
+                CRW_FATAL(ci, message);
                 break;
         }
         fillin_cpool_entry(ci, ipos, tag, index1, index2, (const char *)utf8, len);
diff --git a/src/share/demo/management/MemoryMonitor/MemoryMonitor.java b/src/share/demo/management/MemoryMonitor/MemoryMonitor.java
index ca6ab6e..7dd0b7c 100644
--- a/src/share/demo/management/MemoryMonitor/MemoryMonitor.java
+++ b/src/share/demo/management/MemoryMonitor/MemoryMonitor.java
@@ -122,6 +122,7 @@
         private Font font = new Font("Times New Roman", Font.PLAIN, 11);
         private int columnInc;
         private float usedMem[][];
+        private float usedMemMax[]; // Used when max pool size is undefined
         private int ptNum[];
         private int ascent, descent;
         private Rectangle graphOutlineRect = new Rectangle();
@@ -142,6 +143,10 @@
                 }
             });
             usedMem = new float[numPools][];
+            usedMemMax = new float[numPools];
+            for (int i = 0; i < numPools; i++) {
+                usedMemMax[i] = 1024f * 1024f ;
+            }
             ptNum = new int[numPools];
         }
 
@@ -194,6 +199,12 @@
             MemoryPoolMXBean mp = mpools.get(npool);
             float usedMemory =  mp.getUsage().getUsed();
             float totalMemory =  mp.getUsage().getMax();
+            if (totalMemory < 0) { // Max is undefined for this pool
+                if (usedMemory > usedMemMax[npool]) {
+                    usedMemMax[npool] = usedMemory;
+                }
+                totalMemory = usedMemMax[npool];
+            }
 
             // .. Draw allocated and used strings ..
             big.setColor(Color.green);
diff --git a/src/share/javavm/export/classfile_constants.h b/src/share/javavm/export/classfile_constants.h
index ccdf594..861576e 100644
--- a/src/share/javavm/export/classfile_constants.h
+++ b/src/share/javavm/export/classfile_constants.h
@@ -86,7 +86,8 @@
     JVM_CONSTANT_InterfaceMethodref     = 11,
     JVM_CONSTANT_NameAndType            = 12,
     JVM_CONSTANT_MethodHandle           = 15,  // JSR 292
-    JVM_CONSTANT_MethodType             = 16   // JSR 292
+    JVM_CONSTANT_MethodType             = 16,   // JSR 292
+    JVM_CONSTANT_InvokeDynamic          = 18
 };
 
 /* JVM_CONSTANT_MethodHandle subtypes */
diff --git a/src/share/javavm/export/jvm.h b/src/share/javavm/export/jvm.h
index 1e49717..b551f29 100644
--- a/src/share/javavm/export/jvm.h
+++ b/src/share/javavm/export/jvm.h
@@ -595,7 +595,7 @@
 JVM_AssertionStatusDirectives(JNIEnv *env, jclass unused);
 
 /*
- * java.util.concurrent.AtomicLong
+ * java.util.concurrent.atomic.AtomicLong
  */
 JNIEXPORT jboolean JNICALL
 JVM_SupportsCX8(void);
diff --git a/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java b/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java
index 60c254f..bbebbf5 100644
--- a/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java
+++ b/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java
@@ -721,15 +721,17 @@
             // Location, Client size + insets
             newLocation = new Point(xe.get_x() - currentInsets.left, xe.get_y() - currentInsets.top);
         } else {
-            // CDE/MWM/Metacity/Sawfish bug: if shell is resized using
-            // top or left border, we don't receive synthetic
-            // ConfigureNotify, only the one from X with zero
-            // coordinates.  This is the workaround to get real
-            // location, 6261336
+            // ICCCM 4.1.5 states that a real ConfigureNotify will be sent when
+            // a window is resized but the client can not tell if the window was
+            // moved or not. The client should consider the position as unkown
+            // and use TranslateCoordinates to find the actual position.
+            //
+            // TODO this should be the default for every case.
             switch (XWM.getWMID()) {
                 case XWM.CDE_WM:
                 case XWM.MOTIF_WM:
                 case XWM.METACITY_WM:
+                case XWM.MUTTER_WM:
                 case XWM.SAWFISH_WM:
                 {
                     Point xlocation = queryXLocation();
diff --git a/src/solaris/classes/sun/awt/X11/XKeysym.java b/src/solaris/classes/sun/awt/X11/XKeysym.java
index 7941940..6ba84a8 100644
--- a/src/solaris/classes/sun/awt/X11/XKeysym.java
+++ b/src/solaris/classes/sun/awt/X11/XKeysym.java
@@ -1416,6 +1416,7 @@
         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Meta_L),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_META, java.awt.event.KeyEvent.KEY_LOCATION_LEFT));
         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Meta_R),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_META, java.awt.event.KeyEvent.KEY_LOCATION_RIGHT));
         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Caps_Lock),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_CAPS_LOCK, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
+        keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Shift_Lock),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_CAPS_LOCK, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
 
             /* Misc Functions */
         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Print),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PRINTSCREEN, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
@@ -1590,6 +1591,21 @@
         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Kanji),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_CONVERT, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
             /* Type 5c Japanese keyboard: nihongo */
         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Henkan_Mode),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_INPUT_METHOD_ON_OFF, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
+        keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Eisu_Shift   ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ALPHANUMERIC       , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
+        keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Eisu_toggle  ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ALPHANUMERIC       , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
+        keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Zenkaku      ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_FULL_WIDTH         , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
+        keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Hankaku      ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_HALF_WIDTH         , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
+        keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Hiragana     ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_HIRAGANA           , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
+        keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Katakana     ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_KATAKANA           , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
+        keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Romaji       ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_JAPANESE_ROMAN     , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
+        keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Kana_Shift   ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_KANA               , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
+        keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Kana_Lock    ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_KANA_LOCK          , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
+        keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Muhenkan     ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_NONCONVERT         , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
+        keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Zen_Koho     ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ALL_CANDIDATES     , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
+        keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Kanji_Bangou ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_CODE_INPUT         , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
+        keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Mae_Koho     ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PREVIOUS_CANDIDATE , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
+
+
             /* VK_KANA_LOCK is handled separately because it generates the
              * same keysym as ALT_GRAPH in spite of its different behavior.
              */
diff --git a/src/solaris/classes/sun/awt/X11/XLabelPeer.java b/src/solaris/classes/sun/awt/X11/XLabelPeer.java
index dc94ea1..3feafdb 100644
--- a/src/solaris/classes/sun/awt/X11/XLabelPeer.java
+++ b/src/solaris/classes/sun/awt/X11/XLabelPeer.java
@@ -141,7 +141,7 @@
     }
     public void setFont(Font f) {
         super.setFont(f);
-        target.repaint();
+        repaint();
     }
 
     public void setAlignment(int align) {
diff --git a/src/solaris/classes/sun/awt/X11/XWM.java b/src/solaris/classes/sun/awt/X11/XWM.java
index f25080f..7eb5f2f 100644
--- a/src/solaris/classes/sun/awt/X11/XWM.java
+++ b/src/solaris/classes/sun/awt/X11/XWM.java
@@ -102,7 +102,8 @@
         METACITY_WM = 11,
         COMPIZ_WM = 12,
         LG3D_WM = 13,
-        CWM_WM = 14;
+        CWM_WM = 14,
+        MUTTER_WM = 15;
     public String toString() {
         switch  (WMID) {
           case NO_WM:
@@ -131,6 +132,8 @@
               return "LookingGlass";
           case CWM_WM:
               return "CWM";
+          case MUTTER_WM:
+              return "Mutter";
           case UNDETERMINED_WM:
           default:
               return "Undetermined WM";
@@ -573,6 +576,10 @@
 //                            getIntProperty(XToolkit.getDefaultRootWindow(), XAtom.XA_CARDINAL)) == 0);
     }
 
+    static boolean isMutter() {
+        return isNetWMName("Mutter");
+    }
+
     static boolean isNonReparentingWM() {
         return (XWM.getWMID() == XWM.COMPIZ_WM || XWM.getWMID() == XWM.LG3D_WM || XWM.getWMID() == XWM.CWM_WM);
     }
@@ -742,6 +749,8 @@
                 awt_wmgr = XWM.ENLIGHTEN_WM;
             } else if (isMetacity()) {
                 awt_wmgr = XWM.METACITY_WM;
+            } else if (isMutter()) {
+                awt_wmgr = XWM.MUTTER_WM;
             } else if (isSawfish()) {
                 awt_wmgr = XWM.SAWFISH_WM;
             } else if (isKDE2()) {
diff --git a/src/solaris/classes/sun/nio/ch/DevPollArrayWrapper.java b/src/solaris/classes/sun/nio/ch/DevPollArrayWrapper.java
index 64a241e..de2c3b0 100644
--- a/src/solaris/classes/sun/nio/ch/DevPollArrayWrapper.java
+++ b/src/solaris/classes/sun/nio/ch/DevPollArrayWrapper.java
@@ -25,9 +25,10 @@
 
 package sun.nio.ch;
 
-import sun.misc.*;
 import java.io.IOException;
-import java.util.LinkedList;
+import java.util.BitSet;
+import java.util.Map;
+import java.util.HashMap;
 
 
 /**
@@ -66,62 +67,72 @@
     static final short EVENT_OFFSET  = 4;
     static final short REVENT_OFFSET = 6;
 
+    // Special value to indicate that an update should be ignored
+    static final byte  CANCELLED     = (byte)-1;
+
     // Maximum number of open file descriptors
-    static final int   OPEN_MAX      = fdLimit();
+    static final int   OPEN_MAX      = IOUtil.fdLimit();
 
     // Number of pollfd structures to create.
-    // DP_POLL ioctl allows up to OPEN_MAX-1
+    // dpwrite/ioctl(DP_POLL) allows up to OPEN_MAX-1
     static final int   NUM_POLLFDS   = Math.min(OPEN_MAX-1, 8192);
 
+    // Initial size of arrays for fd registration changes
+    private final int INITIAL_PENDING_UPDATE_SIZE = 64;
+
+    // maximum size of updatesLow
+    private final int MAX_UPDATE_ARRAY_SIZE = Math.min(OPEN_MAX, 64*1024);
+
+    // The pollfd array for results from devpoll driver
+    private final AllocatedNativeObject pollArray;
+
     // Base address of the native pollArray
-    private long pollArrayAddress;
+    private final long pollArrayAddress;
 
-    // Array of pollfd structs used for driver updates
-    private AllocatedNativeObject updatePollArray;
+    // The fd of the devpoll driver
+    private int wfd;
 
-    // Maximum number of POLL_FD structs to update at once
-    private int MAX_UPDATE_SIZE = Math.min(OPEN_MAX, 10000);
+    // The fd of the interrupt line going out
+    private int outgoingInterruptFD;
+
+    // The fd of the interrupt line coming in
+    private int incomingInterruptFD;
+
+    // The index of the interrupt FD
+    private int interruptedIndex;
+
+    // Number of updated pollfd entries
+    int updated;
+
+    // object to synchronize fd registration changes
+    private final Object updateLock = new Object();
+
+    // number of file descriptors with registration changes pending
+    private int updateCount;
+
+    // file descriptors with registration changes pending
+    private int[] updateDescriptors = new int[INITIAL_PENDING_UPDATE_SIZE];
+
+    // events for file descriptors with registration changes pending, indexed
+    // by file descriptor and stored as bytes for efficiency reasons. For
+    // file descriptors higher than MAX_UPDATE_ARRAY_SIZE (unlimited case at
+    // least then the update is stored in a map.
+    private final byte[] eventsLow = new byte[MAX_UPDATE_ARRAY_SIZE];
+    private Map<Integer,Byte> eventsHigh;
+
+    // Used by release and updateRegistrations to track whether a file
+    // descriptor is registered with /dev/poll.
+    private final BitSet registered = new BitSet();
 
     DevPollArrayWrapper() {
         int allocationSize = NUM_POLLFDS * SIZE_POLLFD;
         pollArray = new AllocatedNativeObject(allocationSize, true);
         pollArrayAddress = pollArray.address();
-        allocationSize = MAX_UPDATE_SIZE * SIZE_POLLFD;
-        updatePollArray = new AllocatedNativeObject(allocationSize, true);
         wfd = init();
+        if (OPEN_MAX > MAX_UPDATE_ARRAY_SIZE)
+            eventsHigh = new HashMap<>();
     }
 
-    // Machinery for remembering fd registration changes
-    // A hashmap could be used but the number of changes pending
-    // is expected to be small
-    private static class Updator {
-        int fd;
-        int mask;
-        Updator(int fd, int mask) {
-            this.fd = fd;
-            this.mask = mask;
-        }
-    }
-    private LinkedList<Updator> updateList = new LinkedList<Updator>();
-
-    // The pollfd array for results from devpoll driver
-    private AllocatedNativeObject pollArray;
-
-    // The fd of the devpoll driver
-    int wfd;
-
-    // The fd of the interrupt line going out
-    int outgoingInterruptFD;
-
-    // The fd of the interrupt line coming in
-    int incomingInterruptFD;
-
-    // The index of the interrupt FD
-    int interruptedIndex;
-
-    // Number of updated pollfd entries
-    int updated;
-
     void initInterrupt(int fd0, int fd1) {
         outgoingInterruptFD = fd1;
         incomingInterruptFD = fd0;
@@ -148,22 +159,60 @@
         return pollArray.getInt(offset);
     }
 
+    private void setUpdateEvents(int fd, byte events) {
+        if (fd < MAX_UPDATE_ARRAY_SIZE) {
+            eventsLow[fd] = events;
+        } else {
+            eventsHigh.put(Integer.valueOf(fd), Byte.valueOf(events));
+        }
+    }
+
+    private byte getUpdateEvents(int fd) {
+        if (fd < MAX_UPDATE_ARRAY_SIZE) {
+            return eventsLow[fd];
+        } else {
+            Byte result = eventsHigh.get(Integer.valueOf(fd));
+            // result should never be null
+            return result.byteValue();
+        }
+    }
+
     void setInterest(int fd, int mask) {
-        synchronized (updateList) {
-            updateList.add(new Updator(fd, mask));
+        synchronized (updateLock) {
+            // record the file descriptor and events, expanding the
+            // respective arrays first if necessary.
+            int oldCapacity = updateDescriptors.length;
+            if (updateCount == oldCapacity) {
+                int newCapacity = oldCapacity + INITIAL_PENDING_UPDATE_SIZE;
+                int[] newDescriptors = new int[newCapacity];
+                System.arraycopy(updateDescriptors, 0, newDescriptors, 0, oldCapacity);
+                updateDescriptors = newDescriptors;
+            }
+            updateDescriptors[updateCount++] = fd;
+
+            // events are stored as bytes for efficiency reasons
+            byte b = (byte)mask;
+            assert (b == mask) && (b != CANCELLED);
+            setUpdateEvents(fd, b);
         }
     }
 
     void release(int fd) {
-        synchronized (updateList) {
-            updateList.add(new Updator(fd, POLLREMOVE));
+        synchronized (updateLock) {
+            // cancel any pending update for this file descriptor
+            setUpdateEvents(fd, CANCELLED);
+
+            // remove from /dev/poll
+            if (registered.get(fd)) {
+                register(wfd, fd, POLLREMOVE);
+                registered.clear(fd);
+            }
         }
     }
 
     void closeDevPollFD() throws IOException {
         FileDispatcherImpl.closeIntFD(wfd);
         pollArray.free();
-        updatePollArray.free();
     }
 
     int poll(long timeout) throws IOException {
@@ -180,33 +229,48 @@
     }
 
     void updateRegistrations() throws IOException {
-        // Populate pollfd array with updated masks
-        synchronized (updateList) {
-            while (updateList.size() > 0) {
-                // We have to insert a dummy node in between each
-                // real update to use POLLREMOVE on the fd first because
-                // otherwise the changes are simply OR'd together
-                int index = 0;
-                Updator u = null;
-                while ((u = updateList.poll()) != null) {
-                    // First add pollfd struct to clear out this fd
-                    putPollFD(updatePollArray, index, u.fd, POLLREMOVE);
-                    index++;
-                    // Now add pollfd to update this fd, if necessary
-                    if (u.mask != POLLREMOVE) {
-                        putPollFD(updatePollArray, index, u.fd, (short)u.mask);
-                        index++;
-                    }
+        synchronized (updateLock) {
+            // Populate pollfd array with updated masks
+            int j = 0;
+            int index = 0;
+            while (j < updateCount) {
+                int fd = updateDescriptors[j];
+                short events = getUpdateEvents(fd);
+                boolean isRegistered = registered.get(fd);
 
-                    // Check against the max update size; these are
-                    // all we will process. Valid index ranges from 0 to
-                    // (MAX_UPDATE_SIZE - 1) and we can use up to 2 per loop
-                    if (index >  MAX_UPDATE_SIZE - 2)
-                        break;
+                // events = 0 => POLLREMOVE or do-nothing
+                if (events != CANCELLED) {
+                    if (events == 0) {
+                        if (isRegistered) {
+                            events = POLLREMOVE;
+                            registered.clear(fd);
+                        } else {
+                            events = CANCELLED;
+                        }
+                    } else {
+                        if (!isRegistered) {
+                            registered.set(fd);
+                        }
+                    }
                 }
-                // Register the changes with /dev/poll
-                registerMultiple(wfd, updatePollArray.address(), index);
-             }
+
+                // populate pollfd array with updated event
+                if (events != CANCELLED) {
+                    putPollFD(pollArray, index, fd, events);
+                    index++;
+                    if (index >= NUM_POLLFDS) {
+                        registerMultiple(wfd, pollArray.address(), index);
+                        index = 0;
+                    }
+                }
+                j++;
+            }
+
+            // write any remaining updates
+            if (index > 0)
+                registerMultiple(wfd, pollArray.address(), index);
+
+            updateCount = 0;
         }
     }
 
@@ -244,6 +308,4 @@
     private native int poll0(long pollAddress, int numfds, long timeout,
                              int wfd);
     private static native void interrupt(int fd);
-    private static native int fdLimit();
-
 }
diff --git a/src/share/classes/sun/nio/ch/DevPollSelectorProvider.java b/src/solaris/classes/sun/nio/ch/DevPollSelectorProvider.java
similarity index 100%
rename from src/share/classes/sun/nio/ch/DevPollSelectorProvider.java
rename to src/solaris/classes/sun/nio/ch/DevPollSelectorProvider.java
diff --git a/src/solaris/classes/sun/nio/ch/EPollArrayWrapper.java b/src/solaris/classes/sun/nio/ch/EPollArrayWrapper.java
index 5549de9..539b2c8 100644
--- a/src/solaris/classes/sun/nio/ch/EPollArrayWrapper.java
+++ b/src/solaris/classes/sun/nio/ch/EPollArrayWrapper.java
@@ -74,7 +74,7 @@
     static final int EVENT_OFFSET     = 0;
     static final int DATA_OFFSET      = offsetofData();
     static final int FD_OFFSET        = DATA_OFFSET;
-    static final int NUM_EPOLLEVENTS  = Math.min(fdLimit(), 8192);
+    static final int NUM_EPOLLEVENTS  = Math.min(IOUtil.fdLimit(), 8192);
 
     // Base address of the native pollArray
     private final long pollArrayAddress;
@@ -296,7 +296,6 @@
                                  int epfd) throws IOException;
     private static native int sizeofEPollEvent();
     private static native int offsetofData();
-    private static native int fdLimit();
     private static native void interrupt(int fd);
     private static native void init();
 }
diff --git a/src/solaris/classes/sun/nio/ch/EventPortSelectorImpl.java b/src/solaris/classes/sun/nio/ch/EventPortSelectorImpl.java
new file mode 100644
index 0000000..2b89dad
--- /dev/null
+++ b/src/solaris/classes/sun/nio/ch/EventPortSelectorImpl.java
@@ -0,0 +1,170 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.nio.ch;
+
+import java.io.IOException;
+import java.nio.channels.*;
+import java.nio.channels.spi.*;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Iterator;
+
+/**
+ * Selector implementation based on the Solaris event port mechanism.
+ */
+
+class EventPortSelectorImpl
+    extends SelectorImpl
+{
+    private final EventPortWrapper pollWrapper;
+
+    // Maps from file descriptors to keys
+    private Map<Integer,SelectionKeyImpl> fdToKey;
+
+    // True if this Selector has been closed
+    private boolean closed = false;
+
+    // Lock for interrupt triggering and clearing
+    private final Object interruptLock = new Object();
+    private boolean interruptTriggered = false;
+
+    /**
+     * Package private constructor called by factory method in
+     * the abstract superclass Selector.
+     */
+    EventPortSelectorImpl(SelectorProvider sp) throws IOException {
+        super(sp);
+        pollWrapper = new EventPortWrapper();
+        fdToKey = new HashMap<>();
+    }
+
+    protected int doSelect(long timeout) throws IOException {
+        if (closed)
+            throw new ClosedSelectorException();
+        processDeregisterQueue();
+        int entries;
+        try {
+            begin();
+            entries = pollWrapper.poll(timeout);
+        } finally {
+            end();
+        }
+        processDeregisterQueue();
+        int numKeysUpdated = updateSelectedKeys(entries);
+        if (pollWrapper.interrupted()) {
+            synchronized (interruptLock) {
+                interruptTriggered = false;
+            }
+        }
+        return numKeysUpdated;
+    }
+
+    private int updateSelectedKeys(int entries) {
+        int numKeysUpdated = 0;
+        for (int i=0; i<entries; i++) {
+            int nextFD = pollWrapper.getDescriptor(i);
+            SelectionKeyImpl ski = fdToKey.get(Integer.valueOf(nextFD));
+            if (ski != null) {
+                int rOps = pollWrapper.getEventOps(i);
+                if (selectedKeys.contains(ski)) {
+                    if (ski.channel.translateAndSetReadyOps(rOps, ski)) {
+                        numKeysUpdated++;
+                    }
+                } else {
+                    ski.channel.translateAndSetReadyOps(rOps, ski);
+                    if ((ski.nioReadyOps() & ski.nioInterestOps()) != 0) {
+                        selectedKeys.add(ski);
+                        numKeysUpdated++;
+                    }
+                }
+            }
+        }
+        return numKeysUpdated;
+    }
+
+    protected void implClose() throws IOException {
+        if (closed)
+            return;
+        closed = true;
+
+        // prevent further wakeup
+        synchronized (interruptLock) {
+            interruptTriggered = true;
+        }
+
+        pollWrapper.close();
+        selectedKeys = null;
+
+        // Deregister channels
+        Iterator<SelectionKey> i = keys.iterator();
+        while (i.hasNext()) {
+            SelectionKeyImpl ski = (SelectionKeyImpl)i.next();
+            deregister(ski);
+            SelectableChannel selch = ski.channel();
+            if (!selch.isOpen() && !selch.isRegistered())
+                ((SelChImpl)selch).kill();
+            i.remove();
+        }
+    }
+
+    protected void implRegister(SelectionKeyImpl ski) {
+        int fd = IOUtil.fdVal(ski.channel.getFD());
+        fdToKey.put(Integer.valueOf(fd), ski);
+        keys.add(ski);
+    }
+
+    protected void implDereg(SelectionKeyImpl ski) throws IOException {
+        int i = ski.getIndex();
+        assert (i >= 0);
+        int fd = ski.channel.getFDVal();
+        fdToKey.remove(Integer.valueOf(fd));
+        pollWrapper.release(fd);
+        ski.setIndex(-1);
+        keys.remove(ski);
+        selectedKeys.remove(ski);
+        deregister((AbstractSelectionKey)ski);
+        SelectableChannel selch = ski.channel();
+        if (!selch.isOpen() && !selch.isRegistered())
+            ((SelChImpl)selch).kill();
+    }
+
+    public void putEventOps(SelectionKeyImpl sk, int ops) {
+        if (closed)
+            throw new ClosedSelectorException();
+        int fd = sk.channel.getFDVal();
+        pollWrapper.setInterest(fd, ops);
+    }
+
+    public Selector wakeup() {
+        synchronized (interruptLock) {
+            if (!interruptTriggered) {
+                pollWrapper.interrupt();
+                interruptTriggered = true;
+            }
+        }
+        return this;
+    }
+}
diff --git a/src/share/native/java/sql/DriverManager.c b/src/solaris/classes/sun/nio/ch/EventPortSelectorProvider.java
similarity index 70%
rename from src/share/native/java/sql/DriverManager.c
rename to src/solaris/classes/sun/nio/ch/EventPortSelectorProvider.java
index 5c868d0..25546e3 100644
--- a/src/share/native/java/sql/DriverManager.c
+++ b/src/solaris/classes/sun/nio/ch/EventPortSelectorProvider.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,15 +23,20 @@
  * questions.
  */
 
-#include <stdlib.h>
+package sun.nio.ch;
 
-#include "jni.h"
-#include "jni_util.h"
-#include "jvm.h"
+import java.io.IOException;
+import java.nio.channels.*;
+import java.nio.channels.spi.*;
 
-JNIEXPORT jobject JNICALL
-Java_java_sql_DriverManager_getCallerClassLoader(JNIEnv *env, jobject this)
+public class EventPortSelectorProvider
+    extends SelectorProviderImpl
 {
-    jclass caller = JVM_GetCallerClass(env, 2);
-    return caller != 0 ? JVM_GetClassLoader(env, caller) : 0;
+    public AbstractSelector openSelector() throws IOException {
+        return new EventPortSelectorImpl(this);
+    }
+
+    public Channel inheritedChannel() throws IOException {
+        return InheritedChannel.getChannel();
+    }
 }
diff --git a/src/solaris/classes/sun/nio/ch/EventPortWrapper.java b/src/solaris/classes/sun/nio/ch/EventPortWrapper.java
new file mode 100644
index 0000000..bec3736
--- /dev/null
+++ b/src/solaris/classes/sun/nio/ch/EventPortWrapper.java
@@ -0,0 +1,256 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.nio.ch;
+
+import sun.misc.Unsafe;
+import java.io.IOException;
+import java.util.*;
+import static sun.nio.ch.SolarisEventPort.*;
+
+/**
+ * Manages a Solaris event port and manipulates a native array of pollfd structs
+ * on Solaris.
+ */
+
+class EventPortWrapper {
+    private static final Unsafe unsafe = Unsafe.getUnsafe();
+    private static final int addressSize = unsafe.addressSize();
+
+    // Maximum number of open file descriptors
+    static final int   OPEN_MAX     = IOUtil.fdLimit();
+
+    // Maximum number of events to retrive in one call to port_getn
+    static final int   POLL_MAX     =  Math.min(OPEN_MAX-1, 1024);
+
+    // initial size of the array to hold pending updates
+    private final int INITIAL_PENDING_UPDATE_SIZE = 256;
+
+    // maximum size of updateArray
+    private final int MAX_UPDATE_ARRAY_SIZE = Math.min(OPEN_MAX, 64*1024);
+
+    // special update status to indicate that it should be ignored
+    private static final byte IGNORE = -1;
+
+    // port file descriptor
+    private final int pfd;
+
+    // the poll array (populated by port_getn)
+    private final long pollArrayAddress;
+    private final AllocatedNativeObject pollArray;
+
+    // required when accessing the update* fields
+    private final Object updateLock = new Object();
+
+    // the number of pending updates
+    private int updateCount;
+
+    // queue of file descriptors with updates pending
+    private int[] updateDescriptors = new int[INITIAL_PENDING_UPDATE_SIZE];
+
+    // events for file descriptors with registration changes pending, indexed
+    // by file descriptor and stored as bytes for efficiency reasons. For
+    // file descriptors higher than MAX_UPDATE_ARRAY_SIZE (unlimited case at
+    // least then the update is stored in a map.
+    private final byte[] eventsLow = new byte[MAX_UPDATE_ARRAY_SIZE];
+    private Map<Integer,Byte> eventsHigh;
+    // Used by release and updateRegistrations to track whether a file
+    // descriptor is registered with /dev/poll.
+    private final BitSet registered = new BitSet();
+
+    // bit set to indicate if a file descriptor has been visited when
+    // processing updates (used to avoid duplicates calls to port_associate)
+    private BitSet visited = new BitSet();
+
+    EventPortWrapper() throws IOException {
+        int allocationSize = POLL_MAX * SIZEOF_PORT_EVENT;
+        pollArray = new AllocatedNativeObject(allocationSize, true);
+        pollArrayAddress = pollArray.address();
+        this.pfd = port_create();
+        if (OPEN_MAX > MAX_UPDATE_ARRAY_SIZE)
+            eventsHigh = new HashMap<>();
+    }
+
+    void close() throws IOException {
+        port_close(pfd);
+        pollArray.free();
+    }
+
+    private short getSource(int i) {
+        int offset = SIZEOF_PORT_EVENT * i + OFFSETOF_SOURCE;
+        return pollArray.getShort(offset);
+    }
+
+    int getEventOps(int i) {
+        int offset = SIZEOF_PORT_EVENT * i + OFFSETOF_EVENTS;
+        return pollArray.getInt(offset);
+    }
+
+    int getDescriptor(int i) {
+        int offset = SIZEOF_PORT_EVENT * i + OFFSETOF_OBJECT;
+        if (addressSize == 4) {
+            return pollArray.getInt(offset);
+        } else {
+            return (int) pollArray.getLong(offset);
+        }
+    }
+
+    private void setDescriptor(int i, int fd) {
+        int offset = SIZEOF_PORT_EVENT * i + OFFSETOF_OBJECT;
+        if (addressSize == 4) {
+            pollArray.putInt(offset, fd);
+        } else {
+            pollArray.putLong(offset, fd);
+        }
+    }
+
+    private void setUpdate(int fd, byte events) {
+        if (fd < MAX_UPDATE_ARRAY_SIZE) {
+            eventsLow[fd] = events;
+        } else {
+            eventsHigh.put(Integer.valueOf(fd), Byte.valueOf(events));
+        }
+    }
+
+    private byte getUpdate(int fd) {
+        if (fd < MAX_UPDATE_ARRAY_SIZE) {
+            return eventsLow[fd];
+        } else {
+            Byte result = eventsHigh.get(Integer.valueOf(fd));
+            // result should never be null
+            return result.byteValue();
+        }
+    }
+
+    int poll(long timeout) throws IOException {
+        // update registrations prior to poll
+        synchronized (updateLock) {
+
+            // process newest updates first
+            int i = updateCount - 1;
+            while (i >= 0) {
+                int fd = updateDescriptors[i];
+                if (!visited.get(fd)) {
+                    short ev = getUpdate(fd);
+                    if (ev != IGNORE) {
+                        if (ev == 0) {
+                            if (registered.get(fd)) {
+                                port_dissociate(pfd, PORT_SOURCE_FD, (long)fd);
+                                registered.clear(fd);
+                            }
+                        } else {
+                            if (port_associate(pfd, PORT_SOURCE_FD, (long)fd, ev)) {
+                                registered.set(fd);
+                            }
+                        }
+
+                    }
+                    visited.set(fd);
+                }
+                i--;
+            }
+            updateCount = 0;
+        }
+
+        // poll for events
+        int updated = port_getn(pfd, pollArrayAddress, POLL_MAX, timeout);
+
+        // after polling we need to queue all polled file descriptors as they
+        // are candidates to register for the next poll.
+        synchronized (updateLock) {
+            for (int i=0; i<updated; i++) {
+                if (getSource(i) == PORT_SOURCE_USER) {
+                    interrupted = true;
+                    setDescriptor(i, -1);
+                } else {
+                    // the default is to re-associate for the next poll
+                    int fd = getDescriptor(i);
+                    registered.clear(fd);
+                    setInterest(fd);
+                }
+            }
+        }
+
+        return updated;
+    }
+
+    private void setInterest(int fd) {
+        assert Thread.holdsLock(updateLock);
+
+        // record the file descriptor and events, expanding the
+        // respective arrays first if necessary.
+        int oldCapacity = updateDescriptors.length;
+        if (updateCount >= oldCapacity) {
+            int newCapacity = oldCapacity + INITIAL_PENDING_UPDATE_SIZE;
+            int[] newDescriptors = new int[newCapacity];
+            System.arraycopy(updateDescriptors, 0, newDescriptors, 0, oldCapacity);
+            updateDescriptors = newDescriptors;
+        }
+        updateDescriptors[updateCount++] = fd;
+        visited.clear(fd);
+    }
+
+    void setInterest(int fd, int mask) {
+        synchronized (updateLock) {
+            setInterest(fd);
+            setUpdate(fd, (byte)mask);
+            assert getUpdate(fd) == mask;
+        }
+    }
+
+    void release(int fd) {
+        synchronized (updateLock) {
+            if (registered.get(fd)) {
+                try {
+                    port_dissociate(pfd, PORT_SOURCE_FD, (long)fd);
+                } catch (IOException ioe) {
+                    throw new InternalError(ioe);
+                }
+                registered.clear(fd);
+            }
+            setUpdate(fd, IGNORE);
+        }
+    }
+
+    // -- wakeup support --
+
+    private boolean interrupted;
+
+    public void interrupt() {
+        try {
+            port_send(pfd, 0);
+        } catch (IOException ioe) {
+            throw new InternalError(ioe);
+        }
+    }
+
+    boolean interrupted() {
+        return interrupted;
+    }
+
+    void clearInterrupted() {
+        interrupted = false;
+    }
+}
diff --git a/src/solaris/classes/sun/nio/ch/SolarisEventPort.java b/src/solaris/classes/sun/nio/ch/SolarisEventPort.java
index 276b4b9..6f20d4c 100644
--- a/src/solaris/classes/sun/nio/ch/SolarisEventPort.java
+++ b/src/solaris/classes/sun/nio/ch/SolarisEventPort.java
@@ -31,8 +31,8 @@
 import sun.misc.Unsafe;
 
 /**
- * AsynchronousChannelGroup implementation based on the Solaris 10 event port
- * framework.
+ * Provides an AsynchronousChannelGroup implementation based on the Solaris 10
+ * event port framework and also provides direct access to that framework.
  */
 
 class SolarisEventPort
@@ -54,14 +54,14 @@
      *     void            *portev_user;
      * } port_event_t;
      */
-    private static final int SIZEOF_PORT_EVENT  = dependsArch(16, 24);
-    private static final int OFFSETOF_EVENTS    = 0;
-    private static final int OFFSETOF_SOURCE    = 4;
-    private static final int OFFSETOF_OBJECT    = 8;
+    static final int SIZEOF_PORT_EVENT  = dependsArch(16, 24);
+    static final int OFFSETOF_EVENTS    = 0;
+    static final int OFFSETOF_SOURCE    = 4;
+    static final int OFFSETOF_OBJECT    = 8;
 
     // port sources
-    private static final short PORT_SOURCE_USER     = 3;
-    private static final short PORT_SOURCE_FD       = 4;
+    static final short PORT_SOURCE_USER     = 3;
+    static final short PORT_SOURCE_FD       = 4;
 
     // file descriptor to event port.
     private final int port;
@@ -75,7 +75,7 @@
         super(provider, pool);
 
         // create event port
-        this.port = portCreate();
+        this.port = port_create();
     }
 
     SolarisEventPort start() {
@@ -90,12 +90,12 @@
                 return;
             closed = true;
         }
-        portClose(port);
+        port_close(port);
     }
 
     private void wakeup() {
         try {
-            portSend(port, 0);
+            port_send(port, 0);
         } catch (IOException x) {
             throw new AssertionError(x);
         }
@@ -124,7 +124,7 @@
             // send user event to wakeup each thread
             while (nThreads-- > 0) {
                 try {
-                    portSend(port, 0);
+                    port_send(port, 0);
                 } catch (IOException x) {
                     throw new AssertionError(x);
                 }
@@ -137,7 +137,7 @@
         // (re-)associate file descriptor
         // no need to translate events
         try {
-            portAssociate(port, PORT_SOURCE_FD, fd, events);
+            port_associate(port, PORT_SOURCE_FD, fd, events);
         } catch (IOException x) {
             throw new AssertionError();     // should not happen
         }
@@ -164,7 +164,7 @@
                     // A error here is fatal (thread will not be replaced)
                     replaceMe = false;
                     try {
-                        portGet(port, address);
+                        port_get(port, address);
                     } catch (IOException x) {
                         x.printStackTrace();
                         return;
@@ -220,26 +220,46 @@
         }
     }
 
-    // -- Native methods --
+    /**
+     * Creates an event port
+     */
+    static native int port_create() throws IOException;
 
-    private static native void init();
-
-    private static native int portCreate() throws IOException;
-
-    private static native void portAssociate(int port, int source, long object,
-        int events) throws IOException;
-
-    private static native void portGet(int port, long pe) throws IOException;
-
-    private static native int portGetn(int port, long address, int max)
+    /**
+     * Associates specific events of a given object with a port
+     */
+    static native boolean port_associate(int port, int source, long object, int events)
         throws IOException;
 
-    private static native void portSend(int port, int events) throws IOException;
+    /**
+     * Removes the association of an object with a port.
+     */
+    static native boolean port_dissociate(int port, int source, long object)
+        throws IOException;
 
-    private static native void portClose(int port);
+    /**
+     * Retrieves a single event from a port
+     */
+    static native void port_get(int port, long pe) throws IOException;
+
+    /**
+     * Retrieves at most {@code max} events from a port.
+     */
+    static native int port_getn(int port, long address, int max, long timeout)
+        throws IOException;
+
+    /**
+     * Sends a user-defined eventto a specified  port.
+     */
+    static native void port_send(int port, int events) throws IOException;
+
+    /**
+     * Closes a port.
+     */
+    static native void port_close(int port);
+
 
     static {
         Util.load();
-        init();
     }
 }
diff --git a/src/solaris/native/java/lang/java_props_md.c b/src/solaris/native/java/lang/java_props_md.c
index 8f931cc..a8022f9 100644
--- a/src/solaris/native/java/lang/java_props_md.c
+++ b/src/solaris/native/java/lang/java_props_md.c
@@ -406,7 +406,7 @@
 #ifdef MACOSX
             break;
         default:
-            sprops.graphics_env = "sun.awt.HeadlessGraphicsEnvironment";
+            sprops.graphics_env = "sun.java2d.HeadlessGraphicsEnvironment";
             break;
     }
 #endif
diff --git a/src/solaris/native/java/net/net_util_md.c b/src/solaris/native/java/net/net_util_md.c
index 3533091..ec9c0d2 100644
--- a/src/solaris/native/java/net/net_util_md.c
+++ b/src/solaris/native/java/net/net_util_md.c
@@ -114,9 +114,9 @@
     static jfieldID ni_defaultIndexID;
     if (ni_class == NULL) {
         jclass c = (*env)->FindClass(env, "java/net/NetworkInterface");
-        CHECK_NULL(c);
+        CHECK_NULL_RETURN(c, 0);
         c = (*env)->NewGlobalRef(env, c);
-        CHECK_NULL(c);
+        CHECK_NULL_RETURN(c, 0);
         ni_defaultIndexID = (*env)->GetStaticFieldID(env, c,
                                                      "defaultIndex", "I");
         ni_class = c;
diff --git a/src/solaris/native/sun/awt/swing_GTKEngine.c b/src/solaris/native/sun/awt/swing_GTKEngine.c
index bcb315c..b0eeb0f 100644
--- a/src/solaris/native/sun/awt/swing_GTKEngine.c
+++ b/src/solaris/native/sun/awt/swing_GTKEngine.c
@@ -323,9 +323,8 @@
 JNIEXPORT void JNICALL Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1switch_1theme(
         JNIEnv *env, jobject this)
 {
-    fp_gdk_threads_enter();
+    // Note that flush_gtk_event_loop takes care of locks (7053002)
     flush_gtk_event_loop();
-    fp_gdk_threads_leave();
 }
 
 /*
diff --git a/src/solaris/native/sun/nio/ch/DevPollArrayWrapper.c b/src/solaris/native/sun/nio/ch/DevPollArrayWrapper.c
index 5813ed0..134a279 100644
--- a/src/solaris/native/sun/nio/ch/DevPollArrayWrapper.c
+++ b/src/solaris/native/sun/nio/ch/DevPollArrayWrapper.c
@@ -28,9 +28,7 @@
 #include "jvm.h"
 #include "jlong.h"
 #include "sun_nio_ch_DevPollArrayWrapper.h"
-#include "java_lang_Integer.h"
 #include <sys/poll.h>
-#include <sys/resource.h>
 #include <unistd.h>
 #include <sys/time.h>
 
@@ -118,27 +116,20 @@
 Java_sun_nio_ch_DevPollArrayWrapper_register(JNIEnv *env, jobject this,
                                              jint wfd, jint fd, jint mask)
 {
-    struct pollfd a[2];
-    unsigned char *pollBytes = (unsigned char *)&a[0];
-    unsigned char *pollEnd = pollBytes + sizeof(struct pollfd) * 2;
+    struct pollfd a[1];
+    int n;
 
-    /* We clear it first, otherwise any entries between poll invocations
-       get OR'd together */
     a[0].fd = fd;
-    a[0].events = POLLREMOVE;
+    a[0].events = mask;
     a[0].revents = 0;
 
-    a[1].fd = fd;
-    a[1].events = mask;
-    a[1].revents = 0;
-
-    while (pollBytes < pollEnd) {
-        int bytesWritten = write(wfd, pollBytes, (int)(pollEnd - pollBytes));
-        if (bytesWritten < 0) {
+    n = write(wfd, &a[0], sizeof(a));
+    if (n != sizeof(a)) {
+        if (n < 0) {
             JNU_ThrowIOExceptionWithLastError(env, "Error writing pollfds");
-            return;
+        } else {
+            JNU_ThrowIOException(env, "Unexpected number of bytes written");
         }
-        pollBytes += bytesWritten;
     }
 }
 
@@ -185,21 +176,6 @@
     return result;
 }
 
-JNIEXPORT jint JNICALL
-Java_sun_nio_ch_DevPollArrayWrapper_fdLimit(JNIEnv *env, jclass this)
-{
-    struct rlimit rlp;
-    if (getrlimit(RLIMIT_NOFILE, &rlp) < 0) {
-        JNU_ThrowIOExceptionWithLastError(env,
-                                          "getrlimit failed");
-    }
-    if (rlp.rlim_max < 0 || rlp.rlim_max > java_lang_Integer_MAX_VALUE) {
-        return java_lang_Integer_MAX_VALUE;
-    } else {
-        return (jint)rlp.rlim_max;
-    }
-}
-
 JNIEXPORT void JNICALL
 Java_sun_nio_ch_DevPollArrayWrapper_interrupt(JNIEnv *env, jclass this, jint fd)
 {
diff --git a/src/solaris/native/sun/nio/ch/EPollArrayWrapper.c b/src/solaris/native/sun/nio/ch/EPollArrayWrapper.c
index 7f7a3e8..22ffd1d 100644
--- a/src/solaris/native/sun/nio/ch/EPollArrayWrapper.c
+++ b/src/solaris/native/sun/nio/ch/EPollArrayWrapper.c
@@ -31,7 +31,6 @@
 #include "sun_nio_ch_EPollArrayWrapper.h"
 
 #include <unistd.h>
-#include <sys/resource.h>
 #include <sys/time.h>
 #include <sys/epoll.h>
 
@@ -92,16 +91,6 @@
 }
 
 JNIEXPORT jint JNICALL
-Java_sun_nio_ch_EPollArrayWrapper_fdLimit(JNIEnv *env, jclass this)
-{
-    struct rlimit rlp;
-    if (getrlimit(RLIMIT_NOFILE, &rlp) < 0) {
-        JNU_ThrowIOExceptionWithLastError(env, "getrlimit failed");
-    }
-    return (jint)rlp.rlim_max;
-}
-
-JNIEXPORT jint JNICALL
 Java_sun_nio_ch_EPollArrayWrapper_sizeofEPollEvent(JNIEnv* env, jclass this)
 {
     return sizeof(struct epoll_event);
diff --git a/src/solaris/native/sun/nio/ch/IOUtil.c b/src/solaris/native/sun/nio/ch/IOUtil.c
index 8d0356f..4bea688 100644
--- a/src/solaris/native/sun/nio/ch/IOUtil.c
+++ b/src/solaris/native/sun/nio/ch/IOUtil.c
@@ -25,11 +25,14 @@
 
 #include <sys/types.h>
 #include <string.h>
+#include <sys/resource.h>
+
 #include "jni.h"
 #include "jni_util.h"
 #include "jvm.h"
 #include "jlong.h"
 #include "sun_nio_ch_IOUtil.h"
+#include "java_lang_Integer.h"
 #include "nio.h"
 #include "nio_util.h"
 
@@ -118,6 +121,20 @@
     }
 }
 
+JNIEXPORT jint JNICALL
+Java_sun_nio_ch_IOUtil_fdLimit(JNIEnv *env, jclass this)
+{
+    struct rlimit rlp;
+    if (getrlimit(RLIMIT_NOFILE, &rlp) < 0) {
+        JNU_ThrowIOExceptionWithLastError(env, "getrlimit failed");
+        return -1;
+    }
+    if (rlp.rlim_max < 0 || rlp.rlim_max > java_lang_Integer_MAX_VALUE) {
+        return java_lang_Integer_MAX_VALUE;
+    } else {
+        return (jint)rlp.rlim_max;
+    }
+}
 
 /* Declared in nio_util.h for use elsewhere in NIO */
 
diff --git a/src/solaris/native/sun/nio/ch/SolarisEventPort.c b/src/solaris/native/sun/nio/ch/SolarisEventPort.c
index b91bf09..70f6db4 100644
--- a/src/solaris/native/sun/nio/ch/SolarisEventPort.c
+++ b/src/solaris/native/sun/nio/ch/SolarisEventPort.c
@@ -32,17 +32,12 @@
 #include <stdlib.h>
 #include <dlfcn.h>
 #include <sys/types.h>
-#include <port.h>       // Solaris 10
+#include <port.h>
 
 #include "sun_nio_ch_SolarisEventPort.h"
 
-JNIEXPORT void JNICALL
-Java_sun_nio_ch_SolarisEventPort_init(JNIEnv *env, jclass clazz)
-{
-}
-
 JNIEXPORT jint JNICALL
-Java_sun_nio_ch_SolarisEventPort_portCreate
+Java_sun_nio_ch_SolarisEventPort_port_1create
     (JNIEnv* env, jclass clazz)
 {
     int port = port_create();
@@ -53,37 +48,44 @@
 }
 
 JNIEXPORT void JNICALL
-Java_sun_nio_ch_SolarisEventPort_portClose
+Java_sun_nio_ch_SolarisEventPort_port_1close
     (JNIEnv* env, jclass clazz, jint port)
 {
     int res;
     RESTARTABLE(close(port), res);
 }
 
-JNIEXPORT void JNICALL
-Java_sun_nio_ch_SolarisEventPort_portAssociate
+JNIEXPORT jboolean JNICALL
+Java_sun_nio_ch_SolarisEventPort_port_1associate
     (JNIEnv* env, jclass clazz, jint port, jint source, jlong objectAddress, jint events)
 {
     uintptr_t object = (uintptr_t)jlong_to_ptr(objectAddress);
-
-    if (port_associate((int)port, (int)source, object, (int)events, NULL) == -1) {
-        JNU_ThrowIOExceptionWithLastError(env, "port_associate");
+    if (port_associate((int)port, (int)source, object, (int)events, NULL) == 0) {
+        return JNI_TRUE;
+    } else {
+        if (errno != EBADFD)
+            JNU_ThrowIOExceptionWithLastError(env, "port_associate");
+        return JNI_FALSE;
     }
 }
 
-JNIEXPORT void JNICALL
-Java_sun_nio_ch_SolarisEventPort_portDissociate
+JNIEXPORT jboolean JNICALL
+Java_sun_nio_ch_SolarisEventPort_port_1dissociate
     (JNIEnv* env, jclass clazz, jint port, jint source, jlong objectAddress)
 {
     uintptr_t object = (uintptr_t)jlong_to_ptr(objectAddress);
 
-    if (port_dissociate((int)port, (int)source, object) == -1) {
-        JNU_ThrowIOExceptionWithLastError(env, "port_dissociate");
+    if (port_dissociate((int)port, (int)source, object) == 0) {
+        return JNI_TRUE;
+    } else {
+        if (errno != ENOENT)
+            JNU_ThrowIOExceptionWithLastError(env, "port_dissociate");
+        return JNI_FALSE;
     }
 }
 
 JNIEXPORT void JNICALL
-Java_sun_nio_ch_SolarisEventPort_portSend(JNIEnv* env, jclass clazz,
+Java_sun_nio_ch_SolarisEventPort_port_1send(JNIEnv* env, jclass clazz,
     jint port, jint events)
 {
     if (port_send((int)port, (int)events, NULL) == -1) {
@@ -92,7 +94,7 @@
 }
 
 JNIEXPORT void JNICALL
-Java_sun_nio_ch_SolarisEventPort_portGet(JNIEnv* env, jclass clazz,
+Java_sun_nio_ch_SolarisEventPort_port_1get(JNIEnv* env, jclass clazz,
     jint port, jlong eventAddress)
 {
     int res;
@@ -105,16 +107,28 @@
 }
 
 JNIEXPORT jint JNICALL
-Java_sun_nio_ch_SolarisEventPort_portGetn(JNIEnv* env, jclass clazz,
-    jint port, jlong arrayAddress, jint max)
+Java_sun_nio_ch_SolarisEventPort_port_1getn(JNIEnv* env, jclass clazz,
+    jint port, jlong arrayAddress, jint max, jlong timeout)
 {
     int res;
     uint_t n = 1;
     port_event_t* list = (port_event_t*)jlong_to_ptr(arrayAddress);
+    timespec_t ts;
+    timespec_t* tsp;
 
-    RESTARTABLE(port_getn((int)port, list, (uint_t)max, &n, NULL), res);
-    if (res == -1) {
-        JNU_ThrowIOExceptionWithLastError(env, "port_getn");
+    if (timeout >= 0L) {
+        ts.tv_sec = timeout / 1000;
+        ts.tv_nsec = 1000000 * (timeout % 1000);
+        tsp = &ts;
+    } else {
+        tsp = NULL;
     }
+
+    res = port_getn((int)port, list, (uint_t)max, &n, tsp);
+    if (res == -1) {
+        if (errno != ETIME && errno != EINTR)
+            JNU_ThrowIOExceptionWithLastError(env, "port_getn");
+    }
+
     return (jint)n;
 }
diff --git a/src/solaris/native/sun/xawt/XWindow.c b/src/solaris/native/sun/xawt/XWindow.c
index d801aae..bda2245 100644
--- a/src/solaris/native/sun/xawt/XWindow.c
+++ b/src/solaris/native/sun/xawt/XWindow.c
@@ -175,6 +175,7 @@
     {java_awt_event_KeyEvent_VK_META, XK_Meta_L, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_LEFT},
     {java_awt_event_KeyEvent_VK_META, XK_Meta_R, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_RIGHT},
     {java_awt_event_KeyEvent_VK_CAPS_LOCK, XK_Caps_Lock, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
+    {java_awt_event_KeyEvent_VK_CAPS_LOCK, XK_Shift_Lock, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
 
     /* Misc Functions */
     {java_awt_event_KeyEvent_VK_PRINTSCREEN, XK_Print, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
@@ -350,6 +351,24 @@
      * same keysym as ALT_GRAPH in spite of its different behavior.
      */
 
+    {java_awt_event_KeyEvent_VK_ALL_CANDIDATES, XK_Zen_Koho, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
+    {java_awt_event_KeyEvent_VK_ALPHANUMERIC, XK_Eisu_Shift, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
+    {java_awt_event_KeyEvent_VK_ALPHANUMERIC, XK_Eisu_toggle, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
+    {java_awt_event_KeyEvent_VK_CODE_INPUT, XK_Kanji_Bangou, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
+    {java_awt_event_KeyEvent_VK_FULL_WIDTH, XK_Zenkaku, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
+    {java_awt_event_KeyEvent_VK_HALF_WIDTH, XK_Hankaku, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
+    {java_awt_event_KeyEvent_VK_HIRAGANA, XK_Hiragana, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
+    {java_awt_event_KeyEvent_VK_JAPANESE_HIRAGANA, XK_Hiragana, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
+    {java_awt_event_KeyEvent_VK_KATAKANA, XK_Katakana, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
+    {java_awt_event_KeyEvent_VK_JAPANESE_KATAKANA, XK_Katakana, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
+    {java_awt_event_KeyEvent_VK_JAPANESE_ROMAN, XK_Romaji, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
+    {java_awt_event_KeyEvent_VK_KANA, XK_Kana_Shift, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
+    {java_awt_event_KeyEvent_VK_KANA_LOCK, XK_Kana_Lock, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
+    {java_awt_event_KeyEvent_VK_KANJI, XK_Kanji, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
+    {java_awt_event_KeyEvent_VK_NONCONVERT, XK_Muhenkan, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
+    {java_awt_event_KeyEvent_VK_PREVIOUS_CANDIDATE, XK_Mae_Koho, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
+    {java_awt_event_KeyEvent_VK_ROMAN_CHARACTERS, XK_Romaji, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
+
     {java_awt_event_KeyEvent_VK_COMPOSE, XK_Multi_key, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
     {java_awt_event_KeyEvent_VK_ALT_GRAPH, XK_Mode_switch, FALSE, java_awt_event_KeyEvent_KEY_LOCATION_STANDARD},
 
diff --git a/src/windows/native/java/lang/java_props_md.c b/src/windows/native/java/lang/java_props_md.c
index bfa3711..19cac33 100644
--- a/src/windows/native/java/lang/java_props_md.c
+++ b/src/windows/native/java/lang/java_props_md.c
@@ -403,6 +403,8 @@
          * Windows Server 2008          6               0  (!VER_NT_WORKSTATION)
          * Windows 7                    6               1  (VER_NT_WORKSTATION)
          * Windows Server 2008 R2       6               1  (!VER_NT_WORKSTATION)
+         * Windows 8                    6               2  (VER_NT_WORKSTATION)
+         * Windows Server 2012          6               2  (!VER_NT_WORKSTATION)
          *
          * This mapping will presumably be augmented as new Windows
          * versions are released.
@@ -459,12 +461,14 @@
                     switch (ver.dwMinorVersion) {
                     case  0: sprops.os_name = "Windows Vista";        break;
                     case  1: sprops.os_name = "Windows 7";            break;
+                    case  2: sprops.os_name = "Windows 8";            break;
                     default: sprops.os_name = "Windows NT (unknown)";
                     }
                 } else {
                     switch (ver.dwMinorVersion) {
                     case  0: sprops.os_name = "Windows Server 2008";    break;
                     case  1: sprops.os_name = "Windows Server 2008 R2"; break;
+                    case  2: sprops.os_name = "Windows Server 2012";    break;
                     default: sprops.os_name = "Windows NT (unknown)";
                     }
                 }
diff --git a/src/windows/native/java/util/TimeZone_md.c b/src/windows/native/java/util/TimeZone_md.c
index 5abc61c..d29558c 100644
--- a/src/windows/native/java/util/TimeZone_md.c
+++ b/src/windows/native/java/util/TimeZone_md.c
@@ -165,6 +165,7 @@
     WCHAR *stdNamePtr = tzi.StandardName;
     DWORD valueSize;
     DWORD timeType;
+    int isVista;
 
     /*
      * Get the current time zone setting of the platform.
@@ -180,6 +181,7 @@
     ver.dwOSVersionInfoSize = sizeof(ver);
     GetVersionEx(&ver);
     isNT = ver.dwPlatformId == VER_PLATFORM_WIN32_NT;
+    isVista = isNT && ver.dwMajorVersion >= 6;
 
     ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_CURRENT_TZ_KEY, 0,
                        KEY_READ, (PHKEY)&hKey);
@@ -202,8 +204,13 @@
             ret = RegQueryValueExA(hKey, "DynamicDaylightTimeDisabled",
                                    NULL, &valueType, (LPBYTE) &val, &bufSize);
         }
+
         if (ret == ERROR_SUCCESS) {
-            if (val == 1) {
+            int daylightSavingsUpdateDisabledOther = val == 1 && tzi.DaylightDate.wMonth != 0;
+            int daylightSavingsUpdateDisabledVista = val == 1;
+            int daylightSavingsUpdateDisabled = isVista ? daylightSavingsUpdateDisabledVista : daylightSavingsUpdateDisabledOther;
+
+            if (daylightSavingsUpdateDisabled) {
                 (void) RegCloseKey(hKey);
                 customZoneName(tzi.Bias, winZoneName);
                 return VALUE_GMTOFFSET;
@@ -213,7 +220,7 @@
         /*
          * Vista has the key for the current "Time Zones" entry.
          */
-        if (isNT && ver.dwMajorVersion >= 6) {
+        if (isVista) {
             valueType = 0;
             bufSize = MAX_ZONE_CHAR;
             ret = RegQueryValueExA(hKey, "TimeZoneKeyName", NULL,
diff --git a/src/windows/native/sun/windows/awt_Component.cpp b/src/windows/native/sun/windows/awt_Component.cpp
index b03ea0d..9cc2f76 100644
--- a/src/windows/native/sun/windows/awt_Component.cpp
+++ b/src/windows/native/sun/windows/awt_Component.cpp
@@ -558,6 +558,8 @@
 
     m_hwnd = hwnd;
 
+    ::ImmAssociateContext(m_hwnd, NULL);
+
     SetDrawState((jint)JAWT_LOCK_SURFACE_CHANGED |
         (jint)JAWT_LOCK_BOUNDS_CHANGED |
         (jint)JAWT_LOCK_CLIP_CHANGED);
diff --git a/src/windows/native/sun/windows/awt_TextArea.cpp b/src/windows/native/sun/windows/awt_TextArea.cpp
index 16d36ad..dd56f23 100644
--- a/src/windows/native/sun/windows/awt_TextArea.cpp
+++ b/src/windows/native/sun/windows/awt_TextArea.cpp
@@ -74,135 +74,10 @@
     AwtTextComponent::Dispose();
 }
 
-LPCTSTR AwtTextArea::GetClassName() {
-    static BOOL richedLibraryLoaded = FALSE;
-    if (!richedLibraryLoaded) {
-        JDK_LoadSystemLibrary("RICHED20.DLL");
-        richedLibraryLoaded = TRUE;
-    }
-    return RICHEDIT_CLASS;
-}
-
 /* Create a new AwtTextArea object and window.   */
 AwtTextArea* AwtTextArea::Create(jobject peer, jobject parent)
 {
-    JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
-
-    jobject target = NULL;
-    AwtTextArea* c = NULL;
-
-    try {
-        if (env->EnsureLocalCapacity(1) < 0) {
-            return NULL;
-        }
-
-        PDATA pData;
-        AwtCanvas* awtParent;
-        JNI_CHECK_PEER_GOTO(parent, done);
-
-        awtParent = (AwtCanvas*)pData;
-        JNI_CHECK_NULL_GOTO(awtParent, "null awtParent", done);
-
-        target = env->GetObjectField(peer, AwtObject::targetID);
-        JNI_CHECK_NULL_GOTO(target, "null target", done);
-
-        c = new AwtTextArea();
-
-        {
-            /* Adjust style for scrollbar visibility and word wrap  */
-          DWORD scroll_style;
-          jint scrollbarVisibility =
-              env->GetIntField(target, AwtTextArea::scrollbarVisibilityID);
-
-          switch (scrollbarVisibility) {
-            case java_awt_TextArea_SCROLLBARS_NONE:
-              scroll_style = ES_AUTOVSCROLL;
-              break;
-            case java_awt_TextArea_SCROLLBARS_VERTICAL_ONLY:
-              scroll_style = WS_VSCROLL | ES_AUTOVSCROLL;
-              break;
-            case java_awt_TextArea_SCROLLBARS_HORIZONTAL_ONLY:
-              scroll_style = WS_HSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL;
-              break;
-            case java_awt_TextArea_SCROLLBARS_BOTH:
-              scroll_style = WS_VSCROLL | WS_HSCROLL |
-                  ES_AUTOVSCROLL | ES_AUTOHSCROLL;
-              break;
-          }
-
-          /*
-           * Specify ES_DISABLENOSCROLL - RichEdit control style to disable
-           * scrollbars instead of hiding them when not needed.
-           */
-          DWORD style = WS_CHILD | WS_CLIPSIBLINGS | ES_LEFT | ES_MULTILINE |
-              ES_WANTRETURN | scroll_style | ES_DISABLENOSCROLL;
-          DWORD exStyle = WS_EX_CLIENTEDGE;
-          if (GetRTL()) {
-              exStyle |= WS_EX_RIGHT | WS_EX_LEFTSCROLLBAR;
-              if (GetRTLReadingOrder())
-                  exStyle |= WS_EX_RTLREADING;
-          }
-
-          jint x = env->GetIntField(target, AwtComponent::xID);
-          jint y = env->GetIntField(target, AwtComponent::yID);
-          jint width = env->GetIntField(target, AwtComponent::widthID);
-          jint height = env->GetIntField(target, AwtComponent::heightID);
-
-          c->CreateHWnd(env, L"", style, exStyle,
-                        x, y, width, height,
-                        awtParent->GetHWnd(),
-                        reinterpret_cast<HMENU>(static_cast<INT_PTR>(
-                awtParent->CreateControlID())),
-                        ::GetSysColor(COLOR_WINDOWTEXT),
-                        ::GetSysColor(COLOR_WINDOW),
-                        peer);
-
-          // Fix for 4753116.
-          // If it is not win95 (we are using Richedit 2.0)
-          // we set plain text mode, in which the control is
-          // similar to a standard edit control:
-          //  - The text in a plain text control can have only
-          //    one format.
-          //  - The user cannot paste rich text formats, such as RTF
-          //    or embedded objects into a plain text control.
-          //  - Rich text mode controls always have a default
-          //    end-of-document marker or carriage return,
-          //    to format paragraphs.
-          // kdm@sparc.spb.su
-          c->SendMessage(EM_SETTEXTMODE, TM_PLAINTEXT, 0);
-
-          c->m_backgroundColorSet = TRUE;
-          /* suppress inheriting parent's color. */
-          c->UpdateBackground(env, target);
-          c->SendMessage(EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN,
-                         MAKELPARAM(1, 1));
-          /*
-           * Fix for BugTraq Id 4260109.
-           * Set the text limit to the maximum.
-           * Use EM_EXLIMITTEXT for RichEdit controls.
-           * For some reason RichEdit 1.0 becomes read-only if the
-           * specified limit is greater than 0x7FFFFFFD.
-           */
-          c->SendMessage(EM_EXLIMITTEXT, 0, 0x7FFFFFFD);
-
-          /* Unregister RichEdit built-in drop target. */
-          VERIFY(::RevokeDragDrop(c->GetHWnd()) != DRAGDROP_E_INVALIDHWND);
-
-          /* To enforce CF_TEXT format for paste operations. */
-          VERIFY(c->SendMessage(EM_SETOLECALLBACK, 0,
-                                (LPARAM)&GetOleCallback()));
-
-          c->SendMessage(EM_SETEVENTMASK, 0, ENM_CHANGE);
-        }
-    } catch (...) {
-        env->DeleteLocalRef(target);
-        throw;
-    }
-
-done:
-    env->DeleteLocalRef(target);
-
-    return c;
+    return (AwtTextArea*) AwtTextComponent::Create(peer, parent, true);
 }
 
 void AwtTextArea::EditSetSel(CHARRANGE &cr) {
@@ -220,11 +95,6 @@
     SendMessage(EM_EXGETSEL, 0, reinterpret_cast<LPARAM>(&cr));
 }
 
-LONG AwtTextArea::EditGetCharFromPos(POINT& pt) {
-    return static_cast<LONG>(SendMessage(EM_CHARFROMPOS, 0,
-            reinterpret_cast<LPARAM>(&pt)));
-}
-
 /* Count how many '\n's are there in jStr */
 size_t AwtTextArea::CountNewLines(JNIEnv *env, jstring jStr, size_t maxlen)
 {
@@ -253,34 +123,6 @@
 
 BOOL AwtTextArea::InheritsNativeMouseWheelBehavior() {return true;}
 
-MsgRouting
-AwtTextArea::PreProcessMsg(MSG& msg)
-{
-    MsgRouting mr = mrPassAlong;
-    static BOOL bPassAlongWmLButtonUp = TRUE;
-
-    if (msg.message == WM_LBUTTONDBLCLK) {
-        bPassAlongWmLButtonUp = FALSE;
-    }
-
-    /*
-     * For some reason RichEdit 1.0 filters out WM_LBUTTONUP after
-     * WM_LBUTTONDBLCLK. To work around this "feature" we send WM_LBUTTONUP
-     * directly to the window procedure and consume instead of passing it
-     * to the next hook.
-     */
-    if (msg.message == WM_LBUTTONUP && bPassAlongWmLButtonUp == FALSE) {
-        SendMessage(WM_LBUTTONUP, msg.wParam, msg.lParam);
-        bPassAlongWmLButtonUp = TRUE;
-        mr = mrConsume;
-    }
-
-    if (mr == mrPassAlong) {
-        mr = AwtComponent::PreProcessMsg(msg);
-    }
-
-    return mr;
-}
 
 LRESULT
 AwtTextArea::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) {
@@ -800,54 +642,6 @@
     return returnVal;
 }
 
-/*
- * WM_CTLCOLOR is not sent by rich edit controls.
- * Use EM_SETCHARFORMAT and EM_SETBKGNDCOLOR to set
- * respectively foreground and background color.
- */
-void AwtTextArea::SetColor(COLORREF c) {
-    AwtComponent::SetColor(c);
-
-    CHARFORMAT cf;
-    memset(&cf, 0, sizeof(cf));
-    cf.cbSize = sizeof(cf);
-    cf.dwMask = CFM_COLOR;
-
-    cf.crTextColor = ::IsWindowEnabled(GetHWnd()) ? GetColor() : ::GetSysColor(COLOR_3DSHADOW);
-
-    /*
-     * The documentation for EM_GETCHARFORMAT is not exactly
-     * correct. It appears that wParam has the same meaning
-     * as for EM_SETCHARFORMAT. Our task is to secure that
-     * all the characters in the control have the required
-     * formatting. That's why we use SCF_ALL.
-     */
-    VERIFY(SendMessage(EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf));
-    VERIFY(SendMessage(EM_SETCHARFORMAT, SCF_DEFAULT, (LPARAM)&cf));
-}
-
-/*
- * In responce to EM_SETBKGNDCOLOR rich edit changes
- * its bg color and repaints itself so we don't need
- * to force repaint.
- */
-void AwtTextArea::SetBackgroundColor(COLORREF c) {
-    AwtComponent::SetBackgroundColor(c);
-    SendMessage(EM_SETBKGNDCOLOR, (WPARAM)FALSE, (LPARAM)GetBackgroundColor());
-}
-
-/*
- * Disabled edit control has grayed foreground.
- * Disabled RichEdit 1.0 control has original foreground.
- * Thus we have to set grayed foreground manually.
- */
-void AwtTextArea::Enable(BOOL bEnable)
-{
-    AwtComponent::Enable(bEnable);
-
-    SetColor(GetColor());
-}
-
 
 /* Fix for 4776535, 4648702
  * If width is 0 or 1 Windows hides the horizontal scroll bar even
@@ -1048,133 +842,3 @@
 } /* extern "C" */
 
 
-AwtTextArea::OleCallback AwtTextArea::sm_oleCallback;
-
-/************************************************************************
- * Inner class OleCallback definition.
- */
-
-AwtTextArea::OleCallback::OleCallback() {
-    m_refs = 0;
-    AddRef();
-}
-
-STDMETHODIMP
-AwtTextArea::OleCallback::QueryInterface(REFIID riid, LPVOID * ppvObj) {
-
-    TRY;
-
-    if (::IsEqualIID(riid, IID_IUnknown)) {
-        *ppvObj = (void __RPC_FAR *__RPC_FAR)(IUnknown*)this;
-        AddRef();
-        return S_OK;
-    } else if (::IsEqualIID(riid, IID_IRichEditOleCallback)) {
-        *ppvObj = (void __RPC_FAR *__RPC_FAR)(IRichEditOleCallback*)this;
-        AddRef();
-        return S_OK;
-    } else {
-        *ppvObj = NULL;
-        return E_NOINTERFACE;
-    }
-
-    CATCH_BAD_ALLOC_RET(E_OUTOFMEMORY);
-}
-
-STDMETHODIMP_(ULONG)
-AwtTextArea::OleCallback::AddRef() {
-    return ++m_refs;
-}
-
-STDMETHODIMP_(ULONG)
-AwtTextArea::OleCallback::Release() {
-    int refs;
-
-    if ((refs = --m_refs) == 0) delete this;
-
-    return (ULONG)refs;
-}
-
-STDMETHODIMP
-AwtTextArea::OleCallback::GetNewStorage(LPSTORAGE FAR * ppstg) {
-    return E_NOTIMPL;
-}
-
-STDMETHODIMP
-AwtTextArea::OleCallback::GetInPlaceContext(LPOLEINPLACEFRAME FAR * ppipframe,
-                                                 LPOLEINPLACEUIWINDOW FAR* ppipuiDoc,
-                                                 LPOLEINPLACEFRAMEINFO pipfinfo)
-{
-    return E_NOTIMPL;
-}
-
-STDMETHODIMP
-AwtTextArea::OleCallback::ShowContainerUI(BOOL fShow) {
-    return E_NOTIMPL;
-}
-
-STDMETHODIMP
-AwtTextArea::OleCallback::QueryInsertObject(LPCLSID pclsid,
-                                                 LPSTORAGE pstg,
-                                                 LONG cp) {
-    return NOERROR;
-}
-
-STDMETHODIMP
-AwtTextArea::OleCallback::DeleteObject(LPOLEOBJECT poleobj) {
-    return NOERROR;
-}
-
-STDMETHODIMP
-AwtTextArea::OleCallback::QueryAcceptData(LPDATAOBJECT pdataobj,
-                                               CLIPFORMAT *pcfFormat,
-                                               DWORD reco,
-                                               BOOL fReally,
-                                               HGLOBAL hMetaPict) {
-    if (reco == RECO_PASTE) {
-        // If CF_TEXT format is available edit controls will select it,
-        // otherwise if it is CF_UNICODETEXT is available it will be
-        // selected, otherwise if CF_OEMTEXT is available it will be selected.
-        if (::IsClipboardFormatAvailable(CF_TEXT)) {
-            *pcfFormat = CF_TEXT;
-        } else if (::IsClipboardFormatAvailable(CF_UNICODETEXT)) {
-            *pcfFormat = CF_UNICODETEXT;
-        } else if (::IsClipboardFormatAvailable(CF_OEMTEXT)) {
-            *pcfFormat = CF_OEMTEXT;
-        } else {
-            // Don't allow rich edit to paste clipboard data
-            // in other formats.
-            *pcfFormat = CF_TEXT;
-        }
-    }
-
-    return NOERROR;
-}
-
-STDMETHODIMP
-AwtTextArea::OleCallback::ContextSensitiveHelp(BOOL fEnterMode) {
-    return NOERROR;
-}
-
-STDMETHODIMP
-AwtTextArea::OleCallback::GetClipboardData(CHARRANGE *pchrg,
-                                                DWORD reco,
-                                                LPDATAOBJECT *ppdataobj) {
-    return E_NOTIMPL;
-}
-
-STDMETHODIMP
-AwtTextArea::OleCallback::GetDragDropEffect(BOOL fDrag,
-                                                 DWORD grfKeyState,
-                                                 LPDWORD pdwEffect) {
-
-    return E_NOTIMPL;
-}
-
-
-STDMETHODIMP
-AwtTextArea::OleCallback::GetContextMenu(WORD seltype,
-                                              LPOLEOBJECT lpoleobj,
-                                              CHARRANGE FAR * lpchrg,
-                                              HMENU FAR * lphmenu) {
-    return E_NOTIMPL;
-}
diff --git a/src/windows/native/sun/windows/awt_TextArea.h b/src/windows/native/sun/windows/awt_TextArea.h
index 8a76292..4748730 100644
--- a/src/windows/native/sun/windows/awt_TextArea.h
+++ b/src/windows/native/sun/windows/awt_TextArea.h
@@ -51,15 +51,11 @@
 
     virtual void Dispose();
 
-    LPCTSTR GetClassName();
-
     static AwtTextArea* Create(jobject self, jobject parent);
 
     static size_t CountNewLines(JNIEnv *env, jstring jStr, size_t maxlen);
     static size_t GetALength(JNIEnv* env, jstring jStr, size_t maxlen);
 
-    MsgRouting PreProcessMsg(MSG& msg);
-
     LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
     static LRESULT CALLBACK EditProc(HWND hWnd, UINT message,
                                      WPARAM wParam, LPARAM lParam);
@@ -72,9 +68,6 @@
 
     INLINE void SetIgnoreEnChange(BOOL b) { m_bIgnoreEnChange = b; }
 
-    virtual void SetColor(COLORREF c);
-    virtual void SetBackgroundColor(COLORREF c);
-    virtual void Enable(BOOL bEnable);
     virtual BOOL InheritsNativeMouseWheelBehavior();
     virtual void Reshape(int x, int y, int w, int h);
 
@@ -87,40 +80,8 @@
 
 protected:
 
-    /*****************************************************************
-     * Inner class OleCallback declaration.
-     */
-    class OleCallback : public IRichEditOleCallback {
-    public:
-        OleCallback();
-
-        STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
-        STDMETHODIMP_(ULONG) AddRef();
-        STDMETHODIMP_(ULONG) Release();
-        STDMETHODIMP GetNewStorage(LPSTORAGE FAR * ppstg);
-        STDMETHODIMP GetInPlaceContext(LPOLEINPLACEFRAME FAR * ppipframe,
-                                       LPOLEINPLACEUIWINDOW FAR* ppipuiDoc,
-                                       LPOLEINPLACEFRAMEINFO pipfinfo);
-        STDMETHODIMP ShowContainerUI(BOOL fShow);
-        STDMETHODIMP QueryInsertObject(LPCLSID pclsid, LPSTORAGE pstg, LONG cp);
-        STDMETHODIMP DeleteObject(LPOLEOBJECT poleobj);
-        STDMETHODIMP QueryAcceptData(LPDATAOBJECT pdataobj, CLIPFORMAT *pcfFormat,
-                                     DWORD reco, BOOL fReally, HGLOBAL hMetaPict);
-        STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode);
-        STDMETHODIMP GetClipboardData(CHARRANGE *pchrg, DWORD reco,
-                                      LPDATAOBJECT *ppdataobj);
-        STDMETHODIMP GetDragDropEffect(BOOL fDrag, DWORD grfKeyState,
-                                       LPDWORD pdwEffect);
-        STDMETHODIMP GetContextMenu(WORD seltype, LPOLEOBJECT poleobj,
-                                    CHARRANGE FAR * pchrg, HMENU FAR * phmenu);
-    private:
-        ULONG             m_refs; // Reference count
-    };//OleCallback class
-
-    INLINE static OleCallback& GetOleCallback() { return sm_oleCallback; }
     void EditSetSel(CHARRANGE &cr);
     void EditGetSel(CHARRANGE &cr);
-    LONG EditGetCharFromPos(POINT& pt);
   private:
     // RichEdit 1.0 control generates EN_CHANGE notifications not only
     // on text changes, but also on any character formatting change.
@@ -140,8 +101,6 @@
     LONG    m_lVDeltaAccum;
 
 
-    static OleCallback sm_oleCallback;
-
 };
 
 #endif /* AWT_TEXTAREA_H */
diff --git a/src/windows/native/sun/windows/awt_TextComponent.cpp b/src/windows/native/sun/windows/awt_TextComponent.cpp
index 5e9a08f..17d7c68 100644
--- a/src/windows/native/sun/windows/awt_TextComponent.cpp
+++ b/src/windows/native/sun/windows/awt_TextComponent.cpp
@@ -25,6 +25,8 @@
 
 #include "awt_Toolkit.h"
 #include "awt_TextComponent.h"
+#include "awt_TextArea.h"
+#include "awt_TextField.h"
 #include "awt_Canvas.h"
 
 #include "jni.h"
@@ -70,7 +72,152 @@
 }
 
 LPCTSTR AwtTextComponent::GetClassName() {
-    return TEXT("EDIT");  /* System provided edit control class */
+    static BOOL richedLibraryLoaded = FALSE;
+    if (!richedLibraryLoaded) {
+        JDK_LoadSystemLibrary("RICHED20.DLL");
+        richedLibraryLoaded = TRUE;
+    }
+    return RICHEDIT_CLASS;
+}
+
+/* Create a new AwtTextArea or AwtTextField object and window.   */
+AwtTextComponent* AwtTextComponent::Create(jobject peer, jobject parent, BOOL isMultiline)
+{
+    JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
+
+    jobject target = NULL;
+    AwtTextComponent* c = NULL;
+
+    try {
+        if (env->EnsureLocalCapacity(1) < 0) {
+            return NULL;
+        }
+
+        PDATA pData;
+        AwtCanvas* awtParent;
+        JNI_CHECK_PEER_GOTO(parent, done);
+
+        awtParent = (AwtCanvas*)pData;
+        JNI_CHECK_NULL_GOTO(awtParent, "null awtParent", done);
+
+        target = env->GetObjectField(peer, AwtObject::targetID);
+        JNI_CHECK_NULL_GOTO(target, "null target", done);
+
+        if(isMultiline){
+            c = new AwtTextArea();
+        }else{
+            c = new AwtTextField();
+        }
+
+        {
+            /* Adjust style for scrollbar visibility and word wrap  */
+            DWORD scroll_style;
+
+            if(isMultiline){
+
+                 jint scrollbarVisibility =
+                     env->GetIntField(target, AwtTextArea::scrollbarVisibilityID);
+
+                 switch (scrollbarVisibility) {
+                     case java_awt_TextArea_SCROLLBARS_NONE:
+                         scroll_style = ES_AUTOVSCROLL;
+                         break;
+                     case java_awt_TextArea_SCROLLBARS_VERTICAL_ONLY:
+                         scroll_style = WS_VSCROLL | ES_AUTOVSCROLL;
+                         break;
+                     case java_awt_TextArea_SCROLLBARS_HORIZONTAL_ONLY:
+                         scroll_style = WS_HSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL;
+                         break;
+                     case java_awt_TextArea_SCROLLBARS_BOTH:
+                         scroll_style = WS_VSCROLL | WS_HSCROLL |
+                             ES_AUTOVSCROLL | ES_AUTOHSCROLL;
+                         break;
+                }
+            }
+
+          DWORD style = WS_CHILD | WS_CLIPSIBLINGS | ES_LEFT;
+
+          /*
+           * Specify ES_DISABLENOSCROLL - RichEdit control style to disable
+           * scrollbars instead of hiding them when not needed.
+           */
+          style |= isMultiline ?  ES_MULTILINE | ES_WANTRETURN | scroll_style
+              | ES_DISABLENOSCROLL : ES_AUTOHSCROLL;
+
+
+          DWORD exStyle = WS_EX_CLIENTEDGE;
+          if (GetRTL()) {
+              exStyle |= WS_EX_RIGHT | WS_EX_LEFTSCROLLBAR;
+              if (GetRTLReadingOrder())
+                  exStyle |= WS_EX_RTLREADING;
+          }
+
+
+          jint x = env->GetIntField(target, AwtComponent::xID);
+          jint y = env->GetIntField(target, AwtComponent::yID);
+          jint width = env->GetIntField(target, AwtComponent::widthID);
+          jint height = env->GetIntField(target, AwtComponent::heightID);
+
+          c->CreateHWnd(env, L"", style, exStyle,
+                        x, y, width, height,
+                        awtParent->GetHWnd(),
+                        reinterpret_cast<HMENU>(static_cast<INT_PTR>(
+                awtParent->CreateControlID())),
+                        ::GetSysColor(COLOR_WINDOWTEXT),
+                        ::GetSysColor(COLOR_WINDOW),
+                        peer);
+
+          // Fix for 4753116.
+          // If it is not win95 (we are using Richedit 2.0)
+          // we set plain text mode, in which the control is
+          // similar to a standard edit control:
+          //  - The text in a plain text control can have only
+          //    one format.
+          //  - The user cannot paste rich text formats, such as RTF
+          //    or embedded objects into a plain text control.
+          //  - Rich text mode controls always have a default
+          //    end-of-document marker or carriage return,
+          //    to format paragraphs.
+          // kdm@sparc.spb.su
+          c->SendMessage(EM_SETTEXTMODE, TM_PLAINTEXT, 0);
+
+          c->m_backgroundColorSet = TRUE;
+          /* suppress inheriting parent's color. */
+          c->UpdateBackground(env, target);
+          c->SendMessage(EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN,
+                         MAKELPARAM(1, 1));
+          /*
+           * Fix for BugTraq Id 4260109.
+           * Set the text limit to the maximum.
+           * Use EM_EXLIMITTEXT for RichEdit controls.
+           * For some reason RichEdit 1.0 becomes read-only if the
+           * specified limit is greater than 0x7FFFFFFD.
+           */
+          c->SendMessage(EM_EXLIMITTEXT, 0, 0x7FFFFFFD);
+
+          /* Unregister RichEdit built-in drop target. */
+          VERIFY(::RevokeDragDrop(c->GetHWnd()) != DRAGDROP_E_INVALIDHWND);
+
+          /* To enforce CF_TEXT format for paste operations. */
+          VERIFY(c->SendMessage(EM_SETOLECALLBACK, 0,
+                                (LPARAM)&GetOleCallback()));
+
+          c->SendMessage(EM_SETEVENTMASK, 0, ENM_CHANGE);
+        }
+    } catch (...) {
+        env->DeleteLocalRef(target);
+        throw;
+    }
+
+done:
+    env->DeleteLocalRef(target);
+
+    return c;
+}
+
+LONG AwtTextComponent::EditGetCharFromPos(POINT& pt) {
+    return static_cast<LONG>(SendMessage(EM_CHARFROMPOS, 0,
+            reinterpret_cast<LPARAM>(&pt)));
 }
 
 /* Set a suitable font to IME against the component font. */
@@ -463,6 +610,54 @@
     delete ees;
 }
 
+/*
+ * Disabled edit control has grayed foreground.
+ * Disabled RichEdit 1.0 control has original foreground.
+ * Thus we have to set grayed foreground manually.
+ */
+void AwtTextComponent::Enable(BOOL bEnable)
+{
+    AwtComponent::Enable(bEnable);
+    SetColor(GetColor());
+}
+
+
+/*
+ * WM_CTLCOLOR is not sent by rich edit controls.
+ * Use EM_SETCHARFORMAT and EM_SETBKGNDCOLOR to set
+ * respectively foreground and background color.
+ */
+void AwtTextComponent::SetColor(COLORREF c) {
+    AwtComponent::SetColor(c);
+
+    CHARFORMAT cf;
+    memset(&cf, 0, sizeof(cf));
+    cf.cbSize = sizeof(cf);
+    cf.dwMask = CFM_COLOR;
+
+    cf.crTextColor = ::IsWindowEnabled(GetHWnd()) ? GetColor() : ::GetSysColor(COLOR_3DSHADOW);
+
+    /*
+     * The documentation for EM_GETCHARFORMAT is not exactly
+     * correct. It appears that wParam has the same meaning
+     * as for EM_SETCHARFORMAT. Our task is to secure that
+     * all the characters in the control have the required
+     * formatting. That's why we use SCF_ALL.
+     */
+    VERIFY(SendMessage(EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf));
+    VERIFY(SendMessage(EM_SETCHARFORMAT, SCF_DEFAULT, (LPARAM)&cf));
+}
+
+/*
+ * In responce to EM_SETBKGNDCOLOR rich edit changes
+ * its bg color and repaints itself so we don't need
+ * to force repaint.
+ */
+void AwtTextComponent::SetBackgroundColor(COLORREF c) {
+    AwtComponent::SetBackgroundColor(c);
+    SendMessage(EM_SETBKGNDCOLOR, (WPARAM)FALSE, (LPARAM)GetBackgroundColor());
+}
+
 
 /************************************************************************
  * WTextComponentPeer native methods
@@ -623,6 +818,127 @@
     CATCH_BAD_ALLOC;
 }
 
+
+AwtTextComponent::OleCallback AwtTextComponent::sm_oleCallback;
+
+/************************************************************************
+ * Inner class OleCallback definition.
+ */
+
+AwtTextComponent::OleCallback::OleCallback() {
+    m_refs = 0;
+    AddRef();
+}
+
+STDMETHODIMP
+AwtTextComponent::OleCallback::QueryInterface(REFIID riid, LPVOID * ppvObj) {
+     if (::IsEqualIID(riid, IID_IUnknown) ||::IsEqualIID(riid, IID_IRichEditOleCallback)  ) {
+         *ppvObj = static_cast<IRichEditOleCallback*>(this);
+         AddRef();
+         return S_OK;
+     }
+     *ppvObj = NULL;
+     return E_NOINTERFACE;
+}
+
+
+STDMETHODIMP_(ULONG)
+AwtTextComponent::OleCallback::AddRef() {
+    return ++m_refs;
+}
+
+STDMETHODIMP_(ULONG)
+AwtTextComponent::OleCallback::Release() {
+    return (ULONG)--m_refs;
+}
+
+STDMETHODIMP
+AwtTextComponent::OleCallback::GetNewStorage(LPSTORAGE FAR * ppstg) {
+    return E_NOTIMPL;
+}
+
+STDMETHODIMP
+AwtTextComponent::OleCallback::GetInPlaceContext(LPOLEINPLACEFRAME FAR * ppipframe,
+                                                 LPOLEINPLACEUIWINDOW FAR* ppipuiDoc,
+                                                 LPOLEINPLACEFRAMEINFO pipfinfo)
+{
+    return E_NOTIMPL;
+}
+
+STDMETHODIMP
+AwtTextComponent::OleCallback::ShowContainerUI(BOOL fShow) {
+    return E_NOTIMPL;
+}
+
+STDMETHODIMP
+AwtTextComponent::OleCallback::QueryInsertObject(LPCLSID pclsid,
+                                                 LPSTORAGE pstg,
+                                                 LONG cp) {
+    return S_OK;
+}
+
+STDMETHODIMP
+AwtTextComponent::OleCallback::DeleteObject(LPOLEOBJECT poleobj) {
+    return S_OK;
+}
+
+STDMETHODIMP
+AwtTextComponent::OleCallback::QueryAcceptData(LPDATAOBJECT pdataobj,
+                                               CLIPFORMAT *pcfFormat,
+                                               DWORD reco,
+                                               BOOL fReally,
+                                               HGLOBAL hMetaPict) {
+    if (reco == RECO_PASTE) {
+        // If CF_TEXT format is available edit controls will select it,
+        // otherwise if it is CF_UNICODETEXT is available it will be
+        // selected, otherwise if CF_OEMTEXT is available it will be selected.
+        if (::IsClipboardFormatAvailable(CF_TEXT)) {
+            *pcfFormat = CF_TEXT;
+        } else if (::IsClipboardFormatAvailable(CF_UNICODETEXT)) {
+            *pcfFormat = CF_UNICODETEXT;
+        } else if (::IsClipboardFormatAvailable(CF_OEMTEXT)) {
+            *pcfFormat = CF_OEMTEXT;
+        } else {
+            // Don't allow rich edit to paste clipboard data
+            // in other formats.
+            *pcfFormat = CF_TEXT;
+        }
+    }
+
+    return S_OK;
+}
+
+STDMETHODIMP
+AwtTextComponent::OleCallback::ContextSensitiveHelp(BOOL fEnterMode) {
+    return S_OK;
+}
+
+STDMETHODIMP
+AwtTextComponent::OleCallback::GetClipboardData(CHARRANGE *pchrg,
+                                                DWORD reco,
+                                                LPDATAOBJECT *ppdataobj) {
+    return E_NOTIMPL;
+}
+
+STDMETHODIMP
+AwtTextComponent::OleCallback::GetDragDropEffect(BOOL fDrag,
+                                                 DWORD grfKeyState,
+                                                 LPDWORD pdwEffect) {
+
+    return E_NOTIMPL;
+}
+
+
+STDMETHODIMP
+AwtTextComponent::OleCallback::GetContextMenu(WORD seltype,
+                                              LPOLEOBJECT lpoleobj,
+                                              CHARRANGE FAR * lpchrg,
+                                              HMENU FAR * lphmenu) {
+    return E_NOTIMPL;
+}
+
+
+
 //
 // Accessibility support
 //
diff --git a/src/windows/native/sun/windows/awt_TextComponent.h b/src/windows/native/sun/windows/awt_TextComponent.h
index 34ae4d6..118b974 100644
--- a/src/windows/native/sun/windows/awt_TextComponent.h
+++ b/src/windows/native/sun/windows/awt_TextComponent.h
@@ -47,6 +47,8 @@
 
     AwtTextComponent();
 
+    static AwtTextComponent* Create(jobject self, jobject parent, BOOL isMultiline);
+
     virtual LPCTSTR GetClassName();
 
     int RemoveCR(WCHAR *pStr);
@@ -71,6 +73,10 @@
 
     void SetFont(AwtFont* font);
 
+    virtual void Enable(BOOL bEnable);
+    virtual void SetColor(COLORREF c);
+    virtual void SetBackgroundColor(COLORREF c);
+
     /*
      * Windows message handler functions
      */
@@ -113,7 +119,40 @@
     // Used to prevent untrusted code from synthesizing a WM_PASTE message
     // by posting a <CTRL>-V KeyEvent
     BOOL    m_synthetic;
-    virtual LONG EditGetCharFromPos(POINT& pt) = 0;
+    LONG EditGetCharFromPos(POINT& pt);
+
+    /*****************************************************************
+     * Inner class OleCallback declaration.
+     */
+    class OleCallback : public IRichEditOleCallback {
+    public:
+        OleCallback();
+
+        STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
+        STDMETHODIMP_(ULONG) AddRef();
+        STDMETHODIMP_(ULONG) Release();
+        STDMETHODIMP GetNewStorage(LPSTORAGE FAR * ppstg);
+        STDMETHODIMP GetInPlaceContext(LPOLEINPLACEFRAME FAR * ppipframe,
+                                       LPOLEINPLACEUIWINDOW FAR* ppipuiDoc,
+                                       LPOLEINPLACEFRAMEINFO pipfinfo);
+        STDMETHODIMP ShowContainerUI(BOOL fShow);
+        STDMETHODIMP QueryInsertObject(LPCLSID pclsid, LPSTORAGE pstg, LONG cp);
+        STDMETHODIMP DeleteObject(LPOLEOBJECT poleobj);
+        STDMETHODIMP QueryAcceptData(LPDATAOBJECT pdataobj, CLIPFORMAT *pcfFormat,
+                                     DWORD reco, BOOL fReally, HGLOBAL hMetaPict);
+        STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode);
+        STDMETHODIMP GetClipboardData(CHARRANGE *pchrg, DWORD reco,
+                                      LPDATAOBJECT *ppdataobj);
+        STDMETHODIMP GetDragDropEffect(BOOL fDrag, DWORD grfKeyState,
+                                       LPDWORD pdwEffect);
+        STDMETHODIMP GetContextMenu(WORD seltype, LPOLEOBJECT poleobj,
+                                    CHARRANGE FAR * pchrg, HMENU FAR * phmenu);
+    private:
+        ULONG             m_refs; // Reference count
+    };//OleCallback class
+
+    INLINE static OleCallback& GetOleCallback() { return sm_oleCallback; }
+
 
 private:
 
@@ -126,6 +165,7 @@
     HFONT m_hFont;
     //im --- end
 
+    static OleCallback sm_oleCallback;
 
     //
     // Accessibility support
diff --git a/src/windows/native/sun/windows/awt_TextField.cpp b/src/windows/native/sun/windows/awt_TextField.cpp
index f703346..4ccb64d 100644
--- a/src/windows/native/sun/windows/awt_TextField.cpp
+++ b/src/windows/native/sun/windows/awt_TextField.cpp
@@ -42,84 +42,23 @@
  */
 
 AwtTextField::AwtTextField()
-    : m_initialRescrollFlag( true )
 {
 }
 
 /* Create a new AwtTextField object and window.   */
 AwtTextField* AwtTextField::Create(jobject peer, jobject parent)
 {
-    JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
-
-    jobject target = NULL;
-    AwtTextField* c = NULL;
-
-    try {
-        PDATA pData;
-        AwtCanvas* awtParent;
-        JNI_CHECK_PEER_GOTO(parent, done);
-        awtParent = (AwtCanvas*)pData;
-
-        JNI_CHECK_NULL_GOTO(awtParent, "null awtParent", done);
-
-        target = env->GetObjectField(peer, AwtObject::targetID);
-        JNI_CHECK_NULL_GOTO(target, "null target", done);
-
-        c = new AwtTextField();
-
-        {
-            DWORD style = WS_CHILD | WS_CLIPSIBLINGS |
-                ES_LEFT | ES_AUTOHSCROLL;
-            DWORD exStyle = WS_EX_CLIENTEDGE;
-            if (GetRTL()) {
-                exStyle |= WS_EX_RIGHT | WS_EX_LEFTSCROLLBAR;
-                if (GetRTLReadingOrder())
-                    exStyle |= WS_EX_RTLREADING;
-            }
-
-            jint x = env->GetIntField(target, AwtComponent::xID);
-            jint y = env->GetIntField(target, AwtComponent::yID);
-            jint width = env->GetIntField(target, AwtComponent::widthID);
-            jint height = env->GetIntField(target, AwtComponent::heightID);
-
-            c->CreateHWnd(env, L"", style, exStyle,
-                          x, y, width, height,
-                          awtParent->GetHWnd(),
-                          reinterpret_cast<HMENU>(static_cast<INT_PTR>(
-                awtParent->CreateControlID())),
-                          ::GetSysColor(COLOR_WINDOWTEXT),
-                          ::GetSysColor(COLOR_WINDOW),
-                          peer);
-
-            c->m_backgroundColorSet = TRUE;
-            /* suppress inheriting parent's color. */
-            c->UpdateBackground(env, target);
-            c->SendMessage(EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN,
-                           MAKELPARAM(1, 1));
-            /*
-             * Fix for BugTraq Id 4260109.
-             * Set the text limit to the maximum.
-             */
-            c->SendMessage(EM_SETLIMITTEXT);
-
-        }
-    } catch (...) {
-        env->DeleteLocalRef(target);
-        throw;
-    }
-
-done:
-    env->DeleteLocalRef(target);
-
-    return c;
+    return (AwtTextField*) AwtTextComponent::Create(peer, parent, false);
 }
 
 void AwtTextField::EditSetSel(CHARRANGE &cr) {
-    SendMessage(EM_SETSEL, cr.cpMin, cr.cpMax);
-}
+    SendMessage(EM_EXSETSEL, 0, reinterpret_cast<LPARAM>(&cr));
 
-LONG AwtTextField::EditGetCharFromPos(POINT& pt) {
-    return static_cast<LONG>(SendMessage(EM_CHARFROMPOS, 0, MAKELPARAM(pt.x, pt.y)));
+    // 6417581: force expected drawing
+    if (IS_WINVISTA && cr.cpMin == cr.cpMax) {
+        ::InvalidateRect(GetHWnd(), NULL, TRUE);
+    }
+
 }
 
 LRESULT AwtTextField::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
@@ -162,10 +101,18 @@
          * to allow dnd of the current selection.
          */
         if (msg->message == WM_LBUTTONDBLCLK) {
-            SetStartSelectionPos(static_cast<LONG>(SendMessage(
-                EM_FINDWORDBREAK, WB_MOVEWORDLEFT, lCurPos)));
-            SetEndSelectionPos(static_cast<LONG>(SendMessage(
-                EM_FINDWORDBREAK, WB_MOVEWORDRIGHT, lCurPos)));
+            jchar echo = SendMessage(EM_GETPASSWORDCHAR);
+
+            if(echo == 0){
+              SetStartSelectionPos(static_cast<LONG>(SendMessage(
+                  EM_FINDWORDBREAK, WB_MOVEWORDLEFT, lCurPos)));
+              SetEndSelectionPos(static_cast<LONG>(SendMessage(
+                  EM_FINDWORDBREAK, WB_MOVEWORDRIGHT, lCurPos)));
+            }else{
+              SetStartSelectionPos(0);
+              SetEndSelectionPos(GetTextLength());
+            }
+
         } else {
             SetStartSelectionPos(lCurPos);
             SetEndSelectionPos(lCurPos);
@@ -307,46 +254,6 @@
     delete secs;
 }
 
-void AwtTextField::Reshape(int x, int y, int w, int h)
-{
-    AwtTextComponent::Reshape( x, y, w, h );
-
-    // Another option would be to call this
-    // after WM_SIZE notification is handled
-    initialRescroll();
-}
-
-
-// Windows' Edit control features:
-// (i) if text selection is set while control's width or height is 0,
-//   text is scrolled oddly.
-// (ii) if control's size is changed, text seems never be automatically
-//   rescrolled.
-//
-// This method is designed for the following scenario: AWT spawns Edit
-// control with 0x0 dimensions, then sets text selection, then resizes the
-// control (couple of times). This might cause text appear undesirably scrolled.
-// So we reset/set selection again to rescroll text. (see also CR 6480547)
-void AwtTextField::initialRescroll()
-{
-    if( ! m_initialRescrollFlag ) {
-        return;
-    }
-
-    ::RECT r;
-    BOOL ok = ::GetClientRect( GetHWnd(), &r );
-    if( ! ok || r.right==0 || r.bottom==0 ) {
-        return;
-    }
-
-    m_initialRescrollFlag = false;
-
-    DWORD start, end;
-    SendMessage( EM_GETSEL, (WPARAM)&start, (LPARAM)&end );
-    SendMessage( EM_SETSEL, (WPARAM)0, (LPARAM)0 );
-    SendMessage( EM_SETSEL, (WPARAM)start, (LPARAM)end );
-}
-
 
 /************************************************************************
  * WTextFieldPeer native methods
diff --git a/src/windows/native/sun/windows/awt_TextField.h b/src/windows/native/sun/windows/awt_TextField.h
index 81aeb40..010c5a2 100644
--- a/src/windows/native/sun/windows/awt_TextField.h
+++ b/src/windows/native/sun/windows/awt_TextField.h
@@ -54,15 +54,11 @@
     // invoked on Toolkit thread
     static void _SetEchoChar(void *param);
 
-  protected:
-    LONG EditGetCharFromPos(POINT& pt);
-    virtual void Reshape(int x, int y, int w, int h);
+protected:
 
 private:
     void EditSetSel(CHARRANGE &cr);
-    void initialRescroll();
 
-    bool m_initialRescrollFlag;
 };
 
 #endif /* AWT_TEXTFIELD_H */
diff --git a/test/Makefile b/test/Makefile
index 0fd156b..9f96ba4 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -609,6 +609,16 @@
 jdk_tools: jdk_tools1 jdk_tools2
 	@$(SummaryInfo)
 
+# Stable othervm testruns (minus items from PROBLEM_LIST)
+#   Using agentvm has serious problems with these tests
+ifdef OPENJDK
+jdk_jfr:
+else
+JDK_ALL_TARGETS += jdk_jfr
+jdk_jfr: $(call TestDirs, com/oracle/jfr)
+	$(call RunOthervmBatch)
+endif
+
 # Stable agentvm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_util
 JDK_DEFAULT_TARGETS += jdk_util
diff --git a/test/ProblemList.txt b/test/ProblemList.txt
index 79c53f5..a290c36 100644
--- a/test/ProblemList.txt
+++ b/test/ProblemList.txt
@@ -151,6 +151,9 @@
 
 # jdk_math
 
+# 7174532
+java/lang/Math/WorstCaseTests.java				generic-all
+
 ############################################################################
 
 # jdk_misc
@@ -222,6 +225,9 @@
 sun/net/www/protocol/http/B6299712.java                         macosx-all
 java/net/CookieHandler/CookieManagerTest.java                   macosx-all
 
+# 7164518
+sun/security/krb5/auto/Unreachable.java                         macosx-all
+
 # JPRT needs to set 127.0.0.1 in proxy bypass list
 java/net/URLClassLoader/closetest/CloseTest.java                macosx-all
 ############################################################################
@@ -371,6 +377,9 @@
 # Filed 6979016
 sun/tools/jconsole/ResourceCheckTest.sh                         generic-all
 
+# 7172176
+sun/tools/jconsole/ImmutableResourceTest.sh			generic-all
+
 # 7132203
 sun/jvmstat/monitor/MonitoredVm/CR6672135.java			generic-all
 
diff --git a/test/com/sun/jdi/ConnectedVMs.java b/test/com/sun/jdi/ConnectedVMs.java
index f1be87e..551cc76 100644
--- a/test/com/sun/jdi/ConnectedVMs.java
+++ b/test/com/sun/jdi/ConnectedVMs.java
@@ -28,10 +28,10 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g InstTarg.java
- *  @run main ConnectedVMs "Kill"
- *  @run main ConnectedVMs "Resume to exit"
- *  @run main ConnectedVMs "dispose()"
- *  @run main ConnectedVMs "exit()"
+ *  @run main ConnectedVMs Kill
+ *  @run main ConnectedVMs Resume-to-exit
+ *  @run main ConnectedVMs dispose()
+ *  @run main ConnectedVMs exit()
  *
  * @summary ConnectedVMs checks the method
  * VirtualMachineManager.connectedVirtualMachines()
@@ -85,12 +85,14 @@
         // pick a way to die based on the input arg.
         if (passName.equals("Kill")) {
             vm().process().destroy();
-        } else if (passName.equals("Resume to exit")) {
+        } else if (passName.equals("Resume-to-exit")) {
             vm().resume();
         } else if (passName.equals("dispose()")) {
             vm().dispose();
         } else if (passName.equals("exit()")) {
             vm().exit(1);
+        } else {
+            throw new Exception("Unknown pass name");
         }
 
         resumeToVMDisconnect();
diff --git a/test/java/awt/Frame/ResizeAfterSetFont/ResizeAfterSetFont.java b/test/java/awt/Frame/ResizeAfterSetFont/ResizeAfterSetFont.java
new file mode 100644
index 0000000..32ed472
--- /dev/null
+++ b/test/java/awt/Frame/ResizeAfterSetFont/ResizeAfterSetFont.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * Portions Copyright (c) 2012 IBM Corporation
+ */
+
+/*
+ @test
+ @bug 7170655
+ @summary Frame size does not change after changing font
+ @author Jonathan Lu
+ @library ../../regtesthelpers
+ @build Util
+ @run main ResizeAfterSetFont
+ */
+
+import java.awt.*;
+import test.java.awt.regtesthelpers.Util;
+
+public class ResizeAfterSetFont {
+
+    public static void main(String[] args) throws Exception {
+        Frame frame = new Frame("bug7170655");
+        frame.setLayout(new BorderLayout());
+        frame.setBackground(Color.LIGHT_GRAY);
+
+        Panel panel = new Panel();
+        panel.setLayout(new GridLayout(0, 1, 1, 1));
+
+        Label label = new Label("Test Label");
+        label.setBackground(Color.white);
+        label.setForeground(Color.RED);
+        label.setFont(new Font("Dialog", Font.PLAIN, 12));
+
+        panel.add(label);
+        frame.add(panel, "South");
+        frame.pack();
+        frame.setVisible(true);
+
+        Util.waitForIdle(null);
+
+        Dimension dimBefore = frame.getSize();
+        label.setFont(new Font("Dialog", Font.PLAIN, 24));
+
+        frame.validate();
+        frame.pack();
+        Dimension dimAfter = frame.getSize();
+
+        if (dimBefore.equals(dimAfter)) {
+            throw new Exception(
+                    "Frame size does not change after Label.setFont()!");
+        }
+    }
+}
diff --git a/test/java/awt/WMSpecificTests/Mutter/MutterMaximizeTest.java b/test/java/awt/WMSpecificTests/Mutter/MutterMaximizeTest.java
new file mode 100644
index 0000000..a54f5c4
--- /dev/null
+++ b/test/java/awt/WMSpecificTests/Mutter/MutterMaximizeTest.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright 2012 Red Hat, Inc.  All Rights Reserved.
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+/*
+  @test
+  @bug      7043963
+  @summary  Tests  that the screen location of windows is
+            updated properly after a maximize.
+  @author   Denis Lila
+  @library  ../../regtesthelpers
+  @build    Util
+  @run      main MutterMaximizeTest
+*/
+
+import java.awt.AWTException;
+import java.awt.Dimension;
+import java.awt.Frame;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.Window;
+import java.awt.event.InputEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import test.java.awt.regtesthelpers.Util;
+
+@SuppressWarnings("serial")
+public class MutterMaximizeTest extends Frame {
+
+    public static void main(String[] args) throws InterruptedException {
+        if (Util.getWMID() != Util.MUTTER_WM) {
+            System.out.println("This test is only useful on Mutter");
+            return;
+        }
+        MutterMaximizeTest frame = new MutterMaximizeTest();
+        frame.addWindowListener(Util.getClosingWindowAdapter());
+
+        //Display the window.
+        frame.setSize(500, 500);
+        Util.showWindowWait(frame);
+        runRobotTest(frame);
+    }
+
+    private static void runRobotTest(Frame frame) {
+        try {
+            Thread robotThread = startRegTest(frame);
+            robotThread.start();
+            waitForThread(robotThread);
+        } finally {
+            frame.dispose();
+        }
+    }
+
+    private static void waitForThread(Thread t) {
+        while (t.isAlive()) {
+            try {
+                t.join();
+            } catch (InterruptedException e) {
+            }
+        }
+    }
+
+    private static void sleepFor(long millis) {
+        long dT = 0;
+        long start = System.nanoTime();
+        while (dT < millis) {
+            try {
+                long toSleep = millis - dT/1000000;
+                if (toSleep > 0) {
+                    Thread.sleep(toSleep);
+                }
+                // if this ends without an interrupted exception,
+                // that's good enough.
+                break;
+            } catch (InterruptedException e) {
+                long now = System.nanoTime();
+                dT = now - start;
+            }
+        }
+    }
+
+    private static void rmove(Robot robot, Point p) {
+        robot.mouseMove(p.x, p.y);
+    }
+    private static void rdown(Robot robot) {
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.delay(50);
+    }
+    private static void rup(Robot robot) {
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        robot.delay(50);
+    }
+
+    public static void click(Robot robot) {
+        rdown(robot);
+        rup(robot);
+    }
+
+    public static void doubleClick(Robot robot) {
+        click(robot);
+        click(robot);
+    }
+
+    private static void dragWindow(Window w, int dx, int dy, Robot robot) {
+        Point p = Util.getTitlePoint(w);
+        rmove(robot, p);
+        rdown(robot);
+        p.translate(dx, dy);
+        rmove(robot, p);
+        rup(robot);
+    }
+
+    // f must be visible
+    private static Thread startRegTest(final Frame f) {
+        Thread robot = new Thread(new Runnable() {
+            public void run() {
+                Robot r = Util.createRobot();
+                dragWindow(f, 100, 100, r);
+                // wait for the location to be set.
+                sleepFor(2000);
+
+                final Point l2 = f.getLocationOnScreen();
+
+                // double click should maximize the frame
+                doubleClick(r);
+
+                // wait for location again.
+                sleepFor(2000);
+                final Point l3 = f.getLocationOnScreen();
+                if (l3.equals(l2)) {
+                    throw new RuntimeException("Bad location after maximize. Window location has not moved");
+                }
+            }
+        });
+        return robot;
+    }
+}
+
diff --git a/test/java/awt/dnd/ImageDecoratedDnDNegative/ImageDecoratedDnDNegative.java b/test/java/awt/dnd/ImageDecoratedDnDNegative/ImageDecoratedDnDNegative.java
index d90923b..9c49ed6 100644
--- a/test/java/awt/dnd/ImageDecoratedDnDNegative/ImageDecoratedDnDNegative.java
+++ b/test/java/awt/dnd/ImageDecoratedDnDNegative/ImageDecoratedDnDNegative.java
@@ -25,7 +25,7 @@
 
 /*
   test %W% %E%
-  @bug 4874070
+  @bug 4874070 7146550
   @summary Tests basic DnD functionality
   @author Your Name: Alexey Utkin area=dnd
   @run applet ImageDecoratedDnDNegative.html
diff --git a/test/java/awt/regtesthelpers/Util.java b/test/java/awt/regtesthelpers/Util.java
index 42be600..ebbfdf9 100644
--- a/test/java/awt/regtesthelpers/Util.java
+++ b/test/java/awt/regtesthelpers/Util.java
@@ -162,16 +162,21 @@
         clickOnComp(comp, robot, 50);
     }
 
+    public static Point getTitlePoint(Window decoratedWindow) {
+        Point p = decoratedWindow.getLocationOnScreen();
+        Dimension d = decoratedWindow.getSize();
+        return new Point(p.x + (int)(d.getWidth()/2),
+                         p.y + (int)(decoratedWindow.getInsets().top/2));
+    }
+
     /*
      * Clicks on a title of Frame/Dialog.
      * WARNING: it may fail on some platforms when the window is not wide enough.
      */
     public static void clickOnTitle(final Window decoratedWindow, final Robot robot) {
-        Point p = decoratedWindow.getLocationOnScreen();
-        Dimension d = decoratedWindow.getSize();
-
         if (decoratedWindow instanceof Frame || decoratedWindow instanceof Dialog) {
-            robot.mouseMove(p.x + (int)(d.getWidth()/2), p.y + (int)decoratedWindow.getInsets().top/2);
+            Point p = getTitlePoint(decoratedWindow);
+            robot.mouseMove(p.x, p.y);
             robot.delay(50);
             robot.mousePress(InputEvent.BUTTON1_MASK);
             robot.delay(50);
@@ -409,7 +414,9 @@
         ICE_WM = 10,
         METACITY_WM = 11,
         COMPIZ_WM = 12,
-        LG3D_WM = 13;
+        LG3D_WM = 13,
+        CWM_WM = 14,
+        MUTTER_WM = 15;
 
     /*
      * Returns -1 in case of not X Window or any problems.
diff --git a/test/java/lang/ProcessBuilder/Basic.java b/test/java/lang/ProcessBuilder/Basic.java
index b3aa308..b18a0f6 100644
--- a/test/java/lang/ProcessBuilder/Basic.java
+++ b/test/java/lang/ProcessBuilder/Basic.java
@@ -248,6 +248,7 @@
 
     private static String getenvAsString(Map<String,String> environment) {
         StringBuilder sb = new StringBuilder();
+        environment = new TreeMap<>(environment);
         for (Map.Entry<String,String> e : environment.entrySet())
             // Ignore magic environment variables added by the launcher
             if (! e.getKey().equals("NLSPATH") &&
@@ -1625,7 +1626,7 @@
             childArgs.add("System.getenv()");
             String[] cmdp = childArgs.toArray(new String[childArgs.size()]);
             String[] envp;
-            String[] envpWin = {"=ExitValue=3", "=C:=\\", "SystemRoot="+systemRoot};
+            String[] envpWin = {"=C:=\\", "=ExitValue=3", "SystemRoot="+systemRoot};
             String[] envpOth = {"=ExitValue=3", "=C:=\\"};
             if (Windows.is()) {
                 envp = envpWin;
@@ -1633,7 +1634,7 @@
                 envp = envpOth;
             }
             Process p = Runtime.getRuntime().exec(cmdp, envp);
-            String expected = Windows.is() ? "=C:=\\,SystemRoot="+systemRoot+",=ExitValue=3," : "=C:=\\,";
+            String expected = Windows.is() ? "=C:=\\,=ExitValue=3,SystemRoot="+systemRoot+"," : "=C:=\\,";
             String commandOutput = commandOutput(p);
             if (MacOSX.is()) {
                 commandOutput = removeMacExpectedVars(commandOutput);
@@ -1690,7 +1691,7 @@
                 commandOutput = removeMacExpectedVars(commandOutput);
             }
             check(commandOutput.equals(Windows.is()
-                    ? "SystemRoot="+systemRoot+",LC_ALL=C,"
+                    ? "LC_ALL=C,SystemRoot="+systemRoot+","
                     : "LC_ALL=C,"),
                   "Incorrect handling of envstrings containing NULs");
         } catch (Throwable t) { unexpected(t); }
diff --git a/test/java/nio/channels/DatagramChannel/BindNull.java b/test/java/nio/channels/DatagramChannel/BindNull.java
new file mode 100644
index 0000000..5126d41
--- /dev/null
+++ b/test/java/nio/channels/DatagramChannel/BindNull.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @bug 7161881
+ * @run main/othervm -Djava.net.preferIPv6Addresses=true BindNull
+ * @summary Make sure the bind method uses an ipv4 address for the null case
+ *          when the DatagramChannel is connected to an IPv4 socket and
+ *          -Djava.net.preferIPv6Addresses=true.
+ */
+
+import java.io.*;
+import java.net.*;
+import java.nio.channels.*;
+
+public class BindNull {
+    public static void main(String[] args) throws IOException {
+        try (DatagramChannel dc = DatagramChannel.open()) {
+            dc.bind(null);
+        }
+        try (DatagramChannel dc = DatagramChannel.open(StandardProtocolFamily.INET)) {
+            dc.bind(null);
+        }
+        try (DatagramChannel dc = DatagramChannel.open(StandardProtocolFamily.INET6)) {
+            dc.bind(null);
+        } catch (UnsupportedOperationException uoe) {
+            // IPv6 not available
+        }
+    }
+}
diff --git a/test/java/nio/channels/Selector/lots_of_updates.sh b/test/java/nio/channels/Selector/lots_of_updates.sh
index 021d5a4..c484158 100644
--- a/test/java/nio/channels/Selector/lots_of_updates.sh
+++ b/test/java/nio/channels/Selector/lots_of_updates.sh
@@ -46,4 +46,4 @@
     ulimit -n 2048
 fi
 
-${TESTJAVA}/bin/java LotsOfUpdates
+${TESTJAVA}/bin/java ${TESTVMOPTS} LotsOfUpdates
diff --git a/test/java/nio/channels/SocketChannel/Open.sh b/test/java/nio/channels/SocketChannel/Open.sh
index cb90696..013f8a1 100644
--- a/test/java/nio/channels/SocketChannel/Open.sh
+++ b/test/java/nio/channels/SocketChannel/Open.sh
@@ -29,7 +29,7 @@
     case "$OS" in
         SunOS )
             ulimit -n 100
-            $TESTJAVA/bin/java -classpath $TESTCLASSES Open ;;
+            $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES Open ;;
         * )
             echo "unrecognized system: $OS" ;;
     esac
diff --git a/test/java/security/Signature/VerifyRangeCheckOverflow.java b/test/java/security/Signature/VerifyRangeCheckOverflow.java
new file mode 100644
index 0000000..9077cc2
--- /dev/null
+++ b/test/java/security/Signature/VerifyRangeCheckOverflow.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * Portions Copyright (c) 2012 IBM Corporation
+ */
+
+/* @test
+ * @bug 7172149
+ * @summary AIOOBE from Signature.verify after integer overflow
+ * @author Jonathan Lu
+ */
+
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.PublicKey;
+import java.security.Signature;
+
+public class VerifyRangeCheckOverflow {
+
+    public static void main(String[] args) throws Exception {
+        KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("DSA");
+        keyPairGenerator.initialize(1024);
+        KeyPair keys = keyPairGenerator.generateKeyPair();
+        PublicKey publicKey = keys.getPublic();
+        byte[] sigBytes = new byte[100];
+
+        Signature signature = Signature.getInstance("SHA1withDSA");
+        signature.initVerify(publicKey);
+        try {
+            signature.verify(sigBytes, Integer.MAX_VALUE, 1);
+        } catch (IllegalArgumentException ex) {
+            // Expected
+        }
+    }
+}
diff --git a/test/java/security/cert/PKIXRevocationChecker/UnitTest.java b/test/java/security/cert/PKIXRevocationChecker/UnitTest.java
new file mode 100644
index 0000000..8accf9e
--- /dev/null
+++ b/test/java/security/cert/PKIXRevocationChecker/UnitTest.java
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 6854712
+ * @summary Basic unit test for PKIXRevocationChecker
+ */
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.URI;
+import java.security.cert.CertificateFactory;
+import java.security.cert.CertPathChecker;
+import java.security.cert.CertPathValidator;
+import java.security.cert.Extension;
+import java.security.cert.PKIXRevocationChecker;
+import java.security.cert.PKIXRevocationChecker.Option;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+public class UnitTest {
+
+    public static void main(String[] args) throws Exception {
+
+        CertPathValidator cpv = CertPathValidator.getInstance("PKIX");
+        CertPathChecker cpc = cpv.getRevocationChecker();
+        PKIXRevocationChecker prc = (PKIXRevocationChecker)cpc;
+
+        System.out.println("Testing that get methods return null or " +
+                           "empty lists/sets/maps");
+        requireNull(prc.getOCSPResponder(), "getOCSPResponder()");
+        requireNull(prc.getOCSPResponderCert(), "getOCSPResponderCert()");
+        requireEmpty(prc.getOCSPExtensions(), "getOCSPExtensions()");
+        requireEmpty(prc.getOCSPStapledResponses(),
+                     "getOCSPStapledResponses()");
+        requireEmpty(prc.getOptions(), "getOptions()");
+
+        System.out.println("Testing that get methods return same parameters " +
+                           "that are passed to set methods");
+        URI uri = new URI("http://localhost");
+        prc.setOCSPResponder(uri);
+        requireEquals(uri, prc.getOCSPResponder(), "getOCSPResponder()");
+
+        X509Certificate cert = getCert();
+        prc.setOCSPResponderCert(cert);
+        requireEquals(cert, prc.getOCSPResponderCert(),
+                      "getOCSPResponderCert()");
+
+        List<Extension> exts = new ArrayList<>();
+        for (String oid : cert.getNonCriticalExtensionOIDs()) {
+            System.out.println(oid);
+            exts.add(new ExtensionImpl(oid,
+                                       cert.getExtensionValue(oid), false));
+        }
+        prc.setOCSPExtensions(exts);
+        requireEquals(exts, prc.getOCSPExtensions(), "getOCSPExtensions()");
+
+        Set<Option> options = EnumSet.of(Option.ONLY_END_ENTITY);
+        prc.setOptions(options);
+        requireEquals(options, prc.getOptions(), "getOptions()");
+
+        System.out.println("Testing that parameters are re-initialized to " +
+                           "default values if null is passed to set methods");
+        prc.setOCSPResponder(null);
+        requireNull(prc.getOCSPResponder(), "getOCSPResponder()");
+        prc.setOCSPResponderCert(null);
+        requireNull(prc.getOCSPResponderCert(), "getOCSPResponderCert()");
+        prc.setOCSPExtensions(null);
+        requireEmpty(prc.getOCSPExtensions(), "getOCSPExtensions()");
+        prc.setOCSPStapledResponses(null);
+        requireEmpty(prc.getOCSPStapledResponses(),
+                     "getOCSPStapledResponses()");
+        prc.setOptions(null);
+        requireEmpty(prc.getOptions(), "getOptions()");
+    }
+
+    static void requireNull(Object o, String msg) throws Exception {
+        if (o != null) {
+            throw new Exception("FAILED: " + msg + " must return null");
+        }
+    }
+
+    static void requireEmpty(Map<?,?> m, String msg) throws Exception {
+        if (!m.isEmpty()) {
+            throw new Exception("FAILED: " + msg + " must return an empty map");
+        }
+    }
+
+    static void requireEmpty(List<?> l, String msg) throws Exception {
+        if (!l.isEmpty()) {
+            throw new Exception("FAILED: " + msg +" must return an empty list");
+        }
+    }
+
+    static void requireEmpty(Set<?> s, String msg) throws Exception {
+        if (!s.isEmpty()) {
+            throw new Exception("FAILED: " + msg + " must return an empty set");
+        }
+    }
+
+    static void requireEquals(Object a, Object b, String msg) throws Exception {
+        if (!a.equals(b)) {
+            throw new Exception("FAILED: " + msg + " does not return the " +
+                                "same object that was set");
+        }
+    }
+
+    static X509Certificate getCert() throws Exception {
+        String b64 =
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIIBLTCB2KADAgECAgEDMA0GCSqGSIb3DQEBBAUAMA0xCzAJBgNVBAMTAkNBMB4X\n" +
+        "DTAyMTEwNzExNTcwM1oXDTIyMTEwNzExNTcwM1owFTETMBEGA1UEAxMKRW5kIEVu\n" +
+        "dGl0eTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDVBDfF+uBr5s5jzzDs1njKlZNt\n" +
+        "h8hHzEt3ASh67Peos+QrDzgpUyFXT6fdW2h7iPf0ifjM8eW2xa+3EnPjjU5jAgMB\n" +
+        "AAGjGzAZMBcGA1UdIAQQMA4wBgYEVR0gADAEBgIqADANBgkqhkiG9w0BAQQFAANB\n" +
+        "AFo//WOboCNOCcA1fvcWW9oc4MvV8ZPvFIAbyEbgyFd4id5lGDTRbRPvvNZRvdsN\n" +
+        "NM2gXYr+f87NHIXc9EF3pzw=\n" +
+        "-----END CERTIFICATE-----";
+
+        InputStream is = new ByteArrayInputStream(b64.getBytes("UTF-8"));
+        CertificateFactory cf = CertificateFactory.getInstance("X.509");
+        return (X509Certificate)cf.generateCertificate(is);
+    }
+
+    static class ExtensionImpl implements Extension {
+        private final String oid;
+        private final byte[] val;
+        private final boolean critical;
+
+        ExtensionImpl(String oid, byte[] val, boolean critical) {
+            this.oid = oid;
+            this.val = val;
+            this.critical = critical;
+        }
+
+        public void encode(OutputStream out) throws IOException {
+            throw new UnsupportedOperationException();
+        }
+
+        public String getId() {
+            return oid;
+        }
+
+        public byte[] getValue() {
+            return val.clone();
+        }
+
+        public boolean isCritical() {
+            return critical;
+        }
+    }
+}
diff --git a/test/java/util/Collection/BiggernYours.java b/test/java/util/Collection/BiggernYours.java
index 6800f43..ad5e373 100644
--- a/test/java/util/Collection/BiggernYours.java
+++ b/test/java/util/Collection/BiggernYours.java
@@ -34,15 +34,25 @@
 
 @SuppressWarnings("unchecked")
 public class BiggernYours {
-    static final Random rnd = new Random();
+    static final Random rnd = new Random(18675309);
 
     static void compareCollections(Collection c1, Collection c2) {
-        arrayEqual(c1.toArray(),
-                   c2.toArray());
-        arrayEqual(c1.toArray(new Object[0]),
-                   c2.toArray(new Object[0]));
-        arrayEqual(c1.toArray(new Object[5]),
-                   c2.toArray(new Object[5]));
+        Object[] c1Array = c1.toArray();
+        Object[] c2Array = c2.toArray();
+
+        check(c1Array.length == c2Array.length);
+        for(Object aC1 : c1Array) {
+            boolean found = false;
+            for(Object aC2 : c2Array) {
+                if(Objects.equals(aC1, aC2)) {
+                    found = true;
+                    break;
+                }
+            }
+
+            if(!found)
+                fail(aC1 + " not found in " + Arrays.toString(c2Array));
+        }
     }
 
     static void compareMaps(Map m1, Map m2) {
diff --git a/test/java/util/EnumMap/ProperEntrySetOnClone.java b/test/java/util/EnumMap/ProperEntrySetOnClone.java
new file mode 100644
index 0000000..b5fcffd
--- /dev/null
+++ b/test/java/util/EnumMap/ProperEntrySetOnClone.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug     7164256
+ * @summary EnumMap.entrySet() returns an entrySet referencing to the cloned instance
+ * @author  Diego Belfer
+ */
+
+import java.util.EnumMap;
+
+public class ProperEntrySetOnClone {
+    public enum Test {
+        ONE, TWO
+    }
+
+    public static void main(String[] args) {
+        EnumMap<Test, String> map1 = new EnumMap<Test, String>(Test.class);
+        map1.put(Test.ONE, "1");
+        map1.put(Test.TWO, "2");
+
+        // We need to force creation of the map1.entrySet
+        int size = map1.entrySet().size();
+        if (size != 2) {
+            throw new RuntimeException(
+                    "Invalid size in original map. Expected: 2 was: " + size);
+        }
+
+        EnumMap<Test, String> map2 = map1.clone();
+        map2.remove(Test.ONE);
+        size = map2.entrySet().size();
+        if (size != 1) {
+            throw new RuntimeException(
+                    "Invalid size in cloned instance. Expected: 1 was: " + size);
+        }
+    }
+}
diff --git a/test/java/util/HashMap/NullKeyAtResize.java b/test/java/util/HashMap/NullKeyAtResize.java
new file mode 100644
index 0000000..6166fa8
--- /dev/null
+++ b/test/java/util/HashMap/NullKeyAtResize.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 7173432
+ * @summary If the key to be inserted into a HashMap is null and the table
+ * needs to be resized as part of the insertion then addEntry will try to
+ * recalculate the hash of a null key. This will fail with an NPE.
+ */
+
+import java.util.*;
+
+public class NullKeyAtResize {
+    public static void main(String[] args) throws Exception {
+        List<Object> old_order = new ArrayList<>();
+        Map<Object,Object> m = new HashMap<>(16);
+        int number = 0;
+        while(number < 100000) {
+            m.put(null,null); // try to put in null. This may cause resize.
+            m.remove(null); // remove it.
+            Integer adding = (number += 100);
+            m.put(adding, null); // try to put in a number. This wont cause resize.
+            List<Object> new_order = new ArrayList<>();
+            new_order.addAll(m.keySet());
+            new_order.remove(adding);
+            if(!old_order.equals(new_order)) {
+                // we resized and didn't crash.
+                System.out.println("Encountered resize after " + (number / 100) + " iterations");
+                break;
+            }
+            // remember this order for the next time around.
+            old_order.clear();
+            old_order.addAll(m.keySet());
+        }
+        if(number == 100000) {
+            throw new Error("Resize never occurred");
+        }
+    }
+}
diff --git a/test/java/util/Hashtable/HashCode.java b/test/java/util/Hashtable/HashCode.java
index c62e9fd..822ce51 100644
--- a/test/java/util/Hashtable/HashCode.java
+++ b/test/java/util/Hashtable/HashCode.java
@@ -36,8 +36,5 @@
         if (m.hashCode() != 0)
             throw new Exception("Empty Hashtable has nonzero hashCode.");
 
-        m.put("Joe", "Blow");
-        if (m.hashCode() != ("Joe".hashCode() ^ "Blow".hashCode()))
-            throw new Exception("Non-empty Hashtable has wrong hashCode.");
     }
 }
diff --git a/test/java/util/Hashtable/SimpleSerialization.java b/test/java/util/Hashtable/SimpleSerialization.java
index d278f53..537c32e 100644
--- a/test/java/util/Hashtable/SimpleSerialization.java
+++ b/test/java/util/Hashtable/SimpleSerialization.java
@@ -34,48 +34,58 @@
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
-import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.util.Hashtable;
+import java.util.Map;
 
 public class SimpleSerialization {
     public static void main(final String[] args) throws Exception {
         Hashtable<String, String> h1 = new Hashtable<>();
 
+        System.err.println("*** BEGIN TEST ***");
+
         h1.put("key", "value");
 
         final ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        final ObjectOutputStream oos = new ObjectOutputStream(baos);
-
-        oos.writeObject(h1);
-        oos.close();
+        try (ObjectOutputStream oos = new ObjectOutputStream(baos)) {
+            oos.writeObject(h1);
+        }
 
         final byte[] data = baos.toByteArray();
         final ByteArrayInputStream bais = new ByteArrayInputStream(data);
-        final ObjectInputStream ois = new ObjectInputStream(bais);
+        final Object deserializedObject;
+        try (ObjectInputStream ois = new ObjectInputStream(bais)) {
+            deserializedObject = ois.readObject();
+        }
 
-        final Object deserializedObject = ois.readObject();
-        ois.close();
+        if(!h1.getClass().isInstance(deserializedObject)) {
+             throw new RuntimeException("Result not assignable to type of h1");
+        }
 
         if (false == h1.equals(deserializedObject)) {
+             Hashtable<String, String> d1 = (Hashtable<String, String>) h1;
+            for(Map.Entry entry: h1.entrySet()) {
+                System.err.println("h1.key::" + entry.getKey() + " d1.containsKey()::" + d1.containsKey((String) entry.getKey()));
+                System.err.println("h1.value::" + entry.getValue() + " d1.contains()::" + d1.contains(entry.getValue()));
+                System.err.println("h1.value == d1.value " + entry.getValue().equals(d1.get((String) entry.getKey())));
+            }
+
             throw new RuntimeException(getFailureText(h1, deserializedObject));
         }
     }
 
     private static String getFailureText(final Object orig, final Object copy) {
         final StringWriter sw = new StringWriter();
-        final PrintWriter pw = new PrintWriter(sw);
-
-        pw.println("Test FAILED: Deserialized object is not equal to the original object");
-        pw.print("\tOriginal: ");
-        printObject(pw, orig).println();
-        pw.print("\tCopy:     ");
-        printObject(pw, copy).println();
-
-        pw.close();
+        try (PrintWriter pw = new PrintWriter(sw)) {
+            pw.println("Test FAILED: Deserialized object is not equal to the original object");
+            pw.print("\tOriginal: ");
+            printObject(pw, orig).println();
+            pw.print("\tCopy:     ");
+            printObject(pw, copy).println();
+        }
         return sw.toString();
     }
 
diff --git a/test/java/util/Map/Collisions.java b/test/java/util/Map/Collisions.java
new file mode 100644
index 0000000..bc4e4c3
--- /dev/null
+++ b/test/java/util/Map/Collisions.java
@@ -0,0 +1,345 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7126277
+ * @summary Ensure Maps behave well with lots of hashCode() collisions.
+ * @author Mike Duigou
+ */
+import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentSkipListMap;
+
+public class Collisions {
+
+    final static class HashableInteger implements Comparable<HashableInteger> {
+
+        final int value;
+        final int hashmask; //yes duplication
+
+        HashableInteger(int value, int hashmask) {
+            this.value = value;
+            this.hashmask = hashmask;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (obj instanceof HashableInteger) {
+                HashableInteger other = (HashableInteger) obj;
+
+                return other.value == value;
+            }
+
+            return false;
+        }
+
+        @Override
+        public int hashCode() {
+            return value % hashmask;
+        }
+
+        @Override
+        public int compareTo(HashableInteger o) {
+            return value - o.value;
+        }
+
+        public String toString() {
+            return Integer.toString(value);
+        }
+    }
+    private static final int ITEMS = 10000;
+    private static final Object KEYS[][];
+
+    static {
+        HashableInteger UNIQUE_OBJECTS[] = new HashableInteger[ITEMS];
+        HashableInteger COLLIDING_OBJECTS[] = new HashableInteger[ITEMS];
+        String UNIQUE_STRINGS[] = new String[ITEMS];
+        String COLLIDING_STRINGS[] = new String[ITEMS];
+
+        for (int i = 0; i < ITEMS; i++) {
+            UNIQUE_OBJECTS[i] = new HashableInteger(i, Integer.MAX_VALUE);
+            COLLIDING_OBJECTS[i] = new HashableInteger(i, 10);
+            UNIQUE_STRINGS[i] = unhash(i);
+            COLLIDING_STRINGS[i] = (0 == i % 2)
+                    ? UNIQUE_STRINGS[i / 2]
+                    : "\u0000\u0000\u0000\u0000\u0000" + COLLIDING_STRINGS[i - 1];
+        }
+
+     KEYS = new Object[][] {
+            new Object[]{"Unique Objects", UNIQUE_OBJECTS},
+            new Object[]{"Colliding Objects", COLLIDING_OBJECTS},
+            new Object[]{"Unique Strings", UNIQUE_STRINGS},
+            new Object[]{"Colliding Strings", COLLIDING_STRINGS}
+        };
+    }
+
+    /**
+     * Returns a string with a hash equal to the argument.
+     *
+     * @return string with a hash equal to the argument.
+     */
+    public static String unhash(int target) {
+        StringBuilder answer = new StringBuilder();
+        if (target < 0) {
+            // String with hash of Integer.MIN_VALUE, 0x80000000
+            answer.append("\\u0915\\u0009\\u001e\\u000c\\u0002");
+
+            if (target == Integer.MIN_VALUE) {
+                return answer.toString();
+            }
+            // Find target without sign bit set
+            target = target & Integer.MAX_VALUE;
+        }
+
+        unhash0(answer, target);
+        return answer.toString();
+    }
+
+    private static void unhash0(StringBuilder partial, int target) {
+        int div = target / 31;
+        int rem = target % 31;
+
+        if (div <= Character.MAX_VALUE) {
+            if (div != 0) {
+                partial.append((char) div);
+            }
+            partial.append((char) rem);
+        } else {
+            unhash0(partial, div);
+            partial.append((char) rem);
+        }
+    }
+
+    private static void realMain(String[] args) throws Throwable {
+        for (Object[] keys_desc : KEYS) {
+            Map<Object, Boolean>[] MAPS = (Map<Object, Boolean>[]) new Map[]{
+//                        new Hashtable<>(),
+                        new HashMap<>(),
+                        new IdentityHashMap<>(),
+                        new LinkedHashMap<>(),
+                        new ConcurrentHashMap<>(),
+                        new WeakHashMap<>(),
+                        new TreeMap<>(),
+                        new ConcurrentSkipListMap<>()
+                    };
+
+            for (Map<Object, Boolean> map : MAPS) {
+                String desc = (String) keys_desc[0];
+                Object[] keys = (Object[]) keys_desc[1];
+                testMap(map, desc, keys);
+            }
+        }
+    }
+
+    private static <T> void testMap(Map<T, Boolean> map, String keys_desc, T[] keys) {
+        System.err.println(map.getClass() + " : " + keys_desc);
+        testInsertion(map, keys_desc, keys);
+
+        if (keys[0] instanceof HashableInteger) {
+            testIntegerIteration((Map<HashableInteger, Boolean>) map, (HashableInteger[]) keys);
+        } else {
+            testStringIteration((Map<String, Boolean>) map, (String[]) keys);
+        }
+
+        testContainsKey(map, keys_desc, keys);
+
+        testRemove(map, keys_desc, keys);
+
+        check(map.isEmpty());
+    }
+
+    private static <T> void testInsertion(Map<T, Boolean> map, String keys_desc, T[] keys) {
+        check("map empty", (map.size() == 0) && map.isEmpty());
+
+        for (int i = 0; i < keys.length; i++) {
+            check(String.format("insertion: map expected size m%d != i%d", map.size(), i),
+                    map.size() == i);
+            check(String.format("insertion: put(%s[%d])", keys_desc, i), null == map.put(keys[i], true));
+            check(String.format("insertion: containsKey(%s[%d])", keys_desc, i), map.containsKey(keys[i]));
+        }
+
+        check(String.format("map expected size m%d != k%d", map.size(), keys.length),
+                map.size() == keys.length);
+    }
+
+    private static void testIntegerIteration(Map<HashableInteger, Boolean> map, HashableInteger[] keys) {
+        check(String.format("map expected size m%d != k%d", map.size(), keys.length),
+                map.size() == keys.length);
+
+        BitSet all = new BitSet(keys.length);
+        for (Map.Entry<HashableInteger, Boolean> each : map.entrySet()) {
+            check("Iteration: key already seen", !all.get(each.getKey().value));
+            all.set(each.getKey().value);
+        }
+
+        all.flip(0, keys.length);
+        check("Iteration: some keys not visited", all.isEmpty());
+
+        for (HashableInteger each : map.keySet()) {
+            check("Iteration: key already seen", !all.get(each.value));
+            all.set(each.value);
+        }
+
+        all.flip(0, keys.length);
+        check("Iteration: some keys not visited", all.isEmpty());
+
+        int count = 0;
+        for (Boolean each : map.values()) {
+            count++;
+        }
+
+        check(String.format("Iteration: value count matches size m%d != c%d", map.size(), count),
+                map.size() == count);
+    }
+
+    private static void testStringIteration(Map<String, Boolean> map, String[] keys) {
+        check(String.format("map expected size m%d != k%d", map.size(), keys.length),
+                map.size() == keys.length);
+
+        BitSet all = new BitSet(keys.length);
+        for (Map.Entry<String, Boolean> each : map.entrySet()) {
+            String key = each.getKey();
+            boolean longKey = key.length() > 5;
+            int index = key.hashCode() + (longKey ? keys.length / 2 : 0);
+            check("key already seen", !all.get(index));
+            all.set(index);
+        }
+
+        all.flip(0, keys.length);
+        check("some keys not visited", all.isEmpty());
+
+        for (String each : map.keySet()) {
+            boolean longKey = each.length() > 5;
+            int index = each.hashCode() + (longKey ? keys.length / 2 : 0);
+            check("key already seen", !all.get(index));
+            all.set(index);
+        }
+
+        all.flip(0, keys.length);
+        check("some keys not visited", all.isEmpty());
+
+        int count = 0;
+        for (Boolean each : map.values()) {
+            count++;
+        }
+
+        check(String.format("value count matches size m%d != k%d", map.size(), keys.length),
+                map.size() == keys.length);
+    }
+
+    private static <T> void testContainsKey(Map<T, Boolean> map, String keys_desc, T[] keys) {
+        for (int i = 0; i < keys.length; i++) {
+            T each = keys[i];
+            check("containsKey: " + keys_desc + "[" + i + "]" + each, map.containsKey(each));
+        }
+    }
+
+    private static <T> void testRemove(Map<T, Boolean> map, String keys_desc, T[] keys) {
+        check(String.format("remove: map expected size m%d != k%d", map.size(), keys.length),
+                map.size() == keys.length);
+
+        for (int i = 0; i < keys.length; i++) {
+            T each = keys[i];
+            check("remove: " + keys_desc + "[" + i + "]" + each, null != map.remove(each));
+        }
+
+        check(String.format("remove: map empty. size=%d", map.size()),
+                (map.size() == 0) && map.isEmpty());
+    }
+    //--------------------- Infrastructure ---------------------------
+    static volatile int passed = 0, failed = 0;
+
+    static void pass() {
+        passed++;
+    }
+
+    static void fail() {
+        failed++;
+        (new Error("Failure")).printStackTrace(System.err);
+    }
+
+    static void fail(String msg) {
+        failed++;
+        (new Error("Failure: " + msg)).printStackTrace(System.err);
+    }
+
+    static void abort() {
+        fail();
+        System.exit(1);
+    }
+
+    static void abort(String msg) {
+        fail(msg);
+        System.exit(1);
+    }
+
+    static void unexpected(String msg, Throwable t) {
+        System.err.println("Unexpected: " + msg);
+        unexpected(t);
+    }
+
+    static void unexpected(Throwable t) {
+        failed++;
+        t.printStackTrace(System.err);
+    }
+
+    static void check(boolean cond) {
+        if (cond) {
+            pass();
+        } else {
+            fail();
+        }
+    }
+
+    static void check(String desc, boolean cond) {
+        if (cond) {
+            pass();
+        } else {
+            fail(desc);
+        }
+    }
+
+    static void equal(Object x, Object y) {
+        if (Objects.equals(x, y)) {
+            pass();
+        } else {
+            fail(x + " not equal to " + y);
+        }
+    }
+
+    public static void main(String[] args) throws Throwable {
+        Thread.currentThread().setName("Collisions");
+//        Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
+        try {
+            realMain(args);
+        } catch (Throwable t) {
+            unexpected(t);
+        }
+
+        System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
+        if (failed > 0) {
+            throw new Error("Some tests failed");
+        }
+    }
+}
diff --git a/test/java/util/Map/Get.java b/test/java/util/Map/Get.java
index e7eb8db..870a7b8 100644
--- a/test/java/util/Map/Get.java
+++ b/test/java/util/Map/Get.java
@@ -50,16 +50,16 @@
                             Character key, Boolean value,
                             Boolean oldValue) {
         if (oldValue != null) {
-            check(m.containsValue(oldValue));
-            check(m.values().contains(oldValue));
+            check("containsValue(oldValue)", m.containsValue(oldValue));
+            check("values.contains(oldValue)", m.values().contains(oldValue));
         }
         equal(m.put(key, value), oldValue);
         equal(m.get(key), value);
-        check(m.containsKey(key));
-        check(m.keySet().contains(key));
-        check(m.containsValue(value));
-        check(m.values().contains(value));
-        check(! m.isEmpty());
+        check("containsKey", m.containsKey(key));
+        check("keySet.contains", m.keySet().contains(key));
+        check("containsValue", m.containsValue(value));
+        check("values.contains",  m.values().contains(value));
+        check("!isEmpty", ! m.isEmpty());
     }
 
     private static void testMap(Map<Character,Boolean> m) {
@@ -71,7 +71,7 @@
                                         m instanceof Hashtable));
         boolean usesIdentity = m instanceof IdentityHashMap;
 
-        System.out.println(m.getClass());
+        System.err.println(m.getClass());
         put(m, 'A', true,  null);
         put(m, 'A', false, true);       // Guaranteed identical by JLS
         put(m, 'B', true,  null);
@@ -81,15 +81,15 @@
                 put(m, null, true,  null);
                 put(m, null, false, true);
             }
-            catch (Throwable t) { unexpected(t); }
+            catch (Throwable t) { unexpected(m.getClass().getName(), t); }
         } else {
-            try { m.get(null); fail(); }
+            try { m.get(null); fail(m.getClass().getName() + " did not reject null key"); }
             catch (NullPointerException e) {}
-            catch (Throwable t) { unexpected(t); }
+            catch (Throwable t) { unexpected(m.getClass().getName(), t); }
 
-            try { m.put(null, true); fail(); }
+            try { m.put(null, true); fail(m.getClass().getName() + " did not reject null key"); }
             catch (NullPointerException e) {}
-            catch (Throwable t) { unexpected(t); }
+            catch (Throwable t) { unexpected(m.getClass().getName(), t); }
         }
         if (permitsNullValues) {
             try {
@@ -97,33 +97,35 @@
                 put(m, 'C', true, null);
                 put(m, 'C', null, true);
             }
-            catch (Throwable t) { unexpected(t); }
+            catch (Throwable t) { unexpected(m.getClass().getName(), t); }
         } else {
-            try { m.put('A', null); fail(); }
+            try { m.put('A', null); fail(m.getClass().getName() + " did not reject null key"); }
             catch (NullPointerException e) {}
-            catch (Throwable t) { unexpected(t); }
+            catch (Throwable t) { unexpected(m.getClass().getName(), t); }
 
-            try { m.put('C', null); fail(); }
+            try { m.put('C', null); fail(m.getClass().getName() + " did not reject null key"); }
             catch (NullPointerException e) {}
-            catch (Throwable t) { unexpected(t); }
+            catch (Throwable t) { unexpected(m.getClass().getName(), t); }
         }
     }
 
     //--------------------- Infrastructure ---------------------------
     static volatile int passed = 0, failed = 0;
     static void pass() { passed++; }
-    static void fail() { failed++; Thread.dumpStack(); }
-    static void fail(String msg) { System.out.println(msg); fail(); }
-    static void unexpected(Throwable t) { failed++; t.printStackTrace(); }
+    static void fail() { failed++; (new Error("Failure")).printStackTrace(System.err); }
+    static void fail(String msg) { failed++; (new Error("Failure: " + msg)).printStackTrace(System.err); }
+    static void unexpected(String msg, Throwable t) { System.err.println("Unexpected: " + msg); unexpected(t); }
+    static void unexpected(Throwable t) { failed++; t.printStackTrace(System.err); }
     static void check(boolean cond) { if (cond) pass(); else fail(); }
+    static void check(String desc, boolean cond) { if (cond) pass(); else fail(desc); }
     static void equal(Object x, Object y) {
-        if (x == null ? y == null : x.equals(y)) pass();
-        else {System.out.println(x + " not equal to " + y); fail(); }}
+        if(Objects.equals(x,y)) pass(); else fail(x + " not equal to " + y);
+    }
 
     public static void main(String[] args) throws Throwable {
         try { realMain(args); } catch (Throwable t) { unexpected(t); }
 
         System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
-        if (failed > 0) throw new Exception("Some tests failed");
+        if (failed > 0) throw new Error("Some tests failed");
     }
 }
diff --git a/test/javax/swing/JPopupMenu/6694823/bug6694823.java b/test/javax/swing/JPopupMenu/6694823/bug6694823.java
index e8d24d0..e5a6edb 100644
--- a/test/javax/swing/JPopupMenu/6694823/bug6694823.java
+++ b/test/javax/swing/JPopupMenu/6694823/bug6694823.java
@@ -33,6 +33,8 @@
 import javax.swing.*;
 import java.awt.*;
 import sun.awt.SunToolkit;
+import java.security.Permission;
+import sun.security.util.SecurityConstants;
 
 public class bug6694823 {
     private static JFrame frame;
@@ -48,6 +50,8 @@
             }
         });
 
+        toolkit.realSync();
+
         // Get screen insets
         screenInsets = toolkit.getScreenInsets(frame.getGraphicsConfiguration());
         if (screenInsets.bottom == 0) {
@@ -55,26 +59,23 @@
             return;
         }
 
-        // Show popup as if from a standalone application
-        // The popup should be able to overlap the task bar
-        showPopup(false);
+        System.setSecurityManager(new SecurityManager(){
 
-        // Emulate applet security restrictions
-        toolkit.realSync();
-        System.setSecurityManager(new SecurityManager());
+            private String allowsAlwaysOnTopPermission = SecurityConstants.AWT.SET_WINDOW_ALWAYS_ON_TOP_PERMISSION.getName();
+
+            @Override
+            public void checkPermission(Permission perm) {
+                if (allowsAlwaysOnTopPermission.equals(perm.getName())) {
+                    throw new SecurityException();
+                }
+            }
+
+        });
 
         // Show popup as if from an applet
         // The popup shouldn't overlap the task bar. It should be shifted up.
-        showPopup(true);
+        checkPopup();
 
-        toolkit.realSync();
-        System.out.println("Test passed!");
-
-        SwingUtilities.invokeAndWait(new Runnable() {
-            public void run() {
-                frame.dispose();
-            }
-        });
     }
 
     private static void createGui() {
@@ -93,7 +94,7 @@
         frame.setSize(200, 200);
     }
 
-    private static void showPopup(final boolean shouldBeShifted) throws Exception {
+    private static void checkPopup() throws Exception {
         SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
                 // Place frame just above the task bar
@@ -121,20 +122,14 @@
         toolkit.realSync();
 
         SwingUtilities.invokeAndWait(new Runnable() {
+
             public void run() {
                 Point frameLoc = frame.getLocationOnScreen();
-                if (shouldBeShifted) {
-                    if (popup.getLocationOnScreen()
-                            .equals(new Point(frameLoc.x, frameLoc.y + point.y))) {
-                        throw new RuntimeException("Popup is not shifted");
-                    }
-                } else {
-                    if (!popup.getLocationOnScreen()
-                            .equals(new Point(frameLoc.x, frameLoc.y + point.y))) {
-                        throw new RuntimeException("Popup is unexpectedly shifted");
-                    }
+                if (popup.getLocationOnScreen().equals(new Point(frameLoc.x, frameLoc.y + point.y))) {
+                    throw new RuntimeException("Popup is not shifted");
                 }
                 popup.setVisible(false);
+                frame.dispose();
             }
         });
     }
diff --git a/test/javax/swing/JPopupMenu/6800513/bug6800513.java b/test/javax/swing/JPopupMenu/6800513/bug6800513.java
new file mode 100644
index 0000000..c44e058
--- /dev/null
+++ b/test/javax/swing/JPopupMenu/6800513/bug6800513.java
@@ -0,0 +1,147 @@
+/*
+ * Copyright 2012 Red Hat, Inc.  All Rights Reserved.
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6800513
+ * @summary GTK-LaF renders menus incompletely
+ * @author Mario Torre
+ * @library ../../regtesthelpers/
+ * @build Util
+ * @run main bug6800513
+ */
+
+import sun.awt.SunToolkit;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.InputEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.lang.reflect.Field;
+import java.util.concurrent.Callable;
+
+public class bug6800513 {
+
+    private static JPopupMenu popupMenu;
+    private static JMenu menu;
+    private static JFrame frame;
+
+    public static void testFrame(final boolean defaultLightWeightPopupEnabled,
+            String expectedPopupClass) throws Exception {
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                JPopupMenu.setDefaultLightWeightPopupEnabled(defaultLightWeightPopupEnabled);
+                createAndShowUI();
+            }
+        });
+
+        toolkit.realSync();
+
+        clickOnMenu();
+
+        toolkit.realSync();
+
+        Field getPopup = JPopupMenu.class.getDeclaredField("popup");
+        getPopup.setAccessible(true);
+        Popup popup = (Popup) getPopup.get(popupMenu);
+
+        if (popup == null) {
+            throw new Exception("popup is null!");
+        }
+
+        String className = popup.getClass().getName();
+        if (!className.equals(expectedPopupClass)) {
+            throw new Exception("popup class is: " + className +
+                    ", expected: " + expectedPopupClass);
+        }
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                frame.dispose();
+                popupMenu = null;
+            }
+        });
+
+        toolkit.realSync();
+    }
+
+
+    public static void clickOnMenu() throws Exception {
+        Rectangle bounds = Util.invokeOnEDT(new Callable<Rectangle>() {
+            @Override
+            public Rectangle call() throws Exception {
+                return new Rectangle(menu.getLocationOnScreen(), menu.getSize());
+            }
+        });
+
+        Robot robot = new Robot();
+        robot.setAutoDelay(100);
+
+        robot.mouseMove(bounds.x + bounds.width / 2, bounds.y + bounds.height / 2);
+
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+    }
+
+    private static class PopupListener implements PropertyChangeListener {
+        @Override
+        public void propertyChange(PropertyChangeEvent evt) {
+            if (evt.toString().contains("visible") && ((Boolean) evt.getNewValue() == true)) {
+                popupMenu = (JPopupMenu) evt.getSource();
+            }
+        }
+    }
+
+    public static void createAndShowUI() {
+        frame = new JFrame();
+
+        JMenuBar menuBar = new JMenuBar();
+        menu = new JMenu("Menu");
+
+        menu.add(new JMenuItem("Menu Item #1"));
+        menu.add(new JMenuItem("Menu Item #2"));
+        menu.add(new JMenuItem("Menu Item #3"));
+
+        menuBar.add(menu);
+
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        frame.setJMenuBar(menuBar);
+        frame.setSize(500, 500);
+
+        PopupListener listener = new PopupListener();
+        menu.getPopupMenu().addPropertyChangeListener(listener);
+
+        frame.setVisible(true);
+    }
+
+    public static void main(String[] args) throws Exception {
+        testFrame(false, "javax.swing.PopupFactory$HeavyWeightPopup");
+
+        testFrame(true, "javax.swing.PopupFactory$LightWeightPopup");
+    }
+}
diff --git a/test/javax/swing/JPopupMenu/7156657/bug7156657.java b/test/javax/swing/JPopupMenu/7156657/bug7156657.java
new file mode 100644
index 0000000..6bddc2a
--- /dev/null
+++ b/test/javax/swing/JPopupMenu/7156657/bug7156657.java
@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import com.sun.awt.AWTUtilities;
+import sun.awt.SunToolkit;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.util.concurrent.Callable;
+
+/* @test
+   @bug 7156657
+   @summary Version 7 doesn't support translucent popup menus against a translucent window
+   @library ../../regtesthelpers
+   @author Pavel Porvatov
+*/
+public class bug7156657 {
+    private static JFrame lowerFrame;
+
+    private static JFrame frame;
+
+    private static JPopupMenu popupMenu;
+
+    public static void main(String[] args) throws Exception {
+        final Robot robot = new Robot();
+        final SunToolkit toolkit = ((SunToolkit) Toolkit.getDefaultToolkit());
+
+        Boolean skipTest = Util.invokeOnEDT(new Callable<Boolean>() {
+            @Override
+            public Boolean call() throws Exception {
+                frame = createFrame();
+
+                if (!AWTUtilities.isTranslucencyCapable(frame.getGraphicsConfiguration())) {
+                    System.out.println("Translucency is not supported, the test skipped");
+
+                    return true;
+                }
+
+                lowerFrame = createFrame();
+                lowerFrame.getContentPane().setBackground(Color.RED);
+                lowerFrame.setVisible(true);
+
+                popupMenu = new JPopupMenu();
+                popupMenu.setOpaque(false);
+                popupMenu.add(new TransparentMenuItem("1111"));
+                popupMenu.add(new TransparentMenuItem("2222"));
+                popupMenu.add(new TransparentMenuItem("3333"));
+
+                AWTUtilities.setWindowOpaque(frame, false);
+                JPanel pnContent = new JPanel();
+                pnContent.setBackground(new Color(255, 255, 255, 128));
+                frame.add(pnContent);
+                frame.setVisible(true);
+
+                return false;
+            }
+        });
+
+        if (skipTest) {
+            return;
+        }
+
+        toolkit.realSync();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                popupMenu.show(frame, 0, 0);
+            }
+        });
+
+        toolkit.realSync();
+
+        Rectangle popupRectangle = Util.invokeOnEDT(new Callable<Rectangle>() {
+            @Override
+            public Rectangle call() throws Exception {
+                return popupMenu.getBounds();
+            }
+        });
+
+        BufferedImage redBackgroundCapture = robot.createScreenCapture(popupRectangle);
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                lowerFrame.getContentPane().setBackground(Color.GREEN);
+            }
+        });
+
+        toolkit.realSync();
+
+        BufferedImage greenBackgroundCapture = robot.createScreenCapture(popupRectangle);
+
+        if (Util.compareBufferedImages(redBackgroundCapture, greenBackgroundCapture)) {
+            throw new RuntimeException("The test failed");
+        }
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                popupMenu.setVisible(false);
+                frame.dispose();
+                lowerFrame.dispose();
+            }
+        });
+
+        System.out.println("The test passed");
+    }
+
+
+    private static JFrame createFrame() {
+        JFrame result = new JFrame();
+
+        result.setLocation(0, 0);
+        result.setSize(400, 300);
+        result.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        result.setUndecorated(true);
+
+        return result;
+    }
+
+    private static class TransparentMenuItem extends JMenuItem {
+        public TransparentMenuItem(String text) {
+            super(text);
+            setOpaque(false);
+        }
+
+        @Override
+        public void paint(Graphics g) {
+            Graphics2D g2 = (Graphics2D) g.create();
+            g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f));
+            super.paint(g2);
+            g2.dispose();
+        }
+    }
+}
diff --git a/test/javax/swing/JSpinner/5012888/bug5012888.java b/test/javax/swing/JSpinner/5012888/bug5012888.java
new file mode 100644
index 0000000..7898de4
--- /dev/null
+++ b/test/javax/swing/JSpinner/5012888/bug5012888.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test 1.0 04/04/23
+   @bug 5012888
+   @summary REGRESSION: Click & hold on arrow of JSpinner only transfers focus
+   @author Konstantin Eremin
+   @run main bug5012888
+*/
+import javax.swing.*;
+import javax.swing.event.*;
+import java.awt.*;
+import java.awt.event.*;
+
+public class bug5012888 extends JFrame {
+    JSpinner spinner1, spinner2;
+    public bug5012888() {
+      spinner1 = new JSpinner(new SpinnerNumberModel(0, -1000, 1000, 1));
+      spinner2 = new JSpinner(new SpinnerNumberModel(1, -1000, 1000, 1));
+      Container pane = getContentPane();
+      pane.setLayout(new BorderLayout());
+      pane.add(spinner1, BorderLayout.NORTH);
+      pane.add(spinner2, BorderLayout.SOUTH);
+    }
+    public void doTest() throws Exception {
+        ((sun.awt.SunToolkit)Toolkit.getDefaultToolkit()).realSync();
+        Point p = spinner2.getLocationOnScreen();
+        Rectangle rect = spinner2.getBounds();
+        Robot robot = new Robot();
+        robot.mouseMove(p.x+rect.width-5, p.y+5);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        Thread.sleep(1000);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        if ( ((Integer) spinner2.getValue()).intValue() == 1 ) {
+            throw new Error("Spinner value should be more than 1");
+        }
+    }
+    public static void main(String[] argv) throws Exception {
+        bug5012888 b = new bug5012888();
+        b.setBounds(0, 0, 100, 100);
+        b.setVisible(true);
+        b.doTest();
+    }
+}
diff --git a/test/sun/misc/Hashing.java b/test/sun/misc/Hashing.java
new file mode 100644
index 0000000..0b5baef
--- /dev/null
+++ b/test/sun/misc/Hashing.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test @summary Ensure that Murmur3 hash performs according to specification.
+ * @compile -XDignore.symbol.file Hashing.java
+ */
+public class Hashing {
+
+    static final byte ONE_BYTE[] = {
+        (byte) 0x80};
+    static final byte TWO_BYTE[] = {
+        (byte) 0x80, (byte) 0x81};
+    static final char ONE_CHAR[] = {
+        (char) 0x8180};
+    static final byte THREE_BYTE[] = {
+        (byte) 0x80, (byte) 0x81, (byte) 0x82};
+    static final byte FOUR_BYTE[] = {
+        (byte) 0x80, (byte) 0x81, (byte) 0x82, (byte) 0x83};
+    static final char TWO_CHAR[] = {
+        (char) 0x8180, (char) 0x8382};
+    static final int ONE_INT[] = {
+        0x83828180};
+    static final byte SIX_BYTE[] = {
+        (byte) 0x80, (byte) 0x81, (byte) 0x82,
+        (byte) 0x83, (byte) 0x84, (byte) 0x85};
+    static final char THREE_CHAR[] = {
+        (char) 0x8180, (char) 0x8382, (char) 0x8584};
+    static final byte EIGHT_BYTE[] = {
+        (byte) 0x80, (byte) 0x81, (byte) 0x82,
+        (byte) 0x83, (byte) 0x84, (byte) 0x85,
+        (byte) 0x86, (byte) 0x87};
+    static final char FOUR_CHAR[] = {
+        (char) 0x8180, (char) 0x8382,
+        (char) 0x8584, (char) 0x8786};
+    static final int TWO_INT[] = {
+        0x83828180, 0x87868584};
+    // per  http://code.google.com/p/smhasher/source/browse/trunk/main.cpp, line:72
+    static final int MURMUR3_32_X86_CHECK_VALUE = 0xB0F57EE3;
+
+    public static void testMurmur3_32_ByteArray() {
+        System.out.println("testMurmur3_32_ByteArray");
+
+        byte[] vector = new byte[256];
+        byte[] hashes = new byte[4 * 256];
+
+        for (int i = 0; i < 256; i++) {
+            vector[i] = (byte) i;
+        }
+
+        // Hash subranges {}, {0}, {0,1}, {0,1,2}, ..., {0,...,255}
+        for (int i = 0; i < 256; i++) {
+            int hash = sun.misc.Hashing.murmur3_32(256 - i, vector, 0, i);
+
+            hashes[i * 4] = (byte) hash;
+            hashes[i * 4 + 1] = (byte) (hash >>> 8);
+            hashes[i * 4 + 2] = (byte) (hash >>> 16);
+            hashes[i * 4 + 3] = (byte) (hash >>> 24);
+        }
+
+        // hash to get final result.
+        int final_hash = sun.misc.Hashing.murmur3_32(0, hashes);
+
+        if (MURMUR3_32_X86_CHECK_VALUE != final_hash) {
+            throw new RuntimeException(
+                    String.format("Calculated hash result not as expected. Expected %08X got %08X",
+                    MURMUR3_32_X86_CHECK_VALUE,
+                    final_hash));
+        }
+    }
+
+    public static void testEquivalentHashes() {
+        int bytes, chars, ints;
+
+        System.out.println("testEquivalentHashes");
+
+        bytes = sun.misc.Hashing.murmur3_32(TWO_BYTE);
+        chars = sun.misc.Hashing.murmur3_32(ONE_CHAR);
+        if (bytes != chars) {
+            throw new RuntimeException(String.format("Hashes did not match. b:%08x != c:%08x", bytes, chars));
+        }
+
+        bytes = sun.misc.Hashing.murmur3_32(FOUR_BYTE);
+        chars = sun.misc.Hashing.murmur3_32(TWO_CHAR);
+        ints = sun.misc.Hashing.murmur3_32(ONE_INT);
+        if ((bytes != chars) || (bytes != ints)) {
+            throw new RuntimeException(String.format("Hashes did not match. b:%08x != c:%08x != i:%08x", bytes, chars, ints));
+        }
+        bytes = sun.misc.Hashing.murmur3_32(SIX_BYTE);
+        chars = sun.misc.Hashing.murmur3_32(THREE_CHAR);
+        if (bytes != chars) {
+            throw new RuntimeException(String.format("Hashes did not match. b:%08x != c:%08x", bytes, chars));
+        }
+
+        bytes = sun.misc.Hashing.murmur3_32(EIGHT_BYTE);
+        chars = sun.misc.Hashing.murmur3_32(FOUR_CHAR);
+        ints = sun.misc.Hashing.murmur3_32(TWO_INT);
+        if ((bytes != chars) || (bytes != ints)) {
+            throw new RuntimeException(String.format("Hashes did not match. b:%08x != c:%08x != i:%08x", bytes, chars, ints));
+        }
+    }
+
+    public static void main(String[] args) {
+        testMurmur3_32_ByteArray();
+        testEquivalentHashes();
+    }
+}
diff --git a/test/sun/nio/ch/SelProvider.java b/test/sun/nio/ch/SelProvider.java
index d0682b6..1674120 100644
--- a/test/sun/nio/ch/SelProvider.java
+++ b/test/sun/nio/ch/SelProvider.java
@@ -31,19 +31,23 @@
 
 public class SelProvider {
     public static void main(String[] args) throws Exception {
-        String osname = System.getProperty("os.name");
-        String osver = System.getProperty("os.version");
-        String spName = SelectorProvider.provider().getClass().getName();
-        String expected = null;
-        if ("SunOS".equals(osname)) {
-            expected = "sun.nio.ch.DevPollSelectorProvider";
-        } else if ("Linux".equals(osname)) {
-            expected = "sun.nio.ch.EPollSelectorProvider";
-        } else if (osname.contains("OS X")) {
-            expected = "sun.nio.ch.KQueueSelectorProvider";
-        } else
-            return;
-        if (!spName.equals(expected))
+        String expected = System.getProperty("java.nio.channels.spi.SelectorProvider");
+        if (expected == null) {
+            String osname = System.getProperty("os.name");
+            String osver = System.getProperty("os.version");
+            if ("SunOS".equals(osname)) {
+                expected = "sun.nio.ch.DevPollSelectorProvider";
+            } else if ("Linux".equals(osname)) {
+                expected = "sun.nio.ch.EPollSelectorProvider";
+            } else if (osname.contains("OS X")) {
+                expected = "sun.nio.ch.KQueueSelectorProvider";
+            } else {
+                return;
+            }
+        }
+        String cn = SelectorProvider.provider().getClass().getName();
+        System.out.println(cn);
+        if (!cn.equals(expected))
             throw new Exception("failed");
     }
 }
diff --git a/test/sun/security/krb5/auto/BadKdc.java b/test/sun/security/krb5/auto/BadKdc.java
index 55a4d99..86a464a 100644
--- a/test/sun/security/krb5/auto/BadKdc.java
+++ b/test/sun/security/krb5/auto/BadKdc.java
@@ -87,6 +87,10 @@
             throws Exception {
         System.setProperty("sun.security.krb5.debug", "true");
 
+        // Idle UDP sockets will trigger a SocketTimeoutException, without it,
+        // a PortUnreachableException will be thrown.
+        DatagramSocket d1 = null, d2 = null, d3 = null;
+
         // Make sure KDCs' ports starts with 1 and 2 and 3,
         // useful for checking debug output.
         int p1 = 10000 + new java.util.Random().nextInt(10000);
@@ -109,6 +113,8 @@
         Config.refresh();
 
         // Turn on k3 only
+        d1 = new DatagramSocket(p1);
+        d2 = new DatagramSocket(p2);
         KDC k3 = on(p3);
 
         test(expected[0]);
@@ -117,10 +123,17 @@
         test(expected[2]);
 
         k3.terminate(); // shutdown k3
+        d3 = new DatagramSocket(p3);
+
+        d2.close();
         on(p2);         // k2 is on
+
         test(expected[3]);
+        d1.close();
         on(p1);         // k1 and k2 is on
         test(expected[4]);
+
+        d3.close();
     }
 
     private static KDC on(int p) throws Exception {
diff --git a/test/sun/security/krb5/auto/KDC.java b/test/sun/security/krb5/auto/KDC.java
index 917c56d..05efabd 100644
--- a/test/sun/security/krb5/auto/KDC.java
+++ b/test/sun/security/krb5/auto/KDC.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -67,10 +67,6 @@
  * <ul>
  * <li>test.kdc.save.ccache
  * </ul>
- * Support policies:
- * <ul>
- * <li>ok-as-delegate
- * </ul>
  * Issues and TODOs:
  * <ol>
  * <li> Generates krb5.conf to be used on another machine, currently the kdc is
@@ -178,6 +174,10 @@
          * Multiple ETYPE-INFO-ENTRY with same etype but different salt
          */
         DUP_ETYPE,
+        /**
+         * What backend server can be delegated to
+         */
+        OK_AS_DELEGATE,
     };
 
     static {
@@ -232,7 +232,11 @@
      * @param obj the value
      */
     public void setOption(Option key, Object value) {
-        options.put(key, value);
+        if (value == null) {
+            options.remove(key);
+        } else {
+            options.put(key, value);
+        }
     }
 
     /**
@@ -579,53 +583,6 @@
         }
     }
 
-    private Map<String,String> policies = new HashMap<>();
-
-    public void setPolicy(String rule, String value) {
-        if (value == null) {
-            policies.remove(rule);
-        } else {
-            policies.put(rule, value);
-        }
-    }
-    /**
-     * If the provided client/server pair matches a rule
-     *
-     * A system property named test.kdc.policy.RULE will be consulted.
-     * If it's unset, returns false. If its value is "", any pair is
-     * matched. Otherwise, it should contains the server name matched.
-     *
-     * TODO: client name is not used currently.
-     *
-     * @param c client name
-     * @param s server name
-     * @param rule rule name
-     * @return if a match is found
-     */
-    private boolean configMatch(String c, String s, String rule) {
-        String policy = policies.get(rule);
-        boolean result = false;
-        if (policy == null) {
-            result = false;
-        } else if (policy.length() == 0) {
-            result = true;
-        } else {
-            String[] names = policy.split("\\s+");
-            for (String name: names) {
-                if (name.equals(s)) {
-                    result = true;
-                    break;
-                }
-            }
-        }
-        if (result) {
-            System.out.printf(">>>> Policy match result (%s vs %s on %s) %b\n",
-                    c, s, rule, result);
-        }
-        return result;
-    }
-
-
     /**
      * Processes an incoming request and generates a response.
      * @param in the request
@@ -724,7 +681,10 @@
                 bFlags[Krb5.TKT_OPTS_MAY_POSTDATE] = true;
             }
 
-            if (configMatch("", service.getNameString(), "ok-as-delegate")) {
+            String okAsDelegate = (String)options.get(Option.OK_AS_DELEGATE);
+            if (okAsDelegate != null && (
+                    okAsDelegate.isEmpty() ||
+                    okAsDelegate.contains(service.getNameString()))) {
                 bFlags[Krb5.TKT_OPTS_DELEGATE] = true;
             }
             bFlags[Krb5.TKT_OPTS_INITIAL] = true;
diff --git a/test/sun/security/krb5/auto/MaxRetries.java b/test/sun/security/krb5/auto/MaxRetries.java
index fec1bec..f4f86a3 100644
--- a/test/sun/security/krb5/auto/MaxRetries.java
+++ b/test/sun/security/krb5/auto/MaxRetries.java
@@ -24,11 +24,13 @@
 /*
  * @test
  * @bug 6844193
+ * @compile -XDignore.symbol.file MaxRetries.java
  * @run main/othervm/timeout=300 MaxRetries
  * @summary support max_retries in krb5.conf
  */
 
 import java.io.*;
+import java.net.DatagramSocket;
 import java.security.Security;
 
 public class MaxRetries {
@@ -37,6 +39,10 @@
 
         System.setProperty("sun.security.krb5.debug", "true");
         new OneKDC(null).writeJAASConf();
+
+        // An idle UDP socket to revent PortUnreachableException
+        DatagramSocket ds = new DatagramSocket(33333);
+
         System.setProperty("java.security.krb5.conf", "alternative-krb5.conf");
 
         // For tryLast
@@ -78,6 +84,8 @@
 
         rewriteUdpPrefLimit(10000, 10); // realm rules
         test2("TCP");
+
+        ds.close();
     }
 
     /**
diff --git a/test/sun/security/krb5/auto/OkAsDelegate.java b/test/sun/security/krb5/auto/OkAsDelegate.java
index 435af26..9037634 100644
--- a/test/sun/security/krb5/auto/OkAsDelegate.java
+++ b/test/sun/security/krb5/auto/OkAsDelegate.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,6 +21,32 @@
  * questions.
  */
 
+/*
+ * @test
+ * @bug 6853328 7172701
+ * @run main/othervm OkAsDelegate false true true false false false
+ *      FORWARDABLE ticket not allowed, always fail
+ * @run main/othervm OkAsDelegate true false false false false false
+ *      Service ticket no OK-AS-DELEGATE. Request nothing, gain nothing
+ * @run main/othervm OkAsDelegate true false true false false false
+ *      Service ticket no OK-AS-DELEGATE. Request deleg policy, gain nothing
+ * @run main/othervm OkAsDelegate true true false true false true
+ *      Service ticket no OK-AS-DELEGATE. Request deleg, granted
+ * @run main/othervm OkAsDelegate true true true true false true
+ *      Service ticket no OK-AS-DELEGATE. Request deleg and deleg policy, granted, with info not by policy
+ * @run main/othervm -Dtest.kdc.policy.ok-as-delegate OkAsDelegate true false true true true true
+ *      Service ticket has OK-AS-DELEGATE. Request deleg policy, granted
+ * @run main/othervm -Dtest.kdc.policy.ok-as-delegate OkAsDelegate true true true true true true
+ *      Service ticket has OK-AS-DELEGATE. granted, with info by policy
+ * @run main/othervm -Dtest.spnego OkAsDelegate false true true false false false
+ * @run main/othervm -Dtest.spnego OkAsDelegate true false false false false false
+ * @run main/othervm -Dtest.spnego OkAsDelegate true false true false false false
+ * @run main/othervm -Dtest.spnego OkAsDelegate true true false true false true
+ * @run main/othervm -Dtest.spnego OkAsDelegate true true true true false true
+ * @run main/othervm -Dtest.spnego -Dtest.kdc.policy.ok-as-delegate OkAsDelegate true false true true true true
+ * @run main/othervm -Dtest.spnego -Dtest.kdc.policy.ok-as-delegate OkAsDelegate true true true true true true
+ * @summary Support OK-AS-DELEGATE flag
+ */
 import com.sun.security.jgss.ExtendedGSSContext;
 import org.ietf.jgss.GSSCredential;
 import org.ietf.jgss.GSSException;
@@ -52,7 +78,7 @@
             boolean delegated
             ) throws Exception {
         OneKDC kdc = new OneKDC(null);
-        kdc.setPolicy("ok-as-delegate",
+        kdc.setOption(KDC.Option.OK_AS_DELEGATE,
                 System.getProperty("test.kdc.policy.ok-as-delegate"));
         kdc.writeJAASConf();
         if (!forwardable) {
diff --git a/test/sun/security/krb5/auto/OkAsDelegateXRealm.java b/test/sun/security/krb5/auto/OkAsDelegateXRealm.java
index 7d85599..4607619 100644
--- a/test/sun/security/krb5/auto/OkAsDelegateXRealm.java
+++ b/test/sun/security/krb5/auto/OkAsDelegateXRealm.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,8 +21,19 @@
  * questions.
  */
 
-import com.sun.security.jgss.ExtendedGSSContext;
-import java.io.File;
+/*
+ * @test
+ * @bug 6853328 7172701
+ * @run main/othervm OkAsDelegateXRealm false
+ *      KDC no OK-AS-DELEGATE, fail
+ * @run main/othervm -Dtest.kdc.policy.ok-as-delegate OkAsDelegateXRealm true
+ *      KDC set OK-AS-DELEGATE for all, succeed
+ * @run main/othervm -Dtest.kdc.policy.ok-as-delegate=host/host.r3.local OkAsDelegateXRealm false
+ *      KDC set OK-AS-DELEGATE for host/host.r3.local only, fail
+ * @run main/othervm -Dtest.kdc.policy.ok-as-delegate=host/host.r3.local,krbtgt/R2,krbtgt/R3 OkAsDelegateXRealm true
+ *      KDC set OK-AS-DELEGATE for all three, succeed
+ * @summary Support OK-AS-DELEGATE flag
+ */
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.security.Security;
@@ -31,11 +42,7 @@
 import javax.security.auth.callback.NameCallback;
 import javax.security.auth.callback.PasswordCallback;
 import javax.security.auth.callback.UnsupportedCallbackException;
-import org.ietf.jgss.GSSContext;
-import org.ietf.jgss.GSSCredential;
 import org.ietf.jgss.GSSException;
-import org.ietf.jgss.GSSManager;
-import org.ietf.jgss.GSSName;
 import sun.security.jgss.GSSUtil;
 import sun.security.krb5.Config;
 
@@ -50,21 +57,21 @@
         // Create and start the KDCs. Here we have 3 realms: R1, R2 and R3.
         // R1 is trusted by R2, and R2 trusted by R3.
         KDC kdc1 = KDC.create("R1");
-        kdc1.setPolicy("ok-as-delegate",
+        kdc1.setOption(KDC.Option.OK_AS_DELEGATE,
                 System.getProperty("test.kdc.policy.ok-as-delegate"));
         kdc1.addPrincipal("dummy", "bogus".toCharArray());
         kdc1.addPrincipalRandKey("krbtgt/R1");
         kdc1.addPrincipal("krbtgt/R2@R1", "r1->r2".toCharArray());
 
         KDC kdc2 = KDC.create("R2");
-        kdc2.setPolicy("ok-as-delegate",
+        kdc2.setOption(KDC.Option.OK_AS_DELEGATE,
                 System.getProperty("test.kdc.policy.ok-as-delegate"));
         kdc2.addPrincipalRandKey("krbtgt/R2");
         kdc2.addPrincipal("krbtgt/R2@R1", "r1->r2".toCharArray());
         kdc2.addPrincipal("krbtgt/R3@R2", "r2->r3".toCharArray());
 
         KDC kdc3 = KDC.create("R3");
-        kdc3.setPolicy("ok-as-delegate",
+        kdc3.setOption(KDC.Option.OK_AS_DELEGATE,
                 System.getProperty("test.kdc.policy.ok-as-delegate"));
         kdc3.addPrincipalRandKey("krbtgt/R3");
         kdc3.addPrincipal("krbtgt/R3@R2", "r2->r3".toCharArray());
diff --git a/test/sun/security/krb5/auto/TcpTimeout.java b/test/sun/security/krb5/auto/TcpTimeout.java
index df71d7c..6f55391 100644
--- a/test/sun/security/krb5/auto/TcpTimeout.java
+++ b/test/sun/security/krb5/auto/TcpTimeout.java
@@ -24,6 +24,7 @@
 /*
  * @test
  * @bug 6952519
+ * @compile -XDignore.symbol.file TcpTimeout.java
  * @run main/othervm TcpTimeout
  * @summary kdc_timeout is not being honoured when using TCP
  */
@@ -73,9 +74,7 @@
         // 5 sec on p1, 5 sec on p1, fail
         // 5 sec on p2, 5 sec on p2, fail
         // p3 ok, p3 ok again for preauth.
-        // The total time should be 20sec + 2x. x is processing time for AS-REQ.
         int count = 6;
-        long start = System.currentTimeMillis();
 
         ByteArrayOutputStream bo = new ByteArrayOutputStream();
         PrintStream oldout = System.out;
@@ -93,10 +92,5 @@
         if (count != 0) {
             throw new Exception("Retry count is " + count + " less");
         }
-
-        long end = System.currentTimeMillis();
-        if ((end - start)/1000L < 20) {
-            throw new Exception("Too fast? " + (end - start)/1000L);
-        }
     }
 }
diff --git a/test/sun/security/krb5/auto/Unreachable.java b/test/sun/security/krb5/auto/Unreachable.java
new file mode 100644
index 0000000..5233978
--- /dev/null
+++ b/test/sun/security/krb5/auto/Unreachable.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7162687
+ * @summary enhance KDC server availability detection
+ * @compile -XDignore.symbol.file Unreachable.java
+ * @run main/othervm/timeout=10 Unreachable
+ */
+
+import java.io.File;
+import javax.security.auth.login.LoginException;
+import sun.security.krb5.Config;
+
+public class Unreachable {
+
+    public static void main(String[] args) throws Exception {
+        File f = new File(
+                System.getProperty("test.src", "."), "unreachable.krb5.conf");
+        System.setProperty("java.security.krb5.conf", f.getPath());
+        Config.refresh();
+
+        // If PortUnreachableException is not received, the login will consume
+        // about 3*3*30 seconds and the test will timeout.
+        try {
+            Context.fromUserPass("name", "pass".toCharArray(), true);
+        } catch (LoginException le) {
+            // This is OK
+        }
+    }
+}
diff --git a/test/sun/security/krb5/auto/ok-as-delegate-xrealm.sh b/test/sun/security/krb5/auto/ok-as-delegate-xrealm.sh
deleted file mode 100644
index eb66f1c..0000000
--- a/test/sun/security/krb5/auto/ok-as-delegate-xrealm.sh
+++ /dev/null
@@ -1,79 +0,0 @@
-#
-# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# @test
-# @bug 6853328
-# @summary Support OK-AS-DELEGATE flag
-# @run shell/timeout=600 ok-as-delegate-xrealm.sh
-#
-
-if [ "${TESTSRC}" = "" ] ; then
-  TESTSRC=`dirname $0`
-fi
-
-if [ "${TESTJAVA}" = "" ] ; then
-  JAVAC_CMD=`which javac`
-  TESTJAVA=`dirname $JAVAC_CMD`/..
-fi
-
-# set platform-dependent variables
-OS=`uname -s`
-case "$OS" in
-  Windows_* )
-    FS="\\"
-    SEP=";"
-    ;;
-  CYGWIN* )
-    FS="/"
-    SEP=";"
-    ;;
-  * )
-    FS="/"
-    SEP=":"
-    ;;
-esac
-
-${TESTJAVA}${FS}bin${FS}javac -XDignore.symbol.file -d . \
-    ${TESTSRC}${FS}OkAsDelegateXRealm.java \
-    ${TESTSRC}${FS}KDC.java \
-    ${TESTSRC}${FS}OneKDC.java \
-    ${TESTSRC}${FS}Action.java \
-    ${TESTSRC}${FS}Context.java \
-    || exit 10
-
-# Add $TESTSRC to classpath so that customized nameservice can be used
-J="${TESTJAVA}${FS}bin${FS}java -cp $TESTSRC${SEP}."
-
-# KDC no OK-AS-DELEGATE, fail
-$J OkAsDelegateXRealm false || exit 1
-
-# KDC set OK-AS-DELEGATE for all, succeed
-$J -Dtest.kdc.policy.ok-as-delegate OkAsDelegateXRealm true || exit 2
-
-# KDC set OK-AS-DELEGATE for host/host.r3.local only, fail
-$J -Dtest.kdc.policy.ok-as-delegate=host/host.r3.local OkAsDelegateXRealm false || exit 3
-
-# KDC set OK-AS-DELEGATE for all, succeed
-$J "-Dtest.kdc.policy.ok-as-delegate=host/host.r3.local krbtgt/R2 krbtgt/R3" OkAsDelegateXRealm true || exit 4
-
-exit 0
diff --git a/test/sun/security/krb5/auto/ok-as-delegate.sh b/test/sun/security/krb5/auto/ok-as-delegate.sh
deleted file mode 100644
index 592bf49..0000000
--- a/test/sun/security/krb5/auto/ok-as-delegate.sh
+++ /dev/null
@@ -1,118 +0,0 @@
-#
-# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# @test
-# @bug 6853328
-# @summary Support OK-AS-DELEGATE flag
-# @run shell/timeout=600 ok-as-delegate.sh
-#
-
-if [ "${TESTSRC}" = "" ] ; then
-  TESTSRC=`dirname $0`
-fi
-
-if [ "${TESTJAVA}" = "" ] ; then
-  JAVAC_CMD=`which javac`
-  TESTJAVA=`dirname $JAVAC_CMD`/..
-fi
-
-# set platform-dependent variables
-OS=`uname -s`
-case "$OS" in
-  Windows_* )
-    FS="\\"
-    SEP=";"
-    ;;
-  CYGWIN* )
-    FS="/"
-    SEP=";"
-    ;;
-  * )
-    FS="/"
-    SEP=":"
-    ;;
-esac
-
-${TESTJAVA}${FS}bin${FS}javac -XDignore.symbol.file -d . \
-    ${TESTSRC}${FS}OkAsDelegate.java \
-    ${TESTSRC}${FS}KDC.java \
-    ${TESTSRC}${FS}OneKDC.java \
-    ${TESTSRC}${FS}Action.java \
-    ${TESTSRC}${FS}Context.java \
-    || exit 10
-
-# Testing Kerberos 5
-
-# Add $TESTSRC to classpath so that customized nameservice can be used
-J="${TESTJAVA}${FS}bin${FS}java -cp $TESTSRC${SEP}. OkAsDelegate"
-JOK="${TESTJAVA}${FS}bin${FS}java -cp $TESTSRC${SEP}. -Dtest.kdc.policy.ok-as-delegate OkAsDelegate"
-
-# FORWARDABLE ticket not allowed, always fail
-$J false true true false false false || exit 1
-
-# Service ticket no OK-AS-DELEGATE
-
-# Request nothing, gain nothing
-$J true false false false false false || exit 2
-# Request deleg policy, gain nothing
-$J true false true false false false || exit 3
-# Request deleg, granted
-$J true true false true false true || exit 4
-# Request deleg and deleg policy, granted, with info not by policy
-$J true true true true false true || exit 5
-
-# Service ticket has OK-AS-DELEGATE
-
-# Request deleg policy, granted
-$JOK true false true true true true || exit 6
-# Request deleg and deleg policy, granted, with info by policy
-$JOK true true true true true true || exit 7
-
-# Testing SPNEGO
-
-# Add $TESTSRC to classpath so that customized nameservice can be used
-J="${TESTJAVA}${FS}bin${FS}java -cp $TESTSRC${SEP}. -Dtest.spnego OkAsDelegate"
-JOK="${TESTJAVA}${FS}bin${FS}java -cp $TESTSRC${SEP}. -Dtest.spnego -Dtest.kdc.policy.ok-as-delegate OkAsDelegate"
-
-# FORWARDABLE ticket not allowed, always fail
-$J false true true false false false || exit 11
-
-# Service ticket no OK-AS-DELEGATE
-
-# Request nothing, gain nothing
-$J true false false false false false || exit 12
-# Request deleg policy, gain nothing
-$J true false true false false false || exit 13
-# Request deleg, granted
-$J true true false true false true || exit 14
-# Request deleg and deleg policy, granted, with info not by policy
-$J true true true true false true || exit 15
-
-# Service ticket has OK-AS-DELEGATE
-
-# Request deleg policy, granted
-$JOK true false true true true true || exit 16
-# Request deleg and deleg policy, granted, with info by policy
-$JOK true true true true true true || exit 17
-
-exit 0
diff --git a/test/sun/security/krb5/auto/unreachable.krb5.conf b/test/sun/security/krb5/auto/unreachable.krb5.conf
new file mode 100644
index 0000000..8ff4cc1
--- /dev/null
+++ b/test/sun/security/krb5/auto/unreachable.krb5.conf
@@ -0,0 +1,9 @@
+[libdefaults]
+   default_realm = RABBIT.HOLE
+[realms]
+
+RABBIT.HOLE = {
+   kdc = 127.0.0.1:13434
+   kdc = 127.0.0.1:13435
+   kdc = 127.0.0.1:13436
+}
diff --git a/test/sun/security/ssl/sanity/ciphersuites/CipherSuitesInOrder.java b/test/sun/security/ssl/sanity/ciphersuites/CipherSuitesInOrder.java
new file mode 100644
index 0000000..3d081c1
--- /dev/null
+++ b/test/sun/security/ssl/sanity/ciphersuites/CipherSuitesInOrder.java
@@ -0,0 +1,236 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7174244
+ * @summary NPE in Krb5ProxyImpl.getServerKeys()
+ *
+ *     SunJSSE does not support dynamic system properties, no way to re-use
+ *     system properties in samevm/agentvm mode.
+ * @run main/othervm CipherSuitesInOrder
+ */
+
+import java.util.*;
+import javax.net.ssl.*;
+
+public class CipherSuitesInOrder {
+
+    // supported ciphersuites
+    private final static List<String> supportedCipherSuites =
+            Arrays.<String>asList(
+        "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384",
+        "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384",
+        "TLS_RSA_WITH_AES_256_CBC_SHA256",
+        "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384",
+        "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384",
+        "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256",
+        "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256",
+        "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA",
+        "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA",
+        "TLS_RSA_WITH_AES_256_CBC_SHA",
+        "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA",
+        "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA",
+        "TLS_DHE_RSA_WITH_AES_256_CBC_SHA",
+        "TLS_DHE_DSS_WITH_AES_256_CBC_SHA",
+        "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256",
+        "TLS_RSA_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256",
+        "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256",
+        "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA",
+        "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
+        "TLS_RSA_WITH_AES_128_CBC_SHA",
+        "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA",
+        "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA",
+        "TLS_DHE_RSA_WITH_AES_128_CBC_SHA",
+        "TLS_DHE_DSS_WITH_AES_128_CBC_SHA",
+        "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
+        "TLS_ECDHE_RSA_WITH_RC4_128_SHA",
+        "SSL_RSA_WITH_RC4_128_SHA",
+        "TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
+        "TLS_ECDH_RSA_WITH_RC4_128_SHA",
+        "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA",
+        "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA",
+        "SSL_RSA_WITH_3DES_EDE_CBC_SHA",
+        "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA",
+        "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA",
+        "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA",
+        "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA",
+        "SSL_RSA_WITH_RC4_128_MD5",
+
+        "TLS_EMPTY_RENEGOTIATION_INFO_SCSV",
+
+        "TLS_DH_anon_WITH_AES_256_CBC_SHA256",
+        "TLS_ECDH_anon_WITH_AES_256_CBC_SHA",
+        "TLS_DH_anon_WITH_AES_256_CBC_SHA",
+        "TLS_DH_anon_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDH_anon_WITH_AES_128_CBC_SHA",
+        "TLS_DH_anon_WITH_AES_128_CBC_SHA",
+        "TLS_ECDH_anon_WITH_RC4_128_SHA",
+        "SSL_DH_anon_WITH_RC4_128_MD5",
+        "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA",
+        "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA",
+        "TLS_RSA_WITH_NULL_SHA256",
+        "TLS_ECDHE_ECDSA_WITH_NULL_SHA",
+        "TLS_ECDHE_RSA_WITH_NULL_SHA",
+        "SSL_RSA_WITH_NULL_SHA",
+        "TLS_ECDH_ECDSA_WITH_NULL_SHA",
+        "TLS_ECDH_RSA_WITH_NULL_SHA",
+        "TLS_ECDH_anon_WITH_NULL_SHA",
+        "SSL_RSA_WITH_NULL_MD5",
+        "SSL_RSA_WITH_DES_CBC_SHA",
+        "SSL_DHE_RSA_WITH_DES_CBC_SHA",
+        "SSL_DHE_DSS_WITH_DES_CBC_SHA",
+        "SSL_DH_anon_WITH_DES_CBC_SHA",
+        "SSL_RSA_EXPORT_WITH_RC4_40_MD5",
+        "SSL_DH_anon_EXPORT_WITH_RC4_40_MD5",
+        "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA",
+        "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA",
+        "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA",
+        "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA",
+        "TLS_KRB5_WITH_RC4_128_SHA",
+        "TLS_KRB5_WITH_RC4_128_MD5",
+        "TLS_KRB5_WITH_3DES_EDE_CBC_SHA",
+        "TLS_KRB5_WITH_3DES_EDE_CBC_MD5",
+        "TLS_KRB5_WITH_DES_CBC_SHA",
+        "TLS_KRB5_WITH_DES_CBC_MD5",
+        "TLS_KRB5_EXPORT_WITH_RC4_40_SHA",
+        "TLS_KRB5_EXPORT_WITH_RC4_40_MD5",
+        "TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA",
+        "TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5"
+    );
+
+    private final static String[] protocols = {
+        "", "SSL", "TLS", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"
+    };
+
+
+    public static void main(String[] args) throws Exception {
+        // show all of the supported cipher suites
+        showSuites(supportedCipherSuites.toArray(new String[0]),
+                                "All supported cipher suites");
+
+        for (String protocol : protocols) {
+            System.out.println("//");
+            System.out.println("// " +
+                        "Testing for SSLContext of " + protocol);
+            System.out.println("//");
+            checkForProtocols(protocol);
+        }
+    }
+
+    public static void checkForProtocols(String protocol) throws Exception {
+        SSLContext context;
+        if (protocol.isEmpty()) {
+            context = SSLContext.getDefault();
+        } else {
+            context = SSLContext.getInstance(protocol);
+            context.init(null, null, null);
+        }
+
+        // check the order of default cipher suites of SSLContext
+        SSLParameters parameters = context.getDefaultSSLParameters();
+        checkSuites(parameters.getCipherSuites(),
+                "Default cipher suites in SSLContext");
+
+        // check the order of supported cipher suites of SSLContext
+        parameters = context.getSupportedSSLParameters();
+        checkSuites(parameters.getCipherSuites(),
+                "Supported cipher suites in SSLContext");
+
+
+        //
+        // Check the cipher suites order of SSLEngine
+        //
+        SSLEngine engine = context.createSSLEngine();
+
+        // check the order of endabled cipher suites
+        String[] ciphers = engine.getEnabledCipherSuites();
+        checkSuites(ciphers,
+                "Enabled cipher suites in SSLEngine");
+
+        // check the order of supported cipher suites
+        ciphers = engine.getSupportedCipherSuites();
+        checkSuites(ciphers,
+                "Supported cipher suites in SSLEngine");
+
+        //
+        // Check the cipher suites order of SSLSocket
+        //
+        SSLSocketFactory factory = context.getSocketFactory();
+        try (SSLSocket socket = (SSLSocket)factory.createSocket()) {
+
+            // check the order of endabled cipher suites
+            ciphers = socket.getEnabledCipherSuites();
+            checkSuites(ciphers,
+                "Enabled cipher suites in SSLSocket");
+
+            // check the order of supported cipher suites
+            ciphers = socket.getSupportedCipherSuites();
+            checkSuites(ciphers,
+                "Supported cipher suites in SSLSocket");
+        }
+
+        //
+        // Check the cipher suites order of SSLServerSocket
+        //
+        SSLServerSocketFactory serverFactory = context.getServerSocketFactory();
+        try (SSLServerSocket serverSocket =
+                (SSLServerSocket)serverFactory.createServerSocket()) {
+            // check the order of endabled cipher suites
+            ciphers = serverSocket.getEnabledCipherSuites();
+            checkSuites(ciphers,
+                "Enabled cipher suites in SSLServerSocket");
+
+            // check the order of supported cipher suites
+            ciphers = serverSocket.getSupportedCipherSuites();
+            checkSuites(ciphers,
+                "Supported cipher suites in SSLServerSocket");
+        }
+    }
+
+    private static void checkSuites(String[] suites, String title) {
+        showSuites(suites, title);
+
+        int loc = -1;
+        int index = 0;
+        for (String suite : suites) {
+            index = supportedCipherSuites.indexOf(suite);
+            if (index <= loc) {
+                throw new RuntimeException(suite + " is not in order");
+            }
+
+            loc = index;
+        }
+    }
+
+    private static void showSuites(String[] suites, String title) {
+        System.out.println(title + "[" + suites.length + "]:");
+        for (String suite : suites) {
+            System.out.println("  " + suite);
+        }
+    }
+}
diff --git a/test/sun/security/tools/keytool/KeyToolTest.java b/test/sun/security/tools/keytool/KeyToolTest.java
index ab7474a..573f9be 100644
--- a/test/sun/security/tools/keytool/KeyToolTest.java
+++ b/test/sun/security/tools/keytool/KeyToolTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -453,12 +453,17 @@
         assertTrue(err.indexOf("not imported") != -1, "Not imported");
         assertTrue(err.indexOf("Cannot store non-PrivateKeys") != -1, "Not imported");
 
+        // Importing a JCEKS keystore to a JKS one. Will warn for the 2 SecretKey entries
+
         remove("x.jks");
+        // Two "no" answers to bypass warnings
         testOK("\n\n", "-srcstorepass changeit -deststorepass changeit -importkeystore -srckeystore x.jceks -srcstoretype JCEKS -destkeystore x.jks -deststoretype JKS"); // normal
         assertTrue(err.indexOf("s1 not") != -1, "s1 not");
         assertTrue(err.indexOf("s2 not") != -1, "s2 not");
         assertTrue(err.indexOf("c1 success") != -1, "c1 success");
         assertTrue(err.indexOf("p1 success") != -1, "p1 success");
+        remove("x.jks");
+        // One "yes" to stop
         testOK("yes\n", "-srcstorepass changeit -deststorepass changeit -importkeystore -srckeystore x.jceks -srcstoretype JCEKS -destkeystore x.jks -deststoretype JKS"); // normal
         // maybe c1 or p1 has been imported before s1 or s2 is touched, anyway we know yesNo is only asked once.
 
diff --git a/test/sun/text/resources/LocaleData b/test/sun/text/resources/LocaleData
index 6a86870..2bdaf6b 100644
--- a/test/sun/text/resources/LocaleData
+++ b/test/sun/text/resources/LocaleData
@@ -7029,3 +7029,8 @@
 
 # bug 7028073
 CurrencyNames/es_PE/PEN=S/.
+
+# bug 7171028
+FormatData/sl/DateTimePatterns/4=EEEE, dd. MMMM y
+FormatData/sl/DateTimePatterns/5=dd. MMMM y
+
diff --git a/test/sun/text/resources/LocaleDataTest.java b/test/sun/text/resources/LocaleDataTest.java
index 553593f..32a4a92 100644
--- a/test/sun/text/resources/LocaleDataTest.java
+++ b/test/sun/text/resources/LocaleDataTest.java
@@ -34,7 +34,7 @@
  *      6509039 6609737 6610748 6645271 6507067 6873931 6450945 6645268 6646611
  *      6645405 6650730 6910489 6573250 6870908 6585666 6716626 6914413 6916787
  *      6919624 6998391 7019267 7020960 7025837 7020583 7036905 7066203 7101495
- *      7003124 7085757 7028073
+ *      7003124 7085757 7028073 7171028
  * @summary Verify locale data
  *
  */
diff --git a/test/tools/pack200/PackageVersionTest.java b/test/tools/pack200/PackageVersionTest.java
index 8569781..fe6d5d9 100644
--- a/test/tools/pack200/PackageVersionTest.java
+++ b/test/tools/pack200/PackageVersionTest.java
@@ -24,7 +24,7 @@
 
 /*
  * @test
- * @bug 6712743 6991164
+ * @bug 6712743 6991164 7168401
  * @summary verify package versions
  * @compile -XDignore.symbol.file Utils.java PackageVersionTest.java
  * @run main PackageVersionTest
@@ -71,8 +71,9 @@
         verifyPack("Test6.class", JAVA6_PACKAGE_MAJOR_VERSION,
                 JAVA6_PACKAGE_MINOR_VERSION);
 
-        verifyPack("Test7.class", JAVA7_PACKAGE_MAJOR_VERSION,
-                JAVA7_PACKAGE_MINOR_VERSION);
+        // a jar file devoid of indy classes must generate 160.1 package file
+        verifyPack("Test7.class", JAVA6_PACKAGE_MAJOR_VERSION,
+                JAVA6_PACKAGE_MINOR_VERSION);
 
         // test for resource file, ie. no class files
         verifyPack("Test6.java", JAVA5_PACKAGE_MAJOR_VERSION,
@@ -84,7 +85,7 @@
         String versionStr = unpacker.toString();
         String expected = "Pack200, Vendor: " +
                 System.getProperty("java.vendor") + ", Version: " +
-                JAVA6_PACKAGE_MAJOR_VERSION + "." + JAVA6_PACKAGE_MINOR_VERSION;
+                JAVA7_PACKAGE_MAJOR_VERSION + "." + JAVA7_PACKAGE_MINOR_VERSION;
         if (!versionStr.equals(expected)) {
             System.out.println("Expected: " + expected);
             System.out.println("Obtained: " + versionStr);