changeset 4853:9de1dbf8c9be

Merge
author lana
date Wed, 26 Oct 2011 17:59:13 -0700
parents a7a001378444 (current diff) 7ab0d613cd1a (diff)
children 76defa20906a
files src/share/classes/java/util/XMLUtils.java src/share/classes/sun/tools/jar/JarImageSource.java
diffstat 352 files changed, 5267 insertions(+), 2568 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Mon Oct 24 09:58:47 2011 -0700
+++ b/.hgtags	Wed Oct 26 17:59:13 2011 -0700
@@ -127,3 +127,8 @@
 7989ee9fe673a87f4db3917fa6a005732a6a9b85 jdk8-b03
 fc569517f3cf242f90ce3503b743eb5553938946 jdk8-b04
 0b32369b83d81c226a2e79e730f3a8c0d2595e92 jdk8-b05
+bdb870cc269ef8b221d17a217be89092400b59d2 jdk8-b06
+19f0a3db863cc491affc78b48c4a81a6679b2433 jdk8-b07
+1c023bcd0c5a01ac07bc7eea728aafbb0d8991e9 jdk8-b08
+f1ec21b8142168ff40f3278d2f6b5fe4bd5f3b26 jdk8-b09
+4788745572ef2bde34924ef34e7e4d55ba07e979 jdk8-b10
--- a/make/com/sun/net/httpserver/Makefile	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/com/sun/net/httpserver/Makefile	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
 BUILDDIR = ../../../..
 PACKAGE = com.sun.net.httpserver
 PRODUCT = sun
+JAVAC_MAX_WARNINGS = true
+JAVAC_WARNINGS_FATAL = true
 include $(BUILDDIR)/common/Defs.gmk
 
 #
--- a/make/com/sun/net/ssl/Makefile	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/com/sun/net/ssl/Makefile	Wed Oct 26 17:59:13 2011 -0700
@@ -26,6 +26,9 @@
 BUILDDIR = ../../../..
 PACKAGE = com.sun.net.ssl
 PRODUCT = sun
+JAVAC_LINT_OPTIONS=-Xlint:all,-deprecation
+JAVAC_MAX_WARNINGS = true
+JAVAC_WARNINGS_FATAL = true
 include $(BUILDDIR)/common/Defs.gmk
 
 #
--- a/make/com/sun/org/apache/xml/Makefile	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/com/sun/org/apache/xml/Makefile	Wed Oct 26 17:59:13 2011 -0700
@@ -30,6 +30,8 @@
 BUILDDIR = ../../../../..
 PACKAGE = com.sun.org.apache.xml
 PRODUCT = xml
+JAVAC_MAX_WARNINGS = true
+JAVAC_WARNINGS_FATAL = true
 include $(BUILDDIR)/common/Defs.gmk
 
 #
--- a/make/common/Defs-linux.gmk	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/common/Defs-linux.gmk	Wed Oct 26 17:59:13 2011 -0700
@@ -74,6 +74,57 @@
 CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required!
 CC_PROGRAM_OUTPUT_FLAG = -o #trailing blank required!
 
+# Default OBJCOPY comes from GNU Binutils on Linux:
+DEF_OBJCOPY=/usr/bin/objcopy
+ifdef CROSS_COMPILE_ARCH
+  # don't try to generate .debuginfo files when cross compiling
+  _JUNK_ := $(shell \
+    echo >&2 "INFO: cross compiling for ARCH $(CROSS_COMPILE_ARCH)," \
+      "skipping .debuginfo generation.")
+  OBJCOPY=
+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
+endif
+
+ifdef LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS
+# The setting of OBJCOPY above enables the JDK build to import
+# .debuginfo files from the HotSpot build. However, adding FDS
+# support to the JDK build will occur in phases so a different
+# make variable is used to indicate that a particular library
+# supports FDS.
+
+ifeq ($(OBJCOPY),)
+  _JUNK_ := $(shell \
+    echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
+else
+  _JUNK_ := $(shell \
+    echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
+
+  # Library stripping policies for .debuginfo configs:
+  #   all_strip - strips everything from the library
+  #   min_strip - strips most stuff from the library; leaves minimum symbols
+  #   no_strip  - does not strip the library at all
+  #
+  # Oracle security policy requires "all_strip". A waiver was granted on
+  # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
+  #
+  DEF_STRIP_POLICY="min_strip"
+  ifeq ($(ALT_STRIP_POLICY),)
+    STRIP_POLICY=$(DEF_STRIP_POLICY)
+  else
+    STRIP_POLICY=$(ALT_STRIP_POLICY)
+  endif
+
+  _JUNK_ := $(shell \
+    echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
+endif
+endif
+
 #
 # Default optimization
 #
@@ -322,6 +373,7 @@
 override LIBPOSIX4               =
 override LIBSOCKET               =
 override LIBNSL                  =
+override LIBSCF                  =
 override LIBTHREAD               =
 override MOOT_PRIORITIES         = true
 override NO_INTERRUPTIBLE_IO     = true
@@ -359,6 +411,7 @@
 # Settings for the JDI - Serviceability Agent binding.
 HOTSPOT_SALIB_PATH   = $(HOTSPOT_IMPORT_PATH)/jre/lib/$(LIBARCH)
 SALIB_NAME = $(LIB_PREFIX)saproc.$(LIBRARY_SUFFIX)
+SA_DEBUGINFO_NAME = $(LIB_PREFIX)saproc.debuginfo
 
 # The JDI - Serviceability Agent binding is not currently supported
 # on Linux-ia64.
--- a/make/common/Defs-solaris.gmk	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/common/Defs-solaris.gmk	Wed Oct 26 17:59:13 2011 -0700
@@ -74,6 +74,69 @@
 CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required!
 CC_PROGRAM_OUTPUT_FLAG = -o #trailing blank required!
 
+ifdef ENABLE_FULL_DEBUG_SYMBOLS
+# Only check for Full Debug Symbols support on Solaris if it is
+# specifically enabled. Hopefully, it can be enabled by default
+# once the .debuginfo size issues are worked out.
+
+# 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
+endif
+
+ifdef LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS
+# The setting of OBJCOPY above enables the JDK build to import
+# .debuginfo files from the HotSpot build. However, adding FDS
+# support to the JDK build will occur in phases so a different
+# make variable is used to indicate that a particular library
+# supports FDS.
+
+ifeq ($(OBJCOPY),)
+  _JUNK_ := $(shell \
+    echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
+else
+  _JUNK_ := $(shell \
+    echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
+
+  # Library stripping policies for .debuginfo configs:
+  #   all_strip - strips everything from the library
+  #   min_strip - strips most stuff from the library; leaves minimum symbols
+  #   no_strip  - does not strip the library at all
+  #
+  # Oracle security policy requires "all_strip". A waiver was granted on
+  # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
+  #
+  DEF_STRIP_POLICY="min_strip"
+  ifeq ($(ALT_STRIP_POLICY),)
+    STRIP_POLICY=$(DEF_STRIP_POLICY)
+  else
+    STRIP_POLICY=$(ALT_STRIP_POLICY)
+  endif
+  _JUNK_ := $(shell \
+    echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
+endif
+endif
+endif
+
 #
 # Java default optimization (-x04/-O2) etc.  Applies to the VM.
 #
@@ -648,6 +711,9 @@
 # Network Services library
 LIBNSL = -lnsl
 
+# service configuration facility library
+LIBSCF = -lscf
+
 # GLOBAL_KPIC: If set means all libraries are PIC, position independent code
 #    EXCEPT for select compiles
 #    If a .o file is compiled non-PIC then it should be forced
@@ -684,5 +750,6 @@
 # Settings for the JDI - Serviceability Agent binding.
 HOTSPOT_SALIB_PATH   = $(HOTSPOT_IMPORT_PATH)/jre/lib/$(LIBARCH)
 SALIB_NAME = $(LIB_PREFIX)saproc.$(LIBRARY_SUFFIX)
+SA_DEBUGINFO_NAME = $(LIB_PREFIX)saproc.debuginfo
 INCLUDE_SA=true
 
--- a/make/java/java/FILES_java.gmk	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/java/java/FILES_java.gmk	Wed Oct 26 17:59:13 2011 -0700
@@ -208,7 +208,6 @@
     java/util/Observable.java \
     java/util/Observer.java \
     java/util/Properties.java \
-        java/util/XMLUtils.java \
         java/util/InvalidPropertiesFormatException.java \
     java/util/PropertyPermission.java \
     java/util/PropertyResourceBundle.java \
--- a/make/java/java/Makefile	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/java/java/Makefile	Wed Oct 26 17:59:13 2011 -0700
@@ -208,7 +208,7 @@
 		       -libpath:$(OBJDIR)/../../../verify/$(OBJDIRNAME) verify.lib \
 		       shell32.lib delayimp.lib /DELAYLOAD:shell32.dll
 else
-OTHER_LDLIBS += $(JVMLIB) -lverify $(LIBSOCKET) $(LIBNSL) -ldl \
+OTHER_LDLIBS += $(JVMLIB) -lverify $(LIBSOCKET) $(LIBNSL) $(LIBSCF) -ldl \
 		-L$(OBJDIR)/../../../fdlibm/$(OBJDIRNAME) -lfdlibm.$(ARCH)
 endif
 
--- a/make/java/net/Makefile	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/java/net/Makefile	Wed Oct 26 17:59:13 2011 -0700
@@ -27,6 +27,9 @@
 PACKAGE = java.net
 LIBRARY = net
 PRODUCT = sun
+JAVAC_MAX_WARNINGS = true
+JAVAC_WARNINGS_FATAL = true
+JAVAC_LINT_OPTIONS = -Xlint:all,-deprecation
 include $(BUILDDIR)/common/Defs.gmk
 
 #
--- a/make/java/nio/Makefile	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/java/nio/Makefile	Wed Oct 26 17:59:13 2011 -0700
@@ -206,7 +206,6 @@
 	sun/nio/fs/LinuxUserDefinedFileAttributeView.java \
 	sun/nio/fs/LinuxNativeDispatcher.java \
 	sun/nio/fs/LinuxWatchService.java \
-	sun/nio/fs/PollingWatchService.java \
 	sun/nio/fs/UnixChannelFactory.java \
 	sun/nio/fs/UnixCopyFile.java \
 	sun/nio/fs/UnixDirectoryStream.java \
--- a/make/java/redist/Makefile	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/java/redist/Makefile	Wed Oct 26 17:59:13 2011 -0700
@@ -58,6 +58,11 @@
 JVMDB_NAME             = $(LIB_PREFIX)jvm$(DB_SUFFIX).$(LIBRARY_SUFFIX)
 JVMDTRACE_NAME         = $(LIB_PREFIX)jvm$(DTRACE_SUFFIX).$(LIBRARY_SUFFIX)
 
+JVM_DEBUGINFO_NAME       = $(LIB_PREFIX)jvm.debuginfo
+LIBJSIG_DEBUGINFO_NAME   = $(LIB_PREFIX)jsig.debuginfo
+JVMDB_DEBUGINFO_NAME     = $(LIB_PREFIX)jvm$(DB_SUFFIX).debuginfo
+JVMDTRACE_DEBUGINFO_NAME = $(LIB_PREFIX)jvm$(DTRACE_SUFFIX).debuginfo
+
 CLASSSHARINGDATA_DIR   = $(BUILDDIR)/tools/sharing
 
 # Needed to do file copy
@@ -79,6 +84,12 @@
 ifndef BUILD_CLIENT_ONLY
   IMPORT_LIST = $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_NAME) \
                 $(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt
+  ifneq ($(OBJCOPY),)
+    # the import JDK may not contain .debuginfo files
+    ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/$(JVM_DEBUGINFO_NAME)),)
+      IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_DEBUGINFO_NAME)
+    endif
+  endif
 else
   IMPORT_LIST =
 endif
@@ -88,6 +99,12 @@
 ifeq ($(ARCH_DATA_MODEL), 32)
   IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME) \
                  $(LIB_LOCATION)/$(CLIENT_LOCATION)/Xusage.txt
+  ifneq ($(OBJCOPY),)
+    # the import JDK may not contain .debuginfo files
+    ifneq ($(wildcard $(HOTSPOT_CLIENT_PATH)/$(JVM_DEBUGINFO_NAME)),)
+      IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_DEBUGINFO_NAME)
+    endif
+  endif
 endif
 endif
 
@@ -157,16 +174,40 @@
 #  NOT Windows vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv  NOT Windows
 
 IMPORT_LIST += $(LIB_LOCATION)/$(LIBJSIG_NAME) 
+ifneq ($(OBJCOPY),)
+  # the import JDK may not contain .debuginfo files
+  ifneq ($(wildcard $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJSIG_DEBUGINFO_NAME)),)
+    IMPORT_LIST += $(LIB_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME)
+  endif
+endif
 ifndef BUILD_CLIENT_ONLY
   IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME)
+  ifneq ($(OBJCOPY),)
+    # the import JDK may not contain the target of the symlink
+    ifneq ($(wildcard $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJSIG_DEBUGINFO_NAME)),)
+      IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME)
+    endif
+  endif
 endif
 
 ifeq ($(PLATFORM), solaris)
   ifndef BUILD_CLIENT_ONLY
     IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME)
+    ifneq ($(OBJCOPY),)
+      # the import JDK may not contain .debuginfo files
+      ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/$(JVMDB_DEBUGINFO_NAME)),)
+        IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_DEBUGINFO_NAME)
+      endif
+    endif
     # The conditional can be removed when import JDKs contain these files.
     ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/$(JVMDTRACE_NAME)),)
       IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDTRACE_NAME)
+      ifneq ($(OBJCOPY),)
+        # the import JDK may not contain .debuginfo files
+        ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/$(JVMDTRACE_DEBUGINFO_NAME)),)
+          IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDTRACE_DEBUGINFO_NAME)
+        endif
+      endif
     else
       $(warning WARNING: $(HOTSPOT_SERVER_PATH)/$(JVMDB_NAME) not found!)
     endif 
@@ -177,17 +218,37 @@
 ifeq ($(ARCH_DATA_MODEL), 32)
 
 IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME)
+ifneq ($(OBJCOPY),)
+  # the import JDK may not contain the target of the symlink
+  ifneq ($(wildcard $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJSIG_DEBUGINFO_NAME)),)
+    IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME)
+  endif
+endif
 
 ifeq ($(PLATFORM), solaris)
 #  solaris   vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv  solaris
 
 IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_NAME)
+ifneq ($(OBJCOPY),)
+  # the import JDK may not contain .debuginfo files
+  ifneq ($(wildcard $(HOTSPOT_CLIENT_PATH)/$(JVMDB_DEBUGINFO_NAME)),)
+    IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_DEBUGINFO_NAME)
+  endif
+endif
 
 # The conditional can be removed when import JDKs contain these files.
 ifneq ($(wildcard $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_NAME)),)
   IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDTRACE_NAME)
   IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_NAME)
   IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDTRACE_NAME)
+  ifneq ($(OBJCOPY),)
+    # the import JDK may not contain .debuginfo files
+    ifneq ($(wildcard $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_DEBUGINFO_NAME)),)
+      IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDTRACE_DEBUGINFO_NAME)
+      IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_DEBUGINFO_NAME)
+      IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDTRACE_DEBUGINFO_NAME)
+  endif
+  endif
 else
   $(warning WARNING: $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_NAME) not found!)
 endif
@@ -196,6 +257,12 @@
   # The conditional can be removed when import JDKs contain these files.
   ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME)),)
     IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_NAME)
+    ifneq ($(OBJCOPY),)
+      # the import JDK may not contain .debuginfo files
+      ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_DEBUGINFO_NAME)),)
+        IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_DEBUGINFO_NAME)
+      endif
+    endif
   else
     $(warning WARNING: $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME) not found!)
   endif
@@ -203,6 +270,12 @@
   # The conditional can be removed when import JDKs contain these files.
   ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_NAME)),)
     IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDTRACE_NAME)
+    ifneq ($(OBJCOPY),)
+      # the import JDK may not contain .debuginfo files
+      ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_DEBUGINFO_NAME)),)
+        IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDTRACE_DEBUGINFO_NAME)
+      endif
+    endif
   else
     $(warning WARNING: $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_NAME) not found!)
  endif
@@ -229,6 +302,11 @@
 	$(install-import-file)
 	@$(call binary_file_verification,$@)
 
+ifneq ($(OBJCOPY),)
+$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVM_DEBUGINFO_NAME)
+	$(install-import-file)
+endif
+
 $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVM_NAME): $(HOTSPOT_KERNEL_PATH)/$(JVM_NAME)
 	$(install-file)
 	@$(call binary_file_verification,$@)
@@ -237,15 +315,33 @@
 	$(install-import-file)
 	@$(call binary_file_verification,$@)
 
+ifneq ($(OBJCOPY),)
+$(LIB_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME): $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJSIG_DEBUGINFO_NAME)
+	$(install-import-file)
+endif
+
 ifndef BUILD_CLIENT_ONLY
 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME) \
 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME):
 	@$(prep-target)
 	$(call install-sym-link, ../$(LIBJSIG_NAME))
+
+ifneq ($(OBJCOPY),)
+$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME) \
+$(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME):
+	@$(prep-target)
+	$(call install-sym-link, ../$(LIBJSIG_DEBUGINFO_NAME))
+endif
 else
 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME):
 	@$(prep-target)
 	$(call install-sym-link, ../$(LIBJSIG_NAME))
+
+ifneq ($(OBJCOPY),)
+$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME):
+	@$(prep-target)
+	$(call install-sym-link, ../$(LIBJSIG_DEBUGINFO_NAME))
+endif
 endif
 
 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDB_NAME)
@@ -256,6 +352,14 @@
 	$(install-import-file)
 	@$(call binary_file_verification,$@)
 
+ifneq ($(OBJCOPY),)
+$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDB_DEBUGINFO_NAME)
+	$(install-import-file)
+
+$(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/64/$(JVMDB_DEBUGINFO_NAME)
+	$(install-import-file)
+endif
+
 ifndef BUILD_CLIENT_ONLY
 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDB_NAME)
 	$(install-import-file)
@@ -264,6 +368,14 @@
 $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME)
 	$(install-import-file)
 	@$(call binary_file_verification,$@)
+
+ifneq ($(OBJCOPY),)
+$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDB_DEBUGINFO_NAME)
+	$(install-import-file)
+
+$(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_DEBUGINFO_NAME)
+	$(install-import-file)
+endif
 endif
 
 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDTRACE_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_NAME)
@@ -274,6 +386,14 @@
 	$(install-import-file)
 	@$(call binary_file_verification,$@)
 
+ifneq ($(OBJCOPY),)
+$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDTRACE_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_DEBUGINFO_NAME)
+	$(install-import-file)
+
+$(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDTRACE_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/64/$(JVMDTRACE_DEBUGINFO_NAME)
+	$(install-import-file)
+endif
+
 ifndef BUILD_CLIENT_ONLY
 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDTRACE_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDTRACE_NAME)
 	$(install-import-file)
@@ -287,6 +407,17 @@
 	$(install-import-file)
 	@$(call binary_file_verification,$@)
 
+ifneq ($(OBJCOPY),)
+$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDTRACE_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDTRACE_DEBUGINFO_NAME)
+	$(install-import-file)
+
+$(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDTRACE_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_DEBUGINFO_NAME)
+	$(install-import-file)
+
+$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/$(JVM_DEBUGINFO_NAME)
+	$(install-import-file)
+endif
+
 $(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt : $(HOTSPOT_SERVER_PATH)/Xusage.txt
 	$(install-import-file)
 endif
--- a/make/java/redist/sajdi/Makefile	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/java/redist/sajdi/Makefile	Wed Oct 26 17:59:13 2011 -0700
@@ -56,6 +56,12 @@
     IMPORT_LIST += $(LIB_LOCATION)/$(SAMAP_NAME) \
                    $(LIB_LOCATION)/$(SAPDB_NAME)
   endif
+  ifneq ($(OBJCOPY),)
+    # the import JDK may not contain .debuginfo files
+    ifneq ($(wildcard $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(SA_DEBUGINFO_NAME)),)
+      IMPORT_LIST += $(LIB_LOCATION)/$(SA_DEBUGINFO_NAME)
+    endif
+  endif
 endif # INCLUDE_SA
 
 
@@ -79,6 +85,11 @@
 $(LIB_LOCATION)/$(SAMAP_NAME): $(HOTSPOT_SALIB_PATH)/$(SAMAP_NAME)
 	$(install-import-file)
 endif # windows
+
+  ifneq ($(OBJCOPY),)
+$(LIB_LOCATION)/$(SA_DEBUGINFO_NAME): $(HOTSPOT_SALIB_PATH)/$(SA_DEBUGINFO_NAME)
+	$(install-import-file)
+  endif
 endif # INCLUDE_SA
 
 all: $(IMPORT_LIST)
--- a/make/java/security/Makefile	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/java/security/Makefile	Wed Oct 26 17:59:13 2011 -0700
@@ -26,8 +26,8 @@
 BUILDDIR = ../..
 PACKAGE = java.security
 PRODUCT = sun
-JAVAC_MAX_WARNINGS = false
-JAVAC_LINT_OPTIONS = -Xlint:all,-deprecation
+JAVAC_MAX_WARNINGS = true 
+JAVAC_LINT_OPTIONS = -Xlint:all
 JAVAC_WARNINGS_FATAL = true
 include $(BUILDDIR)/common/Defs.gmk
 
--- a/make/javax/Makefile	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/javax/Makefile	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
 BUILDDIR = ..
 include $(BUILDDIR)/common/Defs.gmk
 
-SUBDIRS = others
+SUBDIRS = others security
 
 SUBDIRS_management = management
 
--- a/make/javax/others/Makefile	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/javax/others/Makefile	Wed Oct 26 17:59:13 2011 -0700
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-JAVAC_MAX_WARNINGS = true
 include $(BUILDDIR)/common/Defs.gmk
 
 #
@@ -39,10 +38,6 @@
     com/sun/naming/internal  \
     javax/net                \
     javax/script             \
-    javax/security/auth      \
-    javax/security/cert      \
-    javax/security/sasl      \
-    javax/smartcardio        \
     javax/tools              \
     javax/xml
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/javax/security/Makefile	Wed Oct 26 17:59:13 2011 -0700
@@ -0,0 +1,49 @@
+#
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#
+# Makefile for building javax (security classes)
+#
+
+BUILDDIR = ../..
+JAVAC_MAX_WARNINGS = true 
+JAVAC_WARNINGS_FATAL = true 
+
+include $(BUILDDIR)/common/Defs.gmk
+
+#
+# Files to compile
+#
+AUTO_FILES_JAVA_DIRS =       \
+    javax/security/auth      \
+    javax/security/cert      \
+    javax/security/sasl      \
+    javax/smartcardio
+
+#
+# Rules
+#
+include $(BUILDDIR)/common/Classes.gmk
+
--- a/make/netbeans/README	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/netbeans/README	Wed Oct 26 17:59:13 2011 -0700
@@ -5,7 +5,7 @@
 
 Getting Started
     In addition to the source bundle for Open JDK, you'll need to download
-    and install copies of the JDK and of NetBeans 6. And if you want to run
+    and install copies of the JDK and of NetBeans. And if you want to run
     tests on the JDK (you do want to run tests, right?), you'll need to
     install the jtreg test harness.
 
@@ -20,30 +20,28 @@
 
     Downloading the JDK
         You've probably done this a million times. Download and install it
-        from http://java.sun.com/javase
+        from http://www.oracle.com/technetwork/java/javase/overview/index.html
 
     Downloading the OpenJDK sources
         Since you're reading this, d you've already downloaded the OpenJDK
         source bundle.  Later in this document we'll refer to the location
         where you installed the Open JDK sources as *install-dir*.
 
-    Downloading a pre-built, JDK 7
+    Downloading a pre-built, JDK 8
         This will be necessary to do builds of some of the projects.  In
         general, you want to download and install a pre-built JDK that
         corresponds to the OpenJDK sources you download.  Building the entire
         OpenJDK depends on a few parts of the pre-built JDK.  Get this from
-        http://download.java.net/jdk7/binaries
+        http://download.java.net/jdk8/binaries
 
-        Note: For working on certain projects, like JMX and JConsole, you 
-              may find convenient to use a pre-built version of JDK 7 (or 
+        Note: For working on certain projects, like JMX and JConsole, you
+              may find convenient to use a pre-built version of JDK 8 (or
               OpenJDK) rather than building your own. This will allow you
               to build only that part of the OpenJDK sources which correspond
-              to that project. 
+              to that project.
 
-    NetBeans 6
-        Yep, NetBeans *6*. Nope, not FCS'd yet. We're on the edge here,
-        enjoy it! Get the latest working development build of NetBeans 6
-        from http://netbeans.org
+    NetBeans 7.0 or later
+        Older versions may also work but are unsupported.
 
     jtreg
         "jtreg" is the test harness for running OpenJDK's regression tests.
@@ -51,7 +49,7 @@
 
     Ant
        NetBeans comes with ant, but if you use a separately-installed copy
-       please make sure that it is at least version 1.7.0.
+       please make sure that it is at least version 1.8.1.
 
 Configuring
     Building OpenJDK is hard and complex. No, strike that. While it's not
@@ -92,8 +90,8 @@
         situation:
 
         make.options=\
-            ALT_BOOTDIR=/home/me/bin/jdk1.6.0 \
-            ALT_JDK_IMPORT_PATH=/home/me/bin/jdk1.7.0 \
+            ALT_BOOTDIR=/home/me/bin/jdk1.7.0 \
+            ALT_JDK_IMPORT_PATH=/home/me/bin/jdk1.8.0 \
             OPENJDK=true
 
         The trailing '\' are important, so that make gets the above as a
@@ -107,7 +105,7 @@
   Windows-specific configuration
     First, please note that the entire JDK cannot currently be built on
     Windows platforms.  This will likely limit your ability to build
-    make-based projects.  See 
+    make-based projects.  See
          *install-dir*/jdk/make/README-builds.html
     for full information on issues with building on the Windows platform.
 
@@ -141,7 +139,7 @@
     editor.
 
   Locale Requirements
-    To build the Open JDK sources, be certain that you are using the "C"
+    To build the OpenJDK sources, be certain that you are using the "C"
     locale on Unix (R) platforms, or "English (United States)" locale on
     Windows.
 
@@ -220,13 +218,13 @@
         running and debugging JConsole.
 
         This ant-based project does *not* require that you build the jdk
-        project first, provided that you use a pre-built version of JDK 7. 
+        project first, provided that you use a pre-built version of JDK 7.
 
     Java (TM) Management Extensions (JMX(TM)) API (directory "jmx")
         For working on JMX source code. Creates ../dist/lib/jmx.jar.
 
         This ant-based project does *not* require that you build the jdk
-        project first, provided that you use a pre-built version of JDK 7. 
+        project first, provided that you use a pre-built version of JDK 7.
 
     Jar & Zip (directory "jarzip")
         For working on jar & zip. It builds the zip library (including
@@ -242,12 +240,12 @@
         running and debugging the SampleTree demo.
 
         This ant-based project does *not* require that you build the jdk
-        project first, provided that you use a pre-built version of JDK 7. 
+        project first, provided that you use a pre-built version of JDK 7.
 
     In addition, there are projects for building the compiler, javadoc,
     and related tools, in the OpenJDK langtools component.  These
     projects are separate from those described here, and have their
-    own set of guidelines and conventions. For more details, see the 
+    own set of guidelines and conventions. For more details, see the
     README files in make/netbeans in the OpenJDK langtools component.
 
 Running Tests
@@ -603,13 +601,6 @@
     * -clean-make
 
 Known Issues
-  Tests won't run: waiting for lock
-    Occasionally when running tests, there will be a delay, followed by a
-    message like this:
-        Waiting to lock test result cache for
-           /tmp/jdk/build/linux-i586/jtreg/jconsole/JTwork for 20 seconds
-    The workaround is to stop the tests, rm -rf the offending jtreg/<project>
-    directory by hand, and re-run the tests.
 
   Can't run nor debug a single test in the JConsole test
     In most projects, you can run a single test by opening it in the editor,
--- a/make/netbeans/common/closed-share-view.ent	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/netbeans/common/closed-share-view.ent	Wed Oct 26 17:59:13 2011 -0700
@@ -31,8 +31,8 @@
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
 
-<source-folder style="packages">
-    <label>Closed-Source Packages</label>
+<source-folder style="tree">
+    <label>Closed Sources</label>
     <location>${root}/src/closed/share/classes</location>
     <includes>${includes}</includes>
     <excludes>${excludes}</excludes>
--- a/make/netbeans/common/java-data-native.ent	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/netbeans/common/java-data-native.ent	Wed Oct 26 17:59:13 2011 -0700
@@ -38,7 +38,12 @@
         <package-root>${root}/src/solaris/classes</package-root>
         <classpath mode="boot">${bootstrap.jdk}/jre/lib/rt.jar</classpath>
         <built-to>${root}/build/${platform}-${arch}/classes</built-to>
-        <javadoc-built-to>${root}/build/javadoc/${name}</javadoc-built-to>
+        <javadoc-built-to>${root}/build/${platform}-${arch}/docs/api</javadoc-built-to>
+        <source-level>1.7</source-level>
+    </compilation-unit>
+    <compilation-unit>
+        <package-root>${root}/test</package-root>
+        <unit-tests/>
         <source-level>1.7</source-level>
     </compilation-unit>
 </java-data>
--- a/make/netbeans/common/java-data-no-native.ent	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/netbeans/common/java-data-no-native.ent	Wed Oct 26 17:59:13 2011 -0700
@@ -36,7 +36,12 @@
         <package-root>${root}/src/share/classes</package-root>
         <classpath mode="boot">${bootstrap.jdk}/jre/lib/rt.jar</classpath>
         <built-to>${root}/build/${platform}-${arch}/classes</built-to>
-        <javadoc-built-to>${root}/build/javadoc/${name}</javadoc-built-to>
+        <javadoc-built-to>${root}/build/${platform}-${arch}/docs/api</javadoc-built-to>
+        <source-level>1.7</source-level>
+    </compilation-unit>
+    <compilation-unit>
+        <package-root>${root}/test</package-root>
+        <unit-tests/>
         <source-level>1.7</source-level>
     </compilation-unit>
 </java-data>
--- a/make/netbeans/common/jtreg-view.ent	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/netbeans/common/jtreg-view.ent	Wed Oct 26 17:59:13 2011 -0700
@@ -31,7 +31,7 @@
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
 
-<source-folder style="packages">
+<source-folder style="tree">
     <label>Tests</label>
     <location>${root}/test</location>
     <includes>${jtreg.tests}</includes>
--- a/make/netbeans/common/sample-view.ent	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/netbeans/common/sample-view.ent	Wed Oct 26 17:59:13 2011 -0700
@@ -31,7 +31,7 @@
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
 
-<source-folder style="packages">
+<source-folder style="tree">
     <label>Samples</label>
     <location>${root}/src/share/sample</location>
     <includes>${samples}</includes>
--- a/make/netbeans/common/share-view.ent	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/netbeans/common/share-view.ent	Wed Oct 26 17:59:13 2011 -0700
@@ -31,7 +31,7 @@
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
 
-<source-folder style="packages">
+<source-folder style="tree">
     <label>Sources for All Platforms</label>
     <location>${root}/src/share/classes</location>
     <includes>${includes}</includes>
--- a/make/netbeans/common/unix-view.ent	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/netbeans/common/unix-view.ent	Wed Oct 26 17:59:13 2011 -0700
@@ -35,7 +35,7 @@
   UNIX is a registered trademark in the United States and other countries,
   exclusively licensed through X/Open Company, Ltd.
 -->
-<source-folder style="packages">
+<source-folder style="tree">
     <label>Sources for Unix® Platform</label>
     <location>${root}/src/solaris/classes</location>
     <includes>${includes}</includes>
--- a/make/netbeans/common/windows-view.ent	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/netbeans/common/windows-view.ent	Wed Oct 26 17:59:13 2011 -0700
@@ -31,7 +31,7 @@
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
 
-<source-folder style="packages">
+<source-folder style="tree">
     <label>Sources for Windows Platform</label>
     <location>${root}/src/windows/classes</location>
     <includes>${includes}</includes>
--- a/make/netbeans/j2se/nbproject/project.xml	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/netbeans/j2se/nbproject/project.xml	Wed Oct 26 17:59:13 2011 -0700
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
 <!--
- Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
 
  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
@@ -36,11 +36,13 @@
     <!ENTITY share-sources SYSTEM "../../common/share-sources.ent">
     <!ENTITY unix-sources SYSTEM "../../common/unix-sources.ent">
     <!ENTITY windows-sources SYSTEM "../../common/windows-sources.ent">
+    <!ENTITY jtreg-sources SYSTEM "../../common/jtreg-sources.ent">
     <!ENTITY build-folder SYSTEM "../../common/build-folder.ent">
     <!ENTITY standard-bindings SYSTEM "../../common/standard-bindings.ent">
     <!ENTITY share-view SYSTEM "../../common/share-view.ent">
     <!ENTITY unix-view SYSTEM "../../common/unix-view.ent">
     <!ENTITY windows-view SYSTEM "../../common/windows-view.ent">
+    <!ENTITY jtreg-view SYSTEM "../../common/jtreg-view.ent">
     <!ENTITY file-view SYSTEM "../../common/file-view.ent">
     <!ENTITY standard-actions SYSTEM "../../common/standard-actions.ent">
     <!ENTITY java-data-native SYSTEM "../../common/java-data-native.ent">
@@ -59,6 +61,7 @@
                 &unix-sources;
                 &windows-sources;
                 &build-folder;
+		&jtreg-sources;
             </folders>
             <ide-actions>
                 <action name="build">
@@ -82,6 +85,7 @@
                     &share-view;
                     &unix-view;
                     &windows-view;
+                    &jtreg-view;
                     &file-view;
                 </items>
                 <context-menu>
--- a/make/org/ietf/jgss/Makefile	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/org/ietf/jgss/Makefile	Wed Oct 26 17:59:13 2011 -0700
@@ -26,6 +26,8 @@
 BUILDDIR = ../../..
 PACKAGE = org.ietf.jgss
 PRODUCT = sun
+JAVAC_MAX_WARNINGS = true
+JAVAC_WARNINGS_FATAL = true
 include $(BUILDDIR)/common/Defs.gmk
 
 #
--- a/make/sun/Makefile	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/sun/Makefile	Wed Oct 26 17:59:13 2011 -0700
@@ -68,7 +68,7 @@
 endif
 
 # nio need to be compiled before awt to have all charsets ready
-SUBDIRS            = jar security javazic misc net nio text launcher
+SUBDIRS            = jar security javazic misc net nio text util launcher
 
 ifdef BUILD_HEADLESS_ONLY
   DISPLAY_LIBS = awt $(HEADLESS_SUBDIR)
--- a/make/sun/javazic/tzdata/VERSION	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/sun/javazic/tzdata/VERSION	Wed Oct 26 17:59:13 2011 -0700
@@ -21,4 +21,4 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 #
-tzdata2011g
+tzdata2011j
--- a/make/sun/javazic/tzdata/africa	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/sun/javazic/tzdata/africa	Wed Oct 26 17:59:13 2011 -0700
@@ -80,7 +80,7 @@
 # I invented the following abbreviations; corrections are welcome!
 #	 2:00	WAST	West Africa Summer Time
 #	 2:30	BEAT	British East Africa Time (no longer used)
-#	 2:44:45 BEAUT	British East Africa Unified Time (no longer used)
+#	 2:45	BEAUT	British East Africa Unified Time (no longer used)
 #	 3:00	CAST	Central Africa Summer Time (no longer used)
 #	 3:00	SAST	South Africa Summer Time (no longer used)
 #	 3:00	EAT	East Africa Time
@@ -418,7 +418,7 @@
 Zone	Africa/Nairobi	2:27:16	-	LMT	1928 Jul
 			3:00	-	EAT	1930
 			2:30	-	BEAT	1940
-			2:44:45	-	BEAUT	1960
+			2:45	-	BEAUT	1960
 			3:00	-	EAT
 
 # Lesotho
@@ -979,6 +979,11 @@
 			2:00	Sudan	CA%sT	2000 Jan 15 12:00
 			3:00	-	EAT
 
+# South Sudan
+Zone	Africa/Juba	2:06:24 -	LMT	1931
+			2:00	Sudan	CA%sT	2000 Jan 15 12:00
+			3:00	-	EAT
+
 # Swaziland
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Africa/Mbabane	2:04:24 -	LMT	1903 Mar
@@ -988,7 +993,7 @@
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Africa/Dar_es_Salaam 2:37:08 -	LMT	1931
 			3:00	-	EAT	1948
-			2:44:45	-	BEAUT	1961
+			2:45	-	BEAUT	1961
 			3:00	-	EAT
 
 # Togo
@@ -1114,7 +1119,7 @@
 Zone	Africa/Kampala	2:09:40 -	LMT	1928 Jul
 			3:00	-	EAT	1930
 			2:30	-	BEAT	1948
-			2:44:45	-	BEAUT	1957
+			2:45	-	BEAUT	1957
 			3:00	-	EAT
 
 # Zambia
--- a/make/sun/javazic/tzdata/antarctica	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/sun/javazic/tzdata/antarctica	Wed Oct 26 17:59:13 2011 -0700
@@ -41,18 +41,6 @@
 # I made up all time zone abbreviations mentioned here; corrections welcome!
 # FORMAT is `zzz' and GMTOFF is 0 for locations while uninhabited.
 
-# These rules are stolen from the `europe' file.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	RussAQ	1981	1984	-	Apr	 1	 0:00	1:00	S
-Rule	RussAQ	1981	1983	-	Oct	 1	 0:00	0	-
-Rule	RussAQ	1984	1991	-	Sep	lastSun	 2:00s	0	-
-Rule	RussAQ	1985	1991	-	Mar	lastSun	 2:00s	1:00	S
-Rule	RussAQ	1992	only	-	Mar	lastSat	 23:00	1:00	S
-Rule	RussAQ	1992	only	-	Sep	lastSat	 23:00	0	-
-Rule	RussAQ	1993	max	-	Mar	lastSun	 2:00s	1:00	S
-Rule	RussAQ	1993	1995	-	Sep	lastSun	 2:00s	0	-
-Rule	RussAQ	1996	max	-	Oct	lastSun	 2:00s	0	-
-
 # These rules are stolen from the `southamerica' file.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	ArgAQ	1964	1966	-	Mar	 1	0:00	0	-
--- a/make/sun/javazic/tzdata/asia	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/sun/javazic/tzdata/asia	Wed Oct 26 17:59:13 2011 -0700
@@ -99,6 +99,10 @@
 Rule RussiaAsia	1993	1995	-	Sep	lastSun	 2:00s	0	-
 Rule RussiaAsia	1996	max	-	Oct	lastSun	 2:00s	0	-
 
+# From Arthur David Olson (2011-06-15):
+# While Russia abandoned DST in 2011, Armenia may choose to
+# follow Russia's "old" rules.
+
 # Afghanistan
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Kabul	4:36:48 -	LMT	1890
--- a/make/sun/javazic/tzdata/australasia	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/sun/javazic/tzdata/australasia	Wed Oct 26 17:59:13 2011 -0700
@@ -521,7 +521,7 @@
 # http://www.parliament.gov.ws/documents/acts/Daylight%20Saving%20Act%20%202009%20%28English%29%20-%20Final%207-7-091.pdf
 # </a>
 
-# From Raymond Hughes (2010-10-07):
+# From Laupue Raymond Hughes (2010-10-07):
 # Please see
 # <a href="http://www.mcil.gov.ws">
 # http://www.mcil.gov.ws
@@ -531,7 +531,7 @@
 # to 01:00am and First Sunday April 2011 (03/04/11) - adjust clocks
 # backwards from 1:00am to 12:00am"
 
-# From Raymond Hughes (2011-03-07)
+# From Laupue Raymond Hughes (2011-03-07):
 # I believe this will be posted shortly on the website
 # <a href="http://www.mcil.gov.ws">
 # www.mcil.gov.ws
@@ -551,12 +551,74 @@
 # Margaret Fruean ACTING CHIEF EXECUTIVE OFFICER MINISTRY OF COMMERCE,
 # INDUSTRY AND LABOUR 28th February 2011
 
+# From David Zuelke (2011-05-09):
+# Subject: Samoa to move timezone from east to west of international date line
+# 
+# <a href="http://www.morningstar.co.uk/uk/markets/newsfeeditem.aspx?id=138501958347963">
+# http://www.morningstar.co.uk/uk/markets/newsfeeditem.aspx?id=138501958347963
+# </a>
+
+# From Mark Sim-Smith (2011-08-17):
+# I have been in contact with Leilani Tuala Warren from the Samoa Law
+# Reform Commission, and she has sent me a copy of the Bill that she
+# confirmed has been passed...Most of the sections are about maps rather
+# than the time zone change, but I'll paste the relevant bits below. But
+# the essence is that at midnight 29 Dec (UTC-11 I suppose), Samoa
+# changes from UTC-11 to UTC+13:
+#
+# International Date Line Bill 2011
+#
+# AN ACT to provide for the change to standard time in Samoa and to make
+# consequential amendments to the position of the International Date
+# Line, and for related purposes.
+#
+# BE IT ENACTED by the Legislative Assembly of Samoa in Parliament
+# assembled as follows:
+#
+# 1. Short title and commencement-(1) This Act may be cited as the
+# International Date Line Act 2011. (2) Except for section 5(3) this Act
+# commences at 12 o'clock midnight, on Thursday 29th December 2011. (3)
+# Section 5(3) commences on the date of assent by the Head of State.
+#
+# [snip]
+#
+# 3. Interpretation - [snip] "Samoa standard time" in this Act and any
+# other statute of Samoa which refers to 'Samoa standard time' means the
+# time 13 hours in advance of Co-ordinated Universal Time.
+#
+# 4. Samoa standard time - (1) Upon the commencement of this Act, Samoa
+# standard time shall be set at 13 hours in advance of Co-ordinated
+# Universal Time for the whole of Samoa. (2) All references to Samoa's
+# time zone and to Samoa standard time in Samoa in all legislation and
+# instruments after the commencement of this Act shall be references to
+# Samoa standard time as provided for in this Act. (3) Nothing in this
+# Act affects the provisions of the Daylight Saving Act 2009, except that
+# it defines Samoa standard time....
+
+# From Laupue Raymond Hughes (2011-09-02):
+# <a href="http://www.mcil.gov.ws/mcil_publications.html">
+# http://www.mcil.gov.ws/mcil_publications.html
+# </a>
+#
+# here is the official website publication for Samoa DST and dateline change
+#
+# DST
+# Year	End	Time	Start	Time
+# 2011	- - -	- - -	24 September	3:00am to 4:00am
+# 2012	01 April	4:00am to 3:00am	- - -	- - -
+#
+# Dateline Change skip Friday 30th Dec 2011
+# Thursday 29th December 2011	23:59:59 Hours
+# Saturday 31st December 2011	00:00:00 Hours
 Zone Pacific/Apia	 12:33:04 -	LMT	1879 Jul  5
 			-11:26:56 -	LMT	1911
 			-11:30	-	SAMT	1950		# Samoa Time
 			-11:00	-	WST	2010 Sep 26
 			-11:00	1:00	WSDT	2011 Apr 2 4:00
-			-11:00	-	WST
+			-11:00	-	WST	2011 Sep 24 3:00
+			-11:00	1:00	WSDT	2011 Dec 30
+			 13:00	1:00	WSDT	2012 Apr 1 4:00
+			 13:00	-	WST
 
 # Solomon Is
 # excludes Bougainville, for which see Papua New Guinea
@@ -1228,7 +1290,7 @@
 # Lord Howe Island Board (controlling authority for the Island) is
 # seeking the community's views on various options for summer time
 # arrangements on the Island, e.g. advance clocks by 1 full hour
-# instead of only 30 minutes.  Dependant on the wishes of residents
+# instead of only 30 minutes.  [Dependent] on the wishes of residents
 # the Board may approach the NSW government to change the existing
 # arrangements.  The starting date for summer time on the Island will
 # however always coincide with the rest of NSW.
@@ -1354,7 +1416,7 @@
 
 # From Paul Eggert (1996-01-22):
 # Today's _Wall Street Journal_ (page 1) reports that Kiribati
-# ``declared it the same day throught the country as of Jan. 1, 1995''
+# ``declared it the same day [throughout] the country as of Jan. 1, 1995''
 # as part of the competition to be first into the 21st century.
 
 
--- a/make/sun/javazic/tzdata/europe	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/sun/javazic/tzdata/europe	Wed Oct 26 17:59:13 2011 -0700
@@ -587,6 +587,26 @@
 Rule	Russia	1993	1995	-	Sep	lastSun	 2:00s	0	-
 Rule	Russia	1996	max	-	Oct	lastSun	 2:00s	0	-
 
+# From Alexander Krivenyshev (2011-06-14):
+# According to Kremlin press service, Russian President Dmitry Medvedev
+# signed a federal law "On calculation of time" on June 9, 2011.
+# According to the law Russia is abolishing daylight saving time.
+# 
+# Medvedev signed a law "On the Calculation of Time" (in russian): 
+# <a href="http://bmockbe.ru/events/?ID=7583">
+# http://bmockbe.ru/events/?ID=7583
+# </a>
+# 
+# Medvedev signed a law on the calculation of the time (in russian):
+# <a href="http://www.regnum.ru/news/polit/1413906.html">
+# http://www.regnum.ru/news/polit/1413906.html
+# </a>
+
+# From Arthur David Olson (2011-06-15):
+# Take "abolishing daylight saving time" to mean that time is now considered
+# to be standard.
+# At least for now, keep the "old" Russia rules for the benefit of Belarus.
+
 # These are for backward compatibility with older versions.
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
@@ -2035,7 +2055,8 @@
 			 1:00	C-Eur	CE%sT	1945
 			 2:00	Poland	CE%sT	1946
 			 3:00	Russia	MSK/MSD	1991 Mar 31 2:00s
-			 2:00	Russia	EE%sT
+			 2:00	Russia	EE%sT	2011 Mar 27 2:00s
+			 3:00	-	KALT
 #
 # From Oscar van Vlijmen (2001-08-25): [This region consists of]
 # Respublika Adygeya, Arkhangel'skaya oblast',
@@ -2064,7 +2085,8 @@
 			 2:00	-	EET	1930 Jun 21
 			 3:00	Russia	MSK/MSD	1991 Mar 31 2:00s
 			 2:00	Russia	EE%sT	1992 Jan 19 2:00s
-			 3:00	Russia	MSK/MSD
+			 3:00	Russia	MSK/MSD	2011 Mar 27 2:00s
+			 4:00	-	MSK
 #
 # Astrakhanskaya oblast', Kirovskaya oblast', Saratovskaya oblast',
 # Volgogradskaya oblast'.  Shanks & Pottenger say Kirov is still at +0400
@@ -2077,7 +2099,8 @@
 			 4:00	Russia	VOL%sT	1989 Mar 26 2:00s # Volgograd T
 			 3:00	Russia	VOL%sT	1991 Mar 31 2:00s
 			 4:00	-	VOLT	1992 Mar 29 2:00s
-			 3:00	Russia	VOL%sT
+			 3:00	Russia	VOL%sT	2011 Mar 27 2:00s
+			 4:00	-	VOLT
 #
 # From Oscar van Vlijmen (2001-08-25): [This region consists of]
 # Samarskaya oblast', Udmyrtskaya respublika
@@ -2089,7 +2112,8 @@
 			 2:00	Russia	KUY%sT	1991 Sep 29 2:00s
 			 3:00	-	KUYT	1991 Oct 20 3:00
 			 4:00	Russia	SAM%sT	2010 Mar 28 2:00s # Samara Time
-			 3:00	Russia	SAM%sT
+			 3:00	Russia	SAM%sT	2011 Mar 27 2:00s
+			 4:00	-	SAMT
 
 #
 # From Oscar van Vlijmen (2001-08-25): [This region consists of]
@@ -2102,7 +2126,8 @@
 			 4:00	-	SVET	1930 Jun 21 # Sverdlovsk Time
 			 5:00	Russia	SVE%sT	1991 Mar 31 2:00s
 			 4:00	Russia	SVE%sT	1992 Jan 19 2:00s
-			 5:00	Russia	YEK%sT	# Yekaterinburg Time
+			 5:00	Russia	YEK%sT	2011 Mar 27 2:00s
+			 6:00	-	YEKT	# Yekaterinburg Time
 #
 # From Oscar van Vlijmen (2001-08-25): [This region consists of]
 # Respublika Altaj, Altajskij kraj, Omskaya oblast'.
@@ -2110,7 +2135,8 @@
 			 5:00	-	OMST	1930 Jun 21 # Omsk TIme
 			 6:00	Russia	OMS%sT	1991 Mar 31 2:00s
 			 5:00	Russia	OMS%sT	1992 Jan 19 2:00s
-			 6:00	Russia	OMS%sT
+			 6:00	Russia	OMS%sT	2011 Mar 27 2:00s
+			 7:00	-	OMST
 #
 # From Paul Eggert (2006-08-19): I'm guessing about Tomsk here; it's
 # not clear when it switched from +7 to +6.
@@ -2120,7 +2146,8 @@
 			 7:00	Russia	NOV%sT	1991 Mar 31 2:00s
 			 6:00	Russia	NOV%sT	1992 Jan 19 2:00s
 			 7:00	Russia	NOV%sT	1993 May 23 # say Shanks & P.
-			 6:00	Russia	NOV%sT
+			 6:00	Russia	NOV%sT	2011 Mar 27 2:00s
+			 7:00	-	NOVT
 
 # From Alexander Krivenyshev (2009-10-13):
 # Kemerovo oblast' (Kemerovo region) in Russia will change current time zone on
@@ -2153,7 +2180,8 @@
 			 7:00	Russia	KRA%sT	1991 Mar 31 2:00s
 			 6:00	Russia	KRA%sT	1992 Jan 19 2:00s
 			 7:00	Russia	KRA%sT	2010 Mar 28 2:00s
-			 6:00	Russia	NOV%sT # Novosibirsk/Novokuznetsk Time
+			 6:00	Russia	NOV%sT	2011 Mar 27 2:00s
+			 7:00	-	NOVT # Novosibirsk/Novokuznetsk Time
 
 #
 # From Oscar van Vlijmen (2001-08-25): [This region consists of]
@@ -2164,7 +2192,8 @@
 			 6:00	-	KRAT	1930 Jun 21 # Krasnoyarsk Time
 			 7:00	Russia	KRA%sT	1991 Mar 31 2:00s
 			 6:00	Russia	KRA%sT	1992 Jan 19 2:00s
-			 7:00	Russia	KRA%sT
+			 7:00	Russia	KRA%sT	2011 Mar 27 2:00s
+			 8:00	-	KRAT
 #
 # From Oscar van Vlijmen (2001-08-25): [This region consists of]
 # Respublika Buryatiya, Irkutskaya oblast',
@@ -2174,7 +2203,8 @@
 			 7:00	-	IRKT	1930 Jun 21 # Irkutsk Time
 			 8:00	Russia	IRK%sT	1991 Mar 31 2:00s
 			 7:00	Russia	IRK%sT	1992 Jan 19 2:00s
-			 8:00	Russia	IRK%sT
+			 8:00	Russia	IRK%sT	2011 Mar 27 2:00s
+			 9:00	-	IRKT
 #
 # From Oscar van Vlijmen (2003-10-18): [This region consists of]
 # Aginskij Buryatskij avtonomnyj okrug, Amurskaya oblast',
@@ -2197,7 +2227,8 @@
 			 8:00	-	YAKT	1930 Jun 21 # Yakutsk Time
 			 9:00	Russia	YAK%sT	1991 Mar 31 2:00s
 			 8:00	Russia	YAK%sT	1992 Jan 19 2:00s
-			 9:00	Russia	YAK%sT
+			 9:00	Russia	YAK%sT	2011 Mar 27 2:00s
+			 10:00	-	YAKT
 #
 # From Oscar van Vlijmen (2003-10-18): [This region consists of]
 # Evrejskaya avtonomnaya oblast', Khabarovskij kraj, Primorskij kraj,
@@ -2210,7 +2241,8 @@
 			 9:00	-	VLAT	1930 Jun 21 # Vladivostok Time
 			10:00	Russia	VLA%sT	1991 Mar 31 2:00s
 			 9:00	Russia	VLA%sST	1992 Jan 19 2:00s
-			10:00	Russia	VLA%sT
+			10:00	Russia	VLA%sT	2011 Mar 27 2:00s
+			11:00	-	VLAT
 #
 # Sakhalinskaya oblast'.
 # The Zone name should be Yuzhno-Sakhalinsk, but that's too long.
@@ -2220,7 +2252,8 @@
 			11:00	Russia	SAK%sT	1991 Mar 31 2:00s # Sakhalin T.
 			10:00	Russia	SAK%sT	1992 Jan 19 2:00s
 			11:00	Russia	SAK%sT	1997 Mar lastSun 2:00s
-			10:00	Russia	SAK%sT
+			10:00	Russia	SAK%sT	2011 Mar 27 2:00s
+			11:00	-	SAKT
 #
 # From Oscar van Vlijmen (2003-10-18): [This region consists of]
 # Magadanskaya oblast', Respublika Sakha (Yakutiya).
@@ -2233,7 +2266,8 @@
 			10:00	-	MAGT	1930 Jun 21 # Magadan Time
 			11:00	Russia	MAG%sT	1991 Mar 31 2:00s
 			10:00	Russia	MAG%sT	1992 Jan 19 2:00s
-			11:00	Russia	MAG%sT
+			11:00	Russia	MAG%sT	2011 Mar 27 2:00s
+			12:00	-	MAGT
 #
 # From Oscar van Vlijmen (2001-08-25): [This region consists of]
 # Kamchatskaya oblast', Koryakskij avtonomnyj okrug.
@@ -2244,7 +2278,8 @@
 			12:00	Russia	PET%sT	1991 Mar 31 2:00s
 			11:00	Russia	PET%sT	1992 Jan 19 2:00s
 			12:00	Russia	PET%sT	2010 Mar 28 2:00s
-			11:00	Russia	PET%sT
+			11:00	Russia	PET%sT	2011 Mar 27 2:00s
+			12:00	-	PETT
 #
 # Chukotskij avtonomnyj okrug
 Zone Asia/Anadyr	11:49:56 -	LMT	1924 May  2
@@ -2253,7 +2288,8 @@
 			12:00	Russia	ANA%sT	1991 Mar 31 2:00s
 			11:00	Russia	ANA%sT	1992 Jan 19 2:00s
 			12:00	Russia	ANA%sT	2010 Mar 28 2:00s
-			11:00	Russia	ANA%sT
+			11:00	Russia	ANA%sT	2011 Mar 27 2:00s
+			12:00	-	ANAT
 
 # Serbia
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
--- a/make/sun/javazic/tzdata/iso3166.tab	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/sun/javazic/tzdata/iso3166.tab	Wed Oct 26 17:59:13 2011 -0700
@@ -43,6 +43,9 @@
 #
 # Lines beginning with `#' are comments.
 #
+# From Arthur David Olson (2011-08-17):
+# Resynchronized today with the ISO 3166 site (adding SS for South Sudan).
+#
 #country-
 #code	country name
 AD	Andorra
@@ -52,7 +55,6 @@
 AI	Anguilla
 AL	Albania
 AM	Armenia
-AN	Netherlands Antilles
 AO	Angola
 AQ	Antarctica
 AR	Argentina
@@ -75,6 +77,7 @@
 BM	Bermuda
 BN	Brunei
 BO	Bolivia
+BQ	Bonaire Sint Eustatius & Saba
 BR	Brazil
 BS	Bahamas
 BT	Bhutan
@@ -97,6 +100,7 @@
 CR	Costa Rica
 CU	Cuba
 CV	Cape Verde
+CW	Curacao
 CX	Christmas Island
 CY	Cyprus
 CZ	Czech Republic
@@ -251,8 +255,10 @@
 SN	Senegal
 SO	Somalia
 SR	Suriname
+SS	South Sudan
 ST	Sao Tome & Principe
 SV	El Salvador
+SX	Sint Maarten
 SY	Syria
 SZ	Swaziland
 TC	Turks & Caicos Is
--- a/make/sun/javazic/tzdata/northamerica	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/sun/javazic/tzdata/northamerica	Wed Oct 26 17:59:13 2011 -0700
@@ -490,6 +490,10 @@
 # own time. I asked about daylight saving; they said it wasn't used. I
 # did not inquire about practices in the past.
 
+# From Arthur David Olson (2011-08-17):
+# For lack of better information, assume that Metlakatla's
+# abandonment of use of daylight saving resulted from the 1983 vote.
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Juneau	 15:02:19 -	LMT	1867 Oct 18
 			 -8:57:41 -	LMT	1900 Aug 20 12:00
@@ -515,7 +519,7 @@
 			 -8:00	US	P%sT	1946
 			 -8:00	-	PST	1969
 			 -8:00	US	P%sT	1983 Oct 30 2:00
-			 -8:00	US	MeST
+			 -8:00	-	MeST
 Zone America/Yakutat	 14:41:05 -	LMT	1867 Oct 18
 			 -9:18:55 -	LMT	1900 Aug 20 12:00
 			 -9:00	-	YST	1942
@@ -615,8 +619,8 @@
 			-10:30	-	HST	1933 Apr 30 2:00 #Laws 1933
 			-10:30	1:00	HDT	1933 May 21 12:00 #Laws 1933+12
 			-10:30	-	HST	1942 Feb 09 2:00 #Schmitt&Cox+2
-			-10:30	1:00	HDT	1945 Sep 30 2:00 #Schmitt&Fox+2
-			-10:30	US	H%sT	1947 Jun  8 2:00 #Schmitt&Fox+2
+			-10:30	1:00	HDT	1945 Sep 30 2:00 #Schmitt&Cox+2
+			-10:30	-	HST	1947 Jun  8 2:00 #Schmitt&Cox+2
 			-10:00	-	HST
 
 # Now we turn to US areas that have diverged from the consensus since 1970.
@@ -1185,12 +1189,39 @@
 # From Paul Eggert (2000-10-02):
 # INMS (2000-09-12) says that, since 1988 at least, Newfoundland switches
 # at 00:01 local time.  For now, assume it started in 1987.
+
+# From Michael Pelley (2011-08-05):
+# The Government of Newfoundland and Labrador has pending changes to
+# modify the hour for daylight savings time to come into effect in
+# November 2011. This modification would change the time from 12:01AM to
+# 2:00AM on the dates of the switches of Daylight Savings Time to/from
+# Standard Time.
+#
+# As a matter of reference, in Canada provinces have the authority of
+# setting time zone information. The legislation has passed our
+# legislative body (The House of Assembly) and is awaiting the
+# proclamation to come into effect. You may find this information at:
+# <a href="http://www.assembly.nl.ca/legislation/sr/lists/Proclamation.htm">
+# http://www.assembly.nl.ca/legislation/sr/lists/Proclamation.htm
+# </a>
+# and
+# search within that web page for Standard Time (Amendment) Act. The Act
+# may be found at:
+# <a href="http://www.assembly.nl.ca/business/bills/Bill1106.htm">
+# http://www.assembly.nl.ca/business/bills/Bill1106.htm
+# </a>
+# ...
+# MICHAEL PELLEY | Manager of Enterprise Architecture - Solution Delivery
+# Office of the Chief Information Officer Executive Council Government of
+# Newfoundland & Labrador P.O. Box 8700, 40 Higgins Line, St. John's NL
+# A1B 4J6
+
 Rule	StJohns	1987	only	-	Apr	Sun>=1	0:01	1:00	D
 Rule	StJohns	1987	2006	-	Oct	lastSun	0:01	0	S
 Rule	StJohns	1988	only	-	Apr	Sun>=1	0:01	2:00	DD
 Rule	StJohns	1989	2006	-	Apr	Sun>=1	0:01	1:00	D
-Rule	StJohns	2007	max	-	Mar	Sun>=8	0:01	1:00	D
-Rule	StJohns	2007	max	-	Nov	Sun>=1	0:01	0	S
+Rule	StJohns	2007	2011	-	Mar	Sun>=8	0:01	1:00	D
+Rule	StJohns	2007	2010	-	Nov	Sun>=1	0:01	0	S
 #
 # St John's has an apostrophe, but Posix file names can't have apostrophes.
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
@@ -1200,7 +1231,8 @@
 			-3:30:52 StJohns N%sT	1935 Mar 30
 			-3:30	StJohns	N%sT	1942 May 11
 			-3:30	Canada	N%sT	1946
-			-3:30	StJohns	N%sT
+			-3:30	StJohns	N%sT	2011 Nov
+			-3:30	Canada	N%sT
 
 # most of east Labrador
 
@@ -1214,7 +1246,8 @@
 			-3:30	StJohns	N%sT	1942 May 11
 			-3:30	Canada	N%sT	1946
 			-3:30	StJohns	N%sT	1966 Mar 15 2:00
-			-4:00	StJohns	A%sT
+			-4:00	StJohns	A%sT	2011 Nov
+			-4:00	Canada	A%sT
 
 
 # west Labrador, Nova Scotia, Prince Edward I
@@ -1946,20 +1979,69 @@
 # daylight saving....
 # http://www.nnsl.com/frames/newspapers/2006-11/nov13_06none.html
 
-# From Chris Walton (2007-03-14):
-# Today I phoned the "hamlet office" to find out what Resolute was doing with
-# its clocks.
+# From Chris Walton (2011-03-21):
+# Back in 2007 I initiated the creation of a new "zone file" for Resolute
+# Bay. Resolute Bay is a small community located about 900km north of
+# the Arctic Circle. The zone file was required because Resolute Bay had
+# decided to use UTC-5 instead of UTC-6 for the winter of 2006-2007.
+#
+# According to new information which I received last week, Resolute Bay
+# went back to using UTC-6 in the winter of 2007-2008...
+#
+# On March 11/2007 most of Canada went onto daylight saving. On March
+# 14/2007 I phoned the Resolute Bay hamlet office to do a "time check." I
+# talked to somebody that was both knowledgeable and helpful. I was able
+# to confirm that Resolute Bay was still operating on UTC-5. It was
+# explained to me that Resolute Bay had been on the Eastern Time zone
+# (EST) in the winter, and was now back on the Central Time zone (CDT).
+# i.e. the time zone had changed twice in the last year but the clocks
+# had not moved. The residents had to know which time zone they were in
+# so they could follow the correct TV schedule...
+#
+# On Nov 02/2008 most of Canada went onto standard time. On Nov 03/2008 I
+# phoned the Resolute Bay hamlet office...[D]ue to the challenging nature
+# of the phone call, I decided to seek out an alternate source of
+# information. I found an e-mail address for somebody by the name of
+# Stephanie Adams whose job was listed as "Inns North Support Officer for
+# Arctic Co-operatives." I was under the impression that Stephanie lived
+# and worked in Resolute Bay...
 #
-# The individual that answered the phone confirmed that the clocks did not
-# move at the end of daylight saving on October 29/2006.  He also told me that
-# the clocks did not move this past weekend (March 11/2007)....
-
-# From Chris Walton (2008-11-13):
-# ...the residents of Resolute believe that they are changing "time zones"
-# twice a year.  In winter months, local time is qualified with "Eastern
-# Time" which is really "Eastern Standard Time (UTC-5)".  In summer
-# months, local time is qualified with "Central Time" which is really
-# "Central Daylight Time (UTC-5)"...
+# On March 14/2011 I phoned the hamlet office again. I was told that
+# Resolute Bay had been using Central Standard Time over the winter of
+# 2010-2011 and that the clocks had therefore been moved one hour ahead
+# on March 13/2011. The person I talked to was aware that Resolute Bay
+# had previously experimented with Eastern Standard Time but he could not
+# tell me when the practice had stopped.
+#
+# On March 17/2011 I searched the Web to find an e-mail address of
+# somebody that might be able to tell me exactly when Resolute Bay went
+# off Eastern Standard Time. I stumbled on the name "Aziz Kheraj." Aziz
+# used to be the mayor of Resolute Bay and he apparently owns half the
+# businesses including "South Camp Inn." This website has some info on
+# Aziz:
+# <a href="http://www.uphere.ca/node/493">
+# http://www.uphere.ca/node/493
+# </a>
+#
+# I sent Aziz an e-mail asking when Resolute Bay had stopped using
+# Eastern Standard Time.
+#
+# Aziz responded quickly with this: "hi, The time was not changed for the
+# 1 year only, the following year, the community went back to the old way
+# of "spring ahead-fall behind" currently we are zulu plus 5 hrs and in
+# the winter Zulu plus 6 hrs"
+#
+# This of course conflicted with everything I had ascertained in November 2008.
+#
+# I sent Aziz a copy of my 2008 e-mail exchange with Stephanie. Aziz
+# responded with this: "Hi, Stephanie lives in Winnipeg. I live here, You
+# may want to check with the weather office in Resolute Bay or do a
+# search on the weather through Env. Canada. web site"
+#
+# If I had realized the Stephanie did not live in Resolute Bay I would
+# never have contacted her.  I now believe that all the information I
+# obtained in November 2008 should be ignored...
+# I apologize for reporting incorrect information in 2008.
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	NT_YK	1918	only	-	Apr	14	2:00	1:00	D
@@ -1987,14 +2069,12 @@
 			-6:00	Canada	C%sT	2000 Oct 29 2:00
 			-5:00	Canada	E%sT
 # aka Qausuittuq
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Resolute 2006	max	-	Nov	Sun>=1	2:00	0	ES
-Rule	Resolute 2007	max	-	Mar	Sun>=8	2:00	0	CD
 Zone America/Resolute	0	-	zzz	1947 Aug 31 # Resolute founded
 			-6:00	NT_YK	C%sT	2000 Oct 29 2:00
 			-5:00	-	EST	2001 Apr  1 3:00
 			-6:00	Canada	C%sT	2006 Oct 29 2:00
-			-5:00	Resolute	%sT
+			-5:00	-	EST	2007 Mar 11 3:00
+			-6:00	Canada	C%sT
 # aka Kangiqiniq
 Zone America/Rankin_Inlet 0	-	zzz	1957 # Rankin Inlet founded
 			-6:00	NT_YK	C%sT	2000 Oct 29 2:00
--- a/make/sun/javazic/tzdata/southamerica	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/sun/javazic/tzdata/southamerica	Wed Oct 26 17:59:13 2011 -0700
@@ -1298,6 +1298,14 @@
 			-4:30	-	ANT	1965 # Netherlands Antilles Time
 			-4:00	-	AST
 
+# From Arthur David Olson (2011-06-15):
+# At least for now, use links for places with new iso3166 codes.
+# The name "Lower Prince's Quarter" is both longer than fourteen charaters
+# and contains an apostrophe; use "Lower_Princes" below.
+
+Link	America/Curacao	America/Lower_Princes # Sint Maarten
+Link	America/Curacao	America/Kralendijk # Bonaire, Sint Estatius and Saba
+
 # Ecuador
 #
 # From Paul Eggert (2007-03-04):
--- a/make/sun/javazic/tzdata/zone.tab	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/sun/javazic/tzdata/zone.tab	Wed Oct 26 17:59:13 2011 -0700
@@ -54,7 +54,6 @@
 AI	+1812-06304	America/Anguilla
 AL	+4120+01950	Europe/Tirane
 AM	+4011+04430	Asia/Yerevan
-AN	+1211-06900	America/Curacao
 AO	-0848+01314	Africa/Luanda
 AQ	-7750+16636	Antarctica/McMurdo	McMurdo Station, Ross Island
 AQ	-9000+00000	Antarctica/South_Pole	Amundsen-Scott Station, South Pole
@@ -109,6 +108,7 @@
 BM	+3217-06446	Atlantic/Bermuda
 BN	+0456+11455	Asia/Brunei
 BO	-1630-06809	America/La_Paz
+BQ	+120903-0681636	America/Kralendijk
 BR	-0351-03225	America/Noronha	Atlantic islands
 BR	-0127-04829	America/Belem	Amapa, E Para
 BR	-0343-03830	America/Fortaleza	NE Brazil (MA, PI, CE, RN, PB)
@@ -142,7 +142,7 @@
 CA	+4823-08915	America/Thunder_Bay	Eastern Time - Thunder Bay, Ontario
 CA	+6344-06828	America/Iqaluit	Eastern Time - east Nunavut - most locations
 CA	+6608-06544	America/Pangnirtung	Eastern Time - Pangnirtung, Nunavut
-CA	+744144-0944945	America/Resolute	Eastern Standard Time - Resolute, Nunavut
+CA	+744144-0944945	America/Resolute	Central Standard Time - Resolute, Nunavut
 CA	+484531-0913718	America/Atikokan	Eastern Standard Time - Atikokan, Ontario and Southampton I, Nunavut
 CA	+624900-0920459	America/Rankin_Inlet	Central Time - central Nunavut
 CA	+4953-09709	America/Winnipeg	Central Time - Manitoba & west Ontario
@@ -177,6 +177,7 @@
 CR	+0956-08405	America/Costa_Rica
 CU	+2308-08222	America/Havana
 CV	+1455-02331	Atlantic/Cape_Verde
+CW	+1211-06900	America/Curacao
 CX	-1025+10543	Indian/Christmas
 CY	+3510+03322	Asia/Nicosia
 CZ	+5005+01426	Europe/Prague
@@ -382,8 +383,10 @@
 SN	+1440-01726	Africa/Dakar
 SO	+0204+04522	Africa/Mogadishu
 SR	+0550-05510	America/Paramaribo
+SS	+0451+03136	Africa/Juba
 ST	+0020+00644	Africa/Sao_Tome
 SV	+1342-08912	America/El_Salvador
+SX	+180305-0630250	America/Lower_Princes
 SY	+3330+03618	Asia/Damascus
 SZ	-2618+03106	Africa/Mbabane
 TC	+2128-07108	America/Grand_Turk
--- a/make/sun/net/Makefile	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/sun/net/Makefile	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,8 @@
 BUILDDIR = ../..
 PACKAGE = sun.net
 PRODUCT = sun
+SUBDIRS_MAKEFLAGS += JAVAC_MAX_WARNINGS=true
+SUBDIRS_MAKEFLAGS += JAVAC_WARNINGS_FATAL=true
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = others spi
--- a/make/sun/net/spi/Makefile	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/sun/net/spi/Makefile	Wed Oct 26 17:59:13 2011 -0700
@@ -24,6 +24,8 @@
 #
 
 BUILDDIR = ../../..
+SUBDIRS_MAKEFLAGS += JAVAC_WARNINGS_FATAL=true
+
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS_misc = nameservice 
--- a/make/sun/net/spi/nameservice/dns/Makefile	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/sun/net/spi/nameservice/dns/Makefile	Wed Oct 26 17:59:13 2011 -0700
@@ -28,7 +28,8 @@
 #
 
 BUILDDIR = ../../../../..
-
+JAVAC_MAX_WARNINGS = true
+JAVAC_WARNINGS_FATAL = true
 # dns should probably be its own module
 PACKAGE = sun.net.spi.nameservice.dns
 PRODUCT = sun
--- a/make/sun/security/other/Makefile	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/sun/security/other/Makefile	Wed Oct 26 17:59:13 2011 -0700
@@ -26,7 +26,7 @@
 BUILDDIR = ../../..
 PACKAGE = sun.security.other
 PRODUCT = sun
-JAVAC_MAX_WARNINGS=false
+JAVAC_MAX_WARNINGS=true
 JAVAC_LINT_OPTIONS=-Xlint:all,-deprecation
 JAVAC_WARNINGS_FATAL=true
 include $(BUILDDIR)/common/Defs.gmk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/sun/util/Makefile	Wed Oct 26 17:59:13 2011 -0700
@@ -0,0 +1,40 @@
+#
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+BUILDDIR = ../..
+PACKAGE = sun.util
+PRODUCT = sun
+include $(BUILDDIR)/common/Defs.gmk
+
+#
+# Files
+#
+AUTO_FILES_JAVA_DIRS = sun/util/xml
+
+#
+# Rules
+#
+include $(BUILDDIR)/common/Classes.gmk
+
--- a/make/tools/src/build/tools/javazic/Mappings.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/make/tools/src/build/tools/javazic/Mappings.java	Wed Oct 26 17:59:13 2011 -0700
@@ -76,8 +76,8 @@
             // If the GMT offset of this Zone will change in some
             // future time, this Zone is added to the exclude list.
             boolean isExcluded = false;
-            if (zone.size() > 1) {
-                ZoneRec zrec = zone.get(zone.size()-2);
+            for (int i = 0; i < zone.size(); i++) {
+                ZoneRec zrec = zone.get(i);
                 if ((zrec.getGmtOffset() != rawOffset)
                     && (zrec.getUntilTime(0) > Time.getCurrentTime())) {
                     if (excludeList == null) {
@@ -85,6 +85,7 @@
                     }
                     excludeList.add(zone.getName());
                     isExcluded = true;
+                    break;
                 }
             }
 
--- a/src/share/classes/com/sun/jndi/ldap/Connection.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/jndi/ldap/Connection.java	Wed Oct 26 17:59:13 2011 -0700
@@ -32,6 +32,7 @@
 import java.io.OutputStream;
 import java.io.InputStream;
 import java.net.Socket;
+import javax.net.ssl.SSLSocket;
 
 import javax.naming.CommunicationException;
 import javax.naming.ServiceUnavailableException;
@@ -361,6 +362,19 @@
             }
         }
 
+        // For LDAP connect timeouts on LDAP over SSL connections must treat
+        // the SSL handshake following socket connection as part of the timeout.
+        // So explicitly set a socket read timeout, trigger the SSL handshake,
+        // then reset the timeout.
+        if (connectTimeout > 0 && socket instanceof SSLSocket) {
+            SSLSocket sslSocket = (SSLSocket) socket;
+            int socketTimeout = sslSocket.getSoTimeout();
+
+            sslSocket.setSoTimeout(connectTimeout); // reuse full timeout value
+            sslSocket.startHandshake();
+            sslSocket.setSoTimeout(socketTimeout);
+        }
+
         return socket;
     }
 
--- a/src/share/classes/com/sun/net/httpserver/BasicAuthenticator.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/net/httpserver/BasicAuthenticator.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -54,13 +54,13 @@
 
     public Result authenticate (HttpExchange t)
     {
-        Headers rmap = (Headers) t.getRequestHeaders();
+        Headers rmap = t.getRequestHeaders();
         /*
          * look for auth token
          */
         String auth = rmap.getFirst ("Authorization");
         if (auth == null) {
-            Headers map = (Headers) t.getResponseHeaders();
+            Headers map = t.getResponseHeaders();
             map.set ("WWW-Authenticate", "Basic realm=" + "\""+realm+"\"");
             return new Authenticator.Retry (401);
         }
@@ -83,7 +83,7 @@
         } else {
             /* reject the request again with 401 */
 
-            Headers map = (Headers) t.getResponseHeaders();
+            Headers map = t.getResponseHeaders();
             map.set ("WWW-Authenticate", "Basic realm=" + "\""+realm+"\"");
             return new Authenticator.Failure(401);
         }
--- a/src/share/classes/com/sun/net/httpserver/Headers.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/net/httpserver/Headers.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -117,7 +117,7 @@
          * @return the first string value associated with the key
          */
         public String getFirst (String key) {
-            List<String> l = map.get(normalize((String)key));
+            List<String> l = map.get(normalize(key));
             if (l == null) {
                 return null;
             }
--- a/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -81,29 +81,27 @@
         if (cn == null)
             return false;
         try {
-            Class c = Class.forName(cn, true,
+            Class<?> c = Class.forName(cn, true,
                                     ClassLoader.getSystemClassLoader());
             provider = (HttpServerProvider)c.newInstance();
             return true;
-        } catch (ClassNotFoundException x) {
-            throw new ServiceConfigurationError(x);
-        } catch (IllegalAccessException x) {
-            throw new ServiceConfigurationError(x);
-        } catch (InstantiationException x) {
-            throw new ServiceConfigurationError(x);
-        } catch (SecurityException x) {
+        } catch (ClassNotFoundException |
+                 IllegalAccessException |
+                 InstantiationException |
+                 SecurityException x) {
             throw new ServiceConfigurationError(x);
         }
     }
 
     private static boolean loadProviderAsService() {
-        Iterator i = Service.providers(HttpServerProvider.class,
+        @SuppressWarnings("unchecked")
+        Iterator<HttpServerProvider> i = Service.providers(HttpServerProvider.class,
                                        ClassLoader.getSystemClassLoader());
         for (;;) {
             try {
                 if (!i.hasNext())
                     return false;
-                provider = (HttpServerProvider)i.next();
+                provider = i.next();
                 return true;
             } catch (ServiceConfigurationError sce) {
                 if (sce.getCause() instanceof SecurityException) {
--- a/src/share/classes/com/sun/net/ssl/SSLSecurity.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/net/ssl/SSLSecurity.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -77,7 +77,7 @@
     {
         Provider provider = service.getProvider();
         String className = service.getClassName();
-        Class implClass;
+        Class<?> implClass;
         try {
             ClassLoader cl = provider.getClass().getClassLoader();
             if (cl == null) {
@@ -133,8 +133,8 @@
              * or someone has removed classes from the jsse.jar file.
              */
 
-            Class typeClassJavax;
-            Class typeClassCom;
+            Class<?> typeClassJavax;
+            Class<?> typeClassCom;
             Object obj = null;
 
             /*
@@ -237,7 +237,7 @@
     /*
      * Checks whether one class is the superclass of another
      */
-    private static boolean checkSuperclass(Class subclass, Class superclass) {
+    private static boolean checkSuperclass(Class<?> subclass, Class<?> superclass) {
         if ((subclass == null) || (superclass == null))
                 return false;
 
@@ -276,7 +276,6 @@
  * object.  This also mean that anything going down into the SPI
  * needs to be wrapped, as well as anything coming back up.
  */
-
 final class SSLContextSpiWrapper extends SSLContextSpi {
 
     private javax.net.ssl.SSLContext theSSLContext;
--- a/src/share/classes/com/sun/net/ssl/internal/www/protocol/https/DelegateHttpsURLConnection.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/net/ssl/internal/www/protocol/https/DelegateHttpsURLConnection.java	Wed Oct 26 17:59:13 2011 -0700
@@ -165,10 +165,10 @@
     private static String getServername(X509Certificate peerCert) {
         try {
             // compare to subjectAltNames if dnsName is present
-            Collection subjAltNames = peerCert.getSubjectAlternativeNames();
+            Collection<List<?>> subjAltNames = peerCert.getSubjectAlternativeNames();
             if (subjAltNames != null) {
-                for (Iterator itr = subjAltNames.iterator(); itr.hasNext(); ) {
-                    List next = (List)itr.next();
+                for (Iterator<List<?>> itr = subjAltNames.iterator(); itr.hasNext(); ) {
+                    List<?> next = itr.next();
                     if (((Integer)next.get(0)).intValue() == 2) {
                         // compare dNSName with host in url
                         String dnsName = ((String)next.get(1));
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/Init.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/Init.java	Wed Oct 26 17:59:13 2011 -0700
@@ -115,9 +115,9 @@
             // provider mechanism instead if implementing their own
             // transform or canonicalization algorithms.
             // InputStream is = Class.forName("com.sun.org.apache.xml.internal.security.Init").getResourceAsStream("resource/config.xml");
-            InputStream is = (InputStream) AccessController.doPrivileged(
-                new PrivilegedAction() {
-                    public Object run() {
+            InputStream is = AccessController.doPrivileged(
+                new PrivilegedAction<InputStream>() {
+                    public InputStream run() {
 //                        String cfile = System.getProperty
 //                            ("com.sun.org.apache.xml.internal.security.resource.config");
                         return getClass().getResourceAsStream
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/JCEMapper.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/JCEMapper.java	Wed Oct 26 17:59:13 2011 -0700
@@ -45,9 +45,9 @@
 
 
 
-   private static Map uriToJCEName;
+   private static Map<String, String> uriToJCEName;
 
-   private static Map algorithmsMap;
+   private static Map<String, Algorithm> algorithmsMap;
 
    private static String providerName = null;
    /**
@@ -63,8 +63,8 @@
 
    static void loadAlgorithms( Element algorithmsEl) {
        Element[] algorithms = XMLUtils.selectNodes(algorithmsEl.getFirstChild(),Init.CONF_NS,"Algorithm");
-       uriToJCEName = new HashMap( algorithms.length * 2);
-       algorithmsMap = new HashMap( algorithms.length * 2);
+       uriToJCEName = new HashMap<String, String>( algorithms.length * 2);
+       algorithmsMap = new HashMap<String, Algorithm>( algorithms.length * 2);
        for (int i = 0 ;i < algorithms.length ;i ++) {
            Element el = algorithms[i];
            String id = el.getAttribute("URI");
@@ -76,7 +76,7 @@
    }
 
    static Algorithm getAlgorithmMapping(String algoURI) {
-           return ((Algorithm)algorithmsMap.get(algoURI));
+           return algorithmsMap.get(algoURI);
    }
 
    /**
@@ -90,7 +90,7 @@
       if (log.isLoggable(java.util.logging.Level.FINE))
           log.log(java.util.logging.Level.FINE, "Request for URI " + AlgorithmURI);
 
-      String jceName = (String) uriToJCEName.get(AlgorithmURI);
+      String jceName = uriToJCEName.get(AlgorithmURI);
       return jceName;
    }
 
@@ -106,7 +106,7 @@
        if (log.isLoggable(java.util.logging.Level.FINE))
            log.log(java.util.logging.Level.FINE, "Request for URI " + AlgorithmURI);
 
-       return ((Algorithm) algorithmsMap.get(AlgorithmURI)).algorithmClass;
+       return (algorithmsMap.get(AlgorithmURI)).algorithmClass;
    }
 
    /**
@@ -116,7 +116,7 @@
     * @return The length of the key used in the alogrithm
     */
    public static int getKeyLengthFromURI(String AlgorithmURI) {
-       return Integer.parseInt(((Algorithm) algorithmsMap.get(AlgorithmURI)).keyLength);
+       return Integer.parseInt((algorithmsMap.get(AlgorithmURI)).keyLength);
    }
 
    /**
@@ -128,7 +128,7 @@
     */
    public static String getJCEKeyAlgorithmFromURI(String AlgorithmURI) {
 
-        return  ((Algorithm) algorithmsMap.get(AlgorithmURI)).requiredKey;
+        return  (algorithmsMap.get(AlgorithmURI)).requiredKey;
 
    }
 
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/MessageDigestAlgorithm.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/MessageDigestAlgorithm.java	Wed Oct 26 17:59:13 2011 -0700
@@ -71,9 +71,10 @@
       this.algorithm = messageDigest;
    }
 
-   static ThreadLocal instances=new ThreadLocal() {
-           protected Object initialValue() {
-                   return new HashMap();
+   static ThreadLocal<Map<String, MessageDigest>> instances=new
+       ThreadLocal<Map<String, MessageDigest>>() {
+           protected Map<String, MessageDigest> initialValue() {
+               return new HashMap<String, MessageDigest>();
            };
    };
 
@@ -92,7 +93,7 @@
    }
 
 private static MessageDigest getDigestInstance(String algorithmURI) throws XMLSignatureException {
-        MessageDigest result=(MessageDigest) ((Map)instances.get()).get(algorithmURI);
+        MessageDigest result= instances.get().get(algorithmURI);
         if (result!=null)
                 return result;
     String algorithmID = JCEMapper.translateURItoJCEID(algorithmURI);
@@ -121,7 +122,7 @@
 
         throw new XMLSignatureException("algorithms.NoSuchAlgorithm", exArgs);
         }
-      ((Map)instances.get()).put(algorithmURI, md);
+        instances.get().put(algorithmURI, md);
         return md;
 }
 
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithm.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithm.java	Wed Oct 26 17:59:13 2011 -0700
@@ -51,28 +51,28 @@
    static boolean _alreadyInitialized = false;
 
    /** All available algorithm classes are registered here */
-   static HashMap _algorithmHash = null;
+   static Map<String, Class<? extends SignatureAlgorithmSpi>> _algorithmHash = null;
 
-   static ThreadLocal instancesSigning=new ThreadLocal() {
-           protected Object initialValue() {
-                   return new HashMap();
+   static ThreadLocal<Map<String, SignatureAlgorithmSpi>> instancesSigning=new ThreadLocal<Map<String, SignatureAlgorithmSpi>>() {
+           protected Map<String, SignatureAlgorithmSpi> initialValue() {
+                   return new HashMap<String, SignatureAlgorithmSpi>();
            };
    };
 
-   static ThreadLocal instancesVerify=new ThreadLocal() {
-           protected Object initialValue() {
-                   return new HashMap();
+   static ThreadLocal<Map<String, SignatureAlgorithmSpi>> instancesVerify=new ThreadLocal<Map<String, SignatureAlgorithmSpi>>() {
+           protected Map<String, SignatureAlgorithmSpi> initialValue() {
+                   return new HashMap<String, SignatureAlgorithmSpi>();
            };
    };
 
-   static ThreadLocal keysSigning=new ThreadLocal() {
-           protected Object initialValue() {
-                   return new HashMap();
+   static ThreadLocal<Map<String, Key>> keysSigning=new ThreadLocal<Map<String, Key>>() {
+           protected Map<String, Key> initialValue() {
+                   return new HashMap<String, Key>();
            };
    };
-   static ThreadLocal keysVerify=new ThreadLocal() {
-           protected Object initialValue() {
-                   return new HashMap();
+   static ThreadLocal<Map<String, Key>> keysVerify=new ThreadLocal<Map<String, Key>>() {
+           protected Map<String, Key> initialValue() {
+                   return new HashMap<String, Key>();
            };
    };
 //   boolean isForSigning=false;
@@ -105,34 +105,34 @@
                       .engineGetContextFromElement(this._constructionElement);
    }
    private static SignatureAlgorithmSpi getInstanceForSigning(String algorithmURI) throws XMLSignatureException {
-           SignatureAlgorithmSpi result=(SignatureAlgorithmSpi) ((Map)instancesSigning.get()).get(algorithmURI);
+           SignatureAlgorithmSpi result= instancesSigning.get().get(algorithmURI);
            if (result!=null) {
                    result.reset();
                    return result;
            }
            result=buildSigner(algorithmURI, result);
-           ((Map)instancesSigning.get()).put(algorithmURI,result);
+           instancesSigning.get().put(algorithmURI,result);
            return result;
    }
    private static SignatureAlgorithmSpi getInstanceForVerify(String algorithmURI) throws XMLSignatureException {
-           SignatureAlgorithmSpi result=(SignatureAlgorithmSpi) ((Map)instancesVerify.get()).get(algorithmURI);
+           SignatureAlgorithmSpi result= instancesVerify.get().get(algorithmURI);
            if (result!=null) {
                    result.reset();
                    return result;
            }
            result=buildSigner(algorithmURI, result);
-           ((Map)instancesVerify.get()).put(algorithmURI,result);
+           instancesVerify.get().put(algorithmURI,result);
            return result;
    }
 
    private static SignatureAlgorithmSpi buildSigner(String algorithmURI, SignatureAlgorithmSpi result) throws XMLSignatureException {
         try {
-         Class implementingClass =
+         Class<? extends SignatureAlgorithmSpi> implementingClass =
             SignatureAlgorithm.getImplementingClass(algorithmURI);
          if (log.isLoggable(java.util.logging.Level.FINE))
                 log.log(java.util.logging.Level.FINE, "Create URI \"" + algorithmURI + "\" class \""
                    + implementingClass + "\"");
-         result=(SignatureAlgorithmSpi) implementingClass.newInstance();
+         result= implementingClass.newInstance();
          return   result;
       }  catch (IllegalAccessException ex) {
          Object exArgs[] = { algorithmURI, ex.getMessage() };
@@ -270,7 +270,7 @@
     */
    public void initSign(Key signingKey) throws XMLSignatureException {
            initializeAlgorithm(true);
-           Map map=(Map)keysSigning.get();
+           Map<String, Key> map=keysSigning.get();
        if (map.get(this.algorithmURI)==signingKey) {
            return;
        }
@@ -329,7 +329,7 @@
     */
    public void initVerify(Key verificationKey) throws XMLSignatureException {
            initializeAlgorithm(false);
-           Map map=(Map)keysVerify.get();
+           Map<String, Key> map=keysVerify.get();
            if (map.get(this.algorithmURI)==verificationKey) {
            return;
        }
@@ -375,7 +375,7 @@
       log.log(java.util.logging.Level.FINE, "Init() called");
 
       if (!SignatureAlgorithm._alreadyInitialized) {
-         SignatureAlgorithm._algorithmHash = new HashMap(10);
+         SignatureAlgorithm._algorithmHash = new HashMap<String, Class<? extends SignatureAlgorithmSpi>>(10);
          SignatureAlgorithm._alreadyInitialized = true;
       }
    }
@@ -388,6 +388,7 @@
     * @throws AlgorithmAlreadyRegisteredException if specified algorithmURI is already registered
     * @throws XMLSignatureException
     */
+   @SuppressWarnings("unchecked")
    public static void register(String algorithmURI, String implementingClass)
            throws AlgorithmAlreadyRegisteredException,XMLSignatureException {
 
@@ -396,7 +397,7 @@
                 log.log(java.util.logging.Level.FINE, "Try to register " + algorithmURI + " " + implementingClass);
 
          // are we already registered?
-         Class registeredClassClass =
+         Class<? extends SignatureAlgorithmSpi> registeredClassClass =
             SignatureAlgorithm.getImplementingClass(algorithmURI);
                  if (registeredClassClass!=null) {
                          String registeredClass = registeredClassClass.getName();
@@ -409,7 +410,7 @@
                          }
                  }
                  try {
-                         SignatureAlgorithm._algorithmHash.put(algorithmURI, Class.forName(implementingClass));
+                         SignatureAlgorithm._algorithmHash.put(algorithmURI, (Class <? extends SignatureAlgorithmSpi>)Class.forName(implementingClass));
               } catch (ClassNotFoundException ex) {
                  Object exArgs[] = { algorithmURI, ex.getMessage() };
 
@@ -431,13 +432,13 @@
     * @param URI
     * @return the class that implements the URI
     */
-   private static Class getImplementingClass(String URI) {
+   private static Class<? extends SignatureAlgorithmSpi> getImplementingClass(String URI) {
 
       if (SignatureAlgorithm._algorithmHash == null) {
          return null;
       }
 
-      return (Class) SignatureAlgorithm._algorithmHash.get(URI);
+      return SignatureAlgorithm._algorithmHash.get(URI);
    }
 
    /**
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/Canonicalizer.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/Canonicalizer.java	Wed Oct 26 17:59:13 2011 -0700
@@ -28,6 +28,7 @@
 
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.xpath.XPath;
 
 import com.sun.org.apache.xml.internal.security.exceptions.AlgorithmAlreadyRegisteredException;
 import org.w3c.dom.Document;
@@ -83,7 +84,7 @@
         ALGO_ID_C14N11_OMIT_COMMENTS + "#WithComments";
 
     static boolean _alreadyInitialized = false;
-    static Map _canonicalizerHash = null;
+    static Map<String,Class<? extends CanonicalizerSpi>> _canonicalizerHash = null;
 
     protected CanonicalizerSpi canonicalizerSpi = null;
 
@@ -94,7 +95,7 @@
     public static void init() {
 
         if (!Canonicalizer._alreadyInitialized) {
-            Canonicalizer._canonicalizerHash = new HashMap(10);
+            Canonicalizer._canonicalizerHash = new HashMap<String, Class<? extends CanonicalizerSpi>>(10);
             Canonicalizer._alreadyInitialized = true;
         }
     }
@@ -109,10 +110,11 @@
            throws InvalidCanonicalizerException {
 
         try {
-            Class implementingClass = getImplementingClass(algorithmURI);
+            Class<? extends CanonicalizerSpi> implementingClass =
+                getImplementingClass(algorithmURI);
 
             this.canonicalizerSpi =
-                (CanonicalizerSpi) implementingClass.newInstance();
+                 implementingClass.newInstance();
             this.canonicalizerSpi.reset=true;
         } catch (Exception e) {
             Object exArgs[] = { algorithmURI };
@@ -144,11 +146,12 @@
      * @param implementingClass
      * @throws AlgorithmAlreadyRegisteredException
      */
+    @SuppressWarnings("unchecked")
     public static void register(String algorithmURI, String implementingClass)
            throws AlgorithmAlreadyRegisteredException {
 
         // check whether URI is already registered
-        Class registeredClass = getImplementingClass(algorithmURI);
+        Class<? extends CanonicalizerSpi> registeredClass = getImplementingClass(algorithmURI);
 
         if (registeredClass != null)  {
             Object exArgs[] = { algorithmURI, registeredClass };
@@ -158,7 +161,7 @@
         }
 
         try {
-            _canonicalizerHash.put(algorithmURI, Class.forName(implementingClass));
+            _canonicalizerHash.put(algorithmURI, (Class<? extends CanonicalizerSpi>) Class.forName(implementingClass));
         } catch (ClassNotFoundException e) {
             throw new RuntimeException("c14n class not found");
         }
@@ -304,7 +307,7 @@
      * @return the result of the c14n.
      * @throws CanonicalizationException
      */
-    public byte[] canonicalizeXPathNodeSet(Set xpathNodeSet)
+    public byte[] canonicalizeXPathNodeSet(Set<Node> xpathNodeSet)
            throws CanonicalizationException {
         return this.canonicalizerSpi.engineCanonicalizeXPathNodeSet(xpathNodeSet);
     }
@@ -317,7 +320,7 @@
      * @return the result of the c14n.
      * @throws CanonicalizationException
      */
-    public byte[] canonicalizeXPathNodeSet(Set xpathNodeSet,
+    public byte[] canonicalizeXPathNodeSet(Set<Node> xpathNodeSet,
         String inclusiveNamespaces) throws CanonicalizationException {
         return this.canonicalizerSpi.engineCanonicalizeXPathNodeSet(xpathNodeSet,
             inclusiveNamespaces);
@@ -347,8 +350,8 @@
      * @param URI
      * @return the name of the class that implements the given URI
      */
-    private static Class getImplementingClass(String URI) {
-        return (Class) _canonicalizerHash.get(URI);
+    private static Class<? extends CanonicalizerSpi> getImplementingClass(String URI) {
+        return _canonicalizerHash.get(URI);
     }
 
     /**
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/CanonicalizerSpi.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/CanonicalizerSpi.java	Wed Oct 26 17:59:13 2011 -0700
@@ -28,6 +28,7 @@
 
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.xpath.XPath;
 
 import com.sun.org.apache.xml.internal.security.utils.XMLUtils;
 import org.w3c.dom.Document;
@@ -151,7 +152,7 @@
     * @return the c14n bytes
     * @throws CanonicalizationException
     */
-   public abstract byte[] engineCanonicalizeXPathNodeSet(Set xpathNodeSet)
+   public abstract byte[] engineCanonicalizeXPathNodeSet(Set<Node> xpathNodeSet)
       throws CanonicalizationException;
 
    /**
@@ -162,7 +163,7 @@
     * @return the c14n bytes
     * @throws CanonicalizationException
     */
-   public abstract byte[] engineCanonicalizeXPathNodeSet(Set xpathNodeSet, String inclusiveNamespaces)
+   public abstract byte[] engineCanonicalizeXPathNodeSet(Set<Node> xpathNodeSet, String inclusiveNamespaces)
       throws CanonicalizationException;
 
    /**
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/helper/AttrCompare.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/helper/AttrCompare.java	Wed Oct 26 17:59:13 2011 -0700
@@ -41,7 +41,7 @@
  *
  * @author Christian Geuer-Pollmann
  */
-public class AttrCompare implements Comparator, Serializable {
+public class AttrCompare implements Comparator<Attr>, Serializable {
 
     private final static long serialVersionUID = -7113259629930576230L;
     private final static int ATTR0_BEFORE_ATTR1 = -1;
@@ -62,16 +62,14 @@
      *   key (an empty namespace URI is lexicographically least).
      * </UL>
      *
-     * @param obj0 casted Attr
-     * @param obj1 casted Attr
+     * @param attr0
+     * @param attr1
      * @return returns a negative integer, zero, or a positive integer as
      *   obj0 is less than, equal to, or greater than obj1
      *
      */
-    public int compare(Object obj0, Object obj1) {
+    public int compare(Attr attr0, Attr attr1) {
 
-        Attr attr0 = (Attr) obj0;
-        Attr attr1 = (Attr) obj1;
         String namespaceURI0 = attr0.getNamespaceURI();
         String namespaceURI1 = attr1.getNamespaceURI();
 
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer11.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer11.java	Wed Oct 26 17:59:13 2011 -0700
@@ -25,6 +25,7 @@
 import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -33,6 +34,7 @@
 import java.util.SortedSet;
 import java.util.TreeSet;
 import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPath;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -59,7 +61,7 @@
  */
 public abstract class Canonicalizer11 extends CanonicalizerBase {
     boolean firstCall = true;
-    final SortedSet result = new TreeSet(COMPARE);
+    final SortedSet<Attr> result = new TreeSet<Attr>(COMPARE);
     static final String XMLNS_URI = Constants.NamespaceSpecNS;
     static final String XML_LANG_URI = Constants.XML_LANG_SPACE_SpecNS;
 
@@ -72,9 +74,9 @@
         static class XmlsStackElement {
             int level;
             boolean rendered = false;
-            List nodes = new ArrayList();
+            List<Attr> nodes = new ArrayList<Attr>();
         };
-        List levels = new ArrayList();
+        List<XmlsStackElement> levels = new ArrayList<XmlsStackElement>();
         void push(int level) {
             currentLevel = level;
             if (currentLevel == -1)
@@ -86,7 +88,7 @@
                     lastlevel = 0;
                     return;
                 }
-                lastlevel=((XmlsStackElement)levels.get(levels.size()-1)).level;
+                lastlevel=(levels.get(levels.size()-1)).level;
             }
         }
         void addXmlnsAttr(Attr n) {
@@ -98,7 +100,7 @@
             }
             cur.nodes.add(n);
         }
-        void getXmlnsAttr(Collection col) {
+        void getXmlnsAttr(Collection<Attr> col) {
             if (cur == null) {
                 cur = new XmlsStackElement();
                 cur.level = currentLevel;
@@ -111,7 +113,7 @@
             if (size == -1) {
                 parentRendered = true;
             } else {
-                e = (XmlsStackElement) levels.get(size);
+                e = levels.get(size);
                 if (e.rendered && e.level+1 == currentLevel)
                     parentRendered = true;
             }
@@ -121,17 +123,17 @@
                 return;
             }
 
-            Map loa = new HashMap();
-            List baseAttrs = new ArrayList();
+            Map<String, Attr> loa = new HashMap<String, Attr>();
+            List<Attr> baseAttrs = new ArrayList<Attr>();
             boolean successiveOmitted = true;
             for (;size>=0;size--) {
-                e = (XmlsStackElement) levels.get(size);
+                e = levels.get(size);
                 if (e.rendered) {
                     successiveOmitted = false;
                 }
-                Iterator it = e.nodes.iterator();
+                Iterator<Attr> it = e.nodes.iterator();
                 while (it.hasNext() && successiveOmitted) {
-                    Attr n = (Attr) it.next();
+                    Attr n = it.next();
                     if (n.getLocalName().equals("base")) {
                         if (!e.rendered) {
                             baseAttrs.add(n);
@@ -141,11 +143,11 @@
                 }
             }
             if (!baseAttrs.isEmpty()) {
-                Iterator it = cur.nodes.iterator();
+                Iterator<Attr> it = cur.nodes.iterator();
                 String base = null;
                 Attr baseAttr = null;
                 while (it.hasNext()) {
-                    Attr n = (Attr) it.next();
+                    Attr n = it.next();
                     if (n.getLocalName().equals("base")) {
                         base = n.getValue();
                         baseAttr = n;
@@ -154,7 +156,7 @@
                 }
                 it = baseAttrs.iterator();
                 while (it.hasNext()) {
-                    Attr n = (Attr) it.next();
+                    Attr n = it.next();
                     if (base == null) {
                         base = n.getValue();
                         baseAttr = n;
@@ -202,13 +204,13 @@
      * @return the Attr[]s to be outputted
      * @throws CanonicalizationException
      */
-    Iterator handleAttributesSubtree(Element E, NameSpaceSymbTable ns)
+    Iterator<Attr> handleAttributesSubtree(Element E, NameSpaceSymbTable ns)
         throws CanonicalizationException {
         if (!E.hasAttributes() && !firstCall) {
             return null;
         }
         // result will contain the attrs which have to be outputted
-        final SortedSet result = this.result;
+        final SortedSet<Attr> result = this.result;
         result.clear();
         NamedNodeMap attrs = E.getAttributes();
         int attrsLength = attrs.getLength();
@@ -236,7 +238,7 @@
 
             if (n != null) {
                 // Render the ns definition
-                result.add(n);
+                result.add((Attr)n);
                 if (C14nHelper.namespaceIsRelative(N)) {
                     Object exArgs[] = {E.getTagName(), NName, N.getNodeValue()};
                     throw new CanonicalizationException(
@@ -251,13 +253,15 @@
             // to the output.
             ns.getUnrenderedNodes(result);
             // output the attributes in the xml namespace.
-            xmlattrStack.getXmlnsAttr(result);
+            xmlattrStack.getXmlnsAttr(getSortedSetAsCollection(result));
             firstCall = false;
         }
 
         return result.iterator();
     }
 
+
+
     /**
      * Returns the Attr[]s to be outputted for the given element.
      * <br>
@@ -271,7 +275,7 @@
      * @return the Attr[]s to be outputted
      * @throws CanonicalizationException
      */
-    Iterator handleAttributes(Element E, NameSpaceSymbTable ns)
+    Iterator<Attr> handleAttributes(Element E, NameSpaceSymbTable ns)
         throws CanonicalizationException {
         // result will contain the attrs which have to be output
         xmlattrStack.push(ns.getLevel());
@@ -283,11 +287,11 @@
             attrsLength = attrs.getLength();
         }
 
-        SortedSet result = this.result;
+        SortedSet<Attr> result = this.result;
         result.clear();
 
         for (int i = 0; i < attrsLength; i++) {
-            Attr N = (Attr) attrs.item(i);
+            Attr N = (Attr)attrs.item(i);
             String NUri = N.getNamespaceURI();
 
             if (XMLNS_URI != NUri) {
@@ -332,7 +336,7 @@
                 //      (NName, NValue, N, isRealVisible);
                 Node n = ns.addMappingAndRender(NName, NValue, N);
                 if (n != null) {
-                    result.add(n);
+                    result.add((Attr)n);
                     if (C14nHelper.namespaceIsRelative(N)) {
                         Object exArgs[] =
                             { E.getTagName(), NName, N.getNodeValue() };
@@ -362,7 +366,7 @@
             }
             // output the xmlns def if needed.
             if (n != null) {
-                result.add(n);
+                result.add((Attr)n);
             }
             // Float all xml:* attributes of the unselected parent elements to
             // this one. addXmlAttributes(E,result);
@@ -381,7 +385,7 @@
      * @return none it always fails
      * @throws CanonicalizationException always
      */
-    public byte[] engineCanonicalizeXPathNodeSet(Set xpathNodeSet,
+    public byte[] engineCanonicalizeXPathNodeSet(Set<Node> xpathNodeSet,
         String inclusiveNamespaces) throws CanonicalizationException {
         throw new CanonicalizationException(
          "c14n.Canonicalizer.UnsupportedOperation");
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315.java	Wed Oct 26 17:59:13 2011 -0700
@@ -57,7 +57,7 @@
  */
 public abstract class Canonicalizer20010315 extends CanonicalizerBase {
         boolean firstCall=true;
-        final SortedSet result= new TreeSet(COMPARE);
+        final SortedSet<Attr> result= new TreeSet<Attr>(COMPARE);
     static final String XMLNS_URI=Constants.NamespaceSpecNS;
     static final String XML_LANG_URI=Constants.XML_LANG_SPACE_SpecNS;
     static class XmlAttrStack {
@@ -67,9 +67,9 @@
         static class XmlsStackElement {
                 int level;
                 boolean rendered=false;
-                List nodes=new ArrayList();
+                List<Attr> nodes=new ArrayList<Attr>();
         };
-        List levels=new ArrayList();
+        List<XmlsStackElement> levels=new ArrayList<XmlsStackElement>();
         void push(int level) {
                 currentLevel=level;
                 if (currentLevel==-1)
@@ -81,7 +81,7 @@
                                 lastlevel=0;
                                 return;
                         }
-                        lastlevel=((XmlsStackElement)levels.get(levels.size()-1)).level;
+                        lastlevel=(levels.get(levels.size()-1)).level;
                 }
         }
         void addXmlnsAttr(Attr n) {
@@ -93,7 +93,7 @@
                 }
                 cur.nodes.add(n);
         }
-        void getXmlnsAttr(Collection col) {
+        void getXmlnsAttr(Collection<Attr> col) {
                 int size=levels.size()-1;
                 if (cur==null) {
                         cur=new XmlsStackElement();
@@ -106,7 +106,7 @@
                 if (size==-1) {
                         parentRendered=true;
                 } else {
-                        e=(XmlsStackElement)levels.get(size);
+                        e=levels.get(size);
                         if (e.rendered && e.level+1==currentLevel)
                                 parentRendered=true;
 
@@ -117,12 +117,12 @@
                                 return;
                         }
 
-                        Map loa = new HashMap();
+                        Map<String,Attr> loa = new HashMap<String,Attr>();
                 for (;size>=0;size--) {
-                        e=(XmlsStackElement)levels.get(size);
-                        Iterator it=e.nodes.iterator();
+                        e=levels.get(size);
+                        Iterator<Attr> it=e.nodes.iterator();
                         while (it.hasNext()) {
-                                Attr n=(Attr)it.next();
+                                Attr n=it.next();
                                 if (!loa.containsKey(n.getName()))
                                         loa.put(n.getName(),n);
                         }
@@ -161,13 +161,13 @@
     * @return the Attr[]s to be outputted
     * @throws CanonicalizationException
     */
-   Iterator handleAttributesSubtree(Element E,  NameSpaceSymbTable ns )
+   Iterator<Attr> handleAttributesSubtree(Element E,  NameSpaceSymbTable ns )
            throws CanonicalizationException {
           if (!E.hasAttributes() && !firstCall) {
          return null;
       }
       // result will contain the attrs which have to be outputted
-      final SortedSet result = this.result;
+      final SortedSet<Attr> result = this.result;
       result.clear();
       NamedNodeMap attrs = E.getAttributes();
       int attrsLength = attrs.getLength();
@@ -194,7 +194,7 @@
 
           if (n!=null) {
                  //Render the ns definition
-             result.add(n);
+             result.add((Attr)n);
              if (C14nHelper.namespaceIsRelative(N)) {
                 Object exArgs[] = { E.getTagName(), NName, N.getNodeValue() };
                 throw new CanonicalizationException(
@@ -206,7 +206,7 @@
       if (firstCall) {
         //It is the first node of the subtree
         //Obtain all the namespaces defined in the parents, and added to the output.
-        ns.getUnrenderedNodes(result);
+        ns.getUnrenderedNodes(getSortedSetAsCollection(result));
         //output the attributes in the xml namespace.
         xmlattrStack.getXmlnsAttr(result);
                 firstCall=false;
@@ -227,7 +227,7 @@
     * @return the Attr[]s to be outputted
     * @throws CanonicalizationException
     */
-   Iterator handleAttributes(Element E,  NameSpaceSymbTable ns ) throws CanonicalizationException {
+   Iterator<Attr> handleAttributes(Element E,  NameSpaceSymbTable ns ) throws CanonicalizationException {
     // result will contain the attrs which have to be outputted
         xmlattrStack.push(ns.getLevel());
     boolean isRealVisible=isVisibleDO(E,ns.getLevel())==1;
@@ -239,7 +239,7 @@
     }
 
 
-    SortedSet result = this.result;
+    SortedSet<Attr> result = this.result;
     result.clear();
 
     for (int i = 0; i < attrsLength; i++) {
@@ -277,7 +277,7 @@
                 //Node n=ns.addMappingAndRenderXNodeSet(NName,NValue,N,isRealVisible);
                 Node n=ns.addMappingAndRender(NName,NValue,N);
                         if (n!=null) {
-                                        result.add(n);
+                                        result.add((Attr)n);
                     if (C14nHelper.namespaceIsRelative(N)) {
                        Object exArgs[] = { E.getTagName(), NName, N.getNodeValue() };
                        throw new CanonicalizationException(
@@ -306,12 +306,12 @@
         }
         //output the xmlns def if needed.
         if (n!=null) {
-                        result.add(n);
+                        result.add((Attr)n);
         }
         //Float all xml:* attributes of the unselected parent elements to this one.
         //addXmlAttributes(E,result);
         xmlattrStack.getXmlnsAttr(result);
-        ns.getUnrenderedNodes(result);
+        ns.getUnrenderedNodes(getSortedSetAsCollection(result));
 
     }
 
@@ -325,7 +325,7 @@
     * @return none it always fails
     * @throws CanonicalizationException always
     */
-   public byte[] engineCanonicalizeXPathNodeSet(Set xpathNodeSet, String inclusiveNamespaces)
+   public byte[] engineCanonicalizeXPathNodeSet(Set<Node> xpathNodeSet, String inclusiveNamespaces)
            throws CanonicalizationException {
 
       /** $todo$ well, should we throw UnsupportedOperationException ? */
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315Excl.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315Excl.java	Wed Oct 26 17:59:13 2011 -0700
@@ -61,9 +61,9 @@
       * This Set contains the names (Strings like "xmlns" or "xmlns:foo") of
       * the inclusive namespaces.
       */
-    TreeSet _inclusiveNSSet = new TreeSet();
+    TreeSet<String> _inclusiveNSSet = new TreeSet<String>();
     static final String XMLNS_URI=Constants.NamespaceSpecNS;
-    final SortedSet result = new TreeSet(COMPARE);
+    final SortedSet<Attr> result = new TreeSet<Attr>(COMPARE);
         /**
          * Constructor Canonicalizer20010315Excl
          *
@@ -106,8 +106,7 @@
          */
         public byte[] engineCanonicalizeSubTree(Node rootNode,
                         String inclusiveNamespaces,Node excl) throws CanonicalizationException {
-                        this._inclusiveNSSet = (TreeSet)InclusiveNamespaces
-                                        .prefixStr2Set(inclusiveNamespaces);
+                        this._inclusiveNSSet = getInclusiveNameSpace(inclusiveNamespaces);
                         return super.engineCanonicalizeSubTree(rootNode,excl);
         }
         /**
@@ -117,10 +116,10 @@
          * @return the rootNode c14n.
          * @throws CanonicalizationException
          */
+        @SuppressWarnings("unchecked")
         public byte[] engineCanonicalize(XMLSignatureInput rootNode,
                         String inclusiveNamespaces) throws CanonicalizationException {
-                        this._inclusiveNSSet = (TreeSet)InclusiveNamespaces
-                                        .prefixStr2Set(inclusiveNamespaces);
+                        this._inclusiveNSSet = getInclusiveNameSpace(inclusiveNamespaces);
                         return super.engineCanonicalize(rootNode);
         }
 
@@ -130,12 +129,12 @@
          * @param E
          * @throws CanonicalizationException
          */
-        Iterator handleAttributesSubtree(Element E,NameSpaceSymbTable ns)
+        Iterator<Attr> handleAttributesSubtree(Element E,NameSpaceSymbTable ns)
                         throws CanonicalizationException {
                 // System.out.println("During the traversal, I encountered " +
                 // XMLUtils.getXPath(E));
                 // result will contain the attrs which have to be outputted
-                SortedSet result = this.result;
+                SortedSet<Attr> result = this.result;
             result.clear();
                 NamedNodeMap attrs=null;
 
@@ -145,7 +144,7 @@
                 attrsLength = attrs.getLength();
         }
                 //The prefix visibly utilized(in the attribute or in the name) in the element
-                SortedSet visiblyUtilized =(SortedSet) _inclusiveNSSet.clone();
+                SortedSet<String> visiblyUtilized = getNSSetClone();
 
                 for (int i = 0; i < attrsLength; i++) {
                         Attr N = (Attr) attrs.item(i);
@@ -187,9 +186,9 @@
                 visiblyUtilized.add(prefix);
 
                 //This can be optimezed by I don't have time
-                Iterator it=visiblyUtilized.iterator();
+                Iterator<String> it=visiblyUtilized.iterator();
                 while (it.hasNext()) {
-                        String s=(String)it.next();
+                        String s=it.next();
                         Attr key=ns.getMapping(s);
                         if (key==null) {
                                 continue;
@@ -207,25 +206,35 @@
          * @param inclusiveNamespaces
          * @throws CanonicalizationException
          */
-        public byte[] engineCanonicalizeXPathNodeSet(Set xpathNodeSet,
+        public byte[] engineCanonicalizeXPathNodeSet(Set<Node> xpathNodeSet,
                         String inclusiveNamespaces) throws CanonicalizationException {
 
-
-                        this._inclusiveNSSet = (TreeSet)InclusiveNamespaces
-                                        .prefixStr2Set(inclusiveNamespaces);
+                        this._inclusiveNSSet = getInclusiveNameSpace(inclusiveNamespaces);
                         return super.engineCanonicalizeXPathNodeSet(xpathNodeSet);
 
         }
 
+    @SuppressWarnings("unchecked")
+    private TreeSet<String> getInclusiveNameSpace(String inclusiveNameSpaces) {
+        return (TreeSet<String>)InclusiveNamespaces.prefixStr2Set(inclusiveNameSpaces);
+    }
+
+
+    @SuppressWarnings("unchecked")
+    private SortedSet<String> getNSSetClone() {
+        return (SortedSet<String>) this._inclusiveNSSet.clone();
+    }
+
+
         /**
      * @inheritDoc
          * @param E
          * @throws CanonicalizationException
          */
-        final Iterator handleAttributes(Element E, NameSpaceSymbTable ns)
+        final Iterator<Attr> handleAttributes(Element E, NameSpaceSymbTable ns)
                         throws CanonicalizationException {
                 // result will contain the attrs which have to be outputted
-                SortedSet result = this.result;
+                SortedSet<Attr> result = this.result;
             result.clear();
                 NamedNodeMap attrs = null;
                 int attrsLength = 0;
@@ -234,11 +243,11 @@
                 attrsLength = attrs.getLength();
         }
                 //The prefix visibly utilized(in the attribute or in the name) in the element
-                Set visiblyUtilized =null;
+                Set<String> visiblyUtilized =null;
                 //It's the output selected.
                 boolean isOutputElement=isVisibleDO(E,ns.getLevel())==1;
                 if (isOutputElement) {
-                        visiblyUtilized =  (Set) this._inclusiveNSSet.clone();
+                        visiblyUtilized =  getNSSetClone();
                 }
 
                 for (int i = 0; i < attrsLength; i++) {
@@ -272,7 +281,7 @@
                         if (!isOutputElement && isVisible(N) && _inclusiveNSSet.contains(NName) && !ns.removeMappingIfRender(NName)) {
                                 Node n=ns.addMappingAndRender(NName,NNodeValue,N);
                                 if (n!=null) {
-                                                result.add(n);
+                                                result.add((Attr)n);
                             if (C14nHelper.namespaceIsRelative(N)) {
                                Object exArgs[] = { E.getTagName(), NName, N.getNodeValue() };
                                throw new CanonicalizationException(
@@ -315,9 +324,9 @@
                         }
                         //This can be optimezed by I don't have time
                         //visiblyUtilized.addAll(this._inclusiveNSSet);
-                        Iterator it=visiblyUtilized.iterator();
+                        Iterator<String> it=visiblyUtilized.iterator();
                         while (it.hasNext()) {
-                                String s=(String)it.next();
+                                String s=it.next();
                                 Attr key=ns.getMapping(s);
                                 if (key==null) {
                                         continue;
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/CanonicalizerBase.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/CanonicalizerBase.java	Wed Oct 26 17:59:13 2011 -0700
@@ -33,9 +33,12 @@
 import java.util.ListIterator;
 import java.util.Map;
 import java.util.Set;
+import java.util.SortedSet;
+import java.util.Collection;
 
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPath;
 
 import com.sun.org.apache.xml.internal.security.c14n.CanonicalizationException;
 import com.sun.org.apache.xml.internal.security.c14n.CanonicalizerSpi;
@@ -94,10 +97,10 @@
     }
    }
 
-   List nodeFilter;
+   List<NodeFilter> nodeFilter;
 
    boolean _includeComments;
-   Set _xpathNodeSet = null;
+   Set<Node> _xpathNodeSet = null;
    /**
     * The node to be skiped/excluded from the DOM tree
     * in subtree canonicalizations.
@@ -130,7 +133,7 @@
     * @param xpathNodeSet
     * @throws CanonicalizationException
     */
-   public byte[] engineCanonicalizeXPathNodeSet(Set xpathNodeSet)
+   public byte[] engineCanonicalizeXPathNodeSet(Set<Node> xpathNodeSet)
            throws CanonicalizationException {
            this._xpathNodeSet = xpathNodeSet;
            return engineCanonicalizeXPathNodeSetInternal(XMLUtils.getOwnerDocument(this._xpathNodeSet));
@@ -251,7 +254,7 @@
         final OutputStream writer=this._writer;
         final Node excludeNode=this._excludeNode;
         final boolean includeComments=this._includeComments;
-        Map cache=new HashMap();
+        Map<String, byte[]> cache=new HashMap<String, byte[]>();
         do {
                 switch (currentNode.getNodeType()) {
 
@@ -298,11 +301,11 @@
                         String name=currentElement.getTagName();
                         UtfHelpper.writeByte(name,writer,cache);
 
-                        Iterator attrs = this.handleAttributesSubtree(currentElement,ns);
+                        Iterator<Attr> attrs = this.handleAttributesSubtree(currentElement,ns);
                         if (attrs!=null) {
                                 //we output all Attrs which are available
                                 while (attrs.hasNext()) {
-                                        Attr attr = (Attr) attrs.next();
+                                        Attr attr = attrs.next();
                                         outputAttrToWriter(attr.getNodeName(),attr.getNodeValue(), writer,cache);
                                 }
                         }
@@ -394,7 +397,7 @@
         Node parentNode=null;
         OutputStream writer=this._writer;
         int documentLevel=NODE_BEFORE_DOCUMENT_ELEMENT;
-        Map cache=new HashMap();
+        Map<String, byte[]> cache=new HashMap<String,byte[]>();
         do {
                 switch (currentNode.getNodeType()) {
 
@@ -464,11 +467,11 @@
                                 ns.push();
                         }
 
-                        Iterator attrs = handleAttributes(currentElement,ns);
+                        Iterator<Attr> attrs = handleAttributes(currentElement,ns);
                         if (attrs!=null) {
                                 //we output all Attrs which are available
                                 while (attrs.hasNext()) {
-                                        Attr attr = (Attr) attrs.next();
+                                        Attr attr = attrs.next();
                                         outputAttrToWriter(attr.getNodeName(),attr.getNodeValue(), writer,cache);
                                 }
                         }
@@ -522,9 +525,9 @@
    }
    int isVisibleDO(Node currentNode,int level) {
            if (nodeFilter!=null) {
-                        Iterator it=nodeFilter.iterator();
+                        Iterator<NodeFilter> it=nodeFilter.iterator();
                         while (it.hasNext()) {
-                                int i=((NodeFilter)it.next()).isNodeIncludeDO(currentNode,level);
+                                int i=(it.next()).isNodeIncludeDO(currentNode,level);
                                 if (i!=1)
                                         return i;
                         }
@@ -535,9 +538,9 @@
    }
    int isVisibleInt(Node currentNode) {
            if (nodeFilter!=null) {
-                Iterator it=nodeFilter.iterator();
+                Iterator<NodeFilter> it=nodeFilter.iterator();
                 while (it.hasNext()) {
-                        int i=((NodeFilter)it.next()).isNodeInclude(currentNode);
+                        int i=(it.next()).isNodeInclude(currentNode);
                         if (i!=1)
                                 return i;
                 }
@@ -549,9 +552,9 @@
 
    boolean isVisible(Node currentNode) {
            if (nodeFilter!=null) {
-                Iterator it=nodeFilter.iterator();
+                Iterator<NodeFilter> it=nodeFilter.iterator();
                 while (it.hasNext()) {
-                        if (((NodeFilter)it.next()).isNodeInclude(currentNode)!=1)
+                        if ((it.next()).isNodeInclude(currentNode)!=1)
                                 return false;
                 }
            }
@@ -589,7 +592,7 @@
          * @param ns
          */
         final void getParentNameSpaces(Element el,NameSpaceSymbTable ns)  {
-                List parents=new ArrayList(10);
+                List<Element> parents=new ArrayList<Element>(10);
                 Node n1=el.getParentNode();
                 if (!(n1 instanceof Element)) {
                         return;
@@ -605,9 +608,9 @@
                         parent=(Element)n;
                 }
                 //Visit them in reverse order.
-                ListIterator it=parents.listIterator(parents.size());
+                ListIterator<Element> it=parents.listIterator(parents.size());
                 while (it.hasPrevious()) {
-                        Element ele=(Element)it.previous();
+                        Element ele=it.previous();
                         handleParent(ele, ns);
         }
         Attr nsprefix;
@@ -624,7 +627,7 @@
         * @return the attributes nodes to output.
     * @throws CanonicalizationException
     */
-   abstract Iterator handleAttributes(Element E, NameSpaceSymbTable ns )
+   abstract Iterator<Attr> handleAttributes(Element E, NameSpaceSymbTable ns )
    throws CanonicalizationException;
 
    /**
@@ -635,7 +638,7 @@
         * @return the attributes nodes to output.
     * @throws CanonicalizationException
     */
-   abstract Iterator handleAttributesSubtree(Element E, NameSpaceSymbTable ns)
+   abstract Iterator<Attr> handleAttributesSubtree(Element E, NameSpaceSymbTable ns)
    throws CanonicalizationException;
 
    abstract void circumventBugIfNeeded(XMLSignatureInput input) throws CanonicalizationException, ParserConfigurationException, IOException, SAXException;
@@ -660,7 +663,7 @@
             * @throws IOException
             */
            static final void outputAttrToWriter(final String name, final String value, final OutputStream writer,
-                                final Map cache) throws IOException {
+                                final Map<String, byte[]> cache) throws IOException {
               writer.write(' ');
               UtfHelpper.writeByte(name,writer,cache);
               writer.write(equalsStr);
@@ -841,4 +844,10 @@
               }
            }
 
+    @SuppressWarnings("unchecked")
+    protected Collection<Attr> getSortedSetAsCollection(SortedSet<Attr> result) {
+        return (Collection<Attr>)(Collection)result;
+    }
+
+
 }
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/NameSpaceSymbTable.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/NameSpaceSymbTable.java	Wed Oct 26 17:59:13 2011 -0700
@@ -44,7 +44,7 @@
         /**The level of nameSpaces (for Inclusive visibility).*/
         int nameSpaces=0;
         /**The stacks for removing the definitions when doing pop.*/
-        List level;
+        List<SymbMap> level;
     boolean cloned=true;
         static final String XMLNS="xmlns";
         final static SymbMap initialMap=new SymbMap();
@@ -57,7 +57,7 @@
      * Default constractor
      **/
     public NameSpaceSymbTable() {
-        level = new ArrayList(10);
+        level = new ArrayList<SymbMap>(10);
         //Insert the default binding for xmlns.
         symb=(SymbMap) initialMap.clone();
     }
@@ -67,11 +67,11 @@
          * For Inclusive rendering
      * @param result the list where to fill the unrendered xmlns definitions.
          **/
-        public  void getUnrenderedNodes(Collection result) {
+        public  void getUnrenderedNodes(Collection<Attr> result) {
            //List result=new ArrayList();
-           Iterator it=symb.entrySet().iterator();
+           Iterator<NameSpaceSymbEntry> it=symb.entrySet().iterator();
            while (it.hasNext()) {
-                        NameSpaceSymbEntry n=(NameSpaceSymbEntry)(it.next());
+                        NameSpaceSymbEntry n= it.next();
                         //put them rendered?
                         if ((!n.rendered) && (n.n!=null)) {
                                 n=(NameSpaceSymbEntry) n.clone();
@@ -339,8 +339,8 @@
         }
     }
 
-    List entrySet() {
-        List a=new ArrayList();
+    List<NameSpaceSymbEntry> entrySet() {
+        List<NameSpaceSymbEntry> a=new ArrayList<NameSpaceSymbEntry>();
         for (int i=0;i<entries.length;i++) {
                 if ((entries[i]!=null) && !("".equals(entries[i].uri))) {
                         a.add(entries[i]);
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/UtfHelpper.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/UtfHelpper.java	Wed Oct 26 17:59:13 2011 -0700
@@ -6,8 +6,8 @@
 
 public class UtfHelpper {
 
-        final static void writeByte(final String str,final OutputStream out,Map cache) throws IOException {
-                   byte []result=(byte[]) cache.get(str);
+        final static void writeByte(final String str,final OutputStream out,Map<String,byte[]> cache) throws IOException {
+                   byte []result= cache.get(str);
                    if (result==null) {
                            result=getStringInUtf8(str);
                            cache.put(str,result);
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AgreementMethod.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/AgreementMethod.java	Wed Oct 26 17:59:13 2011 -0700
@@ -95,7 +95,7 @@
      * Returns aditional information regarding the <code>AgreementMethod</code>.
      * @return
      */
-    Iterator getAgreementMethodInformation();
+    Iterator<Element> getAgreementMethodInformation();
 
     /**
      * Adds additional <code>AgreementMethod</code> information.
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionMethod.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionMethod.java	Wed Oct 26 17:59:13 2011 -0700
@@ -89,7 +89,7 @@
      * @return an <code>Iterator</code> over all the additional infomation
      *   about the <code>EncryptionMethod</code>.
      */
-    Iterator getEncryptionMethodInformation();
+    Iterator<Element> getEncryptionMethodInformation();
 
     /**
      * Adds encryption method information.
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionProperties.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionProperties.java	Wed Oct 26 17:59:13 2011 -0700
@@ -67,7 +67,7 @@
      *
      * @return an <code>Iterator</code> over all the encryption properties.
      */
-    Iterator getEncryptionProperties();
+    Iterator<EncryptionProperty> getEncryptionProperties();
 
     /**
      * Adds an <code>EncryptionProperty</code>.
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionProperty.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionProperty.java	Wed Oct 26 17:59:13 2011 -0700
@@ -101,7 +101,7 @@
      * @return an <code>Iterator</code> over all the addiitonal encryption
      *   information contained in this class.
      */
-    Iterator getEncryptionInformation();
+    Iterator<Element> getEncryptionInformation();
 
     /**
      * Adds encryption information.
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/Reference.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/Reference.java	Wed Oct 26 17:59:13 2011 -0700
@@ -74,7 +74,7 @@
      *
      * @return child elements.
      */
-    Iterator getElementRetrievalInformation();
+    Iterator<Element> getElementRetrievalInformation();
 
     /**
      * Adds retrieval information.
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/ReferenceList.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/ReferenceList.java	Wed Oct 26 17:59:13 2011 -0700
@@ -87,7 +87,7 @@
      *
      * @return Iterator.
      */
-    public Iterator getReferences();
+    public Iterator<Reference> getReferences();
 
     /**
      * <code>DataReference</code> factory method. Returns a
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/XMLCipher.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/XMLCipher.java	Wed Oct 26 17:59:13 2011 -0700
@@ -2772,7 +2772,7 @@
         // </complexType>
         private class AgreementMethodImpl implements AgreementMethod {
             private byte[] kaNonce = null;
-            private List agreementMethodInformation = null;
+            private List<Element> agreementMethodInformation = null;
             private KeyInfo originatorKeyInfo = null;
             private KeyInfo recipientKeyInfo = null;
             private String algorithmURI = null;
@@ -2781,7 +2781,7 @@
              * @param algorithm
              */
             public AgreementMethodImpl(String algorithm) {
-                agreementMethodInformation = new LinkedList();
+                agreementMethodInformation = new LinkedList<Element>();
                 URI tmpAlgorithm = null;
                 try {
                     tmpAlgorithm = new URI(algorithm);
@@ -2802,7 +2802,7 @@
             }
 
             /** @inheritDoc */
-            public Iterator getAgreementMethodInformation() {
+            public Iterator<Element> getAgreementMethodInformation() {
                 return (agreementMethodInformation.iterator());
             }
 
@@ -2879,9 +2879,9 @@
                             _contextDocument.createTextNode(new String(kaNonce)));
                 }
                 if (!agreementMethodInformation.isEmpty()) {
-                    Iterator itr = agreementMethodInformation.iterator();
+                    Iterator<Element> itr = agreementMethodInformation.iterator();
                     while (itr.hasNext()) {
-                        result.appendChild((Element) itr.next());
+                        result.appendChild(itr.next());
                     }
                 }
                 if (null != originatorKeyInfo) {
@@ -3486,7 +3486,7 @@
             private String algorithm = null;
             private int keySize = Integer.MIN_VALUE;
             private byte[] oaepParams = null;
-            private List encryptionMethodInformation = null;
+            private List<Element> encryptionMethodInformation = null;
             /**
              *
              * @param algorithm
@@ -3499,7 +3499,7 @@
                     // complain
                 }
                 this.algorithm = tmpAlgorithm.toString();
-                encryptionMethodInformation = new LinkedList();
+                encryptionMethodInformation = new LinkedList<Element>();
             }
             /** @inheritDoc */
             public String getAlgorithm() {
@@ -3522,7 +3522,7 @@
                 oaepParams = params;
             }
             /** @inheritDoc */
-            public Iterator getEncryptionMethodInformation() {
+            public Iterator<Element> getEncryptionMethodInformation() {
                 return (encryptionMethodInformation.iterator());
             }
             /** @inheritDoc */
@@ -3565,8 +3565,8 @@
                                 new String(oaepParams))));
                 }
                 if (!encryptionMethodInformation.isEmpty()) {
-                    Iterator itr = encryptionMethodInformation.iterator();
-                    result.appendChild((Element) itr.next());
+                    Iterator<Element> itr = encryptionMethodInformation.iterator();
+                    result.appendChild(itr.next());
                 }
 
                 return (result);
@@ -3582,13 +3582,13 @@
         // </complexType>
         private class EncryptionPropertiesImpl implements EncryptionProperties {
             private String id = null;
-            private List encryptionProperties = null;
+            private List<EncryptionProperty> encryptionProperties = null;
             /**
              *
              *
              */
             public EncryptionPropertiesImpl() {
-                encryptionProperties = new LinkedList();
+                encryptionProperties = new LinkedList<EncryptionProperty>();
             }
             /** @inheritDoc */
             public String getId() {
@@ -3599,7 +3599,7 @@
                 this.id = id;
             }
             /** @inheritDoc */
-            public Iterator getEncryptionProperties() {
+            public Iterator<EncryptionProperty> getEncryptionProperties() {
                 return (encryptionProperties.iterator());
             }
             /** @inheritDoc */
@@ -3625,7 +3625,7 @@
                 if (null != id) {
                     result.setAttributeNS(null, EncryptionConstants._ATT_ID, id);
                 }
-                Iterator itr = getEncryptionProperties();
+                Iterator<EncryptionProperty> itr = getEncryptionProperties();
                 while (itr.hasNext()) {
                     result.appendChild(((EncryptionPropertyImpl)
                         itr.next()).toElement());
@@ -3647,15 +3647,15 @@
         private class EncryptionPropertyImpl implements EncryptionProperty {
             private String target = null;
             private String id = null;
-            private HashMap attributeMap = new HashMap();
-            private List encryptionInformation = null;
+            private HashMap<String,String> attributeMap = new HashMap<String,String>();
+            private List<Element> encryptionInformation = null;
 
             /**
              *
              *
              */
             public EncryptionPropertyImpl() {
-                encryptionInformation = new LinkedList();
+                encryptionInformation = new LinkedList<Element>();
             }
             /** @inheritDoc */
             public String getTarget() {
@@ -3692,14 +3692,14 @@
             }
             /** @inheritDoc */
             public String getAttribute(String attribute) {
-                return (String) attributeMap.get(attribute);
+                return attributeMap.get(attribute);
             }
             /** @inheritDoc */
             public void setAttribute(String attribute, String value) {
                 attributeMap.put(attribute, value);
             }
             /** @inheritDoc */
-            public Iterator getEncryptionInformation() {
+            public Iterator<Element> getEncryptionInformation() {
                 return (encryptionInformation.iterator());
             }
             /** @inheritDoc */
@@ -3821,8 +3821,8 @@
         //    </complexType>
         //</element>
         private class ReferenceListImpl implements ReferenceList {
-            private Class sentry;
-            private List references;
+            private Class<?> sentry;
+            private List<Reference> references;
             /**
              *
              * @param type
@@ -3835,7 +3835,7 @@
                 } else {
                     throw new IllegalArgumentException();
                 }
-                references = new LinkedList();
+                references = new LinkedList<Reference>();
             }
             /** @inheritDoc */
             public void add(Reference reference) {
@@ -3860,7 +3860,7 @@
                 return (references.isEmpty());
             }
             /** @inheritDoc */
-            public Iterator getReferences() {
+            public Iterator<Reference> getReferences() {
                 return (references.iterator());
             }
 
@@ -3869,9 +3869,9 @@
                     _contextDocument,
                     EncryptionConstants.EncryptionSpecNS,
                     EncryptionConstants._TAG_REFERENCELIST);
-                Iterator eachReference = references.iterator();
+                Iterator<Reference> eachReference = references.iterator();
                 while (eachReference.hasNext()) {
-                    Reference reference = (Reference) eachReference.next();
+                    Reference reference = eachReference.next();
                     result.appendChild(
                         ((ReferenceImpl) reference).toElement());
                 }
@@ -3894,18 +3894,18 @@
              */
             private abstract class ReferenceImpl implements Reference {
                 private String uri;
-                private List referenceInformation;
+                private List<Element> referenceInformation;
 
                 ReferenceImpl(String _uri) {
                     this.uri = _uri;
-                    referenceInformation = new LinkedList();
+                    referenceInformation = new LinkedList<Element>();
                 }
                 /** @inheritDoc */
                 public String getURI() {
                     return (uri);
                 }
                 /** @inheritDoc */
-                public Iterator getElementRetrievalInformation() {
+                public Iterator<Element> getElementRetrievalInformation() {
                     return (referenceInformation.iterator());
                 }
                 /** @inheritDoc */
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/keys/KeyInfo.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/keys/KeyInfo.java	Wed Oct 26 17:59:13 2011 -0700
@@ -97,12 +97,12 @@
    /** {@link java.util.logging} logging facility */
     static java.util.logging.Logger log =
         java.util.logging.Logger.getLogger(KeyInfo.class.getName());
-    List x509Datas=null;
-    List encryptedKeys=null;
+    List<X509Data> x509Datas=null;
+    List<EncryptedKey> encryptedKeys=null;
 
-    static final List nullList;
+    static final List<StorageResolver> nullList;
     static {
-        List list = new ArrayList();
+        List<StorageResolver> list = new ArrayList<StorageResolver>(1);
         list.add(null);
         nullList = Collections.unmodifiableList(list);
     }
@@ -297,7 +297,7 @@
     */
    public void add(X509Data x509data) {
           if (x509Datas==null)
-                  x509Datas=new ArrayList();
+                  x509Datas=new ArrayList<X509Data>();
           x509Datas.add(x509data);
          this._constructionElement.appendChild(x509data.getElement());
          XMLUtils.addReturnToElement(this._constructionElement);
@@ -313,7 +313,7 @@
         public void add(EncryptedKey encryptedKey)
                 throws XMLEncryptionException {
                         if (encryptedKeys==null)
-                                encryptedKeys=new ArrayList();
+                                encryptedKeys=new ArrayList<EncryptedKey>();
                         encryptedKeys.add(encryptedKey);
                         XMLCipher cipher = XMLCipher.getInstance();
                         this._constructionElement.appendChild(cipher.martial(encryptedKey));
@@ -541,7 +541,7 @@
     */
    public X509Data itemX509Data(int i) throws XMLSecurityException {
            if (x509Datas!=null) {
-                   return (X509Data) x509Datas.get(i);
+                   return x509Datas.get(i);
            }
       Element e = XMLUtils.selectDsNode(this._constructionElement.getFirstChild(),
                                                 Constants._TAG_X509DATA,i);
@@ -562,7 +562,7 @@
 
         public EncryptedKey itemEncryptedKey(int i) throws XMLSecurityException {
                 if (encryptedKeys!=null) {
-                        return (EncryptedKey) encryptedKeys.get(i);
+                        return encryptedKeys.get(i);
                 }
                 Element e =
                         XMLUtils.selectXencNode(this._constructionElement.getFirstChild(),
@@ -728,16 +728,16 @@
    PublicKey getPublicKeyFromStaticResolvers() throws KeyResolverException {
           int length=KeyResolver.length();
           int storageLength=this._storageResolvers.size();
-          Iterator it= KeyResolver.iterator();
+          Iterator<KeyResolverSpi> it= KeyResolver.iterator();
       for (int i = 0; i < length; i++) {
-         KeyResolverSpi keyResolver = (KeyResolverSpi) it.next();
+         KeyResolverSpi keyResolver = it.next();
          Node currentChild=this._constructionElement.getFirstChild();
          String uri= this.getBaseURI();
          while (currentChild!=null)      {
             if (currentChild.getNodeType() == Node.ELEMENT_NODE) {
                   for (int k = 0; k < storageLength; k++) {
                      StorageResolver storage =
-                        (StorageResolver) this._storageResolvers.get(k);
+                        this._storageResolvers.get(k);
 
                      PublicKey pk =
                            keyResolver.engineLookupAndResolvePublicKey((Element) currentChild,
@@ -776,7 +776,7 @@
             if (currentChild.getNodeType() == Node.ELEMENT_NODE) {
                for (int k = 0; k < storageLength; k++) {
                    StorageResolver storage =
-                      (StorageResolver) this._storageResolvers.get(k);
+                       this._storageResolvers.get(k);
                    PublicKey pk = keyResolver
                            .engineLookupAndResolvePublicKey((Element) currentChild, uri, storage);
 
@@ -845,9 +845,9 @@
       String uri=this.getBaseURI();
       int length= KeyResolver.length();
       int storageLength=this._storageResolvers.size();
-      Iterator it = KeyResolver.iterator();
+      Iterator<KeyResolverSpi> it = KeyResolver.iterator();
       for (int i = 0; i <length; i++) {
-         KeyResolverSpi keyResolver = (KeyResolverSpi) it.next();
+         KeyResolverSpi keyResolver =  it.next();
          X509Certificate cert= applyCurrentResolver(uri, storageLength, keyResolver);
          if (cert!=null) {
                  KeyResolver.hit(it);
@@ -863,7 +863,7 @@
                    if (currentChild.getNodeType() == Node.ELEMENT_NODE) {
                for (int k = 0; k < storageLength; k++) {
                    StorageResolver storage =
-                      (StorageResolver) this._storageResolvers.get(k);
+                      this._storageResolvers.get(k);
 
                    X509Certificate cert = keyResolver
                         .engineLookupResolveX509Certificate((Element) currentChild, uri,
@@ -944,9 +944,9 @@
    SecretKey getSecretKeyFromStaticResolvers() throws KeyResolverException {
           final int length=KeyResolver.length();
           int storageLength=this._storageResolvers.size();
-          Iterator it = KeyResolver.iterator();
+          Iterator<KeyResolverSpi> it = KeyResolver.iterator();
       for (int i = 0; i < length; i++) {
-         KeyResolverSpi keyResolver = (KeyResolverSpi) it.next();
+         KeyResolverSpi keyResolver = it.next();
 
          Node currentChild=this._constructionElement.getFirstChild();
          String uri=this.getBaseURI();
@@ -954,7 +954,7 @@
             if (currentChild.getNodeType() == Node.ELEMENT_NODE) {
                   for (int k = 0; k < storageLength; k++) {
                      StorageResolver storage =
-                        (StorageResolver) this._storageResolvers.get(k);
+                        this._storageResolvers.get(k);
 
                      SecretKey sk =
                            keyResolver.engineLookupAndResolveSecretKey((Element) currentChild,
@@ -992,7 +992,7 @@
             if (currentChild.getNodeType() == Node.ELEMENT_NODE) {
                for (int k = 0; k < storageLength; k++) {
                      StorageResolver storage =
-                        (StorageResolver) this._storageResolvers.get(k);
+                        this._storageResolvers.get(k);
 
                      SecretKey sk = keyResolver
                            .engineLookupAndResolveSecretKey((Element) currentChild, uri, storage);
@@ -1012,7 +1012,7 @@
    /**
     * Stores the individual (per-KeyInfo) {@link KeyResolver}s
     */
-   List _internalKeyResolvers = null;
+   List<KeyResolverSpi> _internalKeyResolvers = null;
 
    /**
     * This method is used to add a custom {@link KeyResolverSpi} to a KeyInfo
@@ -1022,7 +1022,7 @@
     */
    public void registerInternalKeyResolver(KeyResolverSpi realKeyResolver) {
            if (_internalKeyResolvers==null) {
-                   _internalKeyResolvers=new ArrayList();
+                   _internalKeyResolvers=new ArrayList<KeyResolverSpi>();
            }
       this._internalKeyResolvers.add(realKeyResolver);
    }
@@ -1044,11 +1044,11 @@
     * @return the KeyResolverSpi for the index.
     */
    KeyResolverSpi itemInternalKeyResolver(int i) {
-      return (KeyResolverSpi) this._internalKeyResolvers.get(i);
+      return this._internalKeyResolvers.get(i);
    }
 
    /** Field _storageResolvers */
-   List _storageResolvers = nullList;
+   List<StorageResolver> _storageResolvers = nullList;
 
    /**
     * Method addStorageResolver
@@ -1057,7 +1057,7 @@
     */
    public void addStorageResolver(StorageResolver storageResolver) {
            if  (_storageResolvers == nullList  ){
-                   _storageResolvers=new ArrayList();
+                   _storageResolvers=new ArrayList<StorageResolver>();
            }
          this._storageResolvers.add(storageResolver);
 
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolver.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolver.java	Wed Oct 26 17:59:13 2011 -0700
@@ -52,7 +52,7 @@
    static boolean _alreadyInitialized = false;
 
    /** Field _resolverVector */
-   static List _resolverVector = null;
+   static List<KeyResolver> _resolverVector = null;
 
    /** Field _resolverSpi */
    protected KeyResolverSpi _resolverSpi = null;
@@ -85,12 +85,12 @@
       return KeyResolver._resolverVector.size();
    }
 
-   public static void hit(Iterator hintI) {
+   public static void hit(Iterator<KeyResolverSpi> hintI) {
            ResolverIterator hint = (ResolverIterator) hintI;
            int i = hint.i;
            if (i!=1 && hint.res ==_resolverVector) {
-                   List resolverVector=(List)((ArrayList)_resolverVector).clone();
-                Object ob=resolverVector.remove(i-1);
+                   List<KeyResolver> resolverVector=getResolverVectorClone();
+                KeyResolver ob=resolverVector.remove(i-1);
                 resolverVector.add(0,ob);
                  _resolverVector=resolverVector;
          } else {
@@ -113,12 +113,9 @@
               throws KeyResolverException {
 
           // use the old vector to not be hit by updates
-          List resolverVector = KeyResolver._resolverVector;
-      for (int i = 0; i < resolverVector.size(); i++) {
-                  KeyResolver resolver=
-            (KeyResolver) resolverVector.get(i);
-
-                  if (resolver==null) {
+          List<KeyResolver> resolverVector = KeyResolver._resolverVector;
+      for (KeyResolver resolver : resolverVector) {
+         if (resolver==null) {
             Object exArgs[] = {
                (((element != null)
                  && (element.getNodeType() == Node.ELEMENT_NODE))
@@ -157,10 +154,8 @@
            Element element, String BaseURI, StorageResolver storage)
               throws KeyResolverException {
 
-          List resolverVector = KeyResolver._resolverVector;
-      for (int i = 0; i < resolverVector.size(); i++) {
-                  KeyResolver resolver=
-            (KeyResolver) resolverVector.get(i);
+          List<KeyResolver> resolverVector = KeyResolver._resolverVector;
+      for (KeyResolver resolver : resolverVector) {
 
                   if (resolver==null) {
             Object exArgs[] = {
@@ -176,11 +171,11 @@
 
          PublicKey cert=resolver.resolvePublicKey(element, BaseURI, storage);
          if (cert!=null) {
-                 if (i!=0 && resolverVector==_resolverVector) {
+                 if (resolverVector.indexOf(resolver)!=0 && resolverVector==_resolverVector) {
                          //update resolver.
-                         resolverVector=(List)((ArrayList)_resolverVector).clone();
-                                 Object ob=resolverVector.remove(i);
-                                 resolverVector.add(0,ob);
+                         resolverVector=getResolverVectorClone();
+                                 resolverVector.remove(resolver);
+                                 resolverVector.add(0,resolver);
                                  _resolverVector=resolverVector;
                  }
                  return cert;
@@ -195,13 +190,19 @@
       throw new KeyResolverException("utils.resolver.noClass", exArgs);
    }
 
+
+   @SuppressWarnings("unchecked")
+   private static List<KeyResolver> getResolverVectorClone() {
+       return (List<KeyResolver>)((ArrayList<KeyResolver>)_resolverVector).clone();
+   }
+
    /**
     * The init() function is called by com.sun.org.apache.xml.internal.security.Init.init()
     */
    public static void init() {
 
       if (!KeyResolver._alreadyInitialized) {
-         KeyResolver._resolverVector = new ArrayList(10);
+         KeyResolver._resolverVector = new ArrayList<KeyResolver>(10);
          _alreadyInitialized = true;
       }
    }
@@ -230,8 +231,8 @@
     *
     * @param className
     */
-   public static void registerAtStart(String className) {
-      KeyResolver._resolverVector.add(0, className);
+   public static void registerAtStart(String className) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
+       register(className);
    }
 
    /**
@@ -322,11 +323,11 @@
       return this._resolverSpi.getClass().getName();
    }
 
-   static class ResolverIterator implements Iterator {
-           List res;
-                Iterator it;
+   static class ResolverIterator implements Iterator<KeyResolverSpi> {
+                List<KeyResolver> res;
+                Iterator<KeyResolver> it;
                 int i;
-           public ResolverIterator(List list) {
+           public ResolverIterator(List<KeyResolver> list) {
                 res = list;
                 it = res.iterator();
         }
@@ -335,9 +336,9 @@
                         return it.hasNext();
                 }
 
-                public Object next() {
+                public KeyResolverSpi next() {
                         i++;
-                        KeyResolver resolver = (KeyResolver) it.next();
+                        KeyResolver resolver =  it.next();
                       if (resolver==null) {
                          throw new RuntimeException("utils.resolver.noClass");
                       }
@@ -351,7 +352,7 @@
                 }
 
         };
-        public static Iterator iterator() {
+        public static Iterator<KeyResolverSpi> iterator() {
                 return new ResolverIterator(_resolverVector);
    }
 }
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolverSpi.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolverSpi.java	Wed Oct 26 17:59:13 2011 -0700
@@ -32,7 +32,7 @@
 /**
  * This class is abstract class for a child KeyInfo Elemnet.
  *
- * If you want the your KeyResolver, at firstly you must extand this class, and register
+ * If you want your KeyResolver, at first you must extend this class, and register
  * as following in config.xml
  * <PRE>
  *  &lt;KeyResolver URI="http://www.w3.org/2000/09/xmldsig#KeyValue"
@@ -177,7 +177,7 @@
    }
 
    /** Field _properties */
-   protected java.util.Map _properties = null;
+   protected java.util.Map<String,String> _properties = null;
 
    protected boolean globalResolver=false;
 
@@ -189,7 +189,7 @@
     */
    public void engineSetProperty(String key, String value) {
            if (_properties==null)
-                   _properties=new HashMap();
+                   _properties=new HashMap<String,String>();
       this._properties.put(key, value);
    }
 
@@ -203,7 +203,7 @@
            if (_properties==null)
                    return null;
 
-      return (String) this._properties.get(key);
+      return this._properties.get(key);
    }
 
    /**
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/RetrievalMethodResolver.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/RetrievalMethodResolver.java	Wed Oct 26 17:59:13 2011 -0700
@@ -278,18 +278,18 @@
       return null;
    }
 
-   static Element getDocumentElement(Set set) {
-           Iterator it=set.iterator();
+   static Element getDocumentElement(Set<Node> set) {
+           Iterator<Node> it=set.iterator();
            Element e=null;
            while (it.hasNext()) {
-                   Node currentNode=(Node)it.next();
+                   Node currentNode=it.next();
                    if (currentNode instanceof Element) {
                            e=(Element)currentNode;
                            break;
                    }
 
            }
-           List parents=new ArrayList(10);
+           List<Element> parents=new ArrayList<Element>(10);
 
                 //Obtain all the parents of the elemnt
                 do {
@@ -301,10 +301,10 @@
                         e=(Element)n;
                 } while (e!=null);
                 //Visit them in reverse order.
-                ListIterator it2=parents.listIterator(parents.size()-1);
+                ListIterator<Element> it2=parents.listIterator(parents.size()-1);
                 Element ele=null;
                 while (it2.hasPrevious()) {
-                        ele=(Element)it2.previous();
+                        ele=it2.previous();
                         if (set.contains(ele)) {
                                 return ele;
                         }
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/StorageResolver.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/StorageResolver.java	Wed Oct 26 17:59:13 2011 -0700
@@ -42,10 +42,10 @@
         java.util.logging.Logger.getLogger(StorageResolver.class.getName());
 
    /** Field _storageResolvers */
-   List _storageResolvers = null;
+   List<Object> _storageResolvers = null;
 
    /** Field _iterator */
-   Iterator _iterator = null;
+   Iterator<Object> _iterator = null;
 
    /**
     * Constructor StorageResolver
@@ -69,7 +69,7 @@
     */
    public void add(StorageResolverSpi resolver) {
            if (_storageResolvers==null)
-                   _storageResolvers=new ArrayList();
+                   _storageResolvers=new ArrayList<Object>();
       this._storageResolvers.add(resolver);
 
       this._iterator = null;
@@ -121,11 +121,11 @@
     * @return the iterator for the resolvers.
     *
     */
-   public Iterator getIterator() {
+   public Iterator<Object> getIterator() {
 
       if (this._iterator == null) {
          if (_storageResolvers==null)
-                   _storageResolvers=new ArrayList();
+                   _storageResolvers=new ArrayList<Object>();
          this._iterator = new StorageResolverIterator(this._storageResolvers.iterator());
       }
 
@@ -141,7 +141,7 @@
 
       if (this._iterator == null) {
           if (_storageResolvers==null)
-                   _storageResolvers=new ArrayList();
+                   _storageResolvers=new ArrayList<Object>();
          this._iterator = new StorageResolverIterator(this._storageResolvers.iterator());
       }
 
@@ -163,17 +163,17 @@
     * @author $Author: mullan $
     * @version $Revision: 1.5 $
     */
-   static class StorageResolverIterator implements Iterator {
+   static class StorageResolverIterator implements Iterator<Object> {
 
       /** Field _resolvers */
-      Iterator _resolvers = null;
+      Iterator<Object> _resolvers = null;
 
       /**
        * Constructor FilesystemIterator
        *
        * @param resolvers
        */
-      public StorageResolverIterator(Iterator resolvers) {
+      public StorageResolverIterator(Iterator<Object> resolvers) {
          this._resolvers = resolvers;
       }
 
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/StorageResolverSpi.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/StorageResolverSpi.java	Wed Oct 26 17:59:13 2011 -0700
@@ -36,5 +36,5 @@
     *
     * @return the iterator for the storage
     */
-   public abstract Iterator getIterator();
+   public abstract Iterator<?> getIterator();
 }
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/implementations/CertsInFilesystemDirectoryResolver.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/implementations/CertsInFilesystemDirectoryResolver.java	Wed Oct 26 17:59:13 2011 -0700
@@ -54,10 +54,10 @@
    String _merlinsCertificatesDir = null;
 
    /** Field _certs */
-   private List _certs = new ArrayList();
+   private List<X509Certificate> _certs = new ArrayList<X509Certificate>();
 
    /** Field _iterator */
-   Iterator _iterator = null;
+   Iterator<X509Certificate> _iterator = null;
 
    /**
     *
@@ -83,7 +83,7 @@
    private void readCertsFromHarddrive() throws StorageResolverException {
 
       File certDir = new File(this._merlinsCertificatesDir);
-      ArrayList al = new ArrayList();
+      ArrayList<String> al = new ArrayList<String>();
       String[] names = certDir.list();
 
       for (int i = 0; i < names.length; i++) {
@@ -108,7 +108,7 @@
 
       for (int i = 0; i < al.size(); i++) {
          String filename = certDir.getAbsolutePath() + File.separator
-                           + (String) al.get(i);
+                           + al.get(i);
          File file = new File(filename);
          boolean added = false;
          String dn = null;
@@ -146,7 +146,7 @@
    }
 
    /** @inheritDoc */
-   public Iterator getIterator() {
+   public Iterator<X509Certificate> getIterator() {
       return this._iterator;
    }
 
@@ -156,10 +156,10 @@
     * @author $Author: mullan $
     * @version $Revision: 1.5 $
     */
-   private static class FilesystemIterator implements Iterator {
+   private static class FilesystemIterator implements Iterator<X509Certificate> {
 
       /** Field _certs */
-      List _certs = null;
+      List<X509Certificate> _certs = null;
 
       /** Field _i */
       int _i;
@@ -169,7 +169,7 @@
        *
        * @param certs
        */
-      public FilesystemIterator(List certs) {
+      public FilesystemIterator(List<X509Certificate> certs) {
          this._certs = certs;
          this._i = 0;
       }
@@ -180,7 +180,7 @@
       }
 
       /** @inheritDoc */
-      public Object next() {
+      public X509Certificate next() {
          return this._certs.get(this._i++);
       }
 
@@ -206,8 +206,8 @@
          new CertsInFilesystemDirectoryResolver(
             "data/ie/baltimore/merlin-examples/merlin-xmldsig-eighteen/certs");
 
-      for (Iterator i = krs.getIterator(); i.hasNext(); ) {
-         X509Certificate cert = (X509Certificate) i.next();
+      for (Iterator<X509Certificate> i = krs.getIterator(); i.hasNext(); ) {
+         X509Certificate cert = i.next();
          byte[] ski =
             com.sun.org.apache.xml.internal.security.keys.content.x509.XMLX509SKI
                .getSKIBytesFromCert(cert);
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/implementations/KeyStoreResolver.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/implementations/KeyStoreResolver.java	Wed Oct 26 17:59:13 2011 -0700
@@ -42,7 +42,7 @@
    KeyStore _keyStore = null;
 
    /** Field _iterator */
-   Iterator _iterator = null;
+   Iterator<X509Certificate> _iterator = null;
 
    /**
     * Constructor KeyStoreResolver
@@ -56,7 +56,7 @@
    }
 
    /** @inheritDoc */
-   public Iterator getIterator() {
+   public Iterator<X509Certificate> getIterator() {
       return this._iterator;
    }
 
@@ -66,13 +66,13 @@
     * @author $Author: mullan $
     * @version $Revision: 1.5 $
     */
-   static class KeyStoreIterator implements Iterator {
+   static class KeyStoreIterator implements Iterator<X509Certificate> {
 
       /** Field _keyStore */
       KeyStore _keyStore = null;
 
       /** Field _aliases */
-      Enumeration _aliases = null;
+      Enumeration<String> _aliases = null;
 
       /**
        * Constructor KeyStoreIterator
@@ -97,12 +97,13 @@
       }
 
       /** @inheritDoc */
-      public Object next() {
+      @SuppressWarnings("unchecked")
+      public X509Certificate next() {
 
-         String alias = (String) this._aliases.nextElement();
+         String alias = this._aliases.nextElement();
 
          try {
-            return this._keyStore.getCertificate(alias);
+            return (X509Certificate)this._keyStore.getCertificate(alias);
          } catch (KeyStoreException ex) {
             return null;
          }
@@ -135,8 +136,8 @@
 
       KeyStoreResolver krs = new KeyStoreResolver(ks);
 
-      for (Iterator i = krs.getIterator(); i.hasNext(); ) {
-         X509Certificate cert = (X509Certificate) i.next();
+      for (Iterator<X509Certificate> i = krs.getIterator(); i.hasNext(); ) {
+         X509Certificate cert = i.next();
          byte[] ski =
             com.sun.org.apache.xml.internal.security.keys.content.x509.XMLX509SKI
                .getSKIBytesFromCert(cert);
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/implementations/SingleCertificateResolver.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/implementations/SingleCertificateResolver.java	Wed Oct 26 17:59:13 2011 -0700
@@ -38,7 +38,7 @@
    X509Certificate _certificate = null;
 
    /** Field _iterator */
-   Iterator _iterator = null;
+   Iterator<X509Certificate> _iterator = null;
 
    /**
     *
@@ -51,7 +51,7 @@
    }
 
    /** @inheritDoc */
-   public Iterator getIterator() {
+   public Iterator<X509Certificate> getIterator() {
       return this._iterator;
    }
 
@@ -61,7 +61,7 @@
     * @author $Author: mullan $
     * @version $Revision: 1.5 $
     */
-   static class InternalIterator implements Iterator {
+   static class InternalIterator implements Iterator<X509Certificate> {
 
       /** Field _alreadyReturned */
       boolean _alreadyReturned = false;
@@ -84,7 +84,7 @@
       }
 
       /** @inheritDoc */
-      public Object next() {
+      public X509Certificate next() {
 
          this._alreadyReturned = true;
 
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Manifest.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Manifest.java	Wed Oct 26 17:59:13 2011 -0700
@@ -28,6 +28,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
+import java.util.Map;
 
 import javax.xml.parsers.ParserConfigurationException;
 
@@ -62,17 +63,17 @@
         java.util.logging.Logger.getLogger(Manifest.class.getName());
 
    /** Field _references */
-   List _references;
+   List<Reference> _references;
    Element[] _referencesEl;
 
    /** Field verificationResults[] */
    private boolean verificationResults[] = null;
 
    /** Field _resolverProperties */
-   HashMap _resolverProperties = null;
+   Map<String,String> _resolverProperties = null;
 
    /** Field _perManifestResolvers */
-   List _perManifestResolvers = null;
+   List<ResourceResolver> _perManifestResolvers = null;
 
    /**
     * Consturts {@link Manifest}
@@ -85,7 +86,7 @@
 
       XMLUtils.addReturnToElement(this._constructionElement);
 
-      this._references = new ArrayList();
+      this._references = new ArrayList<Reference>();
    }
 
    /**
@@ -117,7 +118,7 @@
       }
 
       // create Vector
-      this._references = new ArrayList(le);
+      this._references = new ArrayList<Reference>(le);
 
       for (int i = 0; i < le; i++) {
          this._references.add(null);
@@ -175,7 +176,7 @@
          for (int i = 0; i < this.getLength(); i++) {
 
             // update the cached Reference object, the Element content is automatically updated
-            Reference currentRef = (Reference) this._references.get(i);
+            Reference currentRef = this._references.get(i);
 
             currentRef.generateDigestValue();
          }
@@ -208,7 +209,7 @@
             this._references.set(i, ref);
          }
 
-         return (Reference) this._references.get(i);
+         return this._references.get(i);
 
    }
 
@@ -323,12 +324,12 @@
                 try {
                   XMLSignatureInput signedManifestNodes =
                     currentRef.dereferenceURIandPerformTransforms(null);
-                  Set nl = signedManifestNodes.getNodeSet();
+                  Set<Node> nl = signedManifestNodes.getNodeSet();
                   Manifest referencedManifest = null;
-                  Iterator nlIterator = nl.iterator();
+                  Iterator<Node> nlIterator = nl.iterator();
 
                   findManifest: while (nlIterator.hasNext()) {
-                     Node n = (Node) nlIterator.next();
+                     Node n =  nlIterator.next();
 
                      if ((n.getNodeType() == Node.ELEMENT_NODE) && ((Element) n)
                              .getNamespaceURI()
@@ -449,7 +450,7 @@
           return;
       }
       if (_perManifestResolvers==null)
-          _perManifestResolvers = new ArrayList();
+          _perManifestResolvers = new ArrayList<ResourceResolver>();
       this._perManifestResolvers.add(resolver);
 
    }
@@ -465,7 +466,7 @@
           return;
       }
       if (_perManifestResolvers==null)
-                  _perManifestResolvers = new ArrayList();
+                  _perManifestResolvers = new ArrayList<ResourceResolver>();
       this._perManifestResolvers.add(new ResourceResolver(resolverSpi));
 
    }
@@ -479,7 +480,7 @@
     */
    public void setResolverProperty(String key, String value) {
            if (_resolverProperties==null) {
-                   _resolverProperties=new HashMap(10);
+                   _resolverProperties=new HashMap<String, String>(10);
            }
       this._resolverProperties.put(key, value);
    }
@@ -491,7 +492,7 @@
     * @return the value
     */
    public String getResolverProperty(String key) {
-      return (String) this._resolverProperties.get(key);
+      return this._resolverProperties.get(key);
    }
 
    /**
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java	Wed Oct 26 17:59:13 2011 -0700
@@ -436,6 +436,7 @@
     *
     * @deprecated use getContentsBeforeTransformation
     */
+   @Deprecated
    public XMLSignatureInput getTransformsInput() throws ReferenceNotInitializedException
         {
                 XMLSignatureInput input=getContentsBeforeTransformation();
@@ -557,7 +558,7 @@
 
       try {
          XMLSignatureInput nodes = this.getNodesetBeforeFirstCanonicalization();
-         Set inclusiveNamespaces = new HashSet();
+         Set<String> inclusiveNamespaces = new HashSet<String>();
 
          {
             Transforms transforms = this.getTransforms();
@@ -710,7 +711,7 @@
          XMLSignatureInput output=this.dereferenceURIandPerformTransforms(os);
          // if signing and c14n11 property == true explicitly add
          // C14N11 transform if needed
-         if (this.useC14N11 && !validating &&
+         if (Reference.useC14N11 && !validating &&
              !output.isOutputStreamSet() && !output.isOctetStream()) {
              if (transforms == null) {
                  transforms = new Transforms(this._doc);
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignatureInput.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignatureInput.java	Wed Oct 26 17:59:13 2011 -0700
@@ -74,7 +74,7 @@
     /**
      * The original NodeSet for this XMLSignatureInput
      */
-    Set _inputNodeSet = null;
+    Set<Node> _inputNodeSet = null;
     /**
      * The original Element
      */
@@ -107,7 +107,7 @@
     /**
      * Node Filter list.
      */
-    List nodeFilters=new ArrayList();
+    List<NodeFilter> nodeFilters=new ArrayList<NodeFilter>();
 
     boolean needsToBeExpanded=false;
     OutputStream outputStream=null;
@@ -164,6 +164,7 @@
      * @deprecated
      * @param inputStr the input String which including XML document or node
      */
+    @Deprecated
     public XMLSignatureInput(String inputStr) {
         this(inputStr.getBytes());
     }
@@ -179,6 +180,7 @@
      * @param encoding the encoding of <code>inputStr</code>
      * @throws UnsupportedEncodingException
      */
+    @Deprecated
     public XMLSignatureInput(String inputStr, String encoding)
            throws UnsupportedEncodingException {
         this(inputStr.getBytes(encoding));
@@ -201,7 +203,7 @@
      * @param inputNodeSet
      * @param usedXPathAPI
      */
-    public XMLSignatureInput(Set inputNodeSet) {
+    public XMLSignatureInput(Set<Node> inputNodeSet) {
         this._inputNodeSet = inputNodeSet;
     }
 
@@ -215,7 +217,7 @@
      * @throws ParserConfigurationException
      * @throws CanonicalizationException
      */
-    public Set getNodeSet() throws CanonicalizationException,
+    public Set<Node> getNodeSet() throws CanonicalizationException,
         ParserConfigurationException, IOException, SAXException {
         return getNodeSet(false);
     }
@@ -231,7 +233,7 @@
      * @throws ParserConfigurationException
      * @throws CanonicalizationException
      */
-    public Set getNodeSet(boolean circumvent)
+    public Set<Node> getNodeSet(boolean circumvent)
            throws ParserConfigurationException, IOException, SAXException,
                   CanonicalizationException {
         if (this._inputNodeSet!=null) {
@@ -242,13 +244,13 @@
             if (circumvent) {
                 XMLUtils.circumventBug2650(XMLUtils.getOwnerDocument(_subNode));
             }
-            this._inputNodeSet = new HashSet();
+            this._inputNodeSet = new HashSet<Node>();
             XMLUtils.getSet(_subNode,this._inputNodeSet, excludeNode, this.excludeComments);
 
             return this._inputNodeSet;
         } else if (this.isOctetStream()) {
             convertToNodes();
-            HashSet result=new HashSet();
+            HashSet<Node> result=new HashSet<Node>();
             XMLUtils.getSet(_subNode, result,null,false);
             //this._inputNodeSet=result;
             return result;
@@ -447,7 +449,7 @@
      * @throws XMLSignatureException
      * @return The HTML representation for this XMLSignature
      */
-    public String getHTMLRepresentation(Set inclusiveNamespaces)
+    public String getHTMLRepresentation(Set<String> inclusiveNamespaces)
            throws XMLSignatureException {
 
         XMLSignatureInputDebugger db = new XMLSignatureInputDebugger( this,
@@ -584,7 +586,7 @@
     /**
      * @return the node filters
      */
-    public List getNodeFilters() {
+    public List<NodeFilter> getNodeFilters() {
         // TODO Auto-generated method stub
         return nodeFilters;
     }
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignatureInputDebugger.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignatureInputDebugger.java	Wed Oct 26 17:59:13 2011 -0700
@@ -47,9 +47,9 @@
 
 
         /** Field _xmlSignatureInput */
-        private Set _xpathNodeSet;
+        private Set<Node> _xpathNodeSet;
 
-        private Set _inclusiveNamespaces;
+        private Set<String> _inclusiveNamespaces;
 
         /** Field _doc */
         private Document _doc = null;
@@ -159,7 +159,7 @@
          * @param inclusiveNamespace
          */
         public XMLSignatureInputDebugger(
-                        XMLSignatureInput xmlSignatureInput, Set inclusiveNamespace) {
+                        XMLSignatureInput xmlSignatureInput, Set<String> inclusiveNamespace) {
 
                 this(xmlSignatureInput);
 
@@ -182,7 +182,7 @@
                 {
 
                         // get only a single node as anchor to fetch the owner document
-                        Node n = (Node) this._xpathNodeSet.iterator().next();
+                        Node n = this._xpathNodeSet.iterator().next();
 
                         this._doc = XMLUtils.getOwnerDocument(n);
                 }
@@ -341,10 +341,10 @@
                         // we output all Attrs which are available
                         NamedNodeMap attrs = currentElement.getAttributes();
                         int attrsLength = attrs.getLength();
-                        Object attrs2[] = new Object[attrsLength];
+                        Attr attrs2[] = new Attr[attrsLength];
 
                         for (int i = 0; i < attrsLength; i++) {
-                                attrs2[i] = attrs.item(i);
+                                attrs2[i] = (Attr)attrs.item(i);
                         }
 
                         Arrays.sort(attrs2, ATTR_COMPARE);
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/Transform.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/Transform.java	Wed Oct 26 17:59:13 2011 -0700
@@ -25,6 +25,7 @@
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.HashMap;
+import java.util.Map;
 import javax.xml.parsers.ParserConfigurationException;
 
 import com.sun.org.apache.xml.internal.security.c14n.CanonicalizationException;
@@ -65,9 +66,9 @@
     private static boolean alreadyInitialized = false;
 
     /** All available Transform classes are registered here */
-    private static HashMap transformClassHash = null;
+    private static Map<String, Class<?>> transformClassHash = null;
 
-    private static HashMap transformSpiHash = new HashMap();
+    private static Map<String, TransformSpi> transformSpiHash = new HashMap<String, TransformSpi>();
 
     private TransformSpi transformSpi = null;
 
@@ -209,7 +210,7 @@
      */
     public static void init() {
         if (!alreadyInitialized) {
-            transformClassHash = new HashMap(10);
+            transformClassHash = new HashMap<String,Class<?>>(10);
             // make sure builtin algorithms are all registered first
             com.sun.org.apache.xml.internal.security.Init.init();
             alreadyInitialized = true;
@@ -231,7 +232,7 @@
         throws AlgorithmAlreadyRegisteredException {
 
         // are we already registered?
-        Class registeredClass = getImplementingClass(algorithmURI);
+        Class<? extends TransformSpi> registeredClass = getImplementingClass(algorithmURI);
         if ((registeredClass != null) ) {
             Object exArgs[] = { algorithmURI, registeredClass };
             throw new AlgorithmAlreadyRegisteredException(
@@ -331,20 +332,21 @@
      * @param URI
      * @return The name of the class implementing the URI.
      */
-    private static Class getImplementingClass(String URI) {
-        return (Class) transformClassHash.get(URI);
+    @SuppressWarnings("unchecked")
+    private static Class<? extends TransformSpi> getImplementingClass(String URI) {
+        return (Class<? extends TransformSpi>)transformClassHash.get(URI);
     }
 
     private static TransformSpi getTransformSpi(String URI)
         throws InvalidTransformException {
         try {
-            Object value = transformSpiHash.get(URI);
+            TransformSpi value = transformSpiHash.get(URI);
             if (value != null) {
-                return (TransformSpi) value;
+                return value;
             }
-            Class cl = (Class) transformClassHash.get(URI);
+            Class<? extends TransformSpi> cl = getImplementingClass(URI);
             if (cl != null) {
-                TransformSpi tr = (TransformSpi) cl.newInstance();
+                TransformSpi tr = cl.newInstance();
                 transformSpiHash.put(URI, tr);
                 return tr;
             }
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/TransformSpi.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/TransformSpi.java	Wed Oct 26 17:59:13 2011 -0700
@@ -41,6 +41,7 @@
      * For API compatibility not thread safe.
      * @deprecated
      */
+    @Deprecated
     protected Transform _transformObject = null;
     /**
      * Set the transform object.
@@ -48,6 +49,7 @@
      * @param transform the Transform
      * @deprecated
      */
+    @Deprecated
     protected void setTransform(Transform transform) {
         this._transformObject = transform;
     }
@@ -120,6 +122,7 @@
      * @throws SAXException
      * @throws TransformationException
      */
+    @Deprecated
     protected XMLSignatureInput enginePerformTransform(
         XMLSignatureInput input)
         throws IOException,
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/FuncHere.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/FuncHere.java	Wed Oct 26 17:59:13 2011 -0700
@@ -154,6 +154,7 @@
     * @param vars
     * @param globalsSize
     */
+   @SuppressWarnings("rawtypes")
    public void fixupVariables(java.util.Vector vars, int globalsSize) {
 
       // do nothing
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformXPath2Filter.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformXPath2Filter.java	Wed Oct 26 17:59:13 2011 -0700
@@ -96,9 +96,9 @@
            throws TransformationException {
           CachedXPathAPIHolder.setDoc(_transformObject.getElement().getOwnerDocument());
       try {
-          List unionNodes=new ArrayList();
-           List substractNodes=new ArrayList();
-           List intersectNodes=new ArrayList();
+          List<NodeList> unionNodes=new ArrayList<NodeList>();
+          List<NodeList> substractNodes=new ArrayList<NodeList>();
+          List<NodeList> intersectNodes=new ArrayList<NodeList>();
 
          CachedXPathFuncHereAPI xPathFuncHereAPI =
             new CachedXPathFuncHereAPI(CachedXPathAPIHolder.getCachedXPathAPI());
@@ -170,18 +170,15 @@
          throw new TransformationException("empty", ex);
       }
    }
-   static Set convertNodeListToSet(List l){
-           Set result=new HashSet();
-           for (int j=0;j<l.size();j++) {
-                   NodeList rootNodes=(NodeList) l.get(j);
+   static Set<Node> convertNodeListToSet(List<NodeList> l){
+           Set<Node> result=new HashSet<Node>();
+
+           for (NodeList rootNodes : l) {
                int length = rootNodes.getLength();
-
                for (int i = 0; i < length; i++) {
                     Node rootNode = rootNodes.item(i);
                     result.add(rootNode);
-
                  }
-
            }
            return result;
    }
@@ -191,8 +188,8 @@
         boolean hasUnionNodes;
         boolean hasSubstractNodes;
         boolean hasIntersectNodes;
-        XPath2NodeFilter(Set unionNodes, Set substractNodes,
-                        Set intersectNodes) {
+        XPath2NodeFilter(Set<Node> unionNodes, Set<Node> substractNodes,
+                        Set<Node> intersectNodes) {
                 this.unionNodes=unionNodes;
                 hasUnionNodes=!unionNodes.isEmpty();
                 this.substractNodes=substractNodes;
@@ -200,9 +197,9 @@
                 this.intersectNodes=intersectNodes;
                 hasIntersectNodes=!intersectNodes.isEmpty();
         }
-        Set unionNodes;
-        Set substractNodes;
-        Set intersectNodes;
+        Set<Node> unionNodes;
+        Set<Node> substractNodes;
+        Set<Node> intersectNodes;
 
 
    /**
@@ -282,16 +279,15 @@
     *
     * @return if rooted bye the rootnodes
     */
-   static boolean  rooted(Node currentNode, Set nodeList ) {
+   static boolean  rooted(Node currentNode, Set<Node> nodeList ) {
            if (nodeList.contains(currentNode)) {
                    return true;
            }
-           Iterator it=nodeList.iterator();
-           while (it.hasNext()) {
-                        Node rootNode = (Node) it.next();
-                        if (XMLUtils.isDescendantOrSelf(rootNode,currentNode)) {
-                                   return true;
-                        }
+
+           for(Node rootNode : nodeList) {
+               if (XMLUtils.isDescendantOrSelf(rootNode,currentNode)) {
+                   return true;
+               }
            }
            return false;
    }
@@ -303,7 +299,7 @@
        *
        * @return if rooted bye the rootnodes
        */
-      static boolean  inList(Node currentNode, Set nodeList ) {
+      static boolean  inList(Node currentNode, Set<Node> nodeList ) {
               return nodeList.contains(currentNode);
       }
 }
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformXSLT.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformXSLT.java	Wed Oct 26 17:59:13 2011 -0700
@@ -62,14 +62,6 @@
    static final String defaultXSLTSpecNSprefix = "xslt";
    static final String XSLTSTYLESHEET          = "stylesheet";
 
-   // check for secure processing feature
-   private static Class xClass = null;
-   static {
-      try {
-         xClass = Class.forName("javax.xml.XMLConstants");
-      } catch (Exception e) {}
-   }
-
    static java.util.logging.Logger log =
       java.util.logging.Logger.getLogger(
          TransformXSLT.class.getName());
@@ -101,10 +93,6 @@
     protected XMLSignatureInput enginePerformTransform(XMLSignatureInput input,OutputStream baos, Transform _transformObject)
     throws IOException,
            TransformationException {
-      if (xClass == null) {
-         Object exArgs[] = { "SECURE_PROCESSING_FEATURE not supported" };
-         throw new TransformationException("generic.EmptyMessage", exArgs);
-      }
       try {
          Element transformElement = _transformObject.getElement();
 
@@ -119,11 +107,9 @@
          }
 
          TransformerFactory tFactory = TransformerFactory.newInstance();
-         Class c = tFactory.getClass();
-         Method m = c.getMethod("setFeature", new Class[] {String.class, boolean.class});
+
          // Process XSLT stylesheets in a secure manner
-         m.invoke(tFactory, new Object[] {"http://javax.xml.XMLConstants/feature/secure-processing", Boolean.TRUE});
-
+         tFactory.setFeature("http://javax.xml.XMLConstants/feature/secure-processing", Boolean.TRUE);
          /*
           * This transform requires an octet stream as input. If the actual
           * input is an XPath node-set, then the signature application should
@@ -193,18 +179,6 @@
          Object exArgs[] = { ex.getMessage() };
 
          throw new TransformationException("generic.EmptyMessage", exArgs, ex);
-      } catch (NoSuchMethodException ex) {
-         Object exArgs[] = { ex.getMessage() };
-
-         throw new TransformationException("generic.EmptyMessage", exArgs, ex);
-      } catch (IllegalAccessException ex) {
-         Object exArgs[] = { ex.getMessage() };
-
-         throw new TransformationException("generic.EmptyMessage", exArgs, ex);
-      } catch (java.lang.reflect.InvocationTargetException ex) {
-         Object exArgs[] = { ex.getMessage() };
-
-         throw new TransformationException("generic.EmptyMessage", exArgs, ex);
       }
    }
 }
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/InclusiveNamespaces.java	Wed Oct 26 17:59:13 2011 -0700
@@ -74,19 +74,16 @@
     * @param doc
     * @param prefixes
     */
-   public InclusiveNamespaces(Document doc, Set prefixes) {
+   public InclusiveNamespaces(Document doc, Set<String> prefixes) {
 
       super(doc);
 
       StringBuffer sb = new StringBuffer();
-      SortedSet prefixList = new TreeSet(prefixes);
+      SortedSet<String> prefixList = new TreeSet<String>(prefixes);
 
 
-      Iterator it = prefixList.iterator();
 
-      while (it.hasNext()) {
-         String prefix = (String) it.next();
-
+      for (String prefix : prefixList) {
          if (prefix.equals("xmlns")) {
             sb.append("#default ");
          } else {
@@ -138,9 +135,9 @@
     * @param inclusiveNamespaces
     * @return A set to string
     */
-   public static SortedSet prefixStr2Set(String inclusiveNamespaces) {
+   public static SortedSet<String> prefixStr2Set(String inclusiveNamespaces) {
 
-      SortedSet prefixes = new TreeSet();
+      SortedSet<String> prefixes = new TreeSet<String>();
 
       if ((inclusiveNamespaces == null)
               || (inclusiveNamespaces.length() == 0)) {
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/utils/CachedXPathAPIHolder.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/utils/CachedXPathAPIHolder.java	Wed Oct 26 17:59:13 2011 -0700
@@ -28,8 +28,8 @@
  */
 public class CachedXPathAPIHolder {
 
-    static ThreadLocal  local=new ThreadLocal();
-    static ThreadLocal localDoc=new ThreadLocal();
+    static ThreadLocal<CachedXPathAPI>  local=new ThreadLocal<CachedXPathAPI>();
+    static ThreadLocal<Document> localDoc=new ThreadLocal<Document>();
 
     /**
      * Sets the doc for the xpath transformation. Resets the cache if needed
@@ -37,7 +37,7 @@
      */
     public static void setDoc(Document doc) {
         if (localDoc.get()!=doc) {
-            CachedXPathAPI cx=(CachedXPathAPI)local.get();
+            CachedXPathAPI cx=local.get();
             if (cx==null) {
                 cx=new CachedXPathAPI();
                 local.set(cx);
@@ -54,7 +54,7 @@
      * @return the cachexpathapi for this thread
      */
     public static CachedXPathAPI getCachedXPathAPI() {
-        CachedXPathAPI cx=(CachedXPathAPI)local.get();
+        CachedXPathAPI cx=local.get();
         if (cx==null) {
             cx=new CachedXPathAPI();
             local.set(cx);
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/utils/CachedXPathFuncHereAPI.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/utils/CachedXPathFuncHereAPI.java	Wed Oct 26 17:59:13 2011 -0700
@@ -173,6 +173,7 @@
     * @throws TransformerException
     * @deprecated
     */
+   @Deprecated
    public NodeIterator selectNodeIterator(
            Node contextNode, Node xpathnode, Node namespaceNode)
               throws TransformerException {
@@ -195,6 +196,7 @@
     * @throws TransformerException
     * @deprecated
     */
+   @Deprecated
    public NodeList selectNodeList(Node contextNode, Node xpathnode)
            throws TransformerException {
       return selectNodeList(contextNode, xpathnode, getStrFromNode(xpathnode), contextNode);
@@ -239,6 +241,7 @@
     * @throws TransformerException
     * @deprecated
     */
+   @Deprecated
    public XObject eval(Node contextNode, Node xpathnode)
            throws TransformerException {
       return eval(contextNode, xpathnode, getStrFromNode(xpathnode),contextNode);
@@ -375,12 +378,12 @@
 
     private XPath createXPath(String str, PrefixResolver prefixResolver) throws TransformerException {
         XPath xpath = null;
-        Class[] classes = new Class[]{String.class, SourceLocator.class, PrefixResolver.class, int.class,
+        Class<?>[] classes = new Class<?>[]{String.class, SourceLocator.class, PrefixResolver.class, int.class,
                 ErrorListener.class, FunctionTable.class};
         Object[] objects = new Object[]{str, null, prefixResolver, new Integer(XPath.SELECT), null, _funcTable};
         try {
-            Constructor constructor = XPath.class.getConstructor(classes);
-            xpath = (XPath) constructor.newInstance(objects);
+            Constructor<XPath> constructor = XPath.class.getConstructor(classes);
+            xpath = constructor.newInstance(objects);
         } catch (Throwable t) {
         }
         if (xpath == null) {
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/utils/ElementProxy.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/utils/ElementProxy.java	Wed Oct 26 17:59:13 2011 -0700
@@ -24,6 +24,7 @@
 
 import java.math.BigInteger;
 import java.util.HashMap;
+import java.util.Map;
 
 import com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException;
 import com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException;
@@ -370,6 +371,7 @@
     * @return the bytes
     * @throws XMLSecurityException
     */
+   @Deprecated
    public byte[] getBytesFromChildElement(String localname, String namespace)
            throws XMLSecurityException {
 
@@ -392,14 +394,12 @@
     */
    public String getTextFromChildElement(String localname, String namespace) {
 
-         Text t =
-             (Text) XMLUtils.selectNode(
-                        this._constructionElement.getFirstChild(),
-                        namespace,
-                        localname,
-                        0).getFirstChild();
+         return     XMLUtils.selectNode(
+                    this._constructionElement.getFirstChild(),
+                    namespace,
+                    localname,
+                    0).getFirstChild().getNodeValue();
 
-         return t.getData();
    }
 
    /**
@@ -493,8 +493,8 @@
    }
 
    /** Field _prefixMappings */
-   static HashMap _prefixMappings = new HashMap();
-   static HashMap _prefixMappingsBindings = new HashMap();
+   static Map<String, String> _prefixMappings = new HashMap<String,String>();
+   static Map<String, String> _prefixMappingsBindings = new HashMap<String,String>();
 
     /**
      * Method setDefaultPrefix
@@ -533,10 +533,10 @@
      * @return the default prefix bind to this element.
      */
     public static String getDefaultPrefix(String namespace) {
-        return (String) ElementProxy._prefixMappings.get(namespace);
+        return ElementProxy._prefixMappings.get(namespace);
     }
 
     public static String getDefaultPrefixBindings(String namespace) {
-        return (String) ElementProxy._prefixMappingsBindings.get(namespace);
+        return ElementProxy._prefixMappingsBindings.get(namespace);
     }
 }
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/utils/HelperNodeList.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/utils/HelperNodeList.java	Wed Oct 26 17:59:13 2011 -0700
@@ -21,6 +21,7 @@
 package com.sun.org.apache.xml.internal.security.utils;
 
 import java.util.ArrayList;
+import java.util.List;
 
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
@@ -34,7 +35,7 @@
 public class HelperNodeList implements NodeList {
 
    /** Field nodes */
-   ArrayList nodes = new ArrayList(20);
+   List<Node> nodes = new ArrayList<Node>(20);
    boolean _allNodesMustHaveSameParent = false;
 
    /**
@@ -62,7 +63,7 @@
 
       // log.log(java.util.logging.Level.FINE, "item(" + index + ") of " + this.getLength() + " nodes");
 
-      return (Node) nodes.get(index);
+      return nodes.get(index);
    }
 
    /**
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/utils/IdResolver.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/utils/IdResolver.java	Wed Oct 26 17:59:13 2011 -0700
@@ -23,6 +23,7 @@
 import java.lang.ref.WeakReference;
 import java.util.Arrays;
 import java.util.WeakHashMap;
+import java.util.Map;
 
 import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
@@ -52,7 +53,8 @@
     private static java.util.logging.Logger log =
         java.util.logging.Logger.getLogger(IdResolver.class.getName());
 
-    private static WeakHashMap docMap = new WeakHashMap();
+    private static Map<Document, Map<String, WeakReference<Element>>> docMap =
+                    new WeakHashMap<Document, Map<String, WeakReference<Element>>>();
 
     /**
      * Constructor IdResolver
@@ -70,15 +72,15 @@
      */
     public static void registerElementById(Element element, String idValue) {
         Document doc = element.getOwnerDocument();
-        WeakHashMap elementMap;
+        Map<String, WeakReference<Element>> elementMap;
         synchronized (docMap) {
-            elementMap = (WeakHashMap) docMap.get(doc);
+            elementMap = docMap.get(doc);
             if (elementMap == null) {
-                elementMap = new WeakHashMap();
+                elementMap = new WeakHashMap<String, WeakReference<Element>>();
                 docMap.put(doc, elementMap);
             }
         }
-        elementMap.put(idValue, new WeakReference(element));
+        elementMap.put(idValue, new WeakReference<Element>(element));
     }
 
     /**
@@ -156,20 +158,20 @@
     private static Element getElementByIdType(Document doc, String id) {
         if (log.isLoggable(java.util.logging.Level.FINE))
             log.log(java.util.logging.Level.FINE, "getElementByIdType() Search for ID " + id);
-        WeakHashMap elementMap;
+        Map<String, WeakReference<Element>> elementMap;
         synchronized (docMap) {
-            elementMap = (WeakHashMap) docMap.get(doc);
+            elementMap = docMap.get(doc);
         }
         if (elementMap != null) {
-            WeakReference weakReference = (WeakReference) elementMap.get(id);
+            WeakReference<Element> weakReference =  elementMap.get(id);
             if (weakReference != null) {
-                return (Element) weakReference.get();
+                return weakReference.get();
             }
         }
         return null;
     }
 
-    private static java.util.List names;
+    private static java.util.List<String> names;
     private static int namesLength;
     static {
         String namespaces[]={
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/utils/UnsyncBufferedOutputStream.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/utils/UnsyncBufferedOutputStream.java	Wed Oct 26 17:59:13 2011 -0700
@@ -33,8 +33,8 @@
 
         final byte[] buf;
         static final int size=8*1024;
-        private static ThreadLocal bufCahce = new ThreadLocal() {
-        protected synchronized Object initialValue() {
+        private static ThreadLocal<byte[]> bufCahce = new ThreadLocal<byte[]>() {
+        protected synchronized byte[] initialValue() {
             return new byte[size];
         }
     };
@@ -44,7 +44,7 @@
          * @param out the outputstream to buffer
          */
         public UnsyncBufferedOutputStream(OutputStream out) {
-                buf=(byte[])bufCahce.get();
+                buf=bufCahce.get();
                 this.out=out;
         }
 
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/utils/UnsyncByteArrayOutputStream.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/utils/UnsyncByteArrayOutputStream.java	Wed Oct 26 17:59:13 2011 -0700
@@ -29,8 +29,8 @@
  */
 public class UnsyncByteArrayOutputStream extends OutputStream  {
     private static final int INITIAL_SIZE = 8192;
-    private static ThreadLocal bufCache = new ThreadLocal() {
-        protected synchronized Object initialValue() {
+    private static ThreadLocal<byte[]> bufCache = new ThreadLocal<byte[]>() {
+        protected synchronized byte[] initialValue() {
             return new byte[INITIAL_SIZE];
         }
     };
@@ -40,7 +40,7 @@
     private int pos = 0;
 
     public UnsyncByteArrayOutputStream() {
-        buf = (byte[])bufCache.get();
+        buf = bufCache.get();
     }
 
     public void write(byte[] arg0) {
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/utils/XMLUtils.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/utils/XMLUtils.java	Wed Oct 26 17:59:13 2011 -0700
@@ -82,13 +82,15 @@
     * @param exclude
     * @param com wheather comments or not
     */
-   public static void getSet(Node rootNode,Set result,Node exclude ,boolean com) {
+   public static void getSet(Node rootNode,Set<Node> result,Node exclude ,boolean com) {
           if ((exclude!=null) && isDescendantOrSelf(exclude,rootNode)){
                 return;
       }
       getSetRec(rootNode,result,exclude,com);
    }
-   static final void getSetRec(final Node rootNode,final Set result,
+
+   @SuppressWarnings("fallthrough")
+   static final void getSetRec(final Node rootNode,final Set<Node> result,
         final Node exclude ,final boolean com) {
            //Set result = new HashSet();
        if (rootNode==exclude) {
@@ -104,7 +106,7 @@
                                         result.add(nl.item(i));
                                 }
                 }
-                //no return keep working
+                //no return keep working - ignore fallthrough warning
                 case Node.DOCUMENT_NODE:
                                 for (Node r=rootNode.getFirstChild();r!=null;r=r.getNextSibling()){
                                         if (r.getNodeType()==Node.TEXT_NODE) {
@@ -230,7 +232,7 @@
 
 
    static  String dsPrefix=null;
-   static Map namePrefixes=new HashMap();
+   static Map<String, String> namePrefixes=new HashMap<String, String>();
    /**
     * Creates an Element in the XML Signature specification namespace.
     *
@@ -248,7 +250,7 @@
       if ((dsPrefix == null) || (dsPrefix.length() == 0)) {
          return doc.createElementNS(Constants.SignatureSpecNS, elementName);
       }
-      String namePrefix=(String) namePrefixes.get(elementName);
+      String namePrefix= namePrefixes.get(elementName);
       if (namePrefix==null) {
           StringBuffer tag=new StringBuffer(dsPrefix);
           tag.append(':');
@@ -318,11 +320,9 @@
      * @param xpathNodeSet
      * @return the owner document
      */
-    public static Document getOwnerDocument(Set xpathNodeSet) {
+    public static Document getOwnerDocument(Set<Node> xpathNodeSet) {
        NullPointerException npe = null;
-       Iterator iterator = xpathNodeSet.iterator();
-       while(iterator.hasNext()) {
-           Node node = (Node) iterator.next();
+       for (Node node : xpathNodeSet) {
            int nodeType =node.getNodeType();
            if (nodeType == Node.DOCUMENT_NODE) {
               return (Document) node;
@@ -397,14 +397,14 @@
     * @param xpathNodeSet
     * @return the set with the nodelist
     */
-   public static Set convertNodelistToSet(NodeList xpathNodeSet) {
+   public static Set<Node> convertNodelistToSet(NodeList xpathNodeSet) {
 
       if (xpathNodeSet == null) {
-         return new HashSet();
+         return new HashSet<Node>();
       }
 
       int length = xpathNodeSet.getLength();
-      Set set = new HashSet(length);
+      Set<Node> set = new HashSet<Node>(length);
 
       for (int i = 0; i < length; i++) {
          set.add(xpathNodeSet.item(i));
@@ -446,6 +446,7 @@
     * @param node
     * @see <A HREF="http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2650">Namespace axis resolution is not XPath compliant </A>
     */
+   @SuppressWarnings("fallthrough")
    private static void circumventBug2650internal(Node node) {
            Node parent=null;
            Node sibling=null;
@@ -642,12 +643,12 @@
     * @param inputSet
     * @return nodes with the constrain
     */
-    public static Set excludeNodeFromSet(Node signatureElement, Set inputSet) {
-          Set resultSet = new HashSet();
-          Iterator iterator = inputSet.iterator();
+    public static Set<Node> excludeNodeFromSet(Node signatureElement, Set<Node> inputSet) {
+          Set<Node> resultSet = new HashSet<Node>();
+          Iterator<Node> iterator = inputSet.iterator();
 
           while (iterator.hasNext()) {
-            Node inputNode = (Node) iterator.next();
+            Node inputNode = iterator.next();
 
             if (!XMLUtils
                     .isDescendantOrSelf(signatureElement, inputNode)) {
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolver.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolver.java	Wed Oct 26 17:59:13 2011 -0700
@@ -56,7 +56,7 @@
    static boolean _alreadyInitialized = false;
 
    /** these are the system-wide resolvers */
-   static List _resolverVector = null;
+   static List<ResourceResolver> _resolverVector = null;
 
    static boolean allThreadSafeInList=true;
 
@@ -102,7 +102,7 @@
       int length=ResourceResolver._resolverVector.size();
       for (int i = 0; i < length; i++) {
                   ResourceResolver resolver =
-            (ResourceResolver) ResourceResolver._resolverVector.get(i);
+            ResourceResolver._resolverVector.get(i);
                   ResourceResolver resolverTmp=null;
                   try {
                         resolverTmp =  allThreadSafeInList || resolver._resolverSpi.engineIsThreadSafe() ? resolver :
@@ -120,7 +120,7 @@
                  if (i!=0) {
                  //update resolver.
                          //System.out.println("Swaping");
-                         List resolverVector=(List)((ArrayList)_resolverVector).clone();
+                         List<ResourceResolver> resolverVector=getResolverVectorClone();
                          resolverVector.remove(i);
                          resolverVector.add(0,resolver);
                          _resolverVector=resolverVector;
@@ -139,6 +139,17 @@
       throw new ResourceResolverException("utils.resolver.noClass", exArgs,
                                           uri, BaseURI);
    }
+
+   /**
+    * Method getResolverVectorClone
+    *
+    * @return clone of _resolverVector
+    */
+   @SuppressWarnings("unchecked")
+   private static List<ResourceResolver> getResolverVectorClone() {
+       return (List<ResourceResolver>)((ArrayList<ResourceResolver>)_resolverVector).clone();
+   }
+
    /**
     * Method getInstance
     *
@@ -150,7 +161,7 @@
     * @throws ResourceResolverException
     */
    public static final ResourceResolver getInstance(
-           Attr uri, String BaseURI, List individualResolvers)
+           Attr uri, String BaseURI, List<ResourceResolver> individualResolvers)
               throws ResourceResolverException {
       if (log.isLoggable(java.util.logging.Level.FINE)) {
 
@@ -163,7 +174,7 @@
       if ((individualResolvers != null) && ((size=individualResolvers.size()) > 0)) {
          for (int i = 0; i < size; i++) {
             ResourceResolver resolver =
-               (ResourceResolver) individualResolvers.get(i);
+               individualResolvers.get(i);
 
             if (resolver != null) {
                String currentClass = resolver._resolverSpi.getClass().getName();
@@ -186,7 +197,7 @@
    public static void init() {
 
       if (!ResourceResolver._alreadyInitialized) {
-         ResourceResolver._resolverVector = new ArrayList(10);
+         ResourceResolver._resolverVector = new ArrayList<ResourceResolver>(10);
          _alreadyInitialized = true;
       }
    }
@@ -288,7 +299,7 @@
     *
     * @param properties
     */
-   public void addProperties(Map properties) {
+   public void addProperties(Map<String,String> properties) {
       this._resolverSpi.engineAddProperies(properties);
    }
 
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolverSpi.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolverSpi.java	Wed Oct 26 17:59:13 2011 -0700
@@ -41,7 +41,7 @@
                     ResourceResolverSpi.class.getName());
 
    /** Field _properties */
-   protected java.util.Map _properties = null;
+   protected java.util.Map<String,String> _properties = null;
 
    /**
     * This is the workhorse method used to resolve resources.
@@ -63,7 +63,7 @@
     */
    public void engineSetProperty(String key, String value) {
           if (_properties==null) {
-                  _properties=new HashMap();
+                  _properties=new HashMap<String,String>();
           }
       this._properties.put(key, value);
    }
@@ -78,17 +78,17 @@
           if (_properties==null) {
                         return null;
           }
-      return (String) this._properties.get(key);
+      return this._properties.get(key);
    }
 
    /**
     *
     * @param properties
     */
-   public void engineAddProperies(Map properties) {
+   public void engineAddProperies(Map<String,String> properties) {
           if (properties!=null) {
                   if (_properties==null) {
-                          _properties=new HashMap();
+                          _properties=new HashMap<String,String>();
                   }
                   this._properties.putAll(properties);
           }
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverDirectHTTP.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverDirectHTTP.java	Wed Oct 26 17:59:13 2011 -0700
@@ -289,7 +289,7 @@
     * @inheritDoc
     */
    public String[] engineGetPropertyKeys() {
-      return (String[]) ResolverDirectHTTP.properties.clone();
+      return ResolverDirectHTTP.properties.clone();
    }
 
    private URI getNewURI(String uri, String BaseURI)
--- a/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java	Wed Oct 26 17:59:13 2011 -0700
@@ -725,7 +725,7 @@
                         cred = builder.action().getCreds();
                     }
                     if (storeKey) {
-                        encKeys = builder.getKeys();
+                        encKeys = builder.getKeys(isInitiator);
                         // When encKeys is empty, the login actually fails.
                         // For compatibility, exception is thrown in commit().
                     }
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic.properties	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic.properties	Wed Oct 26 17:59:13 2011 -0700
@@ -91,6 +91,9 @@
 FileChooser.helpButtonToolTipText=FileChooser help
 FileChooser.directoryOpenButtonToolTipText=Open selected directory
 
+FileChooser.filesListAccessibleName=Files List
+FileChooser.filesDetailsAccessibleName=Files Details
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.previewText=Preview
 ColorChooser.okText=OK
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_de.properties	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_de.properties	Wed Oct 26 17:59:13 2011 -0700
@@ -90,6 +90,9 @@
 FileChooser.helpButtonToolTipText=FileChooser-Hilfe
 FileChooser.directoryOpenButtonToolTipText=Ausgew\u00E4hltes Verzeichnis \u00F6ffnen
 
+FileChooser.filesListAccessibleName=Files List
+FileChooser.filesDetailsAccessibleName=Files Details
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.previewText=Vorschau
 ColorChooser.okText=OK
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_es.properties	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_es.properties	Wed Oct 26 17:59:13 2011 -0700
@@ -90,6 +90,9 @@
 FileChooser.helpButtonToolTipText=Ayuda del Selector de Archivos
 FileChooser.directoryOpenButtonToolTipText=Abrir directorio seleccionado
 
+FileChooser.filesListAccessibleName=Files List
+FileChooser.filesDetailsAccessibleName=Files Details
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.previewText=Presentaci\u00F3n Preliminar
 ColorChooser.okText=Aceptar
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_fr.properties	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_fr.properties	Wed Oct 26 17:59:13 2011 -0700
@@ -90,6 +90,9 @@
 FileChooser.helpButtonToolTipText=Aide du s\u00E9lecteur de fichiers
 FileChooser.directoryOpenButtonToolTipText=Ouvre le r\u00E9pertoire s\u00E9lectionn\u00E9
 
+FileChooser.filesListAccessibleName=Files List
+FileChooser.filesDetailsAccessibleName=Files Details
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.previewText=Aper\u00E7u
 ColorChooser.okText=OK
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_it.properties	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_it.properties	Wed Oct 26 17:59:13 2011 -0700
@@ -90,6 +90,9 @@
 FileChooser.helpButtonToolTipText=Guida FileChooser
 FileChooser.directoryOpenButtonToolTipText=Apre la directory selezionata
 
+FileChooser.filesListAccessibleName=Files List
+FileChooser.filesDetailsAccessibleName=Files Details
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.previewText=Anteprima
 ColorChooser.okText=OK
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ja.properties	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ja.properties	Wed Oct 26 17:59:13 2011 -0700
@@ -90,6 +90,9 @@
 FileChooser.helpButtonToolTipText=FileChooser\u306E\u30D8\u30EB\u30D7\u3067\u3059
 FileChooser.directoryOpenButtonToolTipText=\u9078\u629E\u3057\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u958B\u304D\u307E\u3059
 
+FileChooser.filesListAccessibleName=Files List
+FileChooser.filesDetailsAccessibleName=Files Details
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.previewText=\u30D7\u30EC\u30D3\u30E5\u30FC
 ColorChooser.okText=OK
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties	Wed Oct 26 17:59:13 2011 -0700
@@ -90,6 +90,9 @@
 FileChooser.helpButtonToolTipText=FileChooser \uB3C4\uC6C0\uB9D0
 FileChooser.directoryOpenButtonToolTipText=\uC120\uD0DD\uB41C \uB514\uB809\uD1A0\uB9AC \uC5F4\uAE30
 
+FileChooser.filesListAccessibleName=Files List
+FileChooser.filesDetailsAccessibleName=Files Details
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.previewText=\uBBF8\uB9AC\uBCF4\uAE30
 ColorChooser.okText=\uD655\uC778
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties	Wed Oct 26 17:59:13 2011 -0700
@@ -90,6 +90,9 @@
 FileChooser.helpButtonToolTipText=Ajuda do FileChooser
 FileChooser.directoryOpenButtonToolTipText=Abrir diret\u00F3rio selecionado
 
+FileChooser.filesListAccessibleName=Files List
+FileChooser.filesDetailsAccessibleName=Files Details
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.previewText=Visualizar
 ColorChooser.okText=OK
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_sv.properties	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_sv.properties	Wed Oct 26 17:59:13 2011 -0700
@@ -90,6 +90,9 @@
 FileChooser.helpButtonToolTipText=Hj\u00E4lp - Filv\u00E4ljare
 FileChooser.directoryOpenButtonToolTipText=\u00D6ppna vald katalog
 
+FileChooser.filesListAccessibleName=Files List
+FileChooser.filesDetailsAccessibleName=Files Details
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.previewText=Granska
 ColorChooser.okText=OK
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_CN.properties	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_CN.properties	Wed Oct 26 17:59:13 2011 -0700
@@ -90,6 +90,9 @@
 FileChooser.helpButtonToolTipText=FileChooser \u5E2E\u52A9
 FileChooser.directoryOpenButtonToolTipText=\u6253\u5F00\u9009\u62E9\u7684\u76EE\u5F55
 
+FileChooser.filesListAccessibleName=Files List
+FileChooser.filesDetailsAccessibleName=Files Details
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.previewText=\u9884\u89C8
 ColorChooser.okText=\u786E\u5B9A
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_TW.properties	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_TW.properties	Wed Oct 26 17:59:13 2011 -0700
@@ -90,6 +90,9 @@
 FileChooser.helpButtonToolTipText=\u300C\u6A94\u6848\u9078\u64C7\u5668\u300D\u8AAA\u660E
 FileChooser.directoryOpenButtonToolTipText=\u958B\u555F\u9078\u53D6\u7684\u76EE\u9304
 
+FileChooser.filesListAccessibleName=Files List
+FileChooser.filesDetailsAccessibleName=Files Details
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.previewText=\u9810\u89BD
 ColorChooser.okText=\u78BA\u5B9A
--- a/src/share/classes/java/awt/AWTKeyStroke.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/awt/AWTKeyStroke.java	Wed Oct 26 17:59:13 2011 -0700
@@ -777,10 +777,6 @@
      */
     protected Object readResolve() throws java.io.ObjectStreamException {
         synchronized (AWTKeyStroke.class) {
-            Class newClass = getClass();
-            if (!newClass.equals(ctor.getDeclaringClass())) {
-                registerSubclass(newClass);
-            }
             return getCachedStroke(keyChar, keyCode, modifiers, onKeyRelease);
         }
     }
--- a/src/share/classes/java/awt/EventDispatchThread.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/awt/EventDispatchThread.java	Wed Oct 26 17:59:13 2011 -0700
@@ -34,8 +34,10 @@
 import sun.security.action.GetPropertyAction;
 import sun.awt.AWTAutoShutdown;
 import sun.awt.SunToolkit;
+import sun.awt.AppContext;
 
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.List;
 import sun.util.logging.PlatformLogger;
 
 import sun.awt.dnd.SunDragSourceContextPeer;
@@ -66,11 +68,11 @@
 
     private EventQueue theQueue;
     private boolean doDispatch = true;
-    private boolean threadDeathCaught = false;
+    private volatile boolean shutdown = false;
 
     private static final int ANY_EVENT = -1;
 
-    private Vector<EventFilter> eventFilters = new Vector<EventFilter>();
+    private ArrayList<EventFilter> eventFilters = new ArrayList<EventFilter>();
 
     EventDispatchThread(ThreadGroup group, String name, EventQueue queue) {
         super(group, name);
@@ -84,6 +86,11 @@
         doDispatch = false;
     }
 
+    public void interrupt() {
+        shutdown = true;
+        super.interrupt();
+    }
+
     public void run() {
         while (true) {
             try {
@@ -93,8 +100,7 @@
                     }
                 });
             } finally {
-                EventQueue eq = getEventQueue();
-                if (eq.detachDispatchThread(this) || threadDeathCaught) {
+                if(getEventQueue().detachDispatchThread(this, shutdown)) {
                     break;
                 }
             }
@@ -124,10 +130,9 @@
     void pumpEventsForFilter(int id, Conditional cond, EventFilter filter) {
         addEventFilter(filter);
         doDispatch = true;
-        while (doDispatch && cond.evaluate()) {
-            if (isInterrupted() || !pumpOneEventForFilters(id)) {
-                doDispatch = false;
-            }
+        shutdown |= isInterrupted();
+        while (doDispatch && !shutdown && cond.evaluate()) {
+            pumpOneEventForFilters(id);
         }
         removeEventFilter(filter);
     }
@@ -163,7 +168,7 @@
         }
     }
 
-    boolean pumpOneEventForFilters(int id) {
+    void pumpOneEventForFilters(int id) {
         AWTEvent event = null;
         boolean eventOK = false;
         try {
@@ -212,24 +217,18 @@
             if (delegate != null) {
                 delegate.afterDispatch(event, handle);
             }
-
-            return true;
         }
         catch (ThreadDeath death) {
-            threadDeathCaught = true;
-            return false;
-
+            shutdown = true;
+            throw death;
         }
         catch (InterruptedException interruptedException) {
-            return false; // AppContext.dispose() interrupts all
-                          // Threads in the AppContext
-
+            shutdown = true; // AppContext.dispose() interrupts all
+                             // Threads in the AppContext
         }
         catch (Throwable e) {
             processException(e);
         }
-
-        return true;
     }
 
     private void processException(Throwable e) {
--- a/src/share/classes/java/awt/EventQueue.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/awt/EventQueue.java	Wed Oct 26 17:59:13 2011 -0700
@@ -47,6 +47,7 @@
 
 import java.util.concurrent.locks.Condition;
 import java.util.concurrent.locks.Lock;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import java.security.AccessControlContext;
 import java.security.ProtectionDomain;
@@ -99,12 +100,7 @@
  * @since       1.1
  */
 public class EventQueue {
-
-    // From Thread.java
-    private static int threadInitNumber;
-    private static synchronized int nextThreadNum() {
-        return threadInitNumber++;
-    }
+    private static final AtomicInteger threadInitNumber = new AtomicInteger(0);
 
     private static final int LOW_PRIORITY = 0;
     private static final int NORM_PRIORITY = 1;
@@ -175,9 +171,9 @@
      * Non-zero if a thread is waiting in getNextEvent(int) for an event of
      * a particular ID to be posted to the queue.
      */
-    private int waitForID;
+    private volatile int waitForID;
 
-    private final String name = "AWT-EventQueue-" + nextThreadNum();
+    private final String name = "AWT-EventQueue-" + threadInitNumber.getAndIncrement();
 
     private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.EventQueue");
 
@@ -1030,7 +1026,7 @@
         }
     }
 
-    final boolean detachDispatchThread(EventDispatchThread edt) {
+    final boolean detachDispatchThread(EventDispatchThread edt, boolean forceDetach) {
         /*
          * This synchronized block is to secure that the event dispatch
          * thread won't die in the middle of posting a new event to the
@@ -1049,7 +1045,7 @@
                  * Fix for 4648733. Check both the associated java event
                  * queue and the PostEventQueue.
                  */
-                if ((peekEvent() != null) || !SunToolkit.isPostEventQueueEmpty()) {
+                if (!forceDetach && (peekEvent() != null) || !SunToolkit.isPostEventQueueEmpty()) {
                     return false;
                 }
                 dispatchThread = null;
--- a/src/share/classes/java/io/FileInputStream.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/io/FileInputStream.java	Wed Oct 26 17:59:13 2011 -0700
@@ -56,16 +56,6 @@
     private final Object closeLock = new Object();
     private volatile boolean closed = false;
 
-    private static final ThreadLocal<Boolean> runningFinalize =
-        new ThreadLocal<>();
-
-    private static boolean isRunningFinalize() {
-        Boolean val;
-        if ((val = runningFinalize.get()) != null)
-            return val.booleanValue();
-        return false;
-    }
-
     /**
      * Creates a <code>FileInputStream</code> by
      * opening a connection to an actual file,
@@ -319,10 +309,10 @@
         int useCount = fd.decrementAndGetUseCount();
 
         /*
-         * If FileDescriptor is still in use by another stream, the finalizer
+         * If FileDescriptor is still in use by another stream, we
          * will not close it.
          */
-        if ((useCount <= 0) || !isRunningFinalize()) {
+        if (useCount <= 0) {
             close0();
         }
     }
@@ -391,18 +381,7 @@
      */
     protected void finalize() throws IOException {
         if ((fd != null) &&  (fd != FileDescriptor.in)) {
-
-            /*
-             * Finalizer should not release the FileDescriptor if another
-             * stream is still using it. If the user directly invokes
-             * close() then the FileDescriptor is also released.
-             */
-            runningFinalize.set(Boolean.TRUE);
-            try {
                 close();
-            } finally {
-                runningFinalize.set(Boolean.FALSE);
-            }
         }
     }
 }
--- a/src/share/classes/java/io/FileOutputStream.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/io/FileOutputStream.java	Wed Oct 26 17:59:13 2011 -0700
@@ -63,21 +63,12 @@
     private final boolean append;
 
     /**
-     * The associated channel, initalized lazily.
+     * The associated channel, initialized lazily.
      */
     private FileChannel channel;
 
     private final Object closeLock = new Object();
     private volatile boolean closed = false;
-    private static final ThreadLocal<Boolean> runningFinalize =
-        new ThreadLocal<>();
-
-    private static boolean isRunningFinalize() {
-        Boolean val;
-        if ((val = runningFinalize.get()) != null)
-            return val.booleanValue();
-        return false;
-    }
 
     /**
      * Creates a file output stream to write to the file with the
@@ -355,10 +346,10 @@
         int useCount = fd.decrementAndGetUseCount();
 
         /*
-         * If FileDescriptor is still in use by another stream, the finalizer
+         * If FileDescriptor is still in use by another stream, we
          * will not close it.
          */
-        if ((useCount <= 0) || !isRunningFinalize()) {
+        if (useCount <= 0) {
             close0();
         }
     }
@@ -424,18 +415,7 @@
             if (fd == FileDescriptor.out || fd == FileDescriptor.err) {
                 flush();
             } else {
-
-                /*
-                 * Finalizer should not release the FileDescriptor if another
-                 * stream is still using it. If the user directly invokes
-                 * close() then the FileDescriptor is also released.
-                 */
-                runningFinalize.set(Boolean.TRUE);
-                try {
                     close();
-                } finally {
-                    runningFinalize.set(Boolean.FALSE);
-                }
             }
         }
     }
--- a/src/share/classes/java/io/RandomAccessFile.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/io/RandomAccessFile.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -590,8 +590,15 @@
          * Decrement FD use count associated with this stream.
          * The count got incremented by FileDescriptor during its construction.
          */
-        fd.decrementAndGetUseCount();
-        close0();
+        int useCount = fd.decrementAndGetUseCount();
+
+        /*
+         * If FileDescriptor is still in use by another stream, we
+         * will not close it.
+         */
+        if (useCount <= 0) {
+            close0();
+        }
     }
 
     //
--- a/src/share/classes/java/lang/Boolean.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/lang/Boolean.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -101,7 +101,7 @@
      * @param   s   the string to be converted to a {@code Boolean}.
      */
     public Boolean(String s) {
-        this(toBoolean(s));
+        this(parseBoolean(s));
     }
 
     /**
@@ -118,7 +118,7 @@
      * @since 1.5
      */
     public static boolean parseBoolean(String s) {
-        return toBoolean(s);
+        return ((s != null) && s.equalsIgnoreCase("true"));
     }
 
     /**
@@ -159,7 +159,7 @@
      * @return  the {@code Boolean} value represented by the string.
      */
     public static Boolean valueOf(String s) {
-        return toBoolean(s) ? TRUE : FALSE;
+        return parseBoolean(s) ? TRUE : FALSE;
     }
 
     /**
@@ -229,15 +229,16 @@
      *
      * @param   name   the system property name.
      * @return  the {@code boolean} value of the system property.
+     * @throws  SecurityException for the same reasons as
+     *          {@link System#getProperty(String) System.getProperty}
      * @see     java.lang.System#getProperty(java.lang.String)
      * @see     java.lang.System#getProperty(java.lang.String, java.lang.String)
      */
     public static boolean getBoolean(String name) {
         boolean result = false;
         try {
-            result = toBoolean(System.getProperty(name));
-        } catch (IllegalArgumentException e) {
-        } catch (NullPointerException e) {
+            result = parseBoolean(System.getProperty(name));
+        } catch (IllegalArgumentException | NullPointerException e) {
         }
         return result;
     }
@@ -275,8 +276,4 @@
     public static int compare(boolean x, boolean y) {
         return (x == y) ? 0 : (x ? 1 : -1);
     }
-
-    private static boolean toBoolean(String name) {
-        return ((name != null) && name.equalsIgnoreCase("true"));
-    }
 }
--- a/src/share/classes/java/lang/Double.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/lang/Double.java	Wed Oct 26 17:59:13 2011 -0700
@@ -276,14 +276,14 @@
          * 7.19.6.1; however, the output of this method is more
          * tightly specified.
          */
-        if (!FpUtils.isFinite(d) )
+        if (!isFinite(d) )
             // For infinity and NaN, use the decimal output.
             return Double.toString(d);
         else {
             // Initialized to maximum size of output.
             StringBuffer answer = new StringBuffer(24);
 
-            if (FpUtils.rawCopySign(1.0, d) == -1.0) // value is negative,
+            if (Math.copySign(1.0, d) == -1.0)    // value is negative,
                 answer.append("-");                  // so append sign info
 
             answer.append("0x");
@@ -322,7 +322,7 @@
                 // E_min -1).
                 answer.append("p" + (subnormal ?
                                DoubleConsts.MIN_EXPONENT:
-                               FpUtils.getExponent(d) ));
+                               Math.getExponent(d) ));
             }
             return answer.toString();
         }
@@ -548,7 +548,7 @@
      * @return  {@code true} if the value of the argument is NaN;
      *          {@code false} otherwise.
      */
-    static public boolean isNaN(double v) {
+    public static boolean isNaN(double v) {
         return (v != v);
     }
 
@@ -560,11 +560,25 @@
      * @return  {@code true} if the value of the argument is positive
      *          infinity or negative infinity; {@code false} otherwise.
      */
-    static public boolean isInfinite(double v) {
+    public static boolean isInfinite(double v) {
         return (v == POSITIVE_INFINITY) || (v == NEGATIVE_INFINITY);
     }
 
     /**
+     * Returns {@code true} if the argument is a finite floating-point
+     * value; returns {@code false} otherwise (for NaN and infinity
+     * arguments).
+     *
+     * @param d the {@code double} value to be tested
+     * @return {@code true} if the argument is a finite
+     * floating-point value, {@code false} otherwise.
+     * @since 1.8
+     */
+    public static boolean isFinite(double d) {
+        return Math.abs(d) <= DoubleConsts.MAX_VALUE;
+    }
+
+    /**
      * The value of the Double.
      *
      * @serial
--- a/src/share/classes/java/lang/Float.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/lang/Float.java	Wed Oct 26 17:59:13 2011 -0700
@@ -26,7 +26,6 @@
 package java.lang;
 
 import sun.misc.FloatingDecimal;
-import sun.misc.FpUtils;
 import sun.misc.FloatConsts;
 import sun.misc.DoubleConsts;
 
@@ -279,10 +278,10 @@
             // Adjust exponent to create subnormal double, then
             // replace subnormal double exponent with subnormal float
             // exponent
-            String s = Double.toHexString(FpUtils.scalb((double)f,
-                                                        /* -1022+126 */
-                                                        DoubleConsts.MIN_EXPONENT-
-                                                        FloatConsts.MIN_EXPONENT));
+            String s = Double.toHexString(Math.scalb((double)f,
+                                                     /* -1022+126 */
+                                                     DoubleConsts.MIN_EXPONENT-
+                                                     FloatConsts.MIN_EXPONENT));
             return s.replaceFirst("p-1022$", "p-126");
         }
         else // double string will be the same as float string
@@ -460,7 +459,7 @@
      * @return  {@code true} if the argument is NaN;
      *          {@code false} otherwise.
      */
-    static public boolean isNaN(float v) {
+    public static boolean isNaN(float v) {
         return (v != v);
     }
 
@@ -472,10 +471,25 @@
      * @return  {@code true} if the argument is positive infinity or
      *          negative infinity; {@code false} otherwise.
      */
-    static public boolean isInfinite(float v) {
+    public static boolean isInfinite(float v) {
         return (v == POSITIVE_INFINITY) || (v == NEGATIVE_INFINITY);
     }
 
+
+    /**
+     * Returns {@code true} if the argument is a finite floating-point
+     * value; returns {@code false} otherwise (for NaN and infinity
+     * arguments).
+     *
+     * @param f the {@code float} value to be tested
+     * @return {@code true} if the argument is a finite
+     * floating-point value, {@code false} otherwise.
+     * @since 1.8
+     */
+     public static boolean isFinite(float f) {
+        return Math.abs(f) <= FloatConsts.MAX_VALUE;
+    }
+
     /**
      * The value of the Float.
      *
--- a/src/share/classes/java/lang/Integer.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/lang/Integer.java	Wed Oct 26 17:59:13 2011 -0700
@@ -797,6 +797,8 @@
      *
      * @param   nm   property name.
      * @return  the {@code Integer} value of the property.
+     * @throws  SecurityException for the same reasons as
+     *          {@link System#getProperty(String) System.getProperty}
      * @see     java.lang.System#getProperty(java.lang.String)
      * @see     java.lang.System#getProperty(java.lang.String, java.lang.String)
      */
@@ -841,6 +843,8 @@
      * @param   nm   property name.
      * @param   val   default value.
      * @return  the {@code Integer} value of the property.
+     * @throws  SecurityException for the same reasons as
+     *          {@link System#getProperty(String) System.getProperty}
      * @see     java.lang.System#getProperty(java.lang.String)
      * @see     java.lang.System#getProperty(java.lang.String, java.lang.String)
      */
@@ -881,6 +885,8 @@
      * @param   nm   property name.
      * @param   val   default value.
      * @return  the {@code Integer} value of the property.
+     * @throws  SecurityException for the same reasons as
+     *          {@link System#getProperty(String) System.getProperty}
      * @see     System#getProperty(java.lang.String)
      * @see     System#getProperty(java.lang.String, java.lang.String)
      */
--- a/src/share/classes/java/lang/Long.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/lang/Long.java	Wed Oct 26 17:59:13 2011 -0700
@@ -827,6 +827,8 @@
      *
      * @param   nm   property name.
      * @return  the {@code Long} value of the property.
+     * @throws  SecurityException for the same reasons as
+     *          {@link System#getProperty(String) System.getProperty}
      * @see     java.lang.System#getProperty(java.lang.String)
      * @see     java.lang.System#getProperty(java.lang.String, java.lang.String)
      */
@@ -870,6 +872,8 @@
      * @param   nm    property name.
      * @param   val   default value.
      * @return  the {@code Long} value of the property.
+     * @throws  SecurityException for the same reasons as
+     *          {@link System#getProperty(String) System.getProperty}
      * @see     java.lang.System#getProperty(java.lang.String)
      * @see     java.lang.System#getProperty(java.lang.String, java.lang.String)
      */
@@ -917,6 +921,8 @@
      * @param   nm   property name.
      * @param   val   default value.
      * @return  the {@code Long} value of the property.
+     * @throws  SecurityException for the same reasons as
+     *          {@link System#getProperty(String) System.getProperty}
      * @see     System#getProperty(java.lang.String)
      * @see     System#getProperty(java.lang.String, java.lang.String)
      */
--- a/src/share/classes/java/lang/Math.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/lang/Math.java	Wed Oct 26 17:59:13 2011 -0700
@@ -26,6 +26,8 @@
 package java.lang;
 import java.util.Random;
 
+import sun.misc.FloatConsts;
+import sun.misc.DoubleConsts;
 
 /**
  * The class {@code Math} contains methods for performing basic
@@ -963,7 +965,31 @@
      * @since 1.5
      */
     public static double ulp(double d) {
-        return sun.misc.FpUtils.ulp(d);
+        int exp = getExponent(d);
+
+        switch(exp) {
+        case DoubleConsts.MAX_EXPONENT+1:       // NaN or infinity
+            return Math.abs(d);
+
+        case DoubleConsts.MIN_EXPONENT-1:       // zero or subnormal
+            return Double.MIN_VALUE;
+
+        default:
+            assert exp <= DoubleConsts.MAX_EXPONENT && exp >= DoubleConsts.MIN_EXPONENT;
+
+            // ulp(x) is usually 2^(SIGNIFICAND_WIDTH-1)*(2^ilogb(x))
+            exp = exp - (DoubleConsts.SIGNIFICAND_WIDTH-1);
+            if (exp >= DoubleConsts.MIN_EXPONENT) {
+                return powerOfTwoD(exp);
+            }
+            else {
+                // return a subnormal result; left shift integer
+                // representation of Double.MIN_VALUE appropriate
+                // number of positions
+                return Double.longBitsToDouble(1L <<
+                (exp - (DoubleConsts.MIN_EXPONENT - (DoubleConsts.SIGNIFICAND_WIDTH-1)) ));
+            }
+        }
     }
 
     /**
@@ -990,7 +1016,31 @@
      * @since 1.5
      */
     public static float ulp(float f) {
-        return sun.misc.FpUtils.ulp(f);
+        int exp = getExponent(f);
+
+        switch(exp) {
+        case FloatConsts.MAX_EXPONENT+1:        // NaN or infinity
+            return Math.abs(f);
+
+        case FloatConsts.MIN_EXPONENT-1:        // zero or subnormal
+            return FloatConsts.MIN_VALUE;
+
+        default:
+            assert exp <= FloatConsts.MAX_EXPONENT && exp >= FloatConsts.MIN_EXPONENT;
+
+            // ulp(x) is usually 2^(SIGNIFICAND_WIDTH-1)*(2^ilogb(x))
+            exp = exp - (FloatConsts.SIGNIFICAND_WIDTH-1);
+            if (exp >= FloatConsts.MIN_EXPONENT) {
+                return powerOfTwoF(exp);
+            }
+            else {
+                // return a subnormal result; left shift integer
+                // representation of FloatConsts.MIN_VALUE appropriate
+                // number of positions
+                return Float.intBitsToFloat(1 <<
+                (exp - (FloatConsts.MIN_EXPONENT - (FloatConsts.SIGNIFICAND_WIDTH-1)) ));
+            }
+        }
     }
 
     /**
@@ -1011,7 +1061,7 @@
      * @since 1.5
      */
     public static double signum(double d) {
-        return sun.misc.FpUtils.signum(d);
+        return (d == 0.0 || Double.isNaN(d))?d:copySign(1.0, d);
     }
 
     /**
@@ -1032,7 +1082,7 @@
      * @since 1.5
      */
     public static float signum(float f) {
-        return sun.misc.FpUtils.signum(f);
+        return (f == 0.0f || Float.isNaN(f))?f:copySign(1.0f, f);
     }
 
     /**
@@ -1252,7 +1302,11 @@
      * @since 1.6
      */
     public static double copySign(double magnitude, double sign) {
-        return sun.misc.FpUtils.rawCopySign(magnitude, sign);
+        return Double.longBitsToDouble((Double.doubleToRawLongBits(sign) &
+                                        (DoubleConsts.SIGN_BIT_MASK)) |
+                                       (Double.doubleToRawLongBits(magnitude) &
+                                        (DoubleConsts.EXP_BIT_MASK |
+                                         DoubleConsts.SIGNIF_BIT_MASK)));
     }
 
     /**
@@ -1271,7 +1325,11 @@
      * @since 1.6
      */
     public static float copySign(float magnitude, float sign) {
-        return sun.misc.FpUtils.rawCopySign(magnitude, sign);
+        return Float.intBitsToFloat((Float.floatToRawIntBits(sign) &
+                                     (FloatConsts.SIGN_BIT_MASK)) |
+                                    (Float.floatToRawIntBits(magnitude) &
+                                     (FloatConsts.EXP_BIT_MASK |
+                                      FloatConsts.SIGNIF_BIT_MASK)));
     }
 
     /**
@@ -1289,7 +1347,13 @@
      * @since 1.6
      */
     public static int getExponent(float f) {
-        return sun.misc.FpUtils.getExponent(f);
+        /*
+         * Bitwise convert f to integer, mask out exponent bits, shift
+         * to the right and then subtract out float's bias adjust to
+         * get true exponent value
+         */
+        return ((Float.floatToRawIntBits(f) & FloatConsts.EXP_BIT_MASK) >>
+                (FloatConsts.SIGNIFICAND_WIDTH - 1)) - FloatConsts.EXP_BIAS;
     }
 
     /**
@@ -1307,7 +1371,13 @@
      * @since 1.6
      */
     public static int getExponent(double d) {
-        return sun.misc.FpUtils.getExponent(d);
+        /*
+         * Bitwise convert d to long, mask out exponent bits, shift
+         * to the right and then subtract out double's bias adjust to
+         * get true exponent value.
+         */
+        return (int)(((Double.doubleToRawLongBits(d) & DoubleConsts.EXP_BIT_MASK) >>
+                      (DoubleConsts.SIGNIFICAND_WIDTH - 1)) - DoubleConsts.EXP_BIAS);
     }
 
     /**
@@ -1351,7 +1421,63 @@
      * @since 1.6
      */
     public static double nextAfter(double start, double direction) {
-        return sun.misc.FpUtils.nextAfter(start, direction);
+        /*
+         * The cases:
+         *
+         * nextAfter(+infinity, 0)  == MAX_VALUE
+         * nextAfter(+infinity, +infinity)  == +infinity
+         * nextAfter(-infinity, 0)  == -MAX_VALUE
+         * nextAfter(-infinity, -infinity)  == -infinity
+         *
+         * are naturally handled without any additional testing
+         */
+
+        // First check for NaN values
+        if (Double.isNaN(start) || Double.isNaN(direction)) {
+            // return a NaN derived from the input NaN(s)
+            return start + direction;
+        } else if (start == direction) {
+            return direction;
+        } else {        // start > direction or start < direction
+            // Add +0.0 to get rid of a -0.0 (+0.0 + -0.0 => +0.0)
+            // then bitwise convert start to integer.
+            long transducer = Double.doubleToRawLongBits(start + 0.0d);
+
+            /*
+             * IEEE 754 floating-point numbers are lexicographically
+             * ordered if treated as signed- magnitude integers .
+             * Since Java's integers are two's complement,
+             * incrementing" the two's complement representation of a
+             * logically negative floating-point value *decrements*
+             * the signed-magnitude representation. Therefore, when
+             * the integer representation of a floating-point values
+             * is less than zero, the adjustment to the representation
+             * is in the opposite direction than would be expected at
+             * first .
+             */
+            if (direction > start) { // Calculate next greater value
+                transducer = transducer + (transducer >= 0L ? 1L:-1L);
+            } else  { // Calculate next lesser value
+                assert direction < start;
+                if (transducer > 0L)
+                    --transducer;
+                else
+                    if (transducer < 0L )
+                        ++transducer;
+                    /*
+                     * transducer==0, the result is -MIN_VALUE
+                     *
+                     * The transition from zero (implicitly
+                     * positive) to the smallest negative
+                     * signed magnitude value must be done
+                     * explicitly.
+                     */
+                    else
+                        transducer = DoubleConsts.SIGN_BIT_MASK | 1L;
+            }
+
+            return Double.longBitsToDouble(transducer);
+        }
     }
 
     /**
@@ -1394,7 +1520,63 @@
      * @since 1.6
      */
     public static float nextAfter(float start, double direction) {
-        return sun.misc.FpUtils.nextAfter(start, direction);
+        /*
+         * The cases:
+         *
+         * nextAfter(+infinity, 0)  == MAX_VALUE
+         * nextAfter(+infinity, +infinity)  == +infinity
+         * nextAfter(-infinity, 0)  == -MAX_VALUE
+         * nextAfter(-infinity, -infinity)  == -infinity
+         *
+         * are naturally handled without any additional testing
+         */
+
+        // First check for NaN values
+        if (Float.isNaN(start) || Double.isNaN(direction)) {
+            // return a NaN derived from the input NaN(s)
+            return start + (float)direction;
+        } else if (start == direction) {
+            return (float)direction;
+        } else {        // start > direction or start < direction
+            // Add +0.0 to get rid of a -0.0 (+0.0 + -0.0 => +0.0)
+            // then bitwise convert start to integer.
+            int transducer = Float.floatToRawIntBits(start + 0.0f);
+
+            /*
+             * IEEE 754 floating-point numbers are lexicographically
+             * ordered if treated as signed- magnitude integers .
+             * Since Java's integers are two's complement,
+             * incrementing" the two's complement representation of a
+             * logically negative floating-point value *decrements*
+             * the signed-magnitude representation. Therefore, when
+             * the integer representation of a floating-point values
+             * is less than zero, the adjustment to the representation
+             * is in the opposite direction than would be expected at
+             * first.
+             */
+            if (direction > start) {// Calculate next greater value
+                transducer = transducer + (transducer >= 0 ? 1:-1);
+            } else  { // Calculate next lesser value
+                assert direction < start;
+                if (transducer > 0)
+                    --transducer;
+                else
+                    if (transducer < 0 )
+                        ++transducer;
+                    /*
+                     * transducer==0, the result is -MIN_VALUE
+                     *
+                     * The transition from zero (implicitly
+                     * positive) to the smallest negative
+                     * signed magnitude value must be done
+                     * explicitly.
+                     */
+                    else
+                        transducer = FloatConsts.SIGN_BIT_MASK | 1;
+            }
+
+            return Float.intBitsToFloat(transducer);
+        }
     }
 
     /**
@@ -1423,7 +1605,13 @@
      * @since 1.6
      */
     public static double nextUp(double d) {
-        return sun.misc.FpUtils.nextUp(d);
+        if( Double.isNaN(d) || d == Double.POSITIVE_INFINITY)
+            return d;
+        else {
+            d += 0.0d;
+            return Double.longBitsToDouble(Double.doubleToRawLongBits(d) +
+                                           ((d >= 0.0d)?+1L:-1L));
+        }
     }
 
     /**
@@ -1452,9 +1640,88 @@
      * @since 1.6
      */
     public static float nextUp(float f) {
-        return sun.misc.FpUtils.nextUp(f);
+        if( Float.isNaN(f) || f == FloatConsts.POSITIVE_INFINITY)
+            return f;
+        else {
+            f += 0.0f;
+            return Float.intBitsToFloat(Float.floatToRawIntBits(f) +
+                                        ((f >= 0.0f)?+1:-1));
+        }
     }
 
+    /**
+     * Returns the floating-point value adjacent to {@code d} in
+     * the direction of negative infinity.  This method is
+     * semantically equivalent to {@code nextAfter(d,
+     * Double.NEGATIVE_INFINITY)}; however, a
+     * {@code nextDown} implementation may run faster than its
+     * equivalent {@code nextAfter} call.
+     *
+     * <p>Special Cases:
+     * <ul>
+     * <li> If the argument is NaN, the result is NaN.
+     *
+     * <li> If the argument is negative infinity, the result is
+     * negative infinity.
+     *
+     * <li> If the argument is zero, the result is
+     * {@code -Double.MIN_VALUE}
+     *
+     * </ul>
+     *
+     * @param d  starting floating-point value
+     * @return The adjacent floating-point value closer to negative
+     * infinity.
+     * @since 1.8
+     */
+    public static double nextDown(double d) {
+        if (Double.isNaN(d) || d == Double.NEGATIVE_INFINITY)
+            return d;
+        else {
+            if (d == 0.0)
+                return -Double.MIN_VALUE;
+            else
+                return Double.longBitsToDouble(Double.doubleToRawLongBits(d) +
+                                               ((d > 0.0d)?-1L:+1L));
+        }
+    }
+
+    /**
+     * Returns the floating-point value adjacent to {@code f} in
+     * the direction of negative infinity.  This method is
+     * semantically equivalent to {@code nextAfter(f,
+     * Float.NEGATIVE_INFINITY)}; however, a
+     * {@code nextDown} implementation may run faster than its
+     * equivalent {@code nextAfter} call.
+     *
+     * <p>Special Cases:
+     * <ul>
+     * <li> If the argument is NaN, the result is NaN.
+     *
+     * <li> If the argument is negative infinity, the result is
+     * negative infinity.
+     *
+     * <li> If the argument is zero, the result is
+     * {@code -Float.MIN_VALUE}
+     *
+     * </ul>
+     *
+     * @param f  starting floating-point value
+     * @return The adjacent floating-point value closer to negative
+     * infinity.
+     * @since 1.8
+     */
+    public static float nextDown(float f) {
+        if (Float.isNaN(f) || f == Float.NEGATIVE_INFINITY)
+            return f;
+        else {
+            if (f == 0.0f)
+                return -Float.MIN_VALUE;
+            else
+                return Float.intBitsToFloat(Float.floatToRawIntBits(f) +
+                                            ((f > 0.0f)?-1:+1));
+        }
+    }
 
     /**
      * Return {@code d} &times;
@@ -1487,7 +1754,80 @@
      * @since 1.6
      */
     public static double scalb(double d, int scaleFactor) {
-        return sun.misc.FpUtils.scalb(d, scaleFactor);
+        /*
+         * This method does not need to be declared strictfp to
+         * compute the same correct result on all platforms.  When
+         * scaling up, it does not matter what order the
+         * multiply-store operations are done; the result will be
+         * finite or overflow regardless of the operation ordering.
+         * However, to get the correct result when scaling down, a
+         * particular ordering must be used.
+         *
+         * When scaling down, the multiply-store operations are
+         * sequenced so that it is not possible for two consecutive
+         * multiply-stores to return subnormal results.  If one
+         * multiply-store result is subnormal, the next multiply will
+         * round it away to zero.  This is done by first multiplying
+         * by 2 ^ (scaleFactor % n) and then multiplying several
+         * times by by 2^n as needed where n is the exponent of number
+         * that is a covenient power of two.  In this way, at most one
+         * real rounding error occurs.  If the double value set is
+         * being used exclusively, the rounding will occur on a
+         * multiply.  If the double-extended-exponent value set is
+         * being used, the products will (perhaps) be exact but the
+         * stores to d are guaranteed to round to the double value
+         * set.
+         *
+         * It is _not_ a valid implementation to first multiply d by
+         * 2^MIN_EXPONENT and then by 2 ^ (scaleFactor %
+         * MIN_EXPONENT) since even in a strictfp program double
+         * rounding on underflow could occur; e.g. if the scaleFactor
+         * argument was (MIN_EXPONENT - n) and the exponent of d was a
+         * little less than -(MIN_EXPONENT - n), meaning the final
+         * result would be subnormal.
+         *
+         * Since exact reproducibility of this method can be achieved
+         * without any undue performance burden, there is no
+         * compelling reason to allow double rounding on underflow in
+         * scalb.
+         */
+
+        // magnitude of a power of two so large that scaling a finite
+        // nonzero value by it would be guaranteed to over or
+        // underflow; due to rounding, scaling down takes takes an
+        // additional power of two which is reflected here
+        final int MAX_SCALE = DoubleConsts.MAX_EXPONENT + -DoubleConsts.MIN_EXPONENT +
+                              DoubleConsts.SIGNIFICAND_WIDTH + 1;
+        int exp_adjust = 0;
+        int scale_increment = 0;
+        double exp_delta = Double.NaN;
+
+        // Make sure scaling factor is in a reasonable range
+
+        if(scaleFactor < 0) {
+            scaleFactor = Math.max(scaleFactor, -MAX_SCALE);
+            scale_increment = -512;
+            exp_delta = twoToTheDoubleScaleDown;
+        }
+        else {
+            scaleFactor = Math.min(scaleFactor, MAX_SCALE);
+            scale_increment = 512;
+            exp_delta = twoToTheDoubleScaleUp;
+        }
+
+        // Calculate (scaleFactor % +/-512), 512 = 2^9, using
+        // technique from "Hacker's Delight" section 10-2.
+        int t = (scaleFactor >> 9-1) >>> 32 - 9;
+        exp_adjust = ((scaleFactor + t) & (512 -1)) - t;
+
+        d *= powerOfTwoD(exp_adjust);
+        scaleFactor -= exp_adjust;
+
+        while(scaleFactor != 0) {
+            d *= exp_delta;
+            scaleFactor -= scale_increment;
+        }
+        return d;
     }
 
     /**
@@ -1521,6 +1861,49 @@
      * @since 1.6
      */
     public static float scalb(float f, int scaleFactor) {
-        return sun.misc.FpUtils.scalb(f, scaleFactor);
+        // magnitude of a power of two so large that scaling a finite
+        // nonzero value by it would be guaranteed to over or
+        // underflow; due to rounding, scaling down takes takes an
+        // additional power of two which is reflected here
+        final int MAX_SCALE = FloatConsts.MAX_EXPONENT + -FloatConsts.MIN_EXPONENT +
+                              FloatConsts.SIGNIFICAND_WIDTH + 1;
+
+        // Make sure scaling factor is in a reasonable range
+        scaleFactor = Math.max(Math.min(scaleFactor, MAX_SCALE), -MAX_SCALE);
+
+        /*
+         * Since + MAX_SCALE for float fits well within the double
+         * exponent range and + float -> double conversion is exact
+         * the multiplication below will be exact. Therefore, the
+         * rounding that occurs when the double product is cast to
+         * float will be the correctly rounded float result.  Since
+         * all operations other than the final multiply will be exact,
+         * it is not necessary to declare this method strictfp.
+         */
+        return (float)((double)f*powerOfTwoD(scaleFactor));
+    }
+
+    // Constants used in scalb
+    static double twoToTheDoubleScaleUp = powerOfTwoD(512);
+    static double twoToTheDoubleScaleDown = powerOfTwoD(-512);
+
+    /**
+     * Returns a floating-point power of two in the normal range.
+     */
+    static double powerOfTwoD(int n) {
+        assert(n >= DoubleConsts.MIN_EXPONENT && n <= DoubleConsts.MAX_EXPONENT);
+        return Double.longBitsToDouble((((long)n + (long)DoubleConsts.EXP_BIAS) <<
+                                        (DoubleConsts.SIGNIFICAND_WIDTH-1))
+                                       & DoubleConsts.EXP_BIT_MASK);
+    }
+
+    /**
+     * Returns a floating-point power of two in the normal range.
+     */
+    public static float powerOfTwoF(int n) {
+        assert(n >= FloatConsts.MIN_EXPONENT && n <= FloatConsts.MAX_EXPONENT);
+        return Float.intBitsToFloat(((n + FloatConsts.EXP_BIAS) <<
+                                     (FloatConsts.SIGNIFICAND_WIDTH-1))
+                                    & FloatConsts.EXP_BIT_MASK);
     }
 }
--- a/src/share/classes/java/lang/SafeVarargs.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/lang/SafeVarargs.java	Wed Oct 26 17:59:13 2011 -0700
@@ -82,6 +82,7 @@
  *
  * </ul>
  *
+ * @since 1.7
  * @jls 4.7 Reifiable Types
  * @jls 8.4.1 Formal Parameters
  */
--- a/src/share/classes/java/lang/StrictMath.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/lang/StrictMath.java	Wed Oct 26 17:59:13 2011 -0700
@@ -25,7 +25,6 @@
 
 package java.lang;
 import java.util.Random;
-import sun.misc.FpUtils;
 import sun.misc.DoubleConsts;
 
 /**
@@ -428,7 +427,7 @@
          * 1.0, which is exact too.
          */
         double twoToThe52 = (double)(1L << 52); // 2^52
-        double sign = FpUtils.rawCopySign(1.0, a); // preserve sign info
+        double sign = Math.copySign(1.0, a); // preserve sign info
         a = Math.abs(a);
 
         if (a < twoToThe52) { // E_min <= ilogb(a) <= 51
@@ -955,7 +954,7 @@
      * @since 1.5
      */
     public static double ulp(double d) {
-        return sun.misc.FpUtils.ulp(d);
+        return Math.ulp(d);
     }
 
     /**
@@ -982,7 +981,7 @@
      * @since 1.5
      */
     public static float ulp(float f) {
-        return sun.misc.FpUtils.ulp(f);
+        return Math.ulp(f);
     }
 
     /**
@@ -1003,7 +1002,7 @@
      * @since 1.5
      */
     public static double signum(double d) {
-        return sun.misc.FpUtils.signum(d);
+        return Math.signum(d);
     }
 
     /**
@@ -1024,7 +1023,7 @@
      * @since 1.5
      */
     public static float signum(float f) {
-        return sun.misc.FpUtils.signum(f);
+        return Math.signum(f);
     }
 
     /**
@@ -1202,7 +1201,7 @@
      * @since 1.6
      */
     public static double copySign(double magnitude, double sign) {
-        return sun.misc.FpUtils.copySign(magnitude, sign);
+        return Math.copySign(magnitude, (Double.isNaN(sign)?1.0d:sign));
     }
 
     /**
@@ -1218,7 +1217,7 @@
      * @since 1.6
      */
     public static float copySign(float magnitude, float sign) {
-        return sun.misc.FpUtils.copySign(magnitude, sign);
+        return Math.copySign(magnitude, (Float.isNaN(sign)?1.0f:sign));
     }
     /**
      * Returns the unbiased exponent used in the representation of a
@@ -1234,7 +1233,7 @@
      * @since 1.6
      */
     public static int getExponent(float f) {
-        return sun.misc.FpUtils.getExponent(f);
+        return Math.getExponent(f);
     }
 
     /**
@@ -1251,7 +1250,7 @@
      * @since 1.6
      */
     public static int getExponent(double d) {
-        return sun.misc.FpUtils.getExponent(d);
+        return Math.getExponent(d);
     }
 
     /**
@@ -1294,7 +1293,7 @@
      * @since 1.6
      */
     public static double nextAfter(double start, double direction) {
-        return sun.misc.FpUtils.nextAfter(start, direction);
+        return Math.nextAfter(start, direction);
     }
 
     /**
@@ -1336,7 +1335,7 @@
      * @since 1.6
      */
     public static float nextAfter(float start, double direction) {
-        return sun.misc.FpUtils.nextAfter(start, direction);
+        return Math.nextAfter(start, direction);
     }
 
     /**
@@ -1365,7 +1364,7 @@
      * @since 1.6
      */
     public static double nextUp(double d) {
-        return sun.misc.FpUtils.nextUp(d);
+        return Math.nextUp(d);
     }
 
     /**
@@ -1394,9 +1393,66 @@
      * @since 1.6
      */
     public static float nextUp(float f) {
-        return sun.misc.FpUtils.nextUp(f);
+        return Math.nextUp(f);
     }
 
+    /**
+     * Returns the floating-point value adjacent to {@code d} in
+     * the direction of negative infinity.  This method is
+     * semantically equivalent to {@code nextAfter(d,
+     * Double.NEGATIVE_INFINITY)}; however, a
+     * {@code nextDown} implementation may run faster than its
+     * equivalent {@code nextAfter} call.
+     *
+     * <p>Special Cases:
+     * <ul>
+     * <li> If the argument is NaN, the result is NaN.
+     *
+     * <li> If the argument is negative infinity, the result is
+     * negative infinity.
+     *
+     * <li> If the argument is zero, the result is
+     * {@code -Double.MIN_VALUE}
+     *
+     * </ul>
+     *
+     * @param d  starting floating-point value
+     * @return The adjacent floating-point value closer to negative
+     * infinity.
+     * @since 1.8
+     */
+    public static double nextDown(double d) {
+        return Math.nextDown(d);
+    }
+
+    /**
+     * Returns the floating-point value adjacent to {@code f} in
+     * the direction of negative infinity.  This method is
+     * semantically equivalent to {@code nextAfter(f,
+     * Float.NEGATIVE_INFINITY)}; however, a
+     * {@code nextDown} implementation may run faster than its
+     * equivalent {@code nextAfter} call.
+     *
+     * <p>Special Cases:
+     * <ul>
+     * <li> If the argument is NaN, the result is NaN.
+     *
+     * <li> If the argument is negative infinity, the result is
+     * negative infinity.
+     *
+     * <li> If the argument is zero, the result is
+     * {@code -Float.MIN_VALUE}
+     *
+     * </ul>
+     *
+     * @param f  starting floating-point value
+     * @return The adjacent floating-point value closer to negative
+     * infinity.
+     * @since 1.8
+     */
+    public static float nextDown(float f) {
+        return Math.nextDown(f);
+    }
 
     /**
      * Return {@code d} &times;
@@ -1429,7 +1485,7 @@
      * @since 1.6
      */
     public static double scalb(double d, int scaleFactor) {
-        return sun.misc.FpUtils.scalb(d, scaleFactor);
+        return Math.scalb(d, scaleFactor);
     }
 
     /**
@@ -1463,6 +1519,6 @@
      * @since 1.6
      */
     public static float scalb(float f, int scaleFactor) {
-        return sun.misc.FpUtils.scalb(f, scaleFactor);
+        return Math.scalb(f, scaleFactor);
     }
 }
--- a/src/share/classes/java/lang/invoke/AdapterMethodHandle.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/lang/invoke/AdapterMethodHandle.java	Wed Oct 26 17:59:13 2011 -0700
@@ -53,7 +53,7 @@
         // JVM might update VM-specific bits of conversion (ignore)
         MethodHandleNatives.init(this, target, convArgPos(conv));
     }
-    private AdapterMethodHandle(MethodHandle target, MethodType newType,
+    AdapterMethodHandle(MethodHandle target, MethodType newType,
                 long conv) {
         this(target, newType, conv, null);
     }
@@ -423,7 +423,7 @@
                 insertStackMove(stackMove)
                 );
     }
-    private static long makeConv(int convOp) {
+    static long makeConv(int convOp) {
         assert(convOp == OP_RETYPE_ONLY || convOp == OP_RETYPE_RAW);
         return ((long)-1 << 32) | (convOp << CONV_OP_SHIFT);   // stackMove, src, dst all zero
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/lang/invoke/CountingMethodHandle.java	Wed Oct 26 17:59:13 2011 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.lang.invoke;
+
+import static java.lang.invoke.MethodHandleNatives.Constants.*;
+
+/**
+ * This method handle is used to optionally provide a count of how
+ * many times it was invoked.
+ *
+ * @author never
+ */
+class CountingMethodHandle extends AdapterMethodHandle {
+    private int vmcount;
+
+    private CountingMethodHandle(MethodHandle target) {
+        super(target, target.type(), AdapterMethodHandle.makeConv(OP_RETYPE_ONLY));
+    }
+
+    /** Wrap the incoming MethodHandle in a CountingMethodHandle if they are enabled */
+    static MethodHandle wrap(MethodHandle mh) {
+        if (MethodHandleNatives.COUNT_GWT) {
+            return new CountingMethodHandle(mh);
+        }
+        return mh;
+    }
+}
--- a/src/share/classes/java/lang/invoke/MethodHandleImpl.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/lang/invoke/MethodHandleImpl.java	Wed Oct 26 17:59:13 2011 -0700
@@ -749,8 +749,8 @@
         assert(target.type().equals(fallback.type()));
         MethodHandle tailcall = MethodHandles.exactInvoker(target.type());
         MethodHandle select = selectAlternative();
-        select = bindArgument(select, 2, fallback);
-        select = bindArgument(select, 1, target);
+        select = bindArgument(select, 2, CountingMethodHandle.wrap(fallback));
+        select = bindArgument(select, 1, CountingMethodHandle.wrap(target));
         // select(z: boolean) => (z ? target : fallback)
         MethodHandle filter = filterArgument(tailcall, 0, select);
         assert(filter.type().parameterType(0) == boolean.class);
--- a/src/share/classes/java/lang/invoke/MethodHandleNatives.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/lang/invoke/MethodHandleNatives.java	Wed Oct 26 17:59:13 2011 -0700
@@ -120,6 +120,8 @@
 
     static final int OP_ROT_ARGS_DOWN_LIMIT_BIAS;
 
+    static final boolean COUNT_GWT;
+
     private static native void registerNatives();
     static {
         registerNatives();
@@ -131,6 +133,7 @@
         k                           = getConstant(Constants.GC_OP_ROT_ARGS_DOWN_LIMIT_BIAS);
         OP_ROT_ARGS_DOWN_LIMIT_BIAS = (k != 0) ? (byte)k : -1;
         HAVE_RICOCHET_FRAMES        = (CONV_OP_IMPLEMENTED_MASK & (1<<OP_COLLECT_ARGS)) != 0;
+        COUNT_GWT                   = getConstant(Constants.GC_COUNT_GWT) != 0;
         //sun.reflect.Reflection.registerMethodsToFilter(MethodHandleImpl.class, "init");
     }
 
@@ -143,7 +146,8 @@
                 GC_JVM_PUSH_LIMIT = 0,
                 GC_JVM_STACK_MOVE_UNIT = 1,
                 GC_CONV_OP_IMPLEMENTED_MASK = 2,
-                GC_OP_ROT_ARGS_DOWN_LIMIT_BIAS = 3;
+                GC_OP_ROT_ARGS_DOWN_LIMIT_BIAS = 3,
+                GC_COUNT_GWT = 4;
         static final int
                 ETF_HANDLE_OR_METHOD_NAME = 0, // all available data (immediate MH or method)
                 ETF_DIRECT_HANDLE         = 1, // ultimate method handle (will be a DMH, may be self)
--- a/src/share/classes/java/math/BigInteger.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/math/BigInteger.java	Wed Oct 26 17:59:13 2011 -0700
@@ -2919,6 +2919,7 @@
      * result with the opposite sign.
      *
      * @return this BigInteger converted to an {@code int}.
+     * @see #intValueExact()
      */
     public int intValue() {
         int result = 0;
@@ -2939,6 +2940,7 @@
      * result with the opposite sign.
      *
      * @return this BigInteger converted to a {@code long}.
+     * @see #longValueExact()
      */
     public long longValue() {
         long result = 0;
@@ -3382,4 +3384,84 @@
         }
         return result;
     }
+
+    /**
+     * Converts this {@code BigInteger} to a {@code long}, checking
+     * for lost information.  If the value of this {@code BigInteger}
+     * is out of the range of the {@code long} type, then an
+     * {@code ArithmeticException} is thrown.
+     *
+     * @return this {@code BigInteger} converted to a {@code long}.
+     * @throws ArithmeticException if the value of {@code this} will
+     * not exactly fit in a {@code long}.
+     * @see BigInteger#longValue
+     * @since  1.8
+     */
+    public long longValueExact() {
+        if (mag.length <= 2 && bitLength() <= 63)
+            return longValue();
+        else
+            throw new ArithmeticException("BigInteger out of long range");
+    }
+
+    /**
+     * Converts this {@code BigInteger} to an {@code int}, checking
+     * for lost information.  If the value of this {@code BigInteger}
+     * is out of the range of the {@code int} type, then an
+     * {@code ArithmeticException} is thrown.
+     *
+     * @return this {@code BigInteger} converted to an {@code int}.
+     * @throws ArithmeticException if the value of {@code this} will
+     * not exactly fit in a {@code int}.
+     * @see BigInteger#intValue
+     * @since  1.8
+     */
+    public int intValueExact() {
+        if (mag.length <= 1 && bitLength() <= 31)
+            return intValue();
+        else
+            throw new ArithmeticException("BigInteger out of int range");
+    }
+
+    /**
+     * Converts this {@code BigInteger} to a {@code short}, checking
+     * for lost information.  If the value of this {@code BigInteger}
+     * is out of the range of the {@code short} type, then an
+     * {@code ArithmeticException} is thrown.
+     *
+     * @return this {@code BigInteger} converted to a {@code short}.
+     * @throws ArithmeticException if the value of {@code this} will
+     * not exactly fit in a {@code short}.
+     * @see BigInteger#shortValue
+     * @since  1.8
+     */
+    public short shortValueExact() {
+        if (mag.length <= 1 && bitLength() <= 31) {
+            int value = intValue();
+            if (value >= Short.MIN_VALUE && value <= Short.MAX_VALUE)
+                return shortValue();
+        }
+        throw new ArithmeticException("BigInteger out of short range");
+    }
+
+    /**
+     * Converts this {@code BigInteger} to a {@code byte}, checking
+     * for lost information.  If the value of this {@code BigInteger}
+     * is out of the range of the {@code byte} type, then an
+     * {@code ArithmeticException} is thrown.
+     *
+     * @return this {@code BigInteger} converted to a {@code byte}.
+     * @throws ArithmeticException if the value of {@code this} will
+     * not exactly fit in a {@code byte}.
+     * @see BigInteger#byteValue
+     * @since  1.8
+     */
+    public byte byteValueExact() {
+        if (mag.length <= 1 && bitLength() <= 31) {
+            int value = intValue();
+            if (value >= Byte.MIN_VALUE && value <= Byte.MAX_VALUE)
+                return byteValue();
+        }
+        throw new ArithmeticException("BigInteger out of byte range");
+    }
 }
--- a/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java	Wed Oct 26 17:59:13 2011 -0700
@@ -26,8 +26,6 @@
 
 import java.io.FileDescriptor;
 import java.io.IOException;
-import java.io.InterruptedIOException;
-import java.util.Enumeration;
 import sun.net.ResourceManager;
 
 /**
@@ -46,7 +44,7 @@
     int timeout = 0;
     boolean connected = false;
     private int trafficClass = 0;
-    private InetAddress connectedAddress = null;
+    protected InetAddress connectedAddress = null;
     private int connectedPort = -1;
 
     /* cached socket options */
@@ -66,8 +64,8 @@
      * Creates a datagram socket
      */
     protected synchronized void create() throws SocketException {
+        ResourceManager.beforeUdpCreate();
         fd = new FileDescriptor();
-        ResourceManager.beforeUdpCreate();
         try {
             datagramSocketCreate();
         } catch (SocketException ioe) {
@@ -153,11 +151,13 @@
      * Set the TTL (time-to-live) option.
      * @param TTL to be set.
      */
+    @Deprecated
     protected abstract void setTTL(byte ttl) throws IOException;
 
     /**
      * Get the TTL (time-to-live) option.
      */
+    @Deprecated
     protected abstract byte getTTL() throws IOException;
 
     /**
--- a/src/share/classes/java/net/AbstractPlainSocketImpl.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/net/AbstractPlainSocketImpl.java	Wed Oct 26 17:59:13 2011 -0700
@@ -71,7 +71,7 @@
 
    /* whether this Socket is a stream (TCP) socket or not (UDP)
     */
-    private boolean stream;
+    protected boolean stream;
 
     /**
      * Load net library into runtime.
@@ -86,10 +86,11 @@
      * is a stream socket (true) or an unconnected UDP socket (false).
      */
     protected synchronized void create(boolean stream) throws IOException {
-        fd = new FileDescriptor();
         this.stream = stream;
         if (!stream) {
             ResourceManager.beforeUdpCreate();
+            // only create the fd after we know we will be able to create the socket
+            fd = new FileDescriptor();
             try {
                 socketCreate(false);
             } catch (IOException ioe) {
@@ -98,6 +99,7 @@
                 throw ioe;
             }
         } else {
+            fd = new FileDescriptor();
             socketCreate(true);
         }
         if (socket != null)
--- a/src/share/classes/java/net/ContentHandler.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/net/ContentHandler.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -96,7 +96,7 @@
      * @exception  IOException  if an I/O error occurs while reading the object.
      * @since 1.3
      */
-    public Object getContent(URLConnection urlc, Class[] classes) throws IOException {
+    public Object getContent(URLConnection urlc, Class<?>[] classes) throws IOException {
         Object obj = getContent(urlc);
 
         for (int i = 0; i < classes.length; i++) {
--- a/src/share/classes/java/net/CookieManager.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/net/CookieManager.java	Wed Oct 26 17:59:13 2011 -0700
@@ -249,7 +249,6 @@
         return Collections.unmodifiableMap(cookieMap);
     }
 
-
     public void
         put(URI uri, Map<String, List<String>> responseHeaders)
         throws IOException
@@ -284,7 +283,7 @@
                         cookies = HttpCookie.parse(headerValue);
                     } catch (IllegalArgumentException e) {
                         // Bogus header, make an empty list and log the error
-                        cookies = java.util.Collections.EMPTY_LIST;
+                        cookies = java.util.Collections.emptyList();
                         if (logger.isLoggable(PlatformLogger.SEVERE)) {
                             logger.severe("Invalid cookie for " + uri + ": " + headerValue);
                         }
--- a/src/share/classes/java/net/DatagramSocket.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/net/DatagramSocket.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,7 @@
 
 package java.net;
 
-import java.io.FileDescriptor;
 import java.io.IOException;
-import java.io.InterruptedIOException;
 import java.nio.channels.DatagramChannel;
 import java.security.AccessController;
 import java.security.PrivilegedExceptionAction;
@@ -289,7 +287,7 @@
             AccessController.doPrivileged(
                 new PrivilegedExceptionAction<Void>() {
                     public Void run() throws NoSuchMethodException {
-                        Class[] cl = new Class[1];
+                        Class<?>[] cl = new Class<?>[1];
                         cl[0] = DatagramPacket.class;
                         impl.getClass().getDeclaredMethod("peekData", cl);
                         return null;
@@ -300,7 +298,7 @@
         }
     }
 
-    static Class implClass = null;
+    static Class<?> implClass = null;
 
     void createImpl() throws SocketException {
         if (impl == null) {
--- a/src/share/classes/java/net/HttpURLConnection.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/net/HttpURLConnection.java	Wed Oct 26 17:59:13 2011 -0700
@@ -535,6 +535,7 @@
         return responseMessage;
     }
 
+    @SuppressWarnings("deprecation")
     public long getHeaderFieldDate(String name, long Default) {
         String dateString = getHeaderField(name);
         try {
--- a/src/share/classes/java/net/InMemoryCookieStore.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/net/InMemoryCookieStore.java	Wed Oct 26 17:59:13 2011 -0700
@@ -91,8 +91,10 @@
                 if (cookie.getDomain() != null) {
                     addIndex(domainIndex, cookie.getDomain(), cookie);
                 }
-                // add it to uri index, too
-                addIndex(uriIndex, getEffectiveURI(uri), cookie);
+                if (uri != null) {
+                    // add it to uri index, too
+                    addIndex(uriIndex, getEffectiveURI(uri), cookie);
+                }
             }
         } finally {
             lock.unlock();
--- a/src/share/classes/java/net/Inet4Address.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/net/Inet4Address.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,7 @@
 
 package java.net;
 
-import java.security.AccessController;
 import java.io.ObjectStreamException;
-import sun.security.action.*;
 
 /**
  * This class represents an Internet Protocol version 4 (IPv4) address.
--- a/src/share/classes/java/net/Inet4AddressImpl.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/net/Inet4AddressImpl.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -59,11 +59,11 @@
           /*
            * Let's make sure we use an address of the proper family
            */
-          java.util.Enumeration it = netif.getInetAddresses();
+          java.util.Enumeration<InetAddress> it = netif.getInetAddresses();
           InetAddress inetaddr = null;
           while (!(inetaddr instanceof Inet4Address) &&
                  it.hasMoreElements())
-              inetaddr = (InetAddress) it.nextElement();
+              inetaddr = it.nextElement();
           if (inetaddr instanceof Inet4Address)
               ifaddr = inetaddr.getAddress();
       }
--- a/src/share/classes/java/net/Inet6Address.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/net/Inet6Address.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -383,9 +383,9 @@
         while (en.hasMoreElements()) {
             NetworkInterface ifc = en.nextElement();
             if (ifc.getName().equals (ifname)) {
-                Enumeration addresses = ifc.getInetAddresses();
+                Enumeration<InetAddress> addresses = ifc.getInetAddresses();
                 while (addresses.hasMoreElements()) {
-                    InetAddress addr = (InetAddress)addresses.nextElement();
+                    InetAddress addr = addresses.nextElement();
                     if (!(addr instanceof Inet6Address)) {
                         continue;
                     }
--- a/src/share/classes/java/net/Inet6AddressImpl.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/net/Inet6AddressImpl.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,10 +54,10 @@
              * be either an IPv6 address or an IPv4 address (case of a dual
              * stack system).
              */
-            java.util.Enumeration it = netif.getInetAddresses();
+            java.util.Enumeration<InetAddress> it = netif.getInetAddresses();
             InetAddress inetaddr = null;
             while (it.hasMoreElements()) {
-                inetaddr = (InetAddress) it.nextElement();
+                inetaddr = it.nextElement();
                 if (inetaddr.getClass().isInstance(addr)) {
                     ifaddr = inetaddr.getAddress();
                     if (inetaddr instanceof Inet6Address) {
--- a/src/share/classes/java/net/MulticastSocket.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/net/MulticastSocket.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,6 @@
 package java.net;
 
 import java.io.IOException;
-import java.io.InterruptedIOException;
 import java.util.Enumeration;
 
 /**
@@ -500,9 +499,9 @@
              */
             try {
                 NetworkInterface ni = NetworkInterface.getByInetAddress(ia);
-                Enumeration addrs = ni.getInetAddresses();
+                Enumeration<InetAddress> addrs = ni.getInetAddresses();
                 while (addrs.hasMoreElements()) {
-                    InetAddress addr = (InetAddress)(addrs.nextElement());
+                    InetAddress addr = addrs.nextElement();
                     if (addr.equals(infAddress)) {
                         return infAddress;
                     }
--- a/src/share/classes/java/net/Proxy.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/net/Proxy.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -73,7 +73,7 @@
 
     // Creates the proxy that represents a <code>DIRECT</code> connection.
     private Proxy() {
-        type = type.DIRECT;
+        type = Type.DIRECT;
         sa = null;
     }
 
--- a/src/share/classes/java/net/ProxySelector.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/net/ProxySelector.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -69,7 +69,7 @@
 
     static {
         try {
-            Class c = Class.forName("sun.net.spi.DefaultProxySelector");
+            Class<?> c = Class.forName("sun.net.spi.DefaultProxySelector");
             if (c != null && ProxySelector.class.isAssignableFrom(c)) {
                 theProxySelector = (ProxySelector) c.newInstance();
             }
--- a/src/share/classes/java/net/Socket.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/net/Socket.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -459,13 +459,10 @@
         oldImpl = AccessController.doPrivileged
                                 (new PrivilegedAction<Boolean>() {
             public Boolean run() {
-                Class[] cl = new Class[2];
-                cl[0] = SocketAddress.class;
-                cl[1] = Integer.TYPE;
-                Class clazz = impl.getClass();
+                Class<?> clazz = impl.getClass();
                 while (true) {
                     try {
-                        clazz.getDeclaredMethod("connect", cl);
+                        clazz.getDeclaredMethod("connect", SocketAddress.class, int.class);
                         return Boolean.FALSE;
                     } catch (NoSuchMethodException e) {
                         clazz = clazz.getSuperclass();
--- a/src/share/classes/java/net/SocketPermission.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/net/SocketPermission.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -467,6 +467,7 @@
      * @param action the action string
      * @return the action mask
      */
+    @SuppressWarnings("fallthrough")
     private static int getMask(String action) {
 
         if (action == null) {
@@ -1231,7 +1232,7 @@
 implements Serializable
 {
     // Not serialized; see serialization section at end of class
-    private transient List perms;
+    private transient List<SocketPermission> perms;
 
     /**
      * Create an empty SocketPermissions object.
@@ -1239,7 +1240,7 @@
      */
 
     public SocketPermissionCollection() {
-        perms = new ArrayList();
+        perms = new ArrayList<SocketPermission>();
     }
 
     /**
@@ -1267,7 +1268,7 @@
         // optimization to ensure perms most likely to be tested
         // show up early (4301064)
         synchronized (this) {
-            perms.add(0, permission);
+            perms.add(0, (SocketPermission)permission);
         }
     }
 
@@ -1296,7 +1297,7 @@
             int len = perms.size();
             //System.out.println("implies "+np);
             for (int i = 0; i < len; i++) {
-                SocketPermission x = (SocketPermission) perms.get(i);
+                SocketPermission x = perms.get(i);
                 //System.out.println("  trying "+x);
                 if (((needed & x.getMask()) != 0) && x.impliesIgnoreMask(np)) {
                     effective |=  x.getMask();
@@ -1316,10 +1317,11 @@
      * @return an enumeration of all the SocketPermission objects.
      */
 
-    public Enumeration elements() {
+    @SuppressWarnings("unchecked")
+    public Enumeration<Permission> elements() {
         // Convert Iterator into Enumeration
         synchronized (this) {
-            return Collections.enumeration(perms);
+            return Collections.enumeration((List<Permission>)(List)perms);
         }
     }
 
@@ -1353,7 +1355,7 @@
         // Don't call out.defaultWriteObject()
 
         // Write out Vector
-        Vector permissions = new Vector(perms.size());
+        Vector<SocketPermission> permissions = new Vector<>(perms.size());
 
         synchronized (this) {
             permissions.addAll(perms);
@@ -1375,8 +1377,9 @@
         ObjectInputStream.GetField gfields = in.readFields();
 
         // Get the one we want
-        Vector permissions = (Vector)gfields.get("permissions", null);
-        perms = new ArrayList(permissions.size());
+        @SuppressWarnings("unchecked")
+        Vector<SocketPermission> permissions = (Vector<SocketPermission>)gfields.get("permissions", null);
+        perms = new ArrayList<SocketPermission>(permissions.size());
         perms.addAll(permissions);
     }
 }
--- a/src/share/classes/java/net/URL.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/net/URL.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,6 @@
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.OutputStream;
 import java.util.Hashtable;
 import java.util.StringTokenizer;
 import sun.security.util.SecurityConstants;
@@ -1113,7 +1112,7 @@
     /**
      * A table of protocol handlers.
      */
-    static Hashtable handlers = new Hashtable();
+    static Hashtable<String,URLStreamHandler> handlers = new Hashtable<>();
     private static Object streamHandlerLock = new Object();
 
     /**
@@ -1122,7 +1121,7 @@
      */
     static URLStreamHandler getURLStreamHandler(String protocol) {
 
-        URLStreamHandler handler = (URLStreamHandler)handlers.get(protocol);
+        URLStreamHandler handler = handlers.get(protocol);
         if (handler == null) {
 
             boolean checkedWithFactory = false;
@@ -1160,7 +1159,7 @@
                     try {
                         String clsName = packagePrefix + "." + protocol +
                           ".Handler";
-                        Class cls = null;
+                        Class<?> cls = null;
                         try {
                             cls = Class.forName(clsName);
                         } catch (ClassNotFoundException e) {
@@ -1185,7 +1184,7 @@
 
                 // Check again with hashtable just in case another
                 // thread created a handler since we last checked
-                handler2 = (URLStreamHandler)handlers.get(protocol);
+                handler2 = handlers.get(protocol);
 
                 if (handler2 != null) {
                     return handler2;
--- a/src/share/classes/java/net/URLClassLoader.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/net/URLClassLoader.java	Wed Oct 26 17:59:13 2011 -0700
@@ -25,14 +25,7 @@
 
 package java.net;
 
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.ref.*;
 import java.io.*;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLStreamHandlerFactory;
-import java.util.Enumeration;
 import java.util.*;
 import java.util.jar.Manifest;
 import java.util.jar.JarFile;
@@ -352,8 +345,8 @@
     {
         try {
             return AccessController.doPrivileged(
-                new PrivilegedExceptionAction<Class>() {
-                    public Class run() throws ClassNotFoundException {
+                new PrivilegedExceptionAction<Class<?>>() {
+                    public Class<?> run() throws ClassNotFoundException {
                         String path = name.replace('.', '/').concat(".class");
                         Resource res = ucp.getResource(path, false);
                         if (res != null) {
@@ -406,7 +399,7 @@
      * Resource. The resulting Class must be resolved before it can be
      * used.
      */
-    private Class defineClass(String name, Resource res) throws IOException {
+    private Class<?> defineClass(String name, Resource res) throws IOException {
         long t0 = System.nanoTime();
         int i = name.lastIndexOf('.');
         URL url = res.getCodeSourceURL();
@@ -774,7 +767,7 @@
         super(urls, acc);
     }
 
-    public final Class loadClass(String name, boolean resolve)
+    public final Class<?> loadClass(String name, boolean resolve)
         throws ClassNotFoundException
     {
         // First check if we have permission to access the package. This
--- a/src/share/classes/java/net/URLConnection.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/net/URLConnection.java	Wed Oct 26 17:59:13 2011 -0700
@@ -595,7 +595,7 @@
      * @since 1.4
      */
     public Map<String,List<String>> getHeaderFields() {
-        return Collections.EMPTY_MAP;
+        return Collections.emptyMap();
     }
 
     /**
@@ -659,6 +659,7 @@
      *          <code>Default</code> argument is returned if the field is
      *          missing or malformed.
      */
+    @SuppressWarnings("deprecation")
     public long getHeaderFieldDate(String name, long Default) {
         String value = getHeaderField(name);
         try {
@@ -1153,7 +1154,7 @@
             throw new IllegalStateException("Already connected");
 
         if (requests == null)
-            return Collections.EMPTY_MAP;
+            return Collections.emptyMap();
 
         return requests.getHeaders(null);
     }
@@ -1236,7 +1237,7 @@
         factory = fac;
     }
 
-    private static Hashtable handlers = new Hashtable();
+    private static Hashtable<String, ContentHandler> handlers = new Hashtable<>();
 
     /**
      * Gets the Content Handler appropriate for this connection.
@@ -1250,7 +1251,7 @@
         if (contentType == null)
             throw new UnknownServiceException("no content-type");
         try {
-            handler = (ContentHandler) handlers.get(contentType);
+            handler = handlers.get(contentType);
             if (handler != null)
                 return handler;
         } catch(Exception e) {
@@ -1316,7 +1317,7 @@
 
             try {
                 String clsName = packagePrefix + "." + contentHandlerClassName;
-                Class cls = null;
+                Class<?> cls = null;
                 try {
                     cls = Class.forName(clsName);
                 } catch (ClassNotFoundException e) {
--- a/src/share/classes/java/security/Signature.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/security/Signature.java	Wed Oct 26 17:59:13 2011 -0700
@@ -899,6 +899,7 @@
      * and its original parent (Object).
      */
 
+    @SuppressWarnings("deprecation")
     private static class Delegate extends Signature {
 
         // The provider implementation (delegate)
@@ -1203,6 +1204,7 @@
     }
 
     // adapter for RSA/ECB/PKCS1Padding ciphers
+    @SuppressWarnings("deprecation")
     private static class CipherAdapter extends SignatureSpi {
 
         private final Cipher cipher;
--- a/src/share/classes/java/util/Formatter.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/util/Formatter.java	Wed Oct 26 17:59:13 2011 -0700
@@ -50,7 +50,6 @@
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import sun.misc.FpUtils;
 import sun.misc.DoubleConsts;
 import sun.misc.FormattedFloatingDecimal;
 
@@ -3417,24 +3416,24 @@
         // Method assumes that d > 0.
         private String hexDouble(double d, int prec) {
             // Let Double.toHexString handle simple cases
-            if(!FpUtils.isFinite(d) || d == 0.0 || prec == 0 || prec >= 13)
+            if(!Double.isFinite(d) || d == 0.0 || prec == 0 || prec >= 13)
                 // remove "0x"
                 return Double.toHexString(d).substring(2);
             else {
                 assert(prec >= 1 && prec <= 12);
 
-                int exponent  = FpUtils.getExponent(d);
+                int exponent  = Math.getExponent(d);
                 boolean subnormal
                     = (exponent == DoubleConsts.MIN_EXPONENT - 1);
 
                 // If this is subnormal input so normalize (could be faster to
                 // do as integer operation).
                 if (subnormal) {
-                    scaleUp = FpUtils.scalb(1.0, 54);
+                    scaleUp = Math.scalb(1.0, 54);
                     d *= scaleUp;
                     // Calculate the exponent.  This is not just exponent + 54
                     // since the former is not the normalized exponent.
-                    exponent = FpUtils.getExponent(d);
+                    exponent = Math.getExponent(d);
                     assert exponent >= DoubleConsts.MIN_EXPONENT &&
                         exponent <= DoubleConsts.MAX_EXPONENT: exponent;
                 }
--- a/src/share/classes/java/util/Properties.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/util/Properties.java	Wed Oct 26 17:59:13 2011 -0700
@@ -34,6 +34,7 @@
 import java.io.Writer;
 import java.io.OutputStreamWriter;
 import java.io.BufferedWriter;
+import java.lang.reflect.*;
 
 /**
  * The <code>Properties</code> class represents a persistent set of
@@ -1111,4 +1112,60 @@
     private static final char[] hexDigit = {
         '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
     };
+
+
+    private static class XMLUtils {
+        private static Method load = null;
+        private static Method save = null;
+        static {
+            try {
+                // reference sun.util.xml.Utils reflectively
+                // to allow the Properties class be compiled in
+                // the absence of XML
+                Class<?> c = Class.forName("sun.util.xml.XMLUtils", true, null);
+                load = c.getMethod("load", Properties.class, InputStream.class);
+                save = c.getMethod("save", Properties.class, OutputStream.class,
+                                   String.class, String.class);
+            } catch (ClassNotFoundException cnf) {
+                throw new AssertionError(cnf);
+            } catch (NoSuchMethodException e) {
+                throw new AssertionError(e);
+            }
+        }
+
+        static void invoke(Method m, Object... args) throws IOException {
+            try {
+                m.invoke(null, args);
+            } catch (IllegalAccessException e) {
+                throw new AssertionError(e);
+            } catch (InvocationTargetException e) {
+                Throwable t = e.getCause();
+                if (t instanceof RuntimeException)
+                    throw (RuntimeException)t;
+
+                if (t instanceof IOException) {
+                    throw (IOException)t;
+                } else {
+                    throw new AssertionError(t);
+                }
+            }
+        }
+
+        static void load(Properties props, InputStream in)
+            throws IOException, InvalidPropertiesFormatException
+        {
+            if (load == null)
+                throw new InternalError("sun.util.xml.XMLUtils not found");
+            invoke(load, props, in);
+        }
+
+        static void save(Properties props, OutputStream os, String comment,
+                         String encoding)
+            throws IOException
+        {
+            if (save == null)
+                throw new InternalError("sun.util.xml.XMLUtils not found");
+            invoke(save, props, os, comment, encoding);
+        }
+    }
 }
--- a/src/share/classes/java/util/XMLUtils.java	Mon Oct 24 09:58:47 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,206 +0,0 @@
-/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package java.util;
-
-import java.io.*;
-import org.xml.sax.*;
-import org.xml.sax.helpers.*;
-import org.w3c.dom.*;
-import javax.xml.parsers.*;
-import javax.xml.transform.*;
-import javax.xml.transform.dom.*;
-import javax.xml.transform.stream.*;
-
-/**
- * A class used to aid in Properties load and save in XML. Keeping this
- * code outside of Properties helps reduce the number of classes loaded
- * when Properties is loaded.
- *
- * @author  Michael McCloskey
- * @since   1.3
- */
-class XMLUtils {
-
-    // XML loading and saving methods for Properties
-
-    // The required DTD URI for exported properties
-    private static final String PROPS_DTD_URI =
-    "http://java.sun.com/dtd/properties.dtd";
-
-    private static final String PROPS_DTD =
-    "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
-    "<!-- DTD for properties -->"                +
-    "<!ELEMENT properties ( comment?, entry* ) >"+
-    "<!ATTLIST properties"                       +
-        " version CDATA #FIXED \"1.0\">"         +
-    "<!ELEMENT comment (#PCDATA) >"              +
-    "<!ELEMENT entry (#PCDATA) >"                +
-    "<!ATTLIST entry "                           +
-        " key CDATA #REQUIRED>";
-
-    /**
-     * Version number for the format of exported properties files.
-     */
-    private static final String EXTERNAL_XML_VERSION = "1.0";
-
-    static void load(Properties props, InputStream in)
-        throws IOException, InvalidPropertiesFormatException
-    {
-        Document doc = null;
-        try {
-            doc = getLoadingDoc(in);
-        } catch (SAXException saxe) {
-            throw new InvalidPropertiesFormatException(saxe);
-        }
-        Element propertiesElement = (Element)doc.getChildNodes().item(1);
-        String xmlVersion = propertiesElement.getAttribute("version");
-        if (xmlVersion.compareTo(EXTERNAL_XML_VERSION) > 0)
-            throw new InvalidPropertiesFormatException(
-                "Exported Properties file format version " + xmlVersion +
-                " is not supported. This java installation can read" +
-                " versions " + EXTERNAL_XML_VERSION + " or older. You" +
-                " may need to install a newer version of JDK.");
-        importProperties(props, propertiesElement);
-    }
-
-    static Document getLoadingDoc(InputStream in)
-        throws SAXException, IOException
-    {
-        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
-        dbf.setIgnoringElementContentWhitespace(true);
-        dbf.setValidating(true);
-        dbf.setCoalescing(true);
-        dbf.setIgnoringComments(true);
-        try {
-            DocumentBuilder db = dbf.newDocumentBuilder();
-            db.setEntityResolver(new Resolver());
-            db.setErrorHandler(new EH());
-            InputSource is = new InputSource(in);
-            return db.parse(is);
-        } catch (ParserConfigurationException x) {
-            throw new Error(x);
-        }
-    }
-
-    static void importProperties(Properties props, Element propertiesElement) {
-        NodeList entries = propertiesElement.getChildNodes();
-        int numEntries = entries.getLength();
-        int start = numEntries > 0 &&
-            entries.item(0).getNodeName().equals("comment") ? 1 : 0;
-        for (int i=start; i<numEntries; i++) {
-            Element entry = (Element)entries.item(i);
-            if (entry.hasAttribute("key")) {
-                Node n = entry.getFirstChild();
-                String val = (n == null) ? "" : n.getNodeValue();
-                props.setProperty(entry.getAttribute("key"), val);
-            }
-        }
-    }
-
-    static void save(Properties props, OutputStream os, String comment,
-                     String encoding)
-        throws IOException
-    {
-        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
-        DocumentBuilder db = null;
-        try {
-            db = dbf.newDocumentBuilder();
-        } catch (ParserConfigurationException pce) {
-            assert(false);
-        }
-        Document doc = db.newDocument();
-        Element properties =  (Element)
-            doc.appendChild(doc.createElement("properties"));
-
-        if (comment != null) {
-            Element comments = (Element)properties.appendChild(
-                doc.createElement("comment"));
-            comments.appendChild(doc.createTextNode(comment));
-        }
-
-        synchronized (props) {
-            for (String key : props.stringPropertyNames()) {
-                Element entry = (Element)properties.appendChild(
-                    doc.createElement("entry"));
-                entry.setAttribute("key", key);
-                entry.appendChild(doc.createTextNode(props.getProperty(key)));
-            }
-        }
-        emitDocument(doc, os, encoding);
-    }
-
-    static void emitDocument(Document doc, OutputStream os, String encoding)
-        throws IOException
-    {
-        TransformerFactory tf = TransformerFactory.newInstance();
-        Transformer t = null;
-        try {
-            t = tf.newTransformer();
-            t.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, PROPS_DTD_URI);
-            t.setOutputProperty(OutputKeys.INDENT, "yes");
-            t.setOutputProperty(OutputKeys.METHOD, "xml");
-            t.setOutputProperty(OutputKeys.ENCODING, encoding);
-        } catch (TransformerConfigurationException tce) {
-            assert(false);
-        }
-        DOMSource doms = new DOMSource(doc);
-        StreamResult sr = new StreamResult(os);
-        try {
-            t.transform(doms, sr);
-        } catch (TransformerException te) {
-            IOException ioe = new IOException();
-            ioe.initCause(te);
-            throw ioe;
-        }
-    }
-
-    private static class Resolver implements EntityResolver {
-        public InputSource resolveEntity(String pid, String sid)
-            throws SAXException
-        {
-            if (sid.equals(PROPS_DTD_URI)) {
-                InputSource is;
-                is = new InputSource(new StringReader(PROPS_DTD));
-                is.setSystemId(PROPS_DTD_URI);
-                return is;
-            }
-            throw new SAXException("Invalid system identifier: " + sid);
-        }
-    }
-
-    private static class EH implements ErrorHandler {
-        public void error(SAXParseException x) throws SAXException {
-            throw x;
-        }
-        public void fatalError(SAXParseException x) throws SAXException {
-            throw x;
-        }
-        public void warning(SAXParseException x) throws SAXException {
-            throw x;
-        }
-    }
-
-}
--- a/src/share/classes/java/util/concurrent/ScheduledThreadPoolExecutor.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/util/concurrent/ScheduledThreadPoolExecutor.java	Wed Oct 26 17:59:13 2011 -0700
@@ -330,7 +330,7 @@
                 remove(task))
                 task.cancel(false);
             else
-                prestartCoreThread();
+                ensurePrestart();
         }
     }
 
@@ -346,7 +346,7 @@
             if (!canRunInCurrentRunState(true) && remove(task))
                 task.cancel(false);
             else
-                prestartCoreThread();
+                ensurePrestart();
         }
     }
 
--- a/src/share/classes/java/util/concurrent/ThreadPoolExecutor.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/java/util/concurrent/ThreadPoolExecutor.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1546,6 +1546,18 @@
     }
 
     /**
+     * Same as prestartCoreThread except arranges that at least one
+     * thread is started even if corePoolSize is 0.
+     */
+    void ensurePrestart() {
+        int wc = workerCountOf(ctl.get());
+        if (wc < corePoolSize)
+            addWorker(null, true);
+        else if (wc == 0)
+            addWorker(null, false);
+    }
+
+    /**
      * Starts all core threads, causing them to idly wait for work. This
      * overrides the default policy of starting core threads only when
      * new tasks are executed.
--- a/src/share/classes/javax/net/ssl/SSLServerSocketFactory.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/javax/net/ssl/SSLServerSocketFactory.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -87,7 +87,7 @@
             if (clsName != null) {
                 log("setting up default SSLServerSocketFactory");
                 try {
-                    Class cls = null;
+                    Class<?> cls = null;
                     try {
                         cls = Class.forName(clsName);
                     } catch (ClassNotFoundException e) {
--- a/src/share/classes/javax/net/ssl/SSLSocketFactory.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/javax/net/ssl/SSLSocketFactory.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -95,7 +95,7 @@
             if (clsName != null) {
                 log("setting up default SSLSocketFactory");
                 try {
-                    Class cls = null;
+                    Class<?> cls = null;
                     try {
                         cls = Class.forName(clsName);
                     } catch (ClassNotFoundException e) {
--- a/src/share/classes/javax/security/auth/PrivateCredentialPermission.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/javax/security/auth/PrivateCredentialPermission.java	Wed Oct 26 17:59:13 2011 -0700
@@ -117,7 +117,7 @@
      *          The set contains elements of type,
      *          <code>PrivateCredentialPermission.CredOwner</code>.
      */
-    private Set principals;  // ignored - kept around for compatibility
+    private Set<Principal> principals;  // ignored - kept around for compatibility
     private transient CredOwner[] credOwners;
 
     /**
--- a/src/share/classes/javax/security/auth/Subject.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/javax/security/auth/Subject.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1291,6 +1291,7 @@
             oos.writeFields();
         }
 
+        @SuppressWarnings("unchecked")
         private void readObject(ObjectInputStream ois)
             throws IOException, ClassNotFoundException
         {
@@ -1329,6 +1330,7 @@
             }
         }
 
+        @SuppressWarnings("unchecked")     /*To suppress warning from line 1374*/
         private void populateSet() {
             final Iterator<?> iterator;
             switch(which) {
--- a/src/share/classes/javax/security/auth/SubjectDomainCombiner.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/javax/security/auth/SubjectDomainCombiner.java	Wed Oct 26 17:59:13 2011 -0700
@@ -56,6 +56,7 @@
         sun.security.util.Debug.getInstance("combiner",
                                         "\t[SubjectDomainCombiner]");
 
+    @SuppressWarnings("deprecation")
     // Note: check only at classloading time, not dynamically during combine()
     private static final boolean useJavaxPolicy =
         javax.security.auth.Policy.isCustomPolicySet(debug);
@@ -300,6 +301,7 @@
         if (!allowCaching) {
             java.security.AccessController.doPrivileged
                 (new PrivilegedAction<Void>() {
+                    @SuppressWarnings("deprecation")
                     public Void run() {
                         // Call refresh only caching is disallowed
                         javax.security.auth.Policy.getPolicy().refresh();
@@ -308,6 +310,7 @@
                 });
         }
 
+
         int cLen = (currentDomains == null ? 0 : currentDomains.length);
         int aLen = (assignedDomains == null ? 0 : assignedDomains.length);
 
@@ -348,13 +351,13 @@
                     // get the original perms
                     Permissions perms = new Permissions();
                     PermissionCollection coll = pd.getPermissions();
-                    java.util.Enumeration e;
+                    java.util.Enumeration<Permission> e;
                     if (coll != null) {
                         synchronized (coll) {
                             e = coll.elements();
                             while (e.hasMoreElements()) {
                                 Permission newPerm =
-                                        (Permission)e.nextElement();
+                                        e.nextElement();
                                  perms.add(newPerm);
                             }
                         }
@@ -367,6 +370,7 @@
                     PermissionCollection newPerms =
                         java.security.AccessController.doPrivileged
                         (new PrivilegedAction<PermissionCollection>() {
+                        @SuppressWarnings("deprecation")
                         public PermissionCollection run() {
                           return
                           javax.security.auth.Policy.getPolicy().getPermissions
@@ -379,7 +383,7 @@
                     synchronized (newPerms) {
                         e = newPerms.elements();
                         while (e.hasMoreElements()) {
-                            Permission newPerm = (Permission)e.nextElement();
+                            Permission newPerm = e.nextElement();
                             if (!perms.implies(newPerm)) {
                                 perms.add(newPerm);
                                 if (debug != null)
--- a/src/share/classes/javax/security/auth/kerberos/DelegationPermission.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/javax/security/auth/kerberos/DelegationPermission.java	Wed Oct 26 17:59:13 2011 -0700
@@ -375,6 +375,7 @@
     /*
      * Reads in a Vector of DelegationPermissions and saves them in the perms field.
      */
+    @SuppressWarnings("unchecked")
     private void readObject(ObjectInputStream in) throws IOException,
     ClassNotFoundException {
         // Don't call defaultReadObject()
--- a/src/share/classes/javax/security/auth/kerberos/ServicePermission.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/javax/security/auth/kerberos/ServicePermission.java	Wed Oct 26 17:59:13 2011 -0700
@@ -583,6 +583,7 @@
     /*
      * Reads in a Vector of ServicePermissions and saves them in the perms field.
      */
+    @SuppressWarnings("unchecked")
     private void readObject(ObjectInputStream in) throws IOException,
     ClassNotFoundException {
         // Don't call defaultReadObject()
--- a/src/share/classes/javax/security/auth/login/LoginContext.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/javax/security/auth/login/LoginContext.java	Wed Oct 26 17:59:13 2011 -0700
@@ -214,14 +214,14 @@
     private boolean subjectProvided = false;
     private boolean loginSucceeded = false;
     private CallbackHandler callbackHandler;
-    private Map state = new HashMap();
+    private Map<String,?> state = new HashMap<String,Object>();
 
     private Configuration config;
     private boolean configProvided = false;
     private AccessControlContext creatorAcc = null;
     private ModuleInfo[] moduleStack;
     private ClassLoader contextClassLoader = null;
-    private static final Class[] PARAMS = { };
+    private static final Class<?>[] PARAMS = { };
 
     // state saved in the event a user-specified asynchronous exception
     // was specified and thrown
@@ -306,7 +306,7 @@
                         (DEFAULT_HANDLER);
                     if (defaultHandler == null || defaultHandler.length() == 0)
                         return null;
-                    Class c = Class.forName(defaultHandler,
+                    Class<?> c = Class.forName(defaultHandler,
                                         true,
                                         finalLoader);
                     return (CallbackHandler)c.newInstance();
@@ -743,12 +743,12 @@
                 } else {
 
                     // instantiate the LoginModule
-                    Class c = Class.forName
+                    Class<?> c = Class.forName
                                 (moduleStack[i].entry.getLoginModuleName(),
                                 true,
                                 contextClassLoader);
 
-                    Constructor constructor = c.getConstructor(PARAMS);
+                    Constructor<?> constructor = c.getConstructor(PARAMS);
                     Object[] args = { };
 
                     // allow any object to be a LoginModule
--- a/src/share/classes/javax/security/auth/x500/X500Principal.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/javax/security/auth/x500/X500Principal.java	Wed Oct 26 17:59:13 2011 -0700
@@ -118,7 +118,7 @@
      *                  is improperly specified
      */
     public X500Principal(String name) {
-        this(name, (Map<String, String>) Collections.EMPTY_MAP);
+        this(name, Collections.<String, String>emptyMap());
     }
 
     /**
--- a/src/share/classes/javax/security/cert/CertificateEncodingException.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/javax/security/cert/CertificateEncodingException.java	Wed Oct 26 17:59:13 2011 -0700
@@ -41,6 +41,7 @@
  */
 public class CertificateEncodingException extends CertificateException {
 
+    private static final long serialVersionUID = -8187642723048403470L;
     /**
      * Constructs a CertificateEncodingException with no detail message. A
      * detail message is a String that describes this particular
--- a/src/share/classes/javax/security/cert/CertificateException.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/javax/security/cert/CertificateException.java	Wed Oct 26 17:59:13 2011 -0700
@@ -41,6 +41,7 @@
  */
 public class CertificateException extends Exception {
 
+    private static final long serialVersionUID = -5757213374030785290L;
     /**
      * Constructs a certificate exception with no detail message. A detail
      * message is a String that describes this particular exception.
--- a/src/share/classes/javax/security/cert/CertificateExpiredException.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/javax/security/cert/CertificateExpiredException.java	Wed Oct 26 17:59:13 2011 -0700
@@ -43,6 +43,7 @@
  */
 public class CertificateExpiredException extends CertificateException {
 
+    private static final long serialVersionUID = 5091601212177261883L;
     /**
      * Constructs a CertificateExpiredException with no detail message. A
      * detail message is a String that describes this particular
--- a/src/share/classes/javax/security/cert/CertificateNotYetValidException.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/javax/security/cert/CertificateNotYetValidException.java	Wed Oct 26 17:59:13 2011 -0700
@@ -43,6 +43,7 @@
  */
 public class CertificateNotYetValidException extends CertificateException {
 
+    private static final long serialVersionUID = -8976172474266822818L;
     /**
      * Constructs a CertificateNotYetValidException with no detail message. A
      * detail message is a String that describes this particular
--- a/src/share/classes/javax/security/cert/CertificateParsingException.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/javax/security/cert/CertificateParsingException.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,8 @@
  */
 public class CertificateParsingException extends CertificateException {
 
+    private static final long serialVersionUID = -8449352422951136229L;
+
     /**
      * Constructs a CertificateParsingException with no detail message. A
      * detail message is a String that describes this particular
--- a/src/share/classes/javax/security/cert/X509Certificate.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/javax/security/cert/X509Certificate.java	Wed Oct 26 17:59:13 2011 -0700
@@ -219,11 +219,11 @@
             className = "com.sun.security.cert.internal.x509.X509V1CertImpl";
         }
         try {
-            Class[] params = null;
+            Class<?>[] params = null;
             if (value instanceof InputStream) {
-                params = new Class[] { InputStream.class };
+                params = new Class<?>[] { InputStream.class };
             } else if (value instanceof byte[]) {
-                params = new Class[] { value.getClass() };
+                params = new Class<?>[] { value.getClass() };
             } else
                 throw new CertificateException("Unsupported argument type");
             Class<?> certClass = Class.forName(className);
--- a/src/share/classes/javax/security/sasl/Sasl.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/javax/security/sasl/Sasl.java	Wed Oct 26 17:59:13 2011 -0700
@@ -395,7 +395,7 @@
              * will be thrown.
              */
             ClassLoader cl = p.getClass().getClassLoader();
-            Class implClass;
+            Class<?> implClass;
             implClass = Class.forName(className, true, cl);
             return implClass.newInstance();
         } catch (ClassNotFoundException e) {
@@ -576,7 +576,7 @@
             classes.clear();
 
             // Check the keys for each provider.
-            for (Enumeration e = providers[i].keys(); e.hasMoreElements(); ) {
+            for (Enumeration<Object> e = providers[i].keys(); e.hasMoreElements(); ) {
                 String currentKey = (String)e.nextElement();
                 if (currentKey.startsWith(serviceName)) {
                     // We should skip the currentKey if it contains a
--- a/src/share/classes/javax/smartcardio/TerminalFactory.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/javax/smartcardio/TerminalFactory.java	Wed Oct 26 17:59:13 2011 -0700
@@ -113,7 +113,7 @@
                 type = "PC/SC";
                 Provider sun = Security.getProvider("SunPCSC");
                 if (sun == null) {
-                    Class clazz = Class.forName("sun.security.smartcardio.SunPCSC");
+                    Class<?> clazz = Class.forName("sun.security.smartcardio.SunPCSC");
                     sun = (Provider)clazz.newInstance();
                 }
                 factory = TerminalFactory.getInstance(type, null, sun);
@@ -131,6 +131,8 @@
     }
 
     private static final class NoneProvider extends Provider {
+
+        private static final long serialVersionUID = 2745808869881593918L;
         final static Provider INSTANCE = new NoneProvider();
         private NoneProvider() {
             super("None", 1.0d, "none");
--- a/src/share/classes/javax/swing/BufferStrategyPaintManager.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/javax/swing/BufferStrategyPaintManager.java	Wed Oct 26 17:59:13 2011 -0700
@@ -24,20 +24,17 @@
  */
 package javax.swing;
 
-import java.applet.Applet;
 import java.awt.*;
 import java.awt.event.*;
 import java.awt.image.*;
 import java.lang.reflect.*;
 import java.lang.ref.WeakReference;
-import java.security.AccessController;
 import java.util.*;
 
 import com.sun.java.swing.SwingUtilities3;
 
 import sun.awt.SubRegionShowable;
 import sun.java2d.SunGraphics2D;
-import sun.security.action.GetPropertyAction;
 import sun.java2d.pipe.hw.ExtendedBufferCapabilities;
 import sun.awt.SunToolkit;
 import sun.util.logging.PlatformLogger;
@@ -120,10 +117,6 @@
      */
     private JComponent rootJ;
     /**
-     * Parent Applet/Window for the current paint/copyArea
-     */
-    private Container root;
-    /**
      * Location of component being painted relative to root.
      */
     private int xOffset;
@@ -278,7 +271,9 @@
     public boolean paint(JComponent paintingComponent,
                          JComponent bufferComponent, Graphics g,
                          int x, int y, int w, int h) {
-        if (prepare(paintingComponent, true, x, y, w, h)) {
+        Container root = fetchRoot(paintingComponent);
+
+        if (prepare(paintingComponent, root, true, x, y, w, h)) {
             if ((g instanceof SunGraphics2D) &&
                     ((SunGraphics2D)g).getDestination() == root) {
                 // BufferStrategy may have already constrained the Graphics. To
@@ -319,7 +314,9 @@
         //
         // If the buffer isn't in sync there is no point in doing a copyArea,
         // it has garbage.
-        if (prepare(c, false, 0, 0, 0, 0) && bufferInfo.isInSync()) {
+        Container root = fetchRoot(c);
+
+        if (prepare(c, root, false, 0, 0, 0, 0) && bufferInfo.isInSync()) {
             if (clip) {
                 Rectangle cBounds = c.getVisibleRect();
                 int relX = xOffset + x;
@@ -500,14 +497,14 @@
      *
      * @return true if should use buffering per window in painting.
      */
-    private boolean prepare(JComponent c, boolean isPaint, int x, int y,
+    private boolean prepare(JComponent c, Container root, boolean isPaint, int x, int y,
                             int w, int h) {
         if (bsg != null) {
             bsg.dispose();
             bsg = null;
         }
         bufferStrategy = null;
-        if (fetchRoot(c)) {
+        if (root != null) {
             boolean contentsLost = false;
             BufferInfo bufferInfo = getBufferInfo(root);
             if (bufferInfo == null) {
@@ -567,10 +564,10 @@
         return false;
     }
 
-    private boolean fetchRoot(JComponent c) {
+    private Container fetchRoot(JComponent c) {
         boolean encounteredHW = false;
         rootJ = c;
-        root = c;
+        Container root = c;
         xOffset = yOffset = 0;
         while (root != null &&
                (!(root instanceof Window) &&
@@ -597,7 +594,7 @@
                         // heavyweights.  If we didn't do this when we
                         // went to show the descendants of the nested hw
                         // you would see nothing, so, we bail out here.
-                        return false;
+                        return null;
                     }
                 }
             }
@@ -613,11 +610,11 @@
                 // bit tricky with Swing. This gives a good approximation
                 // of the various ways to turn on double buffering for
                 // components.
-                return true;
+                return root;
             }
         }
         // Don't do true double buffering.
-        return false;
+        return null;
     }
 
     /**
--- a/src/share/classes/javax/swing/SwingUtilities.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/javax/swing/SwingUtilities.java	Wed Oct 26 17:59:13 2011 -0700
@@ -792,7 +792,7 @@
      * @return true if the left mouse button was active
      */
     public static boolean isLeftMouseButton(MouseEvent anEvent) {
-         return ((anEvent.getModifiers() & InputEvent.BUTTON1_MASK) != 0);
+         return (anEvent.getButton() == MouseEvent.BUTTON1);
     }
 
     /**
@@ -802,7 +802,7 @@
      * @return true if the middle mouse button was active
      */
     public static boolean isMiddleMouseButton(MouseEvent anEvent) {
-        return ((anEvent.getModifiers() & InputEvent.BUTTON2_MASK) == InputEvent.BUTTON2_MASK);
+        return (anEvent.getButton() == MouseEvent.BUTTON2);
     }
 
     /**
@@ -812,7 +812,7 @@
      * @return true if the right mouse button was active
      */
     public static boolean isRightMouseButton(MouseEvent anEvent) {
-        return ((anEvent.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK);
+        return (anEvent.getButton() == MouseEvent.BUTTON3);
     }
 
     /**
--- a/src/share/classes/javax/swing/plaf/nimbus/doc-files/properties.html	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/javax/swing/plaf/nimbus/doc-files/properties.html	Wed Oct 26 17:59:13 2011 -0700
@@ -1,6 +1,5 @@
 <html>
 <head>
-<link href="style.css" rel="stylesheet" type="text/css" />
 </head>
 <body>
 <h1 id="primaryColors">Primary Colors</h1>
--- a/src/share/classes/org/ietf/jgss/Oid.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/org/ietf/jgss/Oid.java	Wed Oct 26 17:59:13 2011 -0700
@@ -157,7 +157,7 @@
             return (true);
 
         if (other instanceof Oid)
-            return this.oid.equals(((Oid) other).oid);
+            return this.oid.equals((Object)((Oid) other).oid);
         else if (other instanceof ObjectIdentifier)
             return this.oid.equals(other);
         else
--- a/src/share/classes/sun/misc/FloatingDecimal.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/misc/FloatingDecimal.java	Wed Oct 26 17:59:13 2011 -0700
@@ -25,7 +25,6 @@
 
 package sun.misc;
 
-import sun.misc.FpUtils;
 import sun.misc.DoubleConsts;
 import sun.misc.FloatConsts;
 import java.util.regex.*;
@@ -2297,9 +2296,9 @@
                     significand++;
                 }
 
-                FloatingDecimal fd = new FloatingDecimal(FpUtils.rawCopySign(
-                                                                 Double.longBitsToDouble(significand),
-                                                                 sign));
+                FloatingDecimal fd = new FloatingDecimal(Math.copySign(
+                                                              Double.longBitsToDouble(significand),
+                                                              sign));
 
                 /*
                  * Set roundingDir variable field of fd properly so
--- a/src/share/classes/sun/misc/FormattedFloatingDecimal.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/misc/FormattedFloatingDecimal.java	Wed Oct 26 17:59:13 2011 -0700
@@ -25,7 +25,6 @@
 
 package sun.misc;
 
-import sun.misc.FpUtils;
 import sun.misc.DoubleConsts;
 import sun.misc.FloatConsts;
 import java.util.regex.*;
--- a/src/share/classes/sun/misc/FpUtils.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/misc/FpUtils.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -125,10 +125,6 @@
      */
     private FpUtils() {}
 
-    // Constants used in scalb
-    static double twoToTheDoubleScaleUp = powerOfTwoD(512);
-    static double twoToTheDoubleScaleDown = powerOfTwoD(-512);
-
     // Helper Methods
 
     // The following helper methods are used in the implementation of
@@ -137,49 +133,22 @@
 
     /**
      * Returns unbiased exponent of a {@code double}.
+     * @deprecated Use Math.getExponent.
      */
+    @Deprecated
     public static int getExponent(double d){
-        /*
-         * Bitwise convert d to long, mask out exponent bits, shift
-         * to the right and then subtract out double's bias adjust to
-         * get true exponent value.
-         */
-        return (int)(((Double.doubleToRawLongBits(d) & DoubleConsts.EXP_BIT_MASK) >>
-                      (DoubleConsts.SIGNIFICAND_WIDTH - 1)) - DoubleConsts.EXP_BIAS);
+        return Math.getExponent(d);
     }
 
     /**
      * Returns unbiased exponent of a {@code float}.
+     * @deprecated Use Math.getExponent.
      */
+    @Deprecated
     public static int getExponent(float f){
-        /*
-         * Bitwise convert f to integer, mask out exponent bits, shift
-         * to the right and then subtract out float's bias adjust to
-         * get true exponent value
-         */
-        return ((Float.floatToRawIntBits(f) & FloatConsts.EXP_BIT_MASK) >>
-                (FloatConsts.SIGNIFICAND_WIDTH - 1)) - FloatConsts.EXP_BIAS;
+        return Math.getExponent(f);
     }
 
-    /**
-     * Returns a floating-point power of two in the normal range.
-     */
-    static double powerOfTwoD(int n) {
-        assert(n >= DoubleConsts.MIN_EXPONENT && n <= DoubleConsts.MAX_EXPONENT);
-        return Double.longBitsToDouble((((long)n + (long)DoubleConsts.EXP_BIAS) <<
-                                        (DoubleConsts.SIGNIFICAND_WIDTH-1))
-                                       & DoubleConsts.EXP_BIT_MASK);
-    }
-
-    /**
-     * Returns a floating-point power of two in the normal range.
-     */
-    static float powerOfTwoF(int n) {
-        assert(n >= FloatConsts.MIN_EXPONENT && n <= FloatConsts.MAX_EXPONENT);
-        return Float.intBitsToFloat(((n + FloatConsts.EXP_BIAS) <<
-                                     (FloatConsts.SIGNIFICAND_WIDTH-1))
-                                    & FloatConsts.EXP_BIT_MASK);
-    }
 
     /**
      * Returns the first floating-point argument with the sign of the
@@ -195,13 +164,11 @@
      * @return a value with the magnitude of {@code magnitude}
      * and the sign of {@code sign}.
      * @author Joseph D. Darcy
+     * @deprecated Use Math.copySign.
      */
+    @Deprecated
     public static double rawCopySign(double magnitude, double sign) {
-        return Double.longBitsToDouble((Double.doubleToRawLongBits(sign) &
-                                        (DoubleConsts.SIGN_BIT_MASK)) |
-                                       (Double.doubleToRawLongBits(magnitude) &
-                                        (DoubleConsts.EXP_BIT_MASK |
-                                         DoubleConsts.SIGNIF_BIT_MASK)));
+        return Math.copySign(magnitude, sign);
     }
 
     /**
@@ -218,13 +185,11 @@
      * @return a value with the magnitude of {@code magnitude}
      * and the sign of {@code sign}.
      * @author Joseph D. Darcy
+     * @deprecated Use Math.copySign.
      */
+    @Deprecated
     public static float rawCopySign(float magnitude, float sign) {
-        return Float.intBitsToFloat((Float.floatToRawIntBits(sign) &
-                                     (FloatConsts.SIGN_BIT_MASK)) |
-                                    (Float.floatToRawIntBits(magnitude) &
-                                     (FloatConsts.EXP_BIT_MASK |
-                                      FloatConsts.SIGNIF_BIT_MASK)));
+        return Math.copySign(magnitude, sign);
     }
 
     /* ***************************************************************** */
@@ -237,9 +202,11 @@
      * @param d the {@code double} value to be tested
      * @return {@code true} if the argument is a finite
      * floating-point value, {@code false} otherwise.
+     * @deprecated Use Double.isFinite.
      */
+    @Deprecated
     public static boolean isFinite(double d) {
-        return Math.abs(d) <= DoubleConsts.MAX_VALUE;
+        return Double.isFinite(d);
     }
 
     /**
@@ -250,9 +217,11 @@
      * @param f the {@code float} value to be tested
      * @return {@code true} if the argument is a finite
      * floating-point value, {@code false} otherwise.
+     * @deprecated Use Float.isFinite.
      */
+     @Deprecated
      public static boolean isFinite(float f) {
-        return Math.abs(f) <= FloatConsts.MAX_VALUE;
+         return Float.isFinite(f);
     }
 
     /**
@@ -558,82 +527,11 @@
      * @param scale_factor power of 2 used to scale {@code d}
      * @return {@code d * }2<sup>{@code scale_factor}</sup>
      * @author Joseph D. Darcy
+     * @deprecated Use Math.scalb.
      */
+    @Deprecated
     public static double scalb(double d, int scale_factor) {
-        /*
-         * This method does not need to be declared strictfp to
-         * compute the same correct result on all platforms.  When
-         * scaling up, it does not matter what order the
-         * multiply-store operations are done; the result will be
-         * finite or overflow regardless of the operation ordering.
-         * However, to get the correct result when scaling down, a
-         * particular ordering must be used.
-         *
-         * When scaling down, the multiply-store operations are
-         * sequenced so that it is not possible for two consecutive
-         * multiply-stores to return subnormal results.  If one
-         * multiply-store result is subnormal, the next multiply will
-         * round it away to zero.  This is done by first multiplying
-         * by 2 ^ (scale_factor % n) and then multiplying several
-         * times by by 2^n as needed where n is the exponent of number
-         * that is a covenient power of two.  In this way, at most one
-         * real rounding error occurs.  If the double value set is
-         * being used exclusively, the rounding will occur on a
-         * multiply.  If the double-extended-exponent value set is
-         * being used, the products will (perhaps) be exact but the
-         * stores to d are guaranteed to round to the double value
-         * set.
-         *
-         * It is _not_ a valid implementation to first multiply d by
-         * 2^MIN_EXPONENT and then by 2 ^ (scale_factor %
-         * MIN_EXPONENT) since even in a strictfp program double
-         * rounding on underflow could occur; e.g. if the scale_factor
-         * argument was (MIN_EXPONENT - n) and the exponent of d was a
-         * little less than -(MIN_EXPONENT - n), meaning the final
-         * result would be subnormal.
-         *
-         * Since exact reproducibility of this method can be achieved
-         * without any undue performance burden, there is no
-         * compelling reason to allow double rounding on underflow in
-         * scalb.
-         */
-
-        // magnitude of a power of two so large that scaling a finite
-        // nonzero value by it would be guaranteed to over or
-        // underflow; due to rounding, scaling down takes takes an
-        // additional power of two which is reflected here
-        final int MAX_SCALE = DoubleConsts.MAX_EXPONENT + -DoubleConsts.MIN_EXPONENT +
-                              DoubleConsts.SIGNIFICAND_WIDTH + 1;
-        int exp_adjust = 0;
-        int scale_increment = 0;
-        double exp_delta = Double.NaN;
-
-        // Make sure scaling factor is in a reasonable range
-
-        if(scale_factor < 0) {
-            scale_factor = Math.max(scale_factor, -MAX_SCALE);
-            scale_increment = -512;
-            exp_delta = twoToTheDoubleScaleDown;
-        }
-        else {
-            scale_factor = Math.min(scale_factor, MAX_SCALE);
-            scale_increment = 512;
-            exp_delta = twoToTheDoubleScaleUp;
-        }
-
-        // Calculate (scale_factor % +/-512), 512 = 2^9, using
-        // technique from "Hacker's Delight" section 10-2.
-        int t = (scale_factor >> 9-1) >>> 32 - 9;
-        exp_adjust = ((scale_factor + t) & (512 -1)) - t;
-
-        d *= powerOfTwoD(exp_adjust);
-        scale_factor -= exp_adjust;
-
-        while(scale_factor != 0) {
-            d *= exp_delta;
-            scale_factor -= scale_increment;
-        }
-        return d;
+        return Math.scalb(d, scale_factor);
     }
 
     /**
@@ -667,28 +565,11 @@
      * @param scale_factor power of 2 used to scale {@code f}
      * @return {@code f * }2<sup>{@code scale_factor}</sup>
      * @author Joseph D. Darcy
+     * @deprecated Use Math.scalb.
      */
-     public static float scalb(float f, int scale_factor) {
-        // magnitude of a power of two so large that scaling a finite
-        // nonzero value by it would be guaranteed to over or
-        // underflow; due to rounding, scaling down takes takes an
-        // additional power of two which is reflected here
-        final int MAX_SCALE = FloatConsts.MAX_EXPONENT + -FloatConsts.MIN_EXPONENT +
-                              FloatConsts.SIGNIFICAND_WIDTH + 1;
-
-        // Make sure scaling factor is in a reasonable range
-        scale_factor = Math.max(Math.min(scale_factor, MAX_SCALE), -MAX_SCALE);
-
-        /*
-         * Since + MAX_SCALE for float fits well within the double
-         * exponent range and + float -> double conversion is exact
-         * the multiplication below will be exact. Therefore, the
-         * rounding that occurs when the double product is cast to
-         * float will be the correctly rounded float result.  Since
-         * all operations other than the final multiply will be exact,
-         * it is not necessary to declare this method strictfp.
-         */
-        return (float)((double)f*powerOfTwoD(scale_factor));
+    @Deprecated
+    public static float scalb(float f, int scale_factor) {
+        return Math.scalb(f, scale_factor);
     }
 
     /**
@@ -730,65 +611,11 @@
      * @return The floating-point number adjacent to {@code start} in the
      * direction of {@code direction}.
      * @author Joseph D. Darcy
+     * @deprecated Use Math.nextAfter
      */
+    @Deprecated
     public static double nextAfter(double start, double direction) {
-        /*
-         * The cases:
-         *
-         * nextAfter(+infinity, 0)  == MAX_VALUE
-         * nextAfter(+infinity, +infinity)  == +infinity
-         * nextAfter(-infinity, 0)  == -MAX_VALUE
-         * nextAfter(-infinity, -infinity)  == -infinity
-         *
-         * are naturally handled without any additional testing
-         */
-
-        // First check for NaN values
-        if (isNaN(start) || isNaN(direction)) {
-            // return a NaN derived from the input NaN(s)
-            return start + direction;
-        } else if (start == direction) {
-            return direction;
-        } else {        // start > direction or start < direction
-            // Add +0.0 to get rid of a -0.0 (+0.0 + -0.0 => +0.0)
-            // then bitwise convert start to integer.
-            long transducer = Double.doubleToRawLongBits(start + 0.0d);
-
-            /*
-             * IEEE 754 floating-point numbers are lexicographically
-             * ordered if treated as signed- magnitude integers .
-             * Since Java's integers are two's complement,
-             * incrementing" the two's complement representation of a
-             * logically negative floating-point value *decrements*
-             * the signed-magnitude representation. Therefore, when
-             * the integer representation of a floating-point values
-             * is less than zero, the adjustment to the representation
-             * is in the opposite direction than would be expected at
-             * first .
-             */
-            if (direction > start) { // Calculate next greater value
-                transducer = transducer + (transducer >= 0L ? 1L:-1L);
-            } else  { // Calculate next lesser value
-                assert direction < start;
-                if (transducer > 0L)
-                    --transducer;
-                else
-                    if (transducer < 0L )
-                        ++transducer;
-                    /*
-                     * transducer==0, the result is -MIN_VALUE
-                     *
-                     * The transition from zero (implicitly
-                     * positive) to the smallest negative
-                     * signed magnitude value must be done
-                     * explicitly.
-                     */
-                    else
-                        transducer = DoubleConsts.SIGN_BIT_MASK | 1L;
-            }
-
-            return Double.longBitsToDouble(transducer);
-        }
+        return Math.nextAfter(start, direction);
     }
 
     /**
@@ -830,65 +657,11 @@
      * @return The floating-point number adjacent to {@code start} in the
      * direction of {@code direction}.
      * @author Joseph D. Darcy
+     * @deprecated Use Math.nextAfter.
      */
-     public static float nextAfter(float start, double direction) {
-        /*
-         * The cases:
-         *
-         * nextAfter(+infinity, 0)  == MAX_VALUE
-         * nextAfter(+infinity, +infinity)  == +infinity
-         * nextAfter(-infinity, 0)  == -MAX_VALUE
-         * nextAfter(-infinity, -infinity)  == -infinity
-         *
-         * are naturally handled without any additional testing
-         */
-
-        // First check for NaN values
-        if (isNaN(start) || isNaN(direction)) {
-            // return a NaN derived from the input NaN(s)
-            return start + (float)direction;
-        } else if (start == direction) {
-            return (float)direction;
-        } else {        // start > direction or start < direction
-            // Add +0.0 to get rid of a -0.0 (+0.0 + -0.0 => +0.0)
-            // then bitwise convert start to integer.
-            int transducer = Float.floatToRawIntBits(start + 0.0f);
-
-            /*
-             * IEEE 754 floating-point numbers are lexicographically
-             * ordered if treated as signed- magnitude integers .
-             * Since Java's integers are two's complement,
-             * incrementing" the two's complement representation of a
-             * logically negative floating-point value *decrements*
-             * the signed-magnitude representation. Therefore, when
-             * the integer representation of a floating-point values
-             * is less than zero, the adjustment to the representation
-             * is in the opposite direction than would be expected at
-             * first.
-             */
-            if (direction > start) {// Calculate next greater value
-                transducer = transducer + (transducer >= 0 ? 1:-1);
-            } else  { // Calculate next lesser value
-                assert direction < start;
-                if (transducer > 0)
-                    --transducer;
-                else
-                    if (transducer < 0 )
-                        ++transducer;
-                    /*
-                     * transducer==0, the result is -MIN_VALUE
-                     *
-                     * The transition from zero (implicitly
-                     * positive) to the smallest negative
-                     * signed magnitude value must be done
-                     * explicitly.
-                     */
-                    else
-                        transducer = FloatConsts.SIGN_BIT_MASK | 1;
-            }
-
-            return Float.intBitsToFloat(transducer);
-        }
+    @Deprecated
+    public static float nextAfter(float start, double direction) {
+        return Math.nextAfter(start, direction);
     }
 
     /**
@@ -915,15 +688,11 @@
      * @return The adjacent floating-point value closer to positive
      * infinity.
      * @author Joseph D. Darcy
+     * @deprecated use Math.nextUp.
      */
+    @Deprecated
     public static double nextUp(double d) {
-        if( isNaN(d) || d == Double.POSITIVE_INFINITY)
-            return d;
-        else {
-            d += 0.0d;
-            return Double.longBitsToDouble(Double.doubleToRawLongBits(d) +
-                                           ((d >= 0.0d)?+1L:-1L));
-        }
+        return Math.nextUp(d);
     }
 
     /**
@@ -950,15 +719,11 @@
      * @return The adjacent floating-point value closer to positive
      * infinity.
      * @author Joseph D. Darcy
+     * @deprecated Use Math.nextUp.
      */
-     public static float nextUp(float f) {
-        if( isNaN(f) || f == FloatConsts.POSITIVE_INFINITY)
-            return f;
-        else {
-            f += 0.0f;
-            return Float.intBitsToFloat(Float.floatToRawIntBits(f) +
-                                        ((f >= 0.0f)?+1:-1));
-        }
+    @Deprecated
+    public static float nextUp(float f) {
+        return Math.nextUp(f);
     }
 
     /**
@@ -985,17 +750,11 @@
      * @return The adjacent floating-point value closer to negative
      * infinity.
      * @author Joseph D. Darcy
+     * @deprecated Use Math.nextDown.
      */
+    @Deprecated
     public static double nextDown(double d) {
-        if( isNaN(d) || d == Double.NEGATIVE_INFINITY)
-            return d;
-        else {
-            if (d == 0.0)
-                return -Double.MIN_VALUE;
-            else
-                return Double.longBitsToDouble(Double.doubleToRawLongBits(d) +
-                                               ((d > 0.0d)?-1L:+1L));
-        }
+        return Math.nextDown(d);
     }
 
     /**
@@ -1022,17 +781,11 @@
      * @return The adjacent floating-point value closer to negative
      * infinity.
      * @author Joseph D. Darcy
+     * @deprecated Use Math.nextDown.
      */
+    @Deprecated
     public static double nextDown(float f) {
-        if( isNaN(f) || f == Float.NEGATIVE_INFINITY)
-            return f;
-        else {
-            if (f == 0.0f)
-                return -Float.MIN_VALUE;
-            else
-                return Float.intBitsToFloat(Float.floatToRawIntBits(f) +
-                                            ((f > 0.0f)?-1:+1));
-        }
+        return Math.nextDown(f);
     }
 
     /**
@@ -1047,9 +800,11 @@
      * and the sign of {@code sign}.
      * @author Joseph D. Darcy
      * @since 1.5
+     * @deprecated Use StrictMath.copySign.
      */
+    @Deprecated
     public static double copySign(double magnitude, double sign) {
-        return rawCopySign(magnitude, (isNaN(sign)?1.0d:sign));
+        return StrictMath.copySign(magnitude, sign);
     }
 
     /**
@@ -1063,9 +818,11 @@
      * @return a value with the magnitude of {@code magnitude}
      * and the sign of {@code sign}.
      * @author Joseph D. Darcy
+     * @deprecated Use StrictMath.copySign.
      */
-     public static float copySign(float magnitude, float sign) {
-        return rawCopySign(magnitude, (isNaN(sign)?1.0f:sign));
+    @Deprecated
+    public static float copySign(float magnitude, float sign) {
+        return StrictMath.copySign(magnitude, sign);
     }
 
     /**
@@ -1090,33 +847,11 @@
      * @return the size of an ulp of the argument
      * @author Joseph D. Darcy
      * @since 1.5
+     * @deprecated Use Math.ulp.
      */
+    @Deprecated
     public static double ulp(double d) {
-        int exp = getExponent(d);
-
-        switch(exp) {
-        case DoubleConsts.MAX_EXPONENT+1:       // NaN or infinity
-            return Math.abs(d);
-
-        case DoubleConsts.MIN_EXPONENT-1:       // zero or subnormal
-            return Double.MIN_VALUE;
-
-        default:
-            assert exp <= DoubleConsts.MAX_EXPONENT && exp >= DoubleConsts.MIN_EXPONENT;
-
-            // ulp(x) is usually 2^(SIGNIFICAND_WIDTH-1)*(2^ilogb(x))
-            exp = exp - (DoubleConsts.SIGNIFICAND_WIDTH-1);
-            if (exp >= DoubleConsts.MIN_EXPONENT) {
-                return powerOfTwoD(exp);
-            }
-            else {
-                // return a subnormal result; left shift integer
-                // representation of Double.MIN_VALUE appropriate
-                // number of positions
-                return Double.longBitsToDouble(1L <<
-                (exp - (DoubleConsts.MIN_EXPONENT - (DoubleConsts.SIGNIFICAND_WIDTH-1)) ));
-            }
-        }
+        return Math.ulp(d);
     }
 
     /**
@@ -1141,33 +876,11 @@
      * @return the size of an ulp of the argument
      * @author Joseph D. Darcy
      * @since 1.5
+     * @deprecated Use Math.ulp.
      */
+     @Deprecated
      public static float ulp(float f) {
-        int exp = getExponent(f);
-
-        switch(exp) {
-        case FloatConsts.MAX_EXPONENT+1:        // NaN or infinity
-            return Math.abs(f);
-
-        case FloatConsts.MIN_EXPONENT-1:        // zero or subnormal
-            return FloatConsts.MIN_VALUE;
-
-        default:
-            assert exp <= FloatConsts.MAX_EXPONENT && exp >= FloatConsts.MIN_EXPONENT;
-
-            // ulp(x) is usually 2^(SIGNIFICAND_WIDTH-1)*(2^ilogb(x))
-            exp = exp - (FloatConsts.SIGNIFICAND_WIDTH-1);
-            if (exp >= FloatConsts.MIN_EXPONENT) {
-                return powerOfTwoF(exp);
-            }
-            else {
-                // return a subnormal result; left shift integer
-                // representation of FloatConsts.MIN_VALUE appropriate
-                // number of positions
-                return Float.intBitsToFloat(1 <<
-                (exp - (FloatConsts.MIN_EXPONENT - (FloatConsts.SIGNIFICAND_WIDTH-1)) ));
-            }
-        }
+        return Math.ulp(f);
      }
 
     /**
@@ -1186,9 +899,11 @@
      * @return the signum function of the argument
      * @author Joseph D. Darcy
      * @since 1.5
+     * @deprecated Use Math.signum.
      */
+    @Deprecated
     public static double signum(double d) {
-        return (d == 0.0 || isNaN(d))?d:copySign(1.0, d);
+        return Math.signum(d);
     }
 
     /**
@@ -1207,9 +922,10 @@
      * @return the signum function of the argument
      * @author Joseph D. Darcy
      * @since 1.5
+     * @deprecated Use Math.signum.
      */
+    @Deprecated
     public static float signum(float f) {
-        return (f == 0.0f || isNaN(f))?f:copySign(1.0f, f);
+        return Math.signum(f);
     }
-
 }
--- a/src/share/classes/sun/misc/REException.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/misc/REException.java	Wed Oct 26 17:59:13 2011 -0700
@@ -31,6 +31,9 @@
  */
 
 public class REException extends Exception {
+
+    private static final long serialVersionUID = 4656584872733646963L;
+
     REException (String s) {
         super(s);
     }
--- a/src/share/classes/sun/net/TransferProtocolClient.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/TransferProtocolClient.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,8 @@
 
 package sun.net;
 
-import java.lang.StringIndexOutOfBoundsException;
 import java.io.*;
 import java.util.Vector;
-import sun.net.NetworkClient;
 
 /**
  * This class implements that basic intefaces of transfer protocols.
@@ -44,7 +42,7 @@
 
     /** Array of strings (usually 1 entry) for the last reply
         from the server. */
-    protected Vector    serverResponse = new Vector(1);
+    protected Vector<String> serverResponse = new Vector<>(1);
 
     /** code for last reply */
     protected int       lastReplyCode;
@@ -123,11 +121,11 @@
 
     /** converts the server response into a string. */
     public String getResponseString() {
-        return (String) serverResponse.elementAt(0);
+        return serverResponse.elementAt(0);
     }
 
     /** Returns all server response strings. */
-    public Vector getResponseStrings() {
+    public Vector<String> getResponseStrings() {
         return serverResponse;
     }
 
--- a/src/share/classes/sun/net/ftp/FtpClientProvider.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/ftp/FtpClientProvider.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -67,16 +67,13 @@
             return false;
         }
         try {
-            Class c = Class.forName(cm, true, null);
+            Class<?> c = Class.forName(cm, true, null);
             provider = (FtpClientProvider) c.newInstance();
             return true;
-        } catch (ClassNotFoundException x) {
-            throw new ServiceConfigurationError(x.toString());
-        } catch (IllegalAccessException x) {
-            throw new ServiceConfigurationError(x.toString());
-        } catch (InstantiationException x) {
-            throw new ServiceConfigurationError(x.toString());
-        } catch (SecurityException x) {
+        } catch (ClassNotFoundException |
+                 IllegalAccessException |
+                 InstantiationException |
+                 SecurityException x) {
             throw new ServiceConfigurationError(x.toString());
         }
     }
--- a/src/share/classes/sun/net/httpserver/Request.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/httpserver/Request.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,13 +25,10 @@
 
 package sun.net.httpserver;
 
-import java.util.*;
 import java.nio.*;
-import java.net.*;
 import java.io.*;
 import java.nio.channels.*;
 import com.sun.net.httpserver.*;
-import com.sun.net.httpserver.spi.*;
 
 /**
  */
@@ -47,7 +44,6 @@
     private OutputStream os;
 
     Request (InputStream rawInputStream, OutputStream rawout) throws IOException {
-        this.chan = chan;
         is = rawInputStream;
         os = rawout;
         do {
@@ -121,7 +117,7 @@
     }
 
     Headers hdrs = null;
-
+    @SuppressWarnings("fallthrough")
     Headers headers () throws IOException {
         if (hdrs != null) {
             return hdrs;
@@ -152,6 +148,7 @@
     parseloop:{
                 while ((c = is.read()) >= 0) {
                     switch (c) {
+                      /*fallthrough*/
                       case ':':
                         if (inKey && len > 0)
                             keyend = len;
--- a/src/share/classes/sun/net/httpserver/SSLStreams.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/httpserver/SSLStreams.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,13 +29,10 @@
 import java.nio.*;
 import java.io.*;
 import java.nio.channels.*;
-import java.util.*;
-import java.util.concurrent.*;
 import java.util.concurrent.locks.*;
 import javax.net.ssl.*;
 import javax.net.ssl.SSLEngineResult.*;
 import com.sun.net.httpserver.*;
-import com.sun.net.httpserver.spi.*;
 
 /**
  * given a non-blocking SocketChannel, it produces
@@ -448,6 +445,7 @@
      * on the wrapper methods being idempotent. eg. if wrapAndSend()
      * is called with no data to send then there must be no problem
      */
+    @SuppressWarnings("fallthrough")
     void doHandshake (HandshakeStatus hs_status) throws IOException {
         try {
             handshaking.lock();
--- a/src/share/classes/sun/net/httpserver/ServerImpl.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/httpserver/ServerImpl.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -593,8 +593,8 @@
                         rheaders.set ("Connection", "close");
                     } else if (chdr.equalsIgnoreCase ("keep-alive")) {
                         rheaders.set ("Connection", "keep-alive");
-                        int idle=(int)ServerConfig.getIdleInterval()/1000;
-                        int max=(int)ServerConfig.getMaxIdleConnections();
+                        int idle=(int)(ServerConfig.getIdleInterval()/1000);
+                        int max=ServerConfig.getMaxIdleConnections();
                         String val = "timeout="+idle+", max="+max;
                         rheaders.set ("Keep-Alive", val);
                     }
--- a/src/share/classes/sun/net/idn/UCharacterEnums.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/idn/UCharacterEnums.java	Wed Oct 26 17:59:13 2011 -0700
@@ -33,6 +33,22 @@
 //          - copy this file from icu4jsrc_3_2/src/com/ibm/icu/lang/UCharacterEnums.java
 //          - move from package com.ibm.icu.lang to package sun.net.idn
 //
+//      2011-09-06 Kurchi Subhra Hazra
+//          - Added @Deprecated tag to the following:
+//            - class UCharacterEnums
+//            - interfaces ECharacterCategory, ECharacterDirection
+//            - fields INITIAL_QUOTE_PUNCTUATION, FINAL_QUOTE_PUNCTUATION,
+//              DIRECTIONALITY_LEFT_TO_RIGHT, DIRECTIONALITY_RIGHT_TO_LEFT,
+//              DIRECTIONALITY_EUROPEAN_NUMBER, DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR
+//              DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR, DIRECTIONALITY_ARABIC_NUMBER,
+//              DIRECTIONALITY_COMMON_NUMBER_SEPARATOR, DIRECTIONALITY_PARAGRAPH_SEPARATOR,
+//              DIRECTIONALITY_SEGMENT_SEPARATOR, DIRECTIONALITY_WHITESPACE,
+//              DIRECTIONALITY_OTHER_NEUTRALS, DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING,
+//              DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE, DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC,
+//              DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING, DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE,
+//              DIRECTIONALITY_POP_DIRECTIONAL_FORMAT, DIRECTIONALITY_NON_SPACING_MARK,
+//              DIRECTIONALITY_BOUNDARY_NEUTRAL, DIRECTIONALITY_UNDEFINED
+//
 
 package sun.net.idn;
 
@@ -41,6 +57,8 @@
  * @draft ICU 3.0
  * @deprecated This is a draft API and might change in a future release of ICU.
  */
+
+@Deprecated
 class UCharacterEnums {
 
     /** This is just a namespace, it is not instantiatable. */
@@ -54,6 +72,7 @@
      * @draft ICU 3.0
      * @deprecated This is a draft API and might change in a future release of ICU.
      */
+    @Deprecated
     public static interface ECharacterCategory {
         /**
          * Unassigned character type
@@ -245,6 +264,7 @@
          * @draft ICU 2.8
      * @deprecated This is a draft API and might change in a future release of ICU.
          */
+        @Deprecated
         public static final int INITIAL_QUOTE_PUNCTUATION = 28;
 
         /**
@@ -261,6 +281,7 @@
          * @draft ICU 2.8
      * @deprecated This is a draft API and might change in a future release of ICU.
          */
+        @Deprecated
         public static final int FINAL_QUOTE_PUNCTUATION   = 29;
 
         /**
@@ -279,6 +300,8 @@
      * @draft ICU 3.0
      * @deprecated This is a draft API and might change in a future release of ICU.
      */
+
+    @Deprecated
     public static interface ECharacterDirection {
         /**
          * Directional type L
@@ -291,6 +314,7 @@
          * @draft ICU 3.0
      * @deprecated This is a draft API and might change in a future release of ICU.
          */
+        @Deprecated
         public static final byte DIRECTIONALITY_LEFT_TO_RIGHT = (byte)LEFT_TO_RIGHT;
 
         /**
@@ -304,6 +328,7 @@
          * @draft ICU 3.0
      * @deprecated This is a draft API and might change in a future release of ICU.
          */
+        @Deprecated
         public static final byte DIRECTIONALITY_RIGHT_TO_LEFT = (byte)RIGHT_TO_LEFT;
 
         /**
@@ -317,6 +342,7 @@
          * @draft ICU 3.0
      * @deprecated This is a draft API and might change in a future release of ICU.
          */
+        @Deprecated
         public static final byte DIRECTIONALITY_EUROPEAN_NUMBER = (byte)EUROPEAN_NUMBER;
 
         /**
@@ -330,6 +356,7 @@
          * @draft ICU 3.0
      * @deprecated This is a draft API and might change in a future release of ICU.
          */
+        @Deprecated
         public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR = (byte)EUROPEAN_NUMBER_SEPARATOR;
 
         /**
@@ -343,6 +370,7 @@
          * @draft ICU 3.0
      * @deprecated This is a draft API and might change in a future release of ICU.
          */
+        @Deprecated
         public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR = (byte)EUROPEAN_NUMBER_TERMINATOR;
 
         /**
@@ -356,6 +384,7 @@
          * @draft ICU 3.0
      * @deprecated This is a draft API and might change in a future release of ICU.
          */
+        @Deprecated
         public static final byte DIRECTIONALITY_ARABIC_NUMBER = (byte)ARABIC_NUMBER;
 
         /**
@@ -369,6 +398,7 @@
          * @draft ICU 3.0
      * @deprecated This is a draft API and might change in a future release of ICU.
          */
+        @Deprecated
         public static final byte DIRECTIONALITY_COMMON_NUMBER_SEPARATOR = (byte)COMMON_NUMBER_SEPARATOR;
 
         /**
@@ -382,6 +412,7 @@
          * @draft ICU 3.0
      * @deprecated This is a draft API and might change in a future release of ICU.
          */
+        @Deprecated
         public static final byte DIRECTIONALITY_PARAGRAPH_SEPARATOR = (byte)BLOCK_SEPARATOR;
 
         /**
@@ -395,6 +426,7 @@
          * @draft ICU 3.0
      * @deprecated This is a draft API and might change in a future release of ICU.
          */
+        @Deprecated
         public static final byte DIRECTIONALITY_SEGMENT_SEPARATOR = (byte)SEGMENT_SEPARATOR;
 
         /**
@@ -408,6 +440,7 @@
          * @draft ICU 3.0
      * @deprecated This is a draft API and might change in a future release of ICU.
          */
+        @Deprecated
         public static final byte DIRECTIONALITY_WHITESPACE = (byte)WHITE_SPACE_NEUTRAL;
 
         /**
@@ -421,6 +454,7 @@
          * @draft ICU 3.0
      * @deprecated This is a draft API and might change in a future release of ICU.
          */
+        @Deprecated
         public static final byte DIRECTIONALITY_OTHER_NEUTRALS = (byte)OTHER_NEUTRAL;
 
         /**
@@ -434,6 +468,7 @@
          * @draft ICU 3.0
      * @deprecated This is a draft API and might change in a future release of ICU.
          */
+        @Deprecated
         public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING = (byte)LEFT_TO_RIGHT_EMBEDDING;
 
         /**
@@ -447,6 +482,7 @@
          * @draft ICU 3.0
      * @deprecated This is a draft API and might change in a future release of ICU.
          */
+        @Deprecated
         public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE = (byte)LEFT_TO_RIGHT_OVERRIDE;
 
         /**
@@ -460,6 +496,7 @@
          * @draft ICU 3.0
      * @deprecated This is a draft API and might change in a future release of ICU.
          */
+        @Deprecated
         public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC = (byte)RIGHT_TO_LEFT_ARABIC;
 
         /**
@@ -473,6 +510,7 @@
          * @draft ICU 3.0
      * @deprecated This is a draft API and might change in a future release of ICU.
          */
+        @Deprecated
         public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING = (byte)RIGHT_TO_LEFT_EMBEDDING;
 
         /**
@@ -486,6 +524,7 @@
          * @draft ICU 3.0
      * @deprecated This is a draft API and might change in a future release of ICU.
          */
+        @Deprecated
         public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE = (byte)RIGHT_TO_LEFT_OVERRIDE;
 
         /**
@@ -499,6 +538,7 @@
          * @draft ICU 3.0
      * @deprecated This is a draft API and might change in a future release of ICU.
          */
+        @Deprecated
         public static final byte DIRECTIONALITY_POP_DIRECTIONAL_FORMAT = (byte)POP_DIRECTIONAL_FORMAT;
 
         /**
@@ -512,6 +552,7 @@
          * @draft ICU 3.0
      * @deprecated This is a draft API and might change in a future release of ICU.
          */
+        @Deprecated
         public static final byte DIRECTIONALITY_NON_SPACING_MARK = (byte)DIR_NON_SPACING_MARK;
 
         /**
@@ -525,6 +566,7 @@
          * @draft ICU 3.0
      * @deprecated This is a draft API and might change in a future release of ICU.
          */
+        @Deprecated
         public static final byte DIRECTIONALITY_BOUNDARY_NEUTRAL = (byte)BOUNDARY_NEUTRAL;
 
         /**
@@ -539,6 +581,7 @@
      * @draft ICU 3.0
      * @deprecated This is a draft API and might change in a future release of ICU.
          */
+        @Deprecated
         public static final byte DIRECTIONALITY_UNDEFINED = -1;
     }
 }
--- a/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/spi/nameservice/dns/DNSNameService.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -140,7 +140,7 @@
             // create new soft reference to our thread context
             //
             thrCtxt = new ThreadContext(dirCtxt, nsList);
-            contextRef.set(new SoftReference(thrCtxt));
+            contextRef.set(new SoftReference<ThreadContext>(thrCtxt));
         }
 
         return thrCtxt.dirContext();
@@ -193,7 +193,7 @@
                 Attribute attr = ne.next();
                 String attrID = attr.getID();
 
-                for (NamingEnumeration e = attr.getAll(); e.hasMoreElements();) {
+                for (NamingEnumeration<?> e = attr.getAll(); e.hasMoreElements();) {
                     String addr = (String)e.next();
 
                     // for canoncical name records do recursive lookup
@@ -233,7 +233,7 @@
         String domain = AccessController.doPrivileged(
             new GetPropertyAction("sun.net.spi.nameservice.domain"));
         if (domain != null && domain.length() > 0) {
-            domainList = new LinkedList();
+            domainList = new LinkedList<String>();
             domainList.add(domain);
         }
 
@@ -282,7 +282,7 @@
             throw new Error(nx);
         }
 
-        ArrayList results = null;
+        ArrayList<String> results = null;
         UnknownHostException uhe = null;
 
         // If host already contains a domain name then just look it up
@@ -365,7 +365,7 @@
         InetAddress[] addrs = new InetAddress[results.size()];
         int count = 0;
         for (int i=0; i<results.size(); i++) {
-            String addrString = (String)results.get(i);
+            String addrString = results.get(i);
             byte addr[] = IPAddressUtil.textToNumericFormatV4(addrString);
             if (addr == null) {
                 addr = IPAddressUtil.textToNumericFormatV6(addrString);
--- a/src/share/classes/sun/net/www/HeaderParser.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/www/HeaderParser.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -192,7 +192,7 @@
         return Default;
     }
 
-    class ParserIterator implements Iterator {
+    class ParserIterator implements Iterator<String> {
         int index;
         boolean returnsValue; // or key
 
@@ -202,7 +202,7 @@
         public boolean hasNext () {
             return index<nkeys;
         }
-        public Object next () {
+        public String next () {
             return tab[index++][returnsValue?1:0];
         }
         public void remove () {
@@ -210,20 +210,20 @@
         }
     }
 
-    public Iterator keys () {
+    public Iterator<String> keys () {
         return new ParserIterator (false);
     }
 
-    public Iterator values () {
+    public Iterator<String> values () {
         return new ParserIterator (true);
     }
 
     public String toString () {
-        Iterator k = keys();
+        Iterator<String> k = keys();
         StringBuffer sbuf = new StringBuffer();
         sbuf.append ("{size="+asize+" nkeys="+nkeys+" ");
         for (int i=0; k.hasNext(); i++) {
-            String key = (String)k.next();
+            String key = k.next();
             String val = findValue (i);
             if (val != null && "".equals (val)) {
                 val = null;
--- a/src/share/classes/sun/net/www/MessageHeader.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/www/MessageHeader.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,6 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.ArrayList;
-import java.util.Set;
 import java.util.Iterator;
 import java.util.NoSuchElementException;
 
@@ -199,7 +198,8 @@
         return filterAndAddHeaders(excludeList, null);
     }
 
-    public synchronized Map<String, List<String>> filterAndAddHeaders(String[] excludeList, Map<String, List<String>>  include) {
+    public synchronized Map<String, List<String>> filterAndAddHeaders(
+            String[] excludeList, Map<String, List<String>>  include) {
         boolean skipIt = false;
         Map<String, List<String>> m = new HashMap<String, List<String>>();
         for (int i = nkeys; --i >= 0;) {
@@ -228,15 +228,13 @@
         }
 
         if (include != null) {
-            Iterator entries = include.entrySet().iterator();
-            while (entries.hasNext()) {
-                Map.Entry entry = (Map.Entry)entries.next();
-                List l = (List)m.get(entry.getKey());
+                for (Map.Entry<String,List<String>> entry: include.entrySet()) {
+                List<String> l = m.get(entry.getKey());
                 if (l == null) {
-                    l = new ArrayList();
-                    m.put((String)entry.getKey(), l);
+                    l = new ArrayList<String>();
+                    m.put(entry.getKey(), l);
                 }
-                l.add(entry.getValue());
+                l.addAll(entry.getValue());
             }
         }
 
@@ -400,6 +398,7 @@
     }
 
     /** Parse and merge a MIME header from an input stream. */
+    @SuppressWarnings("fallthrough")
     public void mergeHeader(InputStream is) throws java.io.IOException {
         if (is == null)
             return;
@@ -421,6 +420,7 @@
                         break;
                       case '\t':
                         c = ' ';
+                      /*fall through*/
                       case ' ':
                         inKey = false;
                         break;
--- a/src/share/classes/sun/net/www/MimeTable.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/www/MimeTable.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,6 @@
 
 package sun.net.www;
 import java.io.*;
-import java.util.Calendar;
-import java.util.Date;
-import java.text.SimpleDateFormat;
-import java.net.URL;
 import java.net.FileNameMap;
 import java.util.Hashtable;
 import java.util.Enumeration;
@@ -271,7 +267,7 @@
         String tempFileTemplate = (String)entries.get("temp.file.template");
         if (tempFileTemplate != null) {
             entries.remove("temp.file.template");
-            this.tempFileTemplate = tempFileTemplate;
+            MimeTable.tempFileTemplate = tempFileTemplate;
         }
 
         // now, parse the mime-type spec's
@@ -417,10 +413,10 @@
             String user = System.getProperty("user.name");
             if (user != null) {
                 tag = "; customized for " + user;
-                properties.save(os, filePreamble + tag);
+                properties.store(os, filePreamble + tag);
             }
             else {
-                properties.save(os, filePreamble);
+                properties.store(os, filePreamble);
             }
         }
         catch (IOException e) {
--- a/src/share/classes/sun/net/www/URLConnection.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/www/URLConnection.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,12 +26,7 @@
 package sun.net.www;
 
 import java.net.URL;
-import java.net.ContentHandler;
 import java.util.*;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.BufferedInputStream;
-import java.net.UnknownServiceException;
 
 /**
  * A class to represent an active connection to an object
@@ -99,7 +94,7 @@
     public Map<String,List<String>> getRequestProperties() {
         if (connected)
             throw new IllegalStateException("Already connected");
-        return Collections.EMPTY_MAP;
+        return Collections.emptyMap();
     }
 
     public String getHeaderField(String name) {
--- a/src/share/classes/sun/net/www/content/image/gif.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/www/content/image/gif.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,11 +25,8 @@
 
 package sun.net.www.content.image;
 
-import java.net.URL;
-import java.net.URLConnection;
 import java.net.*;
 import sun.awt.image.*;
-import java.io.InputStream;
 import java.io.IOException;
 import java.awt.Image;
 import java.awt.Toolkit;
@@ -40,7 +37,7 @@
         return new URLImageSource(urlc);
     }
 
-    public Object getContent(URLConnection urlc, Class[] classes) throws IOException {
+    public Object getContent(URLConnection urlc, Class<?>[] classes) throws IOException {
         for (int i = 0; i < classes.length; i++) {
           if (classes[i].isAssignableFrom(URLImageSource.class)) {
                 return new URLImageSource(urlc);
--- a/src/share/classes/sun/net/www/content/image/jpeg.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/www/content/image/jpeg.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,11 +25,8 @@
 
 package sun.net.www.content.image;
 
-import java.net.URL;
-import java.net.URLConnection;
 import java.net.*;
 import sun.awt.image.*;
-import java.io.InputStream;
 import java.io.IOException;
 import java.awt.Image;
 import java.awt.Toolkit;
@@ -39,7 +36,7 @@
         return new URLImageSource(urlc);
     }
 
-    public Object getContent(URLConnection urlc, Class[] classes) throws IOException {
+    public Object getContent(URLConnection urlc, Class<?>[] classes) throws IOException {
         for (int i = 0; i < classes.length; i++) {
           if (classes[i].isAssignableFrom(URLImageSource.class)) {
                 return new URLImageSource(urlc);
--- a/src/share/classes/sun/net/www/content/image/png.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/www/content/image/png.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,7 @@
 
 package sun.net.www.content.image;
 
-import java.net.URL;
-import java.net.URLConnection;
 import java.net.*;
-import java.io.InputStream;
 import java.io.IOException;
 import sun.awt.image.*;
 import java.awt.Image;
@@ -39,7 +36,7 @@
         return new URLImageSource(urlc);
     }
 
-    public Object getContent(URLConnection urlc, Class[] classes) throws IOException {
+    public Object getContent(URLConnection urlc, Class<?>[] classes) throws IOException {
         for (int i = 0; i < classes.length; i++) {
           if (classes[i].isAssignableFrom(URLImageSource.class)) {
                 return new URLImageSource(urlc);
--- a/src/share/classes/sun/net/www/content/image/x_xbitmap.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/www/content/image/x_xbitmap.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,7 @@
         return new URLImageSource(urlc);
     }
 
-    public Object getContent(URLConnection urlc, Class[] classes) throws java.io.IOException {
+    public Object getContent(URLConnection urlc, Class<?>[] classes) throws java.io.IOException {
         for (int i = 0; i < classes.length; i++) {
           if (classes[i].isAssignableFrom(URLImageSource.class)) {
                 return new URLImageSource(urlc);
--- a/src/share/classes/sun/net/www/content/image/x_xpixmap.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/www/content/image/x_xpixmap.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,7 @@
         return new URLImageSource(urlc);
     }
 
-    public Object getContent(URLConnection urlc, Class[] classes) throws java.io.IOException {
+    public Object getContent(URLConnection urlc, Class<?>[] classes) throws java.io.IOException {
         for (int i = 0; i < classes.length; i++) {
           if (classes[i].isAssignableFrom(URLImageSource.class)) {
                 return new URLImageSource(urlc);
--- a/src/share/classes/sun/net/www/http/KeepAliveStream.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/www/http/KeepAliveStream.java	Wed Oct 26 17:59:13 2011 -0700
@@ -81,7 +81,7 @@
         // NOTE: Don't close super class
         try {
             if (expected > count) {
-                long nskip = (long) (expected - count);
+                long nskip = expected - count;
                 if (nskip <= available()) {
                     long n = 0;
                     while (n < nskip) {
--- a/src/share/classes/sun/net/www/protocol/gopher/GopherClient.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/www/protocol/gopher/GopherClient.java	Wed Oct 26 17:59:13 2011 -0700
@@ -281,7 +281,7 @@
                 ps.print("</title></head>\n<body>\n<H1>");
                 ps.print(title);
                 ps.print("</h1><dl compact>\n");
-                DataInputStream ds = new DataInputStream(serverInput);
+                BufferedReader ds = new BufferedReader(new InputStreamReader(serverInput));
                 String s;
                 while ((s = ds.readLine()) != null) {
                     int len = s.length();
--- a/src/share/classes/sun/net/www/protocol/http/AuthCacheImpl.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/www/protocol/http/AuthCacheImpl.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,12 +25,8 @@
 
 package sun.net.www.protocol.http;
 
-import java.io.IOException;
-import java.net.URL;
-import java.util.Hashtable;
 import java.util.LinkedList;
 import java.util.ListIterator;
-import java.util.Enumeration;
 import java.util.HashMap;
 
 /**
@@ -38,13 +34,13 @@
  */
 
 public class AuthCacheImpl implements AuthCache {
-    HashMap hashtable;
+    HashMap<String,LinkedList<AuthCacheValue>> hashtable;
 
     public AuthCacheImpl () {
-        hashtable = new HashMap ();
+        hashtable = new HashMap<String,LinkedList<AuthCacheValue>>();
     }
 
-    public void setMap (HashMap map) {
+    public void setMap (HashMap<String,LinkedList<AuthCacheValue>> map) {
         hashtable = map;
     }
 
@@ -52,21 +48,21 @@
     // is the path field of AuthenticationInfo
 
     public synchronized void put (String pkey, AuthCacheValue value) {
-        LinkedList list = (LinkedList) hashtable.get (pkey);
+        LinkedList<AuthCacheValue> list = hashtable.get (pkey);
         String skey = value.getPath();
         if (list == null) {
-            list = new LinkedList ();
-            hashtable.put (pkey, list);
+            list = new LinkedList<AuthCacheValue>();
+            hashtable.put(pkey, list);
         }
         // Check if the path already exists or a super-set of it exists
-        ListIterator iter = list.listIterator();
+        ListIterator<AuthCacheValue> iter = list.listIterator();
         while (iter.hasNext()) {
             AuthenticationInfo inf = (AuthenticationInfo)iter.next();
             if (inf.path == null || inf.path.startsWith (skey)) {
                 iter.remove ();
             }
         }
-        iter.add (value);
+        iter.add(value);
     }
 
     // get a value from map checking both primary
@@ -74,7 +70,7 @@
 
     public synchronized AuthCacheValue get (String pkey, String skey) {
         AuthenticationInfo result = null;
-        LinkedList list = (LinkedList) hashtable.get (pkey);
+        LinkedList<AuthCacheValue> list = hashtable.get (pkey);
         if (list == null || list.size() == 0) {
             return null;
         }
@@ -82,7 +78,7 @@
             // list should contain only one element
             return (AuthenticationInfo)list.get (0);
         }
-        ListIterator iter = list.listIterator();
+        ListIterator<AuthCacheValue> iter = list.listIterator();
         while (iter.hasNext()) {
             AuthenticationInfo inf = (AuthenticationInfo)iter.next();
             if (skey.startsWith (inf.path)) {
@@ -93,7 +89,7 @@
     }
 
     public synchronized void remove (String pkey, AuthCacheValue entry) {
-        LinkedList list = (LinkedList) hashtable.get (pkey);
+        LinkedList<AuthCacheValue> list = hashtable.get (pkey);
         if (list == null) {
             return;
         }
@@ -101,7 +97,7 @@
             list.clear();
             return;
         }
-        ListIterator iter = list.listIterator ();
+        ListIterator<AuthCacheValue> iter = list.listIterator ();
         while (iter.hasNext()) {
             AuthenticationInfo inf = (AuthenticationInfo)iter.next();
             if (entry.equals(inf)) {
--- a/src/share/classes/sun/net/www/protocol/http/AuthenticationHeader.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/www/protocol/http/AuthenticationHeader.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -122,7 +122,7 @@
         this.dontUseNegotiate = dontUseNegotiate;
         rsp = response;
         this.hdrname = hdrname;
-        schemes = new HashMap();
+        schemes = new HashMap<String,SchemeMapValue>();
         parse();
     }
 
@@ -136,7 +136,7 @@
         HeaderParser parser;
     }
 
-    HashMap schemes;
+    HashMap<String, SchemeMapValue> schemes;
 
     /* Iterate through each header line, and then within each line.
      * If multiple entries exist for a particular scheme (unlikely)
@@ -144,11 +144,11 @@
      * preferred scheme that we support will be used.
      */
     private void parse () {
-        Iterator iter = rsp.multiValueIterator (hdrname);
+        Iterator<String> iter = rsp.multiValueIterator(hdrname);
         while (iter.hasNext()) {
-            String raw = (String)iter.next();
-            HeaderParser hp = new HeaderParser (raw);
-            Iterator keys = hp.keys();
+            String raw = iter.next();
+            HeaderParser hp = new HeaderParser(raw);
+            Iterator<String> keys = hp.keys();
             int i, lastSchemeIndex;
             for (i=0, lastSchemeIndex = -1; keys.hasNext(); i++) {
                 keys.next();
@@ -164,7 +164,7 @@
             if (i > lastSchemeIndex) {
                 HeaderParser hpn = hp.subsequence (lastSchemeIndex, i);
                 String scheme = hpn.findKey(0);
-                schemes.put (scheme, new SchemeMapValue (hpn, raw));
+                schemes.put(scheme, new SchemeMapValue (hpn, raw));
             }
         }
 
@@ -172,10 +172,10 @@
          * negotiate -> kerberos -> digest -> ntlm -> basic
          */
         SchemeMapValue v = null;
-        if (authPref == null || (v=(SchemeMapValue)schemes.get (authPref)) == null) {
+        if (authPref == null || (v=schemes.get (authPref)) == null) {
 
             if(v == null && !dontUseNegotiate) {
-                SchemeMapValue tmp = (SchemeMapValue)schemes.get("negotiate");
+                SchemeMapValue tmp = schemes.get("negotiate");
                 if(tmp != null) {
                     if(hci == null || !NegotiateAuthentication.isSupported(new HttpCallerInfo(hci, "Negotiate"))) {
                         tmp = null;
@@ -185,7 +185,7 @@
             }
 
             if(v == null && !dontUseNegotiate) {
-                SchemeMapValue tmp = (SchemeMapValue)schemes.get("kerberos");
+                SchemeMapValue tmp = schemes.get("kerberos");
                 if(tmp != null) {
                     // the Kerberos scheme is only observed in MS ISA Server. In
                     // fact i think it's a Kerberos-mechnism-only Negotiate.
@@ -205,9 +205,9 @@
             }
 
             if(v == null) {
-                if ((v=(SchemeMapValue)schemes.get ("digest")) == null) {
-                    if (((v=(SchemeMapValue)schemes.get("ntlm"))==null)) {
-                        v = (SchemeMapValue)schemes.get ("basic");
+                if ((v=schemes.get ("digest")) == null) {
+                    if (((v=schemes.get("ntlm"))==null)) {
+                        v = schemes.get ("basic");
                     }
                 }
             }
--- a/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Wed Oct 26 17:59:13 2011 -0700
@@ -25,6 +25,7 @@
 
 package sun.net.www.protocol.http;
 
+import java.util.Arrays;
 import java.net.URL;
 import java.net.URLConnection;
 import java.net.ProtocolException;
@@ -229,9 +230,9 @@
             bufSize4ES = 4096; // use the default
         }
 
-        allowRestrictedHeaders = ((Boolean)java.security.AccessController.doPrivileged(
+        allowRestrictedHeaders = java.security.AccessController.doPrivileged(
                 new sun.security.action.GetBooleanAction(
-                    "sun.net.http.allowRestrictedHeaders"))).booleanValue();
+                    "sun.net.http.allowRestrictedHeaders")).booleanValue();
         if (!allowRestrictedHeaders) {
             restrictedHeaderSet = new HashSet<String>(restrictedHeaders.length);
             for (int i=0; i < restrictedHeaders.length; i++) {
@@ -289,6 +290,7 @@
      * REMIND:  backwards compatibility with JDK 1.1.  Should be
      * eliminated for JDK 2.0.
      */
+    @Deprecated
     private static HttpAuthenticator defaultAuth;
 
     /* all the headers we send
@@ -750,6 +752,7 @@
     /**
      * @deprecated.  Use java.net.Authenticator.setDefault() instead.
      */
+    @Deprecated
     public static void setDefaultAuthenticator(HttpAuthenticator a) {
         defaultAuth = a;
     }
@@ -830,8 +833,7 @@
                     InetAddress a1 = InetAddress.getByName(h1);
                     InetAddress a2 = InetAddress.getByName(h2);
                     result[0] = a1.equals(a2);
-                } catch(UnknownHostException e) {
-                } catch(SecurityException e) {
+                } catch(UnknownHostException | SecurityException e) {
                 }
                 return null;
             }
@@ -1336,9 +1338,9 @@
 
                     // Read comments labeled "Failed Negotiate" for details.
                     boolean dontUseNegotiate = false;
-                    Iterator iter = responses.multiValueIterator("Proxy-Authenticate");
+                    Iterator<String> iter = responses.multiValueIterator("Proxy-Authenticate");
                     while (iter.hasNext()) {
-                        String value = ((String)iter.next()).trim();
+                        String value = iter.next().trim();
                         if (value.equalsIgnoreCase("Negotiate") ||
                                 value.equalsIgnoreCase("Kerberos")) {
                             if (!inNegotiateProxy) {
@@ -1414,9 +1416,9 @@
 
                     // Read comments labeled "Failed Negotiate" for details.
                     boolean dontUseNegotiate = false;
-                    Iterator iter = responses.multiValueIterator("WWW-Authenticate");
+                    Iterator<String> iter = responses.multiValueIterator("WWW-Authenticate");
                     while (iter.hasNext()) {
-                        String value = ((String)iter.next()).trim();
+                        String value = iter.next().trim();
                         if (value.equalsIgnoreCase("Negotiate") ||
                                 value.equalsIgnoreCase("Kerberos")) {
                             if (!inNegotiate) {
@@ -1585,9 +1587,8 @@
                                 // HttpsURLConnection instance saved in
                                 // DelegateHttpsURLConnection
                                 uconn = (URLConnection)this.getClass().getField("httpsURLConnection").get(this);
-                                } catch (IllegalAccessException iae) {
-                                    // ignored; use 'this'
-                                } catch (NoSuchFieldException nsfe) {
+                                } catch (IllegalAccessException |
+                                         NoSuchFieldException e) {
                                     // ignored; use 'this'
                                 }
                             }
@@ -1660,7 +1661,7 @@
                         public IOException run() throws Exception {
                             return (IOException)
                                 rememberedException.getClass()
-                                .getConstructor(new Class[] { String.class })
+                                .getConstructor(new Class<?>[] { String.class })
                                 .newInstance(args);
                         }
                     });
@@ -1786,9 +1787,9 @@
                 if (respCode == HTTP_PROXY_AUTH) {
                     // Read comments labeled "Failed Negotiate" for details.
                     boolean dontUseNegotiate = false;
-                    Iterator iter = responses.multiValueIterator("Proxy-Authenticate");
+                    Iterator<String> iter = responses.multiValueIterator("Proxy-Authenticate");
                     while (iter.hasNext()) {
-                        String value = ((String)iter.next()).trim();
+                        String value = iter.next().trim();
                         if (value.equalsIgnoreCase("Negotiate") ||
                                 value.equalsIgnoreCase("Kerberos")) {
                             if (!inNegotiateProxy) {
@@ -1938,6 +1939,7 @@
      * Gets the authentication for an HTTP proxy, and applies it to
      * the connection.
      */
+    @SuppressWarnings("fallthrough")
     private AuthenticationInfo getHttpProxyAuthentication (AuthenticationHeader authhdr) {
         /* get authorization from authenticator */
         AuthenticationInfo ret = null;
@@ -2004,13 +2006,13 @@
                     }
                     break;
                 case NTLM:
-                    if (NTLMAuthenticationProxy.proxy.supported) {
+                    if (NTLMAuthenticationProxy.supported) {
                         /* tryTransparentNTLMProxy will always be true the first
                          * time around, but verify that the platform supports it
                          * otherwise don't try. */
                         if (tryTransparentNTLMProxy) {
                             tryTransparentNTLMProxy =
-                                    NTLMAuthenticationProxy.proxy.supportsTransparentAuth;
+                                    NTLMAuthenticationProxy.supportsTransparentAuth;
                         }
                         a = null;
                         if (tryTransparentNTLMProxy) {
@@ -2043,6 +2045,7 @@
                     break;
                 case UNKNOWN:
                     logger.finest("Unknown/Unsupported authentication scheme: " + scheme);
+                /*fall through*/
                 default:
                     throw new AssertionError("should not reach here");
                 }
@@ -2080,6 +2083,7 @@
      * @param authHdr the AuthenticationHeader which tells what auth scheme is
      * prefered.
      */
+    @SuppressWarnings("fallthrough")
     private AuthenticationInfo getServerAuthentication (AuthenticationHeader authhdr) {
         /* get authorization from authenticator */
         AuthenticationInfo ret = null;
@@ -2150,7 +2154,7 @@
                     }
                     break;
                 case NTLM:
-                    if (NTLMAuthenticationProxy.proxy.supported) {
+                    if (NTLMAuthenticationProxy.supported) {
                         URL url1;
                         try {
                             url1 = new URL (url, "/"); /* truncate the path */
@@ -2163,13 +2167,13 @@
                          * otherwise don't try. */
                         if (tryTransparentNTLMServer) {
                             tryTransparentNTLMServer =
-                                    NTLMAuthenticationProxy.proxy.supportsTransparentAuth;
+                                    NTLMAuthenticationProxy.supportsTransparentAuth;
                             /* If the platform supports transparent authentication
                              * then check if we are in a secure environment
                              * whether, or not, we should try transparent authentication.*/
                             if (tryTransparentNTLMServer) {
                                 tryTransparentNTLMServer =
-                                        NTLMAuthenticationProxy.proxy.isTrustedSite(url);
+                                        NTLMAuthenticationProxy.isTrustedSite(url);
                             }
                         }
                         a = null;
@@ -2198,6 +2202,7 @@
                     break;
                 case UNKNOWN:
                     logger.finest("Unknown/Unsupported authentication scheme: " + scheme);
+                /*fall through*/
                 default:
                     throw new AssertionError("should not reach here");
                 }
@@ -2745,14 +2750,14 @@
          * The cookies in the requests message headers may have
          * been modified. Use the saved user cookies instead.
          */
-        Map userCookiesMap = null;
+        Map<String, List<String>> userCookiesMap = null;
         if (userCookies != null || userCookies2 != null) {
-            userCookiesMap = new HashMap();
+            userCookiesMap = new HashMap<>();
             if (userCookies != null) {
-                userCookiesMap.put("Cookie", userCookies);
+                userCookiesMap.put("Cookie", Arrays.asList(userCookies));
             }
             if (userCookies2 != null) {
-                userCookiesMap.put("Cookie2", userCookies2);
+                userCookiesMap.put("Cookie2", Arrays.asList(userCookies2));
             }
         }
         return requests.filterAndAddHeaders(EXCLUDE_HEADERS2, userCookiesMap);
--- a/src/share/classes/sun/net/www/protocol/http/Negotiator.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/www/protocol/http/Negotiator.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,8 +45,8 @@
         // Makes NegotiatorImpl, and the security classes it references, a
         // runtime dependency rather than a static one.
 
-        Class clazz;
-        Constructor c;
+        Class<?> clazz;
+        Constructor<?> c;
         try {
             clazz = Class.forName("sun.net.www.protocol.http.spnego.NegotiatorImpl", true, null);
             c = clazz.getConstructor(HttpCallerInfo.class);
--- a/src/share/classes/sun/net/www/protocol/https/AbstractDelegateHttpsURLConnection.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/www/protocol/https/AbstractDelegateHttpsURLConnection.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -221,11 +221,11 @@
      */
     public java.security.cert.Certificate[] getLocalCertificates() {
         if (cachedResponse != null) {
-            List l = ((SecureCacheResponse)cachedResponse).getLocalCertificateChain();
+            List<java.security.cert.Certificate> l = ((SecureCacheResponse)cachedResponse).getLocalCertificateChain();
             if (l == null) {
                 return null;
             } else {
-                return (java.security.cert.Certificate[])l.toArray();
+                return l.toArray(new java.security.cert.Certificate[0]);
             }
         }
         if (http == null) {
@@ -243,11 +243,11 @@
     public java.security.cert.Certificate[] getServerCertificates()
             throws SSLPeerUnverifiedException {
         if (cachedResponse != null) {
-            List l = ((SecureCacheResponse)cachedResponse).getServerCertificateChain();
+            List<java.security.cert.Certificate> l = ((SecureCacheResponse)cachedResponse).getServerCertificateChain();
             if (l == null) {
                 return null;
             } else {
-                return (java.security.cert.Certificate[])l.toArray();
+                return l.toArray(new java.security.cert.Certificate[0]);
             }
         }
 
--- a/src/share/classes/sun/net/www/protocol/https/HttpsClient.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/www/protocol/https/HttpsClient.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -529,7 +529,7 @@
                     new BufferedOutputStream(serverSocket.getOutputStream()),
                     false, encoding);
             } catch (UnsupportedEncodingException e) {
-                throw new InternalError(encoding+" encoding not found", e);
+                throw new InternalError(encoding+" encoding not found");
             }
 
             // check URL spoofing if it has not been checked under handshaking
@@ -623,7 +623,7 @@
      */
     @Override
     public void closeIdleConnection() {
-        HttpClient http = (HttpClient) kac.get(url, sslSocketFactory);
+        HttpClient http = kac.get(url, sslSocketFactory);
         if (http != null) {
             http.closeServer();
         }
@@ -681,8 +681,7 @@
             // return the X500Principal of the end-entity cert.
             java.security.cert.Certificate[] certs =
                         session.getPeerCertificates();
-            principal = (X500Principal)
-                ((X509Certificate)certs[0]).getSubjectX500Principal();
+            principal = ((X509Certificate)certs[0]).getSubjectX500Principal();
         }
         return principal;
     }
@@ -703,8 +702,7 @@
             java.security.cert.Certificate[] certs =
                         session.getLocalCertificates();
             if (certs != null) {
-                principal = (X500Principal)
-                    ((X509Certificate)certs[0]).getSubjectX500Principal();
+                principal = ((X509Certificate)certs[0]).getSubjectX500Principal();
             }
         }
         return principal;
--- a/src/share/classes/sun/net/www/protocol/mailto/Handler.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/net/www/protocol/mailto/Handler.java	Wed Oct 26 17:59:13 2011 -0700
@@ -139,6 +139,20 @@
         }
         if (nogood)
             throw new RuntimeException("No email address");
-        setURL(u, protocol, host, port, file, null);
+        setURLHandler(u, protocol, host, port, file, null);
+    }
+
+    /**
+     * This method is used to suppress the deprecated warning
+     *
+     * @param   u the URL to receive the result of parsing the spec
+     * @param   spec the URL string to parse
+     * @param   start the character position to start parsing at.  This is
+     *          just past the ':'.
+     * @param   limit the character position to stop parsing at.
+     */
+    @SuppressWarnings("deprecation")
+    private void setURLHandler(URL u, String protocol, String host, int port, String file, String ref) {
+        setURL(u,protocol,host,port,file,null);
     }
 }
--- a/src/share/classes/sun/security/ec/ECPublicKeyImpl.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/security/ec/ECPublicKeyImpl.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,6 +51,7 @@
      * Construct a key from its components. Used by the
      * ECKeyFactory and SunPKCS11.
      */
+    @SuppressWarnings("deprecation")
     public ECPublicKeyImpl(ECPoint w, ECParameterSpec params)
             throws InvalidKeyException {
         this.w = w;
@@ -85,6 +86,7 @@
 
     // Internal API to get the encoded point. Currently used by SunPKCS11.
     // This may change/go away depending on what we do with the public API.
+    @SuppressWarnings("deprecation")
     public byte[] getEncodedPublicValue() {
         return key.clone();
     }
@@ -92,6 +94,7 @@
     /**
      * Parse the key. Called by X509Key.
      */
+    @SuppressWarnings("deprecation")
     protected void parseKeyBits() throws InvalidKeyException {
         try {
             AlgorithmParameters algParams = this.algid.getParameters();
--- a/src/share/classes/sun/security/jgss/krb5/AcceptSecContextToken.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/security/jgss/krb5/AcceptSecContextToken.java	Wed Oct 26 17:59:13 2011 -0700
@@ -94,7 +94,7 @@
          */
         EncryptionKey subKey = apRep.getSubKey();
         if (subKey != null) {
-            context.setKey(subKey);
+            context.setKey(Krb5Context.ACCEPTOR_SUBKEY, subKey);
             /*
             System.out.println("\n\nSub-Session key from AP-REP is: " +
                                getHexBytes(subKey.getBytes()) + "\n");
--- a/src/share/classes/sun/security/jgss/krb5/InitSecContextToken.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/security/jgss/krb5/InitSecContextToken.java	Wed Oct 26 17:59:13 2011 -0700
@@ -74,9 +74,9 @@
 
         EncryptionKey subKey = apReq.getSubKey();
         if (subKey != null)
-            context.setKey(subKey);
+            context.setKey(Krb5Context.INITIATOR_SUBKEY, subKey);
         else
-            context.setKey(serviceTicket.getSessionKey());
+            context.setKey(Krb5Context.SESSION_KEY, serviceTicket.getSessionKey());
 
         if (!mutualRequired)
             context.resetPeerSequenceNumber(0);
@@ -117,13 +117,13 @@
 
         EncryptionKey subKey = apReq.getSubKey();
         if (subKey != null) {
-            context.setKey(subKey);
+            context.setKey(Krb5Context.INITIATOR_SUBKEY, subKey);
             /*
               System.out.println("Sub-Session key from authenticator is: " +
               getHexBytes(subKey.getBytes()) + "\n");
             */
         } else {
-            context.setKey(sessionKey);
+            context.setKey(Krb5Context.SESSION_KEY, sessionKey);
             //System.out.println("Sub-Session Key Missing in Authenticator.\n");
         }
 
--- a/src/share/classes/sun/security/jgss/krb5/Krb5Context.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/security/jgss/krb5/Krb5Context.java	Wed Oct 26 17:59:13 2011 -0700
@@ -67,6 +67,10 @@
 
     private int state = STATE_NEW;
 
+    public static final int SESSION_KEY = 0;
+    public static final int INITIATOR_SUBKEY = 1;
+    public static final int ACCEPTOR_SUBKEY = 2;
+
     /*
      * Optional features that the application can set and their default
      * values.
@@ -82,6 +86,7 @@
 
     private int mySeqNumber;
     private int peerSeqNumber;
+    private int keySrc;
     private TokenTracker peerTokenTracker;
 
     private CipherHelper cipherHelper = null;
@@ -384,12 +389,17 @@
         }
     }
 
-    final void setKey(EncryptionKey key) throws GSSException {
+    final void setKey(int keySrc, EncryptionKey key) throws GSSException {
         this.key = key;
+        this.keySrc = keySrc;
         // %%% to do: should clear old cipherHelper first
         cipherHelper = new CipherHelper(key);  // Need to use new key
     }
 
+    public final int getKeySrc() {
+        return keySrc;
+    }
+
     private final EncryptionKey getKey() {
         return key;
     }
--- a/src/share/classes/sun/security/jgss/krb5/MessageToken_v2.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/security/jgss/krb5/MessageToken_v2.java	Wed Oct 26 17:59:13 2011 -0700
@@ -141,6 +141,7 @@
     // Context properties
     private boolean confState = true;
     private boolean initiator = true;
+    private boolean have_acceptor_subkey = false;
 
     /* cipher instance used by the corresponding GSSContext */
     CipherHelper cipherHelper = null;
@@ -233,7 +234,6 @@
             }
 
             if (tokenId == Krb5Token.WRAP_ID_v2) {
-                // Does non-confidential data needs a rotate?
                 rotate();
             }
 
@@ -312,8 +312,7 @@
         }
 
         // Create a new gss token header as defined in RFC 4121
-        tokenHeader = new MessageTokenHeader(tokenId,
-                                prop.getPrivacy(), true);
+        tokenHeader = new MessageTokenHeader(tokenId, prop.getPrivacy());
         // debug("\n\t Message Header = " +
         // getHexBytes(tokenHeader.getBytes(), tokenHeader.getBytes().length));
 
@@ -421,10 +420,12 @@
         int conf_flag = tokenHeaderBytes[TOKEN_FLAG_POS] &
                                 FLAG_WRAP_CONFIDENTIAL;
 
-        // clear EC in token header for checksum calculation
+        // clear EC and RRC in token header for checksum calculation
         if ((conf_flag == 0) && (tokenId == WRAP_ID_v2)) {
             tokenHeaderBytes[4] = 0;
             tokenHeaderBytes[5] = 0;
+            tokenHeaderBytes[6] = 0;
+            tokenHeaderBytes[7] = 0;
         }
         return cipherHelper.calculateChecksum(tokenHeaderBytes, data,
                                                 offset, len, key_usage);
@@ -460,6 +461,8 @@
 
         this.initiator = context.isInitiator();
 
+        this.have_acceptor_subkey = context.getKeySrc() == Krb5Context.ACCEPTOR_SUBKEY;
+
         this.cipherHelper = context.getCipherHelper(null);
         //    debug("In MessageToken.Cons");
     }
@@ -500,8 +503,7 @@
          private byte[] bytes = new byte[TOKEN_HEADER_SIZE];
 
          // Writes a new token header
-         public MessageTokenHeader(int tokenId, boolean conf,
-                boolean have_acceptor_subkey) throws GSSException {
+         public MessageTokenHeader(int tokenId, boolean conf) throws GSSException {
 
             this.tokenId = tokenId;
 
--- a/src/share/classes/sun/security/krb5/KrbAsReqBuilder.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/security/krb5/KrbAsReqBuilder.java	Wed Oct 26 17:59:13 2011 -0700
@@ -144,15 +144,18 @@
 
     /**
      * Retrieves an array of secret keys for the client. This is used when
-     * the client supplies password but need keys to act as an acceptor
-     * (in JAAS words, isInitiator=true and storeKey=true)
+     * the client supplies password but need keys to act as an acceptor. For
+     * an initiator, it must be called after AS-REQ is performed (state is OK).
+     * For an acceptor, it can be called when this KrbAsReqBuilder object is
+     * constructed (state is INIT).
+     * @param isInitiator if the caller is an initiator
      * @return generated keys from password. PA-DATA from server might be used.
      * All "default_tkt_enctypes" keys will be generated, Never null.
      * @throws IllegalStateException if not constructed from a password
      * @throws KrbException
      */
-    public EncryptionKey[] getKeys() throws KrbException {
-        checkState(State.REQ_OK, "Cannot get keys");
+    public EncryptionKey[] getKeys(boolean isInitiator) throws KrbException {
+        checkState(isInitiator?State.REQ_OK:State.INIT, "Cannot get keys");
         if (password != null) {
             int[] eTypes = EType.getDefaults("default_tkt_enctypes");
             EncryptionKey[] result = new EncryptionKey[eTypes.length];
--- a/src/share/classes/sun/security/pkcs11/SunPKCS11.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/security/pkcs11/SunPKCS11.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1335,10 +1335,10 @@
                             return null;
                         }
 
-                        Class c = Class.forName
-                                (defaultHandler,
-                                true,
-                                Thread.currentThread().getContextClassLoader());
+                        Class<?> c = Class.forName
+                                   (defaultHandler,
+                                   true,
+                                   Thread.currentThread().getContextClassLoader());
                         return (CallbackHandler)c.newInstance();
                     }
                 });
--- a/src/share/classes/sun/security/validator/PKIXValidator.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/security/validator/PKIXValidator.java	Wed Oct 26 17:59:13 2011 -0700
@@ -327,6 +327,7 @@
      * Set the check date (for debugging).
      */
     private void setDate(PKIXBuilderParameters params) {
+        @SuppressWarnings("deprecation")
         Date date = validationDate;
         if (date != null) {
             params.setDate(date);
--- a/src/share/classes/sun/security/validator/SimpleValidator.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/security/validator/SimpleValidator.java	Wed Oct 26 17:59:13 2011 -0700
@@ -131,6 +131,7 @@
         // make sure chain includes a trusted cert
         chain = buildTrustedChain(chain);
 
+        @SuppressWarnings("deprecation")
         Date date = validationDate;
         if (date == null) {
             date = new Date();
--- a/src/share/classes/sun/security/x509/AVA.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/security/x509/AVA.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1071,8 +1071,17 @@
                  * to need quoting, or at least escaping.  So do leading or
                  * trailing spaces, and multiple internal spaces.
                  */
-                for (int i = 0; i < valStr.length(); i++) {
+                int length = valStr.length();
+                boolean alreadyQuoted =
+                    (length > 1 && valStr.charAt(0) == '\"'
+                     && valStr.charAt(length - 1) == '\"');
+
+                for (int i = 0; i < length; i++) {
                     char c = valStr.charAt(i);
+                    if (alreadyQuoted && (i == 0 || i == length - 1)) {
+                        sbuffer.append(c);
+                        continue;
+                    }
                     if (DerValue.isPrintableStringChar(c) ||
                         escapees.indexOf(c) >= 0) {
 
@@ -1136,7 +1145,8 @@
                 }
 
                 // Emit the string ... quote it if needed
-                if (quoteNeeded) {
+                // if string is already quoted, don't re-quote
+                if (!alreadyQuoted && quoteNeeded) {
                     retval.append("\"" + sbuffer.toString() + "\"");
                 } else {
                     retval.append(sbuffer.toString());
--- a/src/share/classes/sun/security/x509/X509CertImpl.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/security/x509/X509CertImpl.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1323,7 +1323,7 @@
 
                 for (Extension ex : exts.getAllExtensions()) {
                     ObjectIdentifier inCertOID = ex.getExtensionId();
-                    if (inCertOID.equals(findOID)) {
+                    if (inCertOID.equals((Object)findOID)) {
                         certExt = ex;
                         break;
                     }
--- a/src/share/classes/sun/swing/FilePane.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/swing/FilePane.java	Wed Oct 26 17:59:13 2011 -0700
@@ -35,6 +35,7 @@
 import java.util.List;
 import java.util.concurrent.Callable;
 
+import javax.accessibility.AccessibleContext;
 import javax.swing.*;
 import javax.swing.border.*;
 import javax.swing.event.*;
@@ -82,6 +83,9 @@
     private JPanel currentViewPanel;
     private String[] viewTypeActionNames;
 
+    private String filesListAccessibleName = null;
+    private String filesDetailsAccessibleName = null;
+
     private JPopupMenu contextMenu;
     private JMenu viewMenu;
 
@@ -450,6 +454,9 @@
         gigaByteString = UIManager.getString("FileChooser.fileSizeGigaBytes", l);
         fullRowSelection = UIManager.getBoolean("FileView.fullRowSelection");
 
+        filesListAccessibleName = UIManager.getString("FileChooser.filesListAccessibleName", l);
+        filesDetailsAccessibleName = UIManager.getString("FileChooser.filesDetailsAccessibleName", l);
+
         renameErrorTitleText = UIManager.getString("FileChooser.renameErrorTitleText", l);
         renameErrorText = UIManager.getString("FileChooser.renameErrorText", l);
         renameErrorFileExistsText = UIManager.getString("FileChooser.renameErrorFileExistsText", l);
@@ -634,6 +641,9 @@
         if (listViewBorder != null) {
             scrollpane.setBorder(listViewBorder);
         }
+
+        list.putClientProperty(AccessibleContext.ACCESSIBLE_NAME_PROPERTY, filesListAccessibleName);
+
         p.add(scrollpane, BorderLayout.CENTER);
         return p;
     }
@@ -1228,6 +1238,8 @@
 
         detailsTableModel.fireTableStructureChanged();
 
+        detailsTable.putClientProperty(AccessibleContext.ACCESSIBLE_NAME_PROPERTY, filesDetailsAccessibleName);
+
         return p;
     } // createDetailsView
 
--- a/src/share/classes/sun/tools/jar/JarImageSource.java	Mon Oct 24 09:58:47 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  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.jar;
-
-import sun.awt.image.URLImageSource;
-import sun.awt.image.ImageDecoder;
-import java.net.URL;
-import java.net.JarURLConnection;
-import java.util.jar.JarFile;
-import java.util.jar.JarEntry;
-import java.io.InputStream;
-import java.io.IOException;
-
-
-public class JarImageSource extends URLImageSource {
-    String mimeType;
-    String entryName = null;
-    URL url;
-
-    /**
-     * Create an image source from a Jar entry URL with the specified
-     * mime type.
-     */
-    public JarImageSource(URL u, String type) {
-        super(u);
-        url = u;
-        mimeType = type;
-    }
-
-    /**
-     * Create an image source from a Jar file/entry URL
-     * with the specified entry name and mime type.
-     */
-    public JarImageSource(URL u, String name, String type) {
-        this(u, type);
-        this.entryName = name;
-    }
-
-    protected ImageDecoder getDecoder() {
-        InputStream is = null;
-        try {
-            JarURLConnection c = (JarURLConnection)url.openConnection();
-            JarFile f = c.getJarFile();
-            JarEntry e = c.getJarEntry();
-
-            if (entryName != null && e == null) {
-                e = f.getJarEntry(entryName);
-            }
-            if (e == null || (e != null && entryName != null
-                              && (!(entryName.equals(e.getName()))))) {
-                return null;
-            }
-            is = f.getInputStream(e);
-        } catch (IOException e) {
-            return null;
-        }
-
-        ImageDecoder id = decoderForType(is, mimeType);
-        if (id == null) {
-            id = getDecoder(is);
-        }
-        return id;
-    }
-}
--- a/src/share/classes/sun/util/LocaleServiceProviderPool.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/util/LocaleServiceProviderPool.java	Wed Oct 26 17:59:13 2011 -0700
@@ -40,6 +40,7 @@
 import java.util.ServiceLoader;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
 import java.util.spi.LocaleServiceProvider;
 
 import sun.util.logging.PlatformLogger;
@@ -57,8 +58,8 @@
      * A Map that holds singleton instances of this class.  Each instance holds a
      * set of provider implementations of a particular locale sensitive service.
      */
-    private static Map<Class, LocaleServiceProviderPool> poolOfPools =
-        new ConcurrentHashMap<Class, LocaleServiceProviderPool>();
+    private static ConcurrentMap<Class, LocaleServiceProviderPool> poolOfPools =
+        new ConcurrentHashMap<>();
 
     /**
      * A Set containing locale service providers that implement the
@@ -109,7 +110,7 @@
         if (pool == null) {
             LocaleServiceProviderPool newPool =
                 new LocaleServiceProviderPool(providerClass);
-            pool = poolOfPools.put(providerClass, newPool);
+            pool = poolOfPools.putIfAbsent(providerClass, newPool);
             if (pool == null) {
                 pool = newPool;
             }
@@ -257,10 +258,11 @@
             synchronized (LocaleServiceProviderPool.class) {
                 if (availableJRELocales == null) {
                     Locale[] allLocales = LocaleData.getAvailableLocales();
-                    availableJRELocales = new ArrayList<Locale>(allLocales.length);
+                    List<Locale> tmpList = new ArrayList<>(allLocales.length);
                     for (Locale locale : allLocales) {
-                        availableJRELocales.add(getLookupLocale(locale));
+                        tmpList.add(getLookupLocale(locale));
                     }
+                    availableJRELocales = tmpList;
                 }
             }
         }
--- a/src/share/classes/sun/util/resources/TimeZoneNames.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/util/resources/TimeZoneNames.java	Wed Oct 26 17:59:13 2011 -0700
@@ -159,8 +159,6 @@
                                       "Pohnpei Summer Time", "PONST"};
         String PST[] = new String[] {"Pacific Standard Time", "PST",
                                      "Pacific Daylight Time", "PDT"};
-        String RST[] = new String[] {"Eastern Standard Time", "EST",
-                                     "Central Daylight Time", "CDT"};
         String SAST[] = new String[] {"South Africa Standard Time", "SAST",
                                       "South Africa Summer Time", "SAST"};
         String SBT[] = new String[] {"Solomon Is. Time", "SBT",
@@ -262,6 +260,7 @@
             {"Africa/Gaborone", CAT},
             {"Africa/Harare", CAT},
             {"Africa/Johannesburg", SAST},
+            {"Africa/Juba", EAT},
             {"Africa/Kampala", EAT},
             {"Africa/Khartoum", EAT},
             {"Africa/Kigali", CAT},
@@ -378,11 +377,13 @@
             {"America/Kentucky/Louisville", EST},
             {"America/Kentucky/Monticello", EST},
             {"America/Knox_IN", CST},
+            {"America/Kralendijk", AST},
             {"America/La_Paz", new String[] {"Bolivia Time", "BOT",
                                              "Bolivia Summer Time", "BOST"}},
             {"America/Lima", new String[] {"Peru Time", "PET",
                                            "Peru Summer Time", "PEST"}},
             {"America/Louisville", EST},
+            {"America/Lower_Princes", AST},
             {"America/Maceio", BRT},
             {"America/Managua", CST},
             {"America/Manaus", AMT},
@@ -425,7 +426,7 @@
             {"America/Rankin_Inlet", CST},
             {"America/Recife", BRT},
             {"America/Regina", CST},
-            {"America/Resolute", RST},
+            {"America/Resolute", CST},
             {"America/Rio_Branco", AMT},
             {"America/Rosario", AGT},
             {"America/Santa_Isabel", PST},
@@ -673,7 +674,8 @@
             {"Europe/Isle_of_Man", GMTBST},
             {"Europe/Istanbul", EET},
             {"Europe/Jersey", GMTBST},
-            {"Europe/Kaliningrad", EET},
+            {"Europe/Kaliningrad", new String[] {"Kaliningrad Time", "KALT",
+                                                 "Kaliningrad Summer Time", "KALST"}},
             {"Europe/Kiev", EET},
             {"Europe/Lisbon", WET},
             {"Europe/Ljubljana", CET},
--- a/src/share/classes/sun/util/resources/TimeZoneNames_de.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/util/resources/TimeZoneNames_de.java	Wed Oct 26 17:59:13 2011 -0700
@@ -159,8 +159,6 @@
                                       "Pohnpei Summer Time", "PONST"};
         String PST[] = new String[] {"Pazifische Normalzeit", "PST",
                                      "Pazifische Sommerzeit", "PDT"};
-        String RST[] = new String[] {"\u00d6stliche Normalzeit", "EST",
-                                     "Zentrale Sommerzeit", "CDT"};
         String SAST[] = new String[] {"S\u00fcdafrikanische Normalzeit", "SAST",
                                       "S\u00fcdafrikanische Sommerzeit", "SAST"};
         String SBT[] = new String[] {"Salomoninseln Zeit", "SBT",
@@ -262,6 +260,7 @@
             {"Africa/Gaborone", CAT},
             {"Africa/Harare", CAT},
             {"Africa/Johannesburg", SAST},
+            {"Africa/Juba", EAT},
             {"Africa/Kampala", EAT},
             {"Africa/Khartoum", EAT},
             {"Africa/Kigali", CAT},
@@ -378,11 +377,13 @@
             {"America/Kentucky/Louisville", EST},
             {"America/Kentucky/Monticello", EST},
             {"America/Knox_IN", CST},
+            {"America/Kralendijk", AST},
             {"America/La_Paz", new String[] {"Bolivianische Zeit", "BOT",
                                              "Bolivianische Sommerzeit", "BOST"}},
             {"America/Lima", new String[] {"Peruanische Zeit", "PET",
                                            "Peruanische Sommerzeit", "PEST"}},
             {"America/Louisville", EST},
+            {"America/Lower_Princes", AST},
             {"America/Maceio", BRT},
             {"America/Managua", CST},
             {"America/Manaus", AMT},
@@ -425,7 +426,7 @@
             {"America/Rankin_Inlet", CST},
             {"America/Recife", BRT},
             {"America/Regina", CST},
-            {"America/Resolute", RST},
+            {"America/Resolute", CST},
             {"America/Rio_Branco", AMT},
             {"America/Rosario", AGT},
             {"America/Santa_Isabel", PST},
@@ -673,7 +674,8 @@
             {"Europe/Isle_of_Man", GMTBST},
             {"Europe/Istanbul", EET},
             {"Europe/Jersey", GMTBST},
-            {"Europe/Kaliningrad", EET},
+            {"Europe/Kaliningrad", new String[] {"Kaliningrad Time", "KALT",
+                                                 "Kaliningrad Summer Time", "KALST"}},
             {"Europe/Kiev", EET},
             {"Europe/Lisbon", WET},
             {"Europe/Ljubljana", CET},
--- a/src/share/classes/sun/util/resources/TimeZoneNames_es.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/util/resources/TimeZoneNames_es.java	Wed Oct 26 17:59:13 2011 -0700
@@ -159,8 +159,6 @@
                                       "Pohnpei Summer Time", "PONST"};
         String PST[] = new String[] {"Hora est\u00e1ndar del Pac\u00edfico", "PST",
                                      "Hora de verano del Pac\u00edfico", "PDT"};
-        String RST[] = new String[] {"Hora est\u00e1ndar Oriental", "EST",
-                                     "Hora de verano Central", "CDT"};
         String SAST[] = new String[] {"Hora est\u00e1ndar de Sud\u00e1frica", "SAST",
                                       "Hora de verano de Sud\u00e1frica", "SAST"};
         String SBT[] = new String[] {"Hora de las Islas Solomon", "SBT",
@@ -262,6 +260,7 @@
             {"Africa/Gaborone", CAT},
             {"Africa/Harare", CAT},
             {"Africa/Johannesburg", SAST},
+            {"Africa/Juba", EAT},
             {"Africa/Kampala", EAT},
             {"Africa/Khartoum", EAT},
             {"Africa/Kigali", CAT},
@@ -378,11 +377,13 @@
             {"America/Kentucky/Louisville", EST},
             {"America/Kentucky/Monticello", EST},
             {"America/Knox_IN", CST},
+            {"America/Kralendijk", AST},
             {"America/La_Paz", new String[] {"Hora de Bolivia", "BOT",
                                              "Hora de verano de Bolivia", "BOST"}},
             {"America/Lima", new String[] {"Hora de Per\u00fa", "PET",
                                            "Hora de verano de Per\u00fa", "PEST"}},
             {"America/Louisville", EST},
+            {"America/Lower_Princes", AST},
             {"America/Maceio", BRT},
             {"America/Managua", CST},
             {"America/Manaus", AMT},
@@ -425,7 +426,7 @@
             {"America/Rankin_Inlet", CST},
             {"America/Recife", BRT},
             {"America/Regina", CST},
-            {"America/Resolute", RST},
+            {"America/Resolute", CST},
             {"America/Rio_Branco", AMT},
             {"America/Rosario", AGT},
             {"America/Santa_Isabel", PST},
@@ -673,7 +674,8 @@
             {"Europe/Isle_of_Man", GMTBST},
             {"Europe/Istanbul", EET},
             {"Europe/Jersey", GMTBST},
-            {"Europe/Kaliningrad", EET},
+            {"Europe/Kaliningrad", new String[] {"Kaliningrad Time", "KALT",
+                                                 "Kaliningrad Summer Time", "KALST"}},
             {"Europe/Kiev", EET},
             {"Europe/Lisbon", WET},
             {"Europe/Ljubljana", CET},
--- a/src/share/classes/sun/util/resources/TimeZoneNames_fr.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/util/resources/TimeZoneNames_fr.java	Wed Oct 26 17:59:13 2011 -0700
@@ -159,8 +159,6 @@
                                       "Pohnpei Summer Time", "PONST"};
         String PST[] = new String[] {"Heure normale du Pacifique", "PST",
                                      "Heure avanc\u00e9e du Pacifique", "PDT"} ;
-        String RST[] = new String[] {"Heure normale de l'Est", "EST",
-                                     "Heure avanc\u00e9e du Centre", "CDT"} ;
         String SAST[] = new String[] {"Heure normale d'Afrique du Sud", "SAST",
                                       "Heure d'\u00e9t\u00e9 d'Afrique du Sud", "SAST"} ;
         String SBT[] = new String[] {"Heure des \u00celes Salomon", "SBT",
@@ -262,6 +260,7 @@
             {"Africa/Gaborone", CAT},
             {"Africa/Harare", CAT},
             {"Africa/Johannesburg", SAST},
+            {"Africa/Juba", EAT},
             {"Africa/Kampala", EAT},
             {"Africa/Khartoum", EAT},
             {"Africa/Kigali", CAT},
@@ -378,11 +377,13 @@
             {"America/Kentucky/Louisville", EST},
             {"America/Kentucky/Monticello", EST},
             {"America/Knox_IN", CST},
+            {"America/Kralendijk", AST},
             {"America/La_Paz", new String[] {"Heure de Bolivie", "BOT",
                                              "Heure d'\u00e9t\u00e9 de Bolivie", "BOST"}},
             {"America/Lima", new String[] {"Heure du P\u00e9rou", "PET",
                                            "Heure d'\u00e9t\u00e9 du P\u00e9rou", "PEST"}},
             {"America/Louisville", EST},
+            {"America/Lower_Princes", AST},
             {"America/Maceio", BRT},
             {"America/Managua", CST},
             {"America/Manaus", AMT},
@@ -425,7 +426,7 @@
             {"America/Rankin_Inlet", CST},
             {"America/Recife", BRT},
             {"America/Regina", CST},
-            {"America/Resolute", RST},
+            {"America/Resolute", CST},
             {"America/Rio_Branco", AMT},
             {"America/Rosario", AGT},
             {"America/Santa_Isabel", PST},
@@ -673,7 +674,8 @@
             {"Europe/Isle_of_Man", GMTBST},
             {"Europe/Istanbul", EET},
             {"Europe/Jersey", GMTBST},
-            {"Europe/Kaliningrad", EET},
+            {"Europe/Kaliningrad", new String[] {"Kaliningrad Time", "KALT",
+                                                 "Kaliningrad Summer Time", "KALST"}},
             {"Europe/Kiev", EET},
             {"Europe/Lisbon", WET},
             {"Europe/Ljubljana", CET},
--- a/src/share/classes/sun/util/resources/TimeZoneNames_it.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/util/resources/TimeZoneNames_it.java	Wed Oct 26 17:59:13 2011 -0700
@@ -159,8 +159,6 @@
                                       "Pohnpei Summer Time", "PONST"};
         String PST[] = new String[] {"Ora solare della costa occidentale USA", "PST",
                                      "Ora legale della costa occidentale USA", "PDT"};
-        String RST[] = new String[] {"Ora solare USA orientale", "EST",
-                                     "Ora legale USA centrale", "CDT"};
         String SAST[] = new String[] {"Ora solare del Sudafrica", "SAST",
                                       "Ora estiva del Sudafrica", "SAST"};
         String SBT[] = new String[] {"Ora delle Isole Salomone", "SBT",
@@ -262,6 +260,7 @@
             {"Africa/Gaborone", CAT},
             {"Africa/Harare", CAT},
             {"Africa/Johannesburg", SAST},
+            {"Africa/Juba", EAT},
             {"Africa/Kampala", EAT},
             {"Africa/Khartoum", EAT},
             {"Africa/Kigali", CAT},
@@ -378,11 +377,13 @@
             {"America/Kentucky/Louisville", EST},
             {"America/Kentucky/Monticello", EST},
             {"America/Knox_IN", CST},
+            {"America/Kralendijk", AST},
             {"America/La_Paz", new String[] {"Ora della Bolivia", "BOT",
                                              "Ora estiva della Bolivia", "BOST"}},
             {"America/Lima", new String[] {"Ora del Per\u00f9", "PET",
                                            "Ora estiva del Per\u00f9", "PEST"}},
             {"America/Louisville", EST},
+            {"America/Lower_Princes", AST},
             {"America/Maceio", BRT},
             {"America/Managua", CST},
             {"America/Manaus", AMT},
@@ -425,7 +426,7 @@
             {"America/Rankin_Inlet", CST},
             {"America/Recife", BRT},
             {"America/Regina", CST},
-            {"America/Resolute", RST},
+            {"America/Resolute", CST},
             {"America/Rio_Branco", AMT},
             {"America/Rosario", AGT},
             {"America/Santa_Isabel", PST},
@@ -673,7 +674,8 @@
             {"Europe/Isle_of_Man", GMTBST},
             {"Europe/Istanbul", EET},
             {"Europe/Jersey", GMTBST},
-            {"Europe/Kaliningrad", EET},
+            {"Europe/Kaliningrad", new String[] {"Kaliningrad Time", "KALT",
+                                                 "Kaliningrad Summer Time", "KALST"}},
             {"Europe/Kiev", EET},
             {"Europe/Lisbon", WET},
             {"Europe/Ljubljana", CET},
--- a/src/share/classes/sun/util/resources/TimeZoneNames_ja.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/util/resources/TimeZoneNames_ja.java	Wed Oct 26 17:59:13 2011 -0700
@@ -159,8 +159,6 @@
                                       "Pohnpei Summer Time", "PONST"};
         String PST[] = new String[] {"\u592a\u5e73\u6d0b\u6a19\u6e96\u6642", "PST",
                                      "\u592a\u5e73\u6d0b\u590f\u6642\u9593", "PDT"};
-        String RST[] = new String[] {"\u6771\u90e8\u6a19\u6e96\u6642", "EST",
-                                     "\u4e2d\u90e8\u590f\u6642\u9593", "CDT"};
         String SAST[] = new String[] {"\u5357\u30a2\u30d5\u30ea\u30ab\u6a19\u6e96\u6642", "SAST",
                                       "\u5357\u30a2\u30d5\u30ea\u30ab\u590f\u6642\u9593", "SAST"};
         String SBT[] = new String[] {"\u30bd\u30ed\u30e2\u30f3\u8af8\u5cf6\u6642\u9593", "SBT",
@@ -262,6 +260,7 @@
             {"Africa/Gaborone", CAT},
             {"Africa/Harare", CAT},
             {"Africa/Johannesburg", SAST},
+            {"Africa/Juba", EAT},
             {"Africa/Kampala", EAT},
             {"Africa/Khartoum", EAT},
             {"Africa/Kigali", CAT},
@@ -378,11 +377,13 @@
             {"America/Kentucky/Louisville", EST},
             {"America/Kentucky/Monticello", EST},
             {"America/Knox_IN", CST},
+            {"America/Kralendijk", AST},
             {"America/La_Paz", new String[] {"\u30dc\u30ea\u30d3\u30a2\u6642\u9593", "BOT",
                                              "\u30dc\u30ea\u30d3\u30a2\u590f\u6642\u9593", "BOST"}},
             {"America/Lima", new String[] {"\u30da\u30eb\u30fc\u6642\u9593", "PET",
                                            "\u30da\u30eb\u30fc\u590f\u6642\u9593", "PEST"}},
             {"America/Louisville", EST},
+            {"America/Lower_Princes", AST},
             {"America/Maceio", BRT},
             {"America/Managua", CST},
             {"America/Manaus", AMT},
@@ -425,7 +426,7 @@
             {"America/Rankin_Inlet", CST},
             {"America/Recife", BRT},
             {"America/Regina", CST},
-            {"America/Resolute", RST},
+            {"America/Resolute", CST},
             {"America/Rio_Branco", AMT},
             {"America/Rosario", AGT},
             {"America/Santa_Isabel", PST},
@@ -673,7 +674,8 @@
             {"Europe/Isle_of_Man", GMTBST},
             {"Europe/Istanbul", EET},
             {"Europe/Jersey", GMTBST},
-            {"Europe/Kaliningrad", EET},
+            {"Europe/Kaliningrad", new String[] {"Kaliningrad Time", "KALT",
+                                                 "Kaliningrad Summer Time", "KALST"}},
             {"Europe/Kiev", EET},
             {"Europe/Lisbon", WET},
             {"Europe/Ljubljana", CET},
--- a/src/share/classes/sun/util/resources/TimeZoneNames_ko.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/util/resources/TimeZoneNames_ko.java	Wed Oct 26 17:59:13 2011 -0700
@@ -159,8 +159,6 @@
                                       "Pohnpei Summer Time", "PONST"};
         String PST[] = new String[] {"\ud0dc\ud3c9\uc591 \ud45c\uc900\uc2dc", "PST",
                                      "\ud0dc\ud3c9\uc591 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "PDT"};
-        String RST[] = new String[] {"\ub3d9\ubd80 \ud45c\uc900\uc2dc", "EST",
-                                     "\uc911\ubd80 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "CDT"};
         String SAST[] = new String[] {"\ub0a8\uc544\ud504\ub9ac\uce74 \ud45c\uc900\uc2dc", "SAST",
                                       "\ub0a8\uc544\ud504\ub9ac\uce74 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "SAST"};
         String SBT[] = new String[] {"\uc194\ub85c\ubaac \uad70\ub3c4 \uc2dc\uac04", "SBT",
@@ -262,6 +260,7 @@
             {"Africa/Gaborone", CAT},
             {"Africa/Harare", CAT},
             {"Africa/Johannesburg", SAST},
+            {"Africa/Juba", EAT},
             {"Africa/Kampala", EAT},
             {"Africa/Khartoum", EAT},
             {"Africa/Kigali", CAT},
@@ -378,11 +377,13 @@
             {"America/Kentucky/Louisville", EST},
             {"America/Kentucky/Monticello", EST},
             {"America/Knox_IN", CST},
+            {"America/Kralendijk", AST},
             {"America/La_Paz", new String[] {"\ubcfc\ub9ac\ube44\uc544 \uc2dc\uac04", "BOT",
                                             "\ubcfc\ub9ac\ube44\uc544 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "BOST"}},
             {"America/Lima", new String[] {"\ud398\ub8e8 \uc2dc\uac04", "PET",
                                             "\ud398\ub8e8 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "PEST"}},
             {"America/Louisville", EST},
+            {"America/Lower_Princes", AST},
             {"America/Maceio", BRT},
             {"America/Managua", CST},
             {"America/Manaus", AMT},
@@ -425,7 +426,7 @@
             {"America/Rankin_Inlet", CST},
             {"America/Recife", BRT},
             {"America/Regina", CST},
-            {"America/Resolute", RST},
+            {"America/Resolute", CST},
             {"America/Rio_Branco", AMT},
             {"America/Rosario", AGT},
             {"America/Santa_Isabel", PST},
@@ -673,7 +674,8 @@
             {"Europe/Isle_of_Man", GMTBST},
             {"Europe/Istanbul", EET},
             {"Europe/Jersey", GMTBST},
-            {"Europe/Kaliningrad", EET},
+            {"Europe/Kaliningrad", new String[] {"Kaliningrad Time", "KALT",
+                                                 "Kaliningrad Summer Time", "KALST"}},
             {"Europe/Kiev", EET},
             {"Europe/Lisbon", WET},
             {"Europe/Ljubljana", CET},
--- a/src/share/classes/sun/util/resources/TimeZoneNames_pt_BR.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/util/resources/TimeZoneNames_pt_BR.java	Wed Oct 26 17:59:13 2011 -0700
@@ -157,8 +157,6 @@
                                       "Fuso hor\u00e1rio de ver\u00e3o de Pohnpei", "PONST"};
         String PST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do Pac\u00edfico", "PST",
                                      "Hor\u00e1rio de luz natural do Pac\u00edfico", "PDT"};
-        String RST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o oriental", "EST",
-                                     "Hor\u00e1rio de luz natural central", "CDT"};
         String SAST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o da \u00c1frica do Sul", "SAST",
                                       "Fuso hor\u00e1rio de ver\u00e3o da \u00c1frica do Sul", "SAST"};
         String SBT[] = new String[] {"Fuso hor\u00e1rio das Ilhas Salom\u00e3o", "SBT",
@@ -262,6 +260,7 @@
             {"Africa/Gaborone", CAT},
             {"Africa/Harare", CAT},
             {"Africa/Johannesburg", SAST},
+            {"Africa/Juba", EAT},
             {"Africa/Kampala", EAT},
             {"Africa/Khartoum", EAT},
             {"Africa/Kigali", CAT},
@@ -378,11 +377,13 @@
             {"America/Kentucky/Louisville", EST},
             {"America/Kentucky/Monticello", EST},
             {"America/Knox_IN", CST},
+            {"America/Kralendijk", AST},
             {"America/La_Paz", new String[] {"Fuso hor\u00e1rio da Bol\u00edvia", "BOT",
                                              "Fuso hor\u00e1rio de ver\u00e3o da Bol\u00edvia", "BOST"}},
             {"America/Lima", new String[] {"Fuso hor\u00e1rio do Peru", "PET",
                                            "Fuso hor\u00e1rio de ver\u00e3o do Peru", "PEST"}},
             {"America/Louisville", EST},
+            {"America/Lower_Princes", AST},
             {"America/Maceio", BRT},
             {"America/Managua", CST},
             {"America/Manaus", AMT},
@@ -425,7 +426,7 @@
             {"America/Rankin_Inlet", CST},
             {"America/Recife", BRT},
             {"America/Regina", CST},
-            {"America/Resolute", RST},
+            {"America/Resolute", CST},
             {"America/Rio_Branco", AMT},
             {"America/Rosario", AGT},
             {"America/Santa_Isabel", PST},
@@ -673,7 +674,8 @@
             {"Europe/Isle_of_Man", GMTBST},
             {"Europe/Istanbul", EET},
             {"Europe/Jersey", GMTBST},
-            {"Europe/Kaliningrad", EET},
+            {"Europe/Kaliningrad", new String[] {"Kaliningrad Time", "KALT",
+                                                 "Kaliningrad Summer Time", "KALST"}},
             {"Europe/Kiev", EET},
             {"Europe/Lisbon", WET},
             {"Europe/Ljubljana", CET},
--- a/src/share/classes/sun/util/resources/TimeZoneNames_sv.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/util/resources/TimeZoneNames_sv.java	Wed Oct 26 17:59:13 2011 -0700
@@ -159,8 +159,6 @@
                                       "Pohnpei Summer Time", "PONST"};
         String PST[] = new String[] {"Stilla havet, normaltid", "PST",
                                      "Stilla havet, sommartid", "PDT"};
-        String RST[] = new String[] {"Eastern, normaltid", "EST",
-                                     "Central sommartid", "CDT"};
         String SAST[] = new String[] {"Sydafrika, normaltid", "SAST",
                                       "Sydafrika, sommartid", "SAST"};
         String SBT[] = new String[] {"Salomon\u00f6arna, normaltid", "SBT",
@@ -262,6 +260,7 @@
             {"Africa/Gaborone", CAT},
             {"Africa/Harare", CAT},
             {"Africa/Johannesburg", SAST},
+            {"Africa/Juba", EAT},
             {"Africa/Kampala", EAT},
             {"Africa/Khartoum", EAT},
             {"Africa/Kigali", CAT},
@@ -378,11 +377,13 @@
             {"America/Kentucky/Louisville", EST},
             {"America/Kentucky/Monticello", EST},
             {"America/Knox_IN", CST},
+            {"America/Kralendijk", AST},
             {"America/La_Paz", new String[] {"Bolivia, normaltid", "BOT",
                                              "Bolivia, sommartid", "BOST"}},
             {"America/Lima", new String[] {"Peru, normaltid", "PET",
                                            "Peru, sommartid", "PEST"}},
             {"America/Louisville", EST},
+            {"America/Lower_Princes", AST},
             {"America/Maceio", BRT},
             {"America/Managua", CST},
             {"America/Manaus", AMT},
@@ -425,7 +426,7 @@
             {"America/Rankin_Inlet", CST},
             {"America/Recife", BRT},
             {"America/Regina", CST},
-            {"America/Resolute", RST},
+            {"America/Resolute", CST},
             {"America/Rio_Branco", AMT},
             {"America/Rosario", AGT},
             {"America/Santa_Isabel", PST},
@@ -673,7 +674,8 @@
             {"Europe/Isle_of_Man", GMTBST},
             {"Europe/Istanbul", EET},
             {"Europe/Jersey", GMTBST},
-            {"Europe/Kaliningrad", EET},
+            {"Europe/Kaliningrad", new String[] {"Kaliningrad Time", "KALT",
+                                                 "Kaliningrad Summer Time", "KALST"}},
             {"Europe/Kiev", EET},
             {"Europe/Lisbon", WET},
             {"Europe/Ljubljana", CET},
--- a/src/share/classes/sun/util/resources/TimeZoneNames_zh_CN.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/util/resources/TimeZoneNames_zh_CN.java	Wed Oct 26 17:59:13 2011 -0700
@@ -159,8 +159,6 @@
                                       "Pohnpei Summer Time", "PONST"};
         String PST[] = new String[] {"\u592a\u5e73\u6d0b\u6807\u51c6\u65f6\u95f4", "PST",
                                      "\u592a\u5e73\u6d0b\u590f\u4ee4\u65f6", "PDT"};
-        String RST[] = new String[] {"\u4e1c\u90e8\u6807\u51c6\u65f6\u95f4", "EST",
-                                     "\u4e2d\u592e\u590f\u4ee4\u65f6", "CDT"};
         String SAST[] = new String[] {"\u5357\u975e\u6807\u51c6\u65f6\u95f4", "SAST",
                                       "\u5357\u975e\u590f\u4ee4\u65f6", "SAST"};
         String SBT[] = new String[] {"\u6240\u7f57\u95e8\u7fa4\u5c9b\u65f6\u95f4", "SBT",
@@ -262,6 +260,7 @@
             {"Africa/Gaborone", CAT},
             {"Africa/Harare", CAT},
             {"Africa/Johannesburg", SAST},
+            {"Africa/Juba", EAT},
             {"Africa/Kampala", EAT},
             {"Africa/Khartoum", EAT},
             {"Africa/Kigali", CAT},
@@ -378,11 +377,13 @@
             {"America/Kentucky/Louisville", EST},
             {"America/Kentucky/Monticello", EST},
             {"America/Knox_IN", CST},
+            {"America/Kralendijk", AST},
             {"America/La_Paz", new String[] {"\u73bb\u5229\u7ef4\u4e9a\u65f6\u95f4", "BOT",
                                              "\u73bb\u5229\u7ef4\u4e9a\u590f\u4ee4\u65f6", "BOST"}},
             {"America/Lima", new String[] {"\u79d8\u9c81\u65f6\u95f4", "PET",
                                            "\u79d8\u9c81\u590f\u4ee4\u65f6", "PEST"}},
             {"America/Louisville", EST},
+            {"America/Lower_Princes", AST},
             {"America/Maceio", BRT},
             {"America/Managua", CST},
             {"America/Manaus", AMT},
@@ -425,7 +426,7 @@
             {"America/Rankin_Inlet", CST},
             {"America/Recife", BRT},
             {"America/Regina", CST},
-            {"America/Resolute", RST},
+            {"America/Resolute", CST},
             {"America/Rio_Branco", AMT},
             {"America/Rosario", AGT},
             {"America/Santa_Isabel", PST},
@@ -673,7 +674,8 @@
             {"Europe/Isle_of_Man", GMTBST},
             {"Europe/Istanbul", EET},
             {"Europe/Jersey", GMTBST},
-            {"Europe/Kaliningrad", EET},
+            {"Europe/Kaliningrad", new String[] {"Kaliningrad Time", "KALT",
+                                                 "Kaliningrad Summer Time", "KALST"}},
             {"Europe/Kiev", EET},
             {"Europe/Lisbon", WET},
             {"Europe/Ljubljana", CET},
--- a/src/share/classes/sun/util/resources/TimeZoneNames_zh_TW.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/share/classes/sun/util/resources/TimeZoneNames_zh_TW.java	Wed Oct 26 17:59:13 2011 -0700
@@ -159,8 +159,6 @@
                                       "Pohnpei Summer Time", "PONST"};
         String PST[] = new String[] {"\u592a\u5e73\u6d0b\u6a19\u6e96\u6642\u9593", "PST",
                                      "\u592a\u5e73\u6d0b\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "PDT"};
-        String RST[] = new String[] {"\u6771\u65b9\u6a19\u6e96\u6642\u9593", "EST",
-                                     "\u4e2d\u592e\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "CDT"};
         String SAST[] = new String[] {"\u5357\u975e\u6a19\u6e96\u6642\u9593", "SAST",
                                       "\u5357\u975e\u590f\u4ee4\u6642\u9593", "SAST"};
         String SBT[] = new String[] {"\u6240\u7f85\u9580\u7fa4\u5cf6\u6642\u9593", "SBT",
@@ -262,6 +260,7 @@
             {"Africa/Gaborone", CAT},
             {"Africa/Harare", CAT},
             {"Africa/Johannesburg", SAST},
+            {"Africa/Juba", EAT},
             {"Africa/Kampala", EAT},
             {"Africa/Khartoum", EAT},
             {"Africa/Kigali", CAT},
@@ -378,11 +377,13 @@
             {"America/Kentucky/Louisville", EST},
             {"America/Kentucky/Monticello", EST},
             {"America/Knox_IN", CST},
+            {"America/Kralendijk", AST},
             {"America/La_Paz", new String[] {"\u73bb\u5229\u7dad\u4e9e\u6642\u9593", "BOT",
                                              "\u73bb\u5229\u7dad\u4e9e\u590f\u4ee4\u6642\u9593", "BOST"}},
             {"America/Lima", new String[] {"\u7955\u9b6f\u6642\u9593", "PET",
                                            "\u7955\u9b6f\u590f\u4ee4\u6642\u9593", "PEST"}},
             {"America/Louisville", EST},
+            {"America/Lower_Princes", AST},
             {"America/Maceio", BRT},
             {"America/Managua", CST},
             {"America/Manaus", AMT},
@@ -425,7 +426,7 @@
             {"America/Rankin_Inlet", CST},
             {"America/Recife", BRT},
             {"America/Regina", CST},
-            {"America/Resolute", RST},
+            {"America/Resolute", CST},
             {"America/Rio_Branco", AMT},
             {"America/Rosario", AGT},
             {"America/Santa_Isabel", PST},
@@ -674,7 +675,8 @@
             {"Europe/Isle_of_Man", GMTBST},
             {"Europe/Istanbul", EET},
             {"Europe/Jersey", GMTBST},
-            {"Europe/Kaliningrad", EET},
+            {"Europe/Kaliningrad", new String[] {"Kaliningrad Time", "KALT",
+                                                 "Kaliningrad Summer Time", "KALST"}},
             {"Europe/Kiev", EET},
             {"Europe/Lisbon", WET},
             {"Europe/Ljubljana", CET},
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/util/xml/XMLUtils.java	Wed Oct 26 17:59:13 2011 -0700
@@ -0,0 +1,207 @@
+/*
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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.util.xml;
+
+import java.io.*;
+import java.util.*;
+import org.xml.sax.*;
+import org.xml.sax.helpers.*;
+import org.w3c.dom.*;
+import javax.xml.parsers.*;
+import javax.xml.transform.*;
+import javax.xml.transform.dom.*;
+import javax.xml.transform.stream.*;
+
+/**
+ * A class used to aid in Properties load and save in XML. Keeping this
+ * code outside of Properties helps reduce the number of classes loaded
+ * when Properties is loaded.
+ *
+ * @author  Michael McCloskey
+ * @since   1.3
+ */
+public class XMLUtils {
+
+    // XML loading and saving methods for Properties
+
+    // The required DTD URI for exported properties
+    private static final String PROPS_DTD_URI =
+    "http://java.sun.com/dtd/properties.dtd";
+
+    private static final String PROPS_DTD =
+    "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
+    "<!-- DTD for properties -->"                +
+    "<!ELEMENT properties ( comment?, entry* ) >"+
+    "<!ATTLIST properties"                       +
+        " version CDATA #FIXED \"1.0\">"         +
+    "<!ELEMENT comment (#PCDATA) >"              +
+    "<!ELEMENT entry (#PCDATA) >"                +
+    "<!ATTLIST entry "                           +
+        " key CDATA #REQUIRED>";
+
+    /**
+     * Version number for the format of exported properties files.
+     */
+    private static final String EXTERNAL_XML_VERSION = "1.0";
+
+    public static void load(Properties props, InputStream in)
+        throws IOException, InvalidPropertiesFormatException
+    {
+        Document doc = null;
+        try {
+            doc = getLoadingDoc(in);
+        } catch (SAXException saxe) {
+            throw new InvalidPropertiesFormatException(saxe);
+        }
+        Element propertiesElement = (Element)doc.getChildNodes().item(1);
+        String xmlVersion = propertiesElement.getAttribute("version");
+        if (xmlVersion.compareTo(EXTERNAL_XML_VERSION) > 0)
+            throw new InvalidPropertiesFormatException(
+                "Exported Properties file format version " + xmlVersion +
+                " is not supported. This java installation can read" +
+                " versions " + EXTERNAL_XML_VERSION + " or older. You" +
+                " may need to install a newer version of JDK.");
+        importProperties(props, propertiesElement);
+    }
+
+    static Document getLoadingDoc(InputStream in)
+        throws SAXException, IOException
+    {
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+        dbf.setIgnoringElementContentWhitespace(true);
+        dbf.setValidating(true);
+        dbf.setCoalescing(true);
+        dbf.setIgnoringComments(true);
+        try {
+            DocumentBuilder db = dbf.newDocumentBuilder();
+            db.setEntityResolver(new Resolver());
+            db.setErrorHandler(new EH());
+            InputSource is = new InputSource(in);
+            return db.parse(is);
+        } catch (ParserConfigurationException x) {
+            throw new Error(x);
+        }
+    }
+
+    static void importProperties(Properties props, Element propertiesElement) {
+        NodeList entries = propertiesElement.getChildNodes();
+        int numEntries = entries.getLength();
+        int start = numEntries > 0 &&
+            entries.item(0).getNodeName().equals("comment") ? 1 : 0;
+        for (int i=start; i<numEntries; i++) {
+            Element entry = (Element)entries.item(i);
+            if (entry.hasAttribute("key")) {
+                Node n = entry.getFirstChild();
+                String val = (n == null) ? "" : n.getNodeValue();
+                props.setProperty(entry.getAttribute("key"), val);
+            }
+        }
+    }
+
+    public static void save(Properties props, OutputStream os, String comment,
+                     String encoding)
+        throws IOException
+    {
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+        DocumentBuilder db = null;
+        try {
+            db = dbf.newDocumentBuilder();
+        } catch (ParserConfigurationException pce) {
+            assert(false);
+        }
+        Document doc = db.newDocument();
+        Element properties =  (Element)
+            doc.appendChild(doc.createElement("properties"));
+
+        if (comment != null) {
+            Element comments = (Element)properties.appendChild(
+                doc.createElement("comment"));
+            comments.appendChild(doc.createTextNode(comment));
+        }
+
+        synchronized (props) {
+            for (String key : props.stringPropertyNames()) {
+                Element entry = (Element)properties.appendChild(
+                    doc.createElement("entry"));
+                entry.setAttribute("key", key);
+                entry.appendChild(doc.createTextNode(props.getProperty(key)));
+            }
+        }
+        emitDocument(doc, os, encoding);
+    }
+
+    static void emitDocument(Document doc, OutputStream os, String encoding)
+        throws IOException
+    {
+        TransformerFactory tf = TransformerFactory.newInstance();
+        Transformer t = null;
+        try {
+            t = tf.newTransformer();
+            t.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, PROPS_DTD_URI);
+            t.setOutputProperty(OutputKeys.INDENT, "yes");
+            t.setOutputProperty(OutputKeys.METHOD, "xml");
+            t.setOutputProperty(OutputKeys.ENCODING, encoding);
+        } catch (TransformerConfigurationException tce) {
+            assert(false);
+        }
+        DOMSource doms = new DOMSource(doc);
+        StreamResult sr = new StreamResult(os);
+        try {
+            t.transform(doms, sr);
+        } catch (TransformerException te) {
+            IOException ioe = new IOException();
+            ioe.initCause(te);
+            throw ioe;
+        }
+    }
+
+    private static class Resolver implements EntityResolver {
+        public InputSource resolveEntity(String pid, String sid)
+            throws SAXException
+        {
+            if (sid.equals(PROPS_DTD_URI)) {
+                InputSource is;
+                is = new InputSource(new StringReader(PROPS_DTD));
+                is.setSystemId(PROPS_DTD_URI);
+                return is;
+            }
+            throw new SAXException("Invalid system identifier: " + sid);
+        }
+    }
+
+    private static class EH implements ErrorHandler {
+        public void error(SAXParseException x) throws SAXException {
+            throw x;
+        }
+        public void fatalError(SAXParseException x) throws SAXException {
+            throw x;
+        }
+        public void warning(SAXParseException x) throws SAXException {
+            throw x;
+        }
+    }
+
+}
--- a/src/solaris/bin/java_md.c	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/solaris/bin/java_md.c	Wed Oct 26 17:59:13 2011 -0700
@@ -820,7 +820,6 @@
 jboolean
 LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn)
 {
-    Dl_info dlinfo;
     void *libjvm;
 
     JLI_TraceLauncher("JVM path is %s\n", jvmpath);
--- a/src/solaris/classes/java/net/DefaultDatagramSocketImplFactory.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/solaris/classes/java/net/DefaultDatagramSocketImplFactory.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007,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
@@ -35,7 +35,7 @@
  */
 
 class DefaultDatagramSocketImplFactory {
-    static Class prefixImplClass = null;
+    static Class<?> prefixImplClass = null;
 
     static {
         String prefix = null;
--- a/src/solaris/classes/java/net/PlainDatagramSocketImpl.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/solaris/classes/java/net/PlainDatagramSocketImpl.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007,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
@@ -54,8 +54,10 @@
 
     protected native int getTimeToLive() throws IOException;
 
+    @Deprecated
     protected native void setTTL(byte ttl) throws IOException;
 
+    @Deprecated
     protected native byte getTTL() throws IOException;
 
     protected native void join(InetAddress inetaddr, NetworkInterface netIf)
--- a/src/solaris/classes/sun/net/dns/ResolverConfigurationImpl.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/solaris/classes/sun/net/dns/ResolverConfigurationImpl.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -149,7 +149,7 @@
         sl = java.security.AccessController.doPrivileged(
                  new java.security.PrivilegedAction<LinkedList<String>>() {
                     public LinkedList<String> run() {
-                        LinkedList ll;
+                        LinkedList<String> ll;
 
                         // first try search keyword (max 6 domains)
                         ll = resolvconf("search", 6, 1);
@@ -173,7 +173,7 @@
 
         String localDomain = localDomain0();
         if (localDomain != null && localDomain.length() > 0) {
-            sl = new LinkedList();
+            sl = new LinkedList<String>();
             sl.add(localDomain);
             return sl;
         }
@@ -198,7 +198,7 @@
         }
 
         // no local domain so try fallback (RPC) domain or
-        // hostname
+        // hostName
 
         sl = new LinkedList<>();
         String domain = fallbackDomain0();
@@ -216,22 +216,26 @@
         opts = new OptionsImpl();
     }
 
+    @SuppressWarnings("unchecked")
     public List<String> searchlist() {
         synchronized (lock) {
             loadConfig();
 
             // List is mutable so return a shallow copy
-            return (List)searchlist.clone();
+            return (List<String>)searchlist.clone();
         }
     }
 
+    @SuppressWarnings("unchecked")
     public List<String> nameservers() {
         synchronized (lock) {
             loadConfig();
 
             // List is mutable so return a shallow copy
-            return (List)nameservers.clone();
-         }
+
+          return (List<String>)nameservers.clone();
+
+        }
     }
 
     public Options options() {
--- a/src/solaris/native/java/net/NetworkInterface.c	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/solaris/native/java/net/NetworkInterface.c	Wed Oct 26 17:59:13 2011 -0700
@@ -139,8 +139,12 @@
 #ifdef __solaris__
 static netif *enumIPvXInterfaces(JNIEnv *env, int sock, netif *ifs, int family);
 static int    getMacFromDevice(JNIEnv *env, const char* ifname, unsigned char* retbuf);
+
+#ifndef SIOCGLIFHWADDR
+#define SIOCGLIFHWADDR  _IOWR('i', 192, struct lifreq)
 #endif
 
+#endif
 
 /******************* Java entry points *****************************/
 
@@ -1567,6 +1571,20 @@
     struct sockaddr_in* sin;
     struct sockaddr_in ipAddr;
     int len, i;
+    struct lifreq lif;
+
+    /* First, try the new (S11) SIOCGLIFHWADDR ioctl(). If that fails
+     * try the old way.
+     */
+    memset(&lif, 0, sizeof(lif));
+    strlcpy(lif.lifr_name, ifname, sizeof(lif.lifr_name));
+
+    if (ioctl(sock, SIOCGLIFHWADDR, &lif) != -1) {
+        struct sockaddr_dl *sp;
+        sp = (struct sockaddr_dl *)&lif.lifr_addr;
+        memcpy(buf, &sp->sdl_data[0], sp->sdl_alen);
+        return sp->sdl_alen;
+    }
 
    /**
     * On Solaris we have to use DLPI, but it will only work if we have
@@ -1576,34 +1594,29 @@
     if ((len = getMacFromDevice(env, ifname, buf))  == 0) {
         /*DLPI failed - trying to do arp lookup*/
 
-       if (addr == NULL) {
-          /**
-           * No IPv4 address for that interface, so can't do an ARP lookup.
-           */
-           return -1;
-      }
+        if (addr == NULL) {
+            /**
+             * No IPv4 address for that interface, so can't do an ARP lookup.
+             */
+             return -1;
+         }
 
-      len = 6; //???
+         len = 6; //???
 
-      sin = (struct sockaddr_in *) &arpreq.arp_pa;
-      memset((char *) &arpreq, 0, sizeof(struct arpreq));
-      ipAddr.sin_port = 0;
-      ipAddr.sin_family = AF_INET;
-      memcpy(&ipAddr.sin_addr, addr, sizeof(struct in_addr));
-      memcpy(&arpreq.arp_pa, &ipAddr, sizeof(struct sockaddr_in));
-      arpreq.arp_flags= ATF_PUBL;
+         sin = (struct sockaddr_in *) &arpreq.arp_pa;
+         memset((char *) &arpreq, 0, sizeof(struct arpreq));
+         ipAddr.sin_port = 0;
+         ipAddr.sin_family = AF_INET;
+         memcpy(&ipAddr.sin_addr, addr, sizeof(struct in_addr));
+         memcpy(&arpreq.arp_pa, &ipAddr, sizeof(struct sockaddr_in));
+         arpreq.arp_flags= ATF_PUBL;
 
-      if (ioctl(sock, SIOCGARP, &arpreq) < 0) {
-          if (errno != ENXIO) {
-              // "No such device or address" means no hardware address, so it's
-              // normal don't throw an exception
-              NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "IOCTL failed");
-              return -1;
-          }
-     }
+         if (ioctl(sock, SIOCGARP, &arpreq) < 0) {
+             return -1;
+         }
 
-     memcpy(buf, &arpreq.arp_ha.sa_data[0], len );
-  }
+         memcpy(buf, &arpreq.arp_ha.sa_data[0], len );
+    }
 
     /*
      * All bytes to 0 means no hardware address.
--- a/src/solaris/native/java/util/TimeZone_md.c	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/solaris/native/java/util/TimeZone_md.c	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,13 +30,13 @@
 #include <limits.h>
 #include <errno.h>
 #include <stddef.h>
-
-#ifdef __linux__
+#include <sys/stat.h>
+#include <sys/types.h>
 #include <string.h>
 #include <dirent.h>
-#include <sys/stat.h>
-#include <sys/types.h>
 #include <unistd.h>
+#ifdef __solaris__
+#include <libscf.h>
 #endif
 
 #include "jvm.h"
@@ -54,17 +54,22 @@
 static const char *ETC_TIMEZONE_FILE = "/etc/timezone";
 static const char *ZONEINFO_DIR = "/usr/share/zoneinfo";
 static const char *DEFAULT_ZONEINFO_FILE = "/etc/localtime";
+#else
+static const char *SYS_INIT_FILE = "/etc/default/init";
+static const char *ZONEINFO_DIR = "/usr/share/lib/zoneinfo";
+static const char *DEFAULT_ZONEINFO_FILE = "/usr/share/lib/zoneinfo/localtime";
+#endif /*__linux__*/
 
 /*
- * Returns a point to the zone ID portion of the given zoneinfo file
- * name.
+ * Returns a pointer to the zone ID portion of the given zoneinfo file
+ * name, or NULL if the given string doesn't contain "zoneinfo/".
  */
 static char *
 getZoneName(char *str)
 {
     static const char *zidir = "zoneinfo/";
 
-    char * pos = strstr((const char *)str, zidir);
+    char *pos = strstr((const char *)str, zidir);
     if (pos == NULL) {
         return NULL;
     }
@@ -74,7 +79,7 @@
 /*
  * Returns a path name created from the given 'dir' and 'name' under
  * UNIX. This function allocates memory for the pathname calling
- * malloc().
+ * malloc(). NULL is returned if malloc() fails.
  */
 static char *
 getPathName(const char *dir, const char *name) {
@@ -89,19 +94,18 @@
 
 /*
  * Scans the specified directory and its subdirectories to find a
- * zoneinfo file which has the same content as /etc/localtime given in
- * 'buf'. Returns a zone ID if found, otherwise, NULL is returned.
+ * zoneinfo file which has the same content as /etc/localtime on Linux
+ * or /usr/share/lib/zoneinfo/localtime (most likely a symbolic link)
+ * on Solaris given in 'buf'. Returns a zone ID if found, otherwise,
+ * NULL is returned.
  */
 static char *
 findZoneinfoFile(char *buf, size_t size, const char *dir)
 {
     DIR *dirp = NULL;
     struct stat statbuf;
-    union {
-        struct dirent d;
-        char b[offsetof (struct dirent, d_name) + NAME_MAX + 1];
-    } entry;
-    struct dirent *dp;
+    struct dirent *dp = NULL;
+    struct dirent *entry = NULL;
     char *pathname = NULL;
     int fd = -1;
     char *dbuf = NULL;
@@ -112,7 +116,19 @@
         return NULL;
     }
 
-    while (readdir_r(dirp, &entry.d, &dp) == 0 && dp != NULL) {
+    entry = (struct dirent *) malloc((size_t) pathconf(dir, _PC_NAME_MAX));
+    if (entry == NULL) {
+        (void) closedir(dirp);
+        return NULL;
+    }
+
+#if defined(__linux__) || (defined(__solaris__) && (defined(_POSIX_PTHREAD_SEMANTICS) || \
+                                                    defined(_LP64)))
+    while (readdir_r(dirp, entry, &dp) == 0 && dp != NULL) {
+#else
+    while ((dp = readdir_r(dirp, entry)) != NULL) {
+#endif
+
         /*
          * Skip '.' and '..' (and possibly other .* files)
          */
@@ -121,11 +137,17 @@
         }
 
         /*
-         * Skip "ROC", "posixrules", and "localtime" since Java doesn't
-         * support them.
+         * Skip "ROC", "posixrules", and "localtime".
          */
         if ((strcmp(dp->d_name, "ROC") == 0)
             || (strcmp(dp->d_name, "posixrules") == 0)
+#ifdef __solaris__
+            /*
+             * Skip the "src" and "tab" directories on Solaris.
+             */
+            || (strcmp(dp->d_name, "src") == 0)
+            || (strcmp(dp->d_name, "tab") == 0)
+#endif
             || (strcmp(dp->d_name, "localtime") == 0)) {
             continue;
         }
@@ -149,7 +171,6 @@
                 break;
             }
             if ((fd = open(pathname, O_RDONLY)) == -1) {
-                fd = 0;
                 break;
             }
             if (read(fd, dbuf, size) != (ssize_t) size) {
@@ -165,19 +186,22 @@
             free((void *) dbuf);
             dbuf = NULL;
             (void) close(fd);
-            fd = 0;
+            fd = -1;
         }
         free((void *) pathname);
         pathname = NULL;
     }
 
+    if (entry != NULL) {
+        free((void *) entry);
+    }
     if (dirp != NULL) {
         (void) closedir(dirp);
     }
     if (pathname != NULL) {
         free((void *) pathname);
     }
-    if (fd != 0) {
+    if (fd != -1) {
         (void) close(fd);
     }
     if (dbuf != NULL) {
@@ -186,8 +210,10 @@
     return tz;
 }
 
+#ifdef __linux__
+
 /*
- * Performs libc implementation specific mapping and returns a zone ID
+ * Performs Linux specific mapping and returns a zone ID
  * if found. Otherwise, NULL is returned.
  */
 static char *
@@ -408,12 +434,11 @@
 }
 #endif /* not __sparcv9 */
 
-static const char *sys_init_file = "/etc/default/init";
 
 /*
- * Performs libc implementation dependent mapping. Returns a zone ID
- * if found. Otherwise, NULL is returned.  Solaris libc looks up
- * "/etc/default/init" to get a default TZ value if TZ is not defined
+ * Performs Solaris dependent mapping. Returns a zone ID if
+ * found. Otherwise, NULL is returned.  Solaris libc looks up
+ * "/etc/default/init" to get the default TZ value if TZ is not defined
  * as an environment variable.
  */
 static char *
@@ -425,7 +450,7 @@
     /*
      * Try the TZ entry in /etc/default/init.
      */
-    if ((fp = fileopen(sys_init_file, "r")) != NULL) {
+    if ((fp = fileopen(SYS_INIT_FILE, "r")) != NULL) {
         char line[256];
         char quote = '\0';
 
@@ -473,8 +498,113 @@
     return tz;
 }
 
-#endif
-#endif
+#define TIMEZONE_FMRI   "svc:/system/timezone:default"
+#define TIMEZONE_PG     "timezone"
+#define LOCALTIME_PROP  "localtime"
+
+static void
+cleanupScf(scf_handle_t *h,
+           scf_snapshot_t *snap,
+           scf_instance_t *inst,
+           scf_propertygroup_t *pg,
+           scf_property_t *prop,
+           scf_value_t *val,
+           char *buf) {
+    if (buf != NULL) {
+        free(buf);
+    }
+    if (snap != NULL) {
+        scf_snapshot_destroy(snap);
+    }
+    if (val != NULL) {
+        scf_value_destroy(val);
+    }
+    if (prop != NULL) {
+        scf_property_destroy(prop);
+    }
+    if (pg != NULL) {
+        scf_pg_destroy(pg);
+    }
+    if (inst != NULL) {
+        scf_instance_destroy(inst);
+    }
+    if (h != NULL) {
+        scf_handle_destroy(h);
+    }
+}
+
+/*
+ * Retruns a zone ID of Solaris when the TZ value is "localtime".
+ * First, it tries scf. If scf fails, it looks for the same file as
+ * /usr/share/lib/zoneinfo/localtime under /usr/share/lib/zoneinfo/.
+ */
+static char *
+getSolarisDefaultZoneID() {
+    char *tz = NULL;
+    struct stat statbuf;
+    size_t size;
+    char *buf;
+    int fd;
+    /* scf specific variables */
+    scf_handle_t *h = NULL;
+    scf_snapshot_t *snap = NULL;
+    scf_instance_t *inst = NULL;
+    scf_propertygroup_t *pg = NULL;
+    scf_property_t *prop = NULL;
+    scf_value_t *val = NULL;
+
+    if ((h = scf_handle_create(SCF_VERSION)) != NULL
+        && scf_handle_bind(h) == 0
+        && (inst = scf_instance_create(h)) != NULL
+        && (snap = scf_snapshot_create(h)) != NULL
+        && (pg = scf_pg_create(h)) != NULL
+        && (prop = scf_property_create(h)) != NULL
+        && (val = scf_value_create(h)) != NULL
+        && scf_handle_decode_fmri(h, TIMEZONE_FMRI, NULL, NULL, inst,
+                                  NULL, NULL, SCF_DECODE_FMRI_REQUIRE_INSTANCE) == 0
+        && scf_instance_get_snapshot(inst, "running", snap) == 0
+        && scf_instance_get_pg_composed(inst, snap, TIMEZONE_PG, pg) == 0
+        && scf_pg_get_property(pg, LOCALTIME_PROP, prop) == 0
+        && scf_property_get_value(prop, val) == 0) {
+        ssize_t len;
+
+        /* Gets the length of the zone ID string */
+        len = scf_value_get_astring(val, NULL, 0);
+        if (len != -1) {
+            tz = malloc(++len); /* +1 for a null byte */
+            if (tz != NULL && scf_value_get_astring(val, tz, len) != -1) {
+                cleanupScf(h, snap, inst, pg, prop, val, NULL);
+                return tz;
+            }
+        }
+    }
+    cleanupScf(h, snap, inst, pg, prop, val, tz);
+
+    if (stat(DEFAULT_ZONEINFO_FILE, &statbuf) == -1) {
+        return NULL;
+    }
+    size = (size_t) statbuf.st_size;
+    buf = malloc(size);
+    if (buf == NULL) {
+        return NULL;
+    }
+    if ((fd = open(DEFAULT_ZONEINFO_FILE, O_RDONLY)) == -1) {
+        free((void *) buf);
+        return NULL;
+    }
+
+    if (read(fd, buf, size) != (ssize_t) size) {
+        (void) close(fd);
+        free((void *) buf);
+        return NULL;
+    }
+    (void) close(fd);
+    tz = findZoneinfoFile(buf, size, ZONEINFO_DIR);
+    free((void *) buf);
+    return tz;
+}
+#endif /*__solaris__*/
+#endif /*__linux__*/
 
 /*
  * findJavaTZ_md() maps platform time zone ID to Java time zone ID
@@ -504,10 +634,21 @@
         freetz = tz;
     }
 
+    /*
+     * Remove any preceding ':'
+     */
+    if (tz != NULL && *tz == ':') {
+        tz++;
+    }
+
+#ifdef __solaris__
+    if (strcmp(tz, "localtime") == 0) {
+        tz = getSolarisDefaultZoneID();
+        freetz = tz;
+    }
+#endif
+
     if (tz != NULL) {
-        if (*tz == ':') {
-            tz++;
-        }
 #ifdef __linux__
         /*
          * Ignore "posix/" prefix.
@@ -525,24 +666,36 @@
 }
 
 /**
- * Returns a GMT-offset-based time zone ID. (e.g., "GMT-08:00")
+ * Returns a GMT-offset-based zone ID. (e.g., "GMT-08:00")
  */
 char *
 getGMTOffsetID()
 {
     time_t offset;
-    char sign, buf[16];
+    char sign, buf[32];
+#ifdef __solaris__
+    struct tm localtm;
+    time_t currenttime;
 
-    if (timezone == 0) {
+    currenttime = time(NULL);
+    if (localtime_r(&currenttime, &localtm) == NULL) {
+        return NULL;
+    }
+
+    offset = localtm.tm_isdst ? altzone : timezone;
+#else
+    offset = timezone;
+#endif /*__linux__*/
+
+    if (offset == 0) {
         return strdup("GMT");
     }
 
     /* Note that the time offset direction is opposite. */
-    if (timezone > 0) {
-        offset = timezone;
+    if (offset > 0) {
         sign = '-';
     } else {
-        offset = -timezone;
+        offset = -offset;
         sign = '+';
     }
     sprintf(buf, (const char *)"GMT%c%02d:%02d",
--- a/src/solaris/native/sun/awt/splashscreen/splashscreen_sys.c	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/solaris/native/sun/awt/splashscreen/splashscreen_sys.c	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -334,6 +334,7 @@
     XDestroyImage(ximage);
     SplashRemoveDecoration(splash);
     XMapWindow(splash->display, splash->window);
+    XFlush(splash->display);
 }
 
 void SplashReconfigureNow(Splash * splash) {
--- a/src/windows/classes/java/net/DefaultDatagramSocketImplFactory.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/windows/classes/java/net/DefaultDatagramSocketImplFactory.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -45,7 +45,7 @@
 
 class DefaultDatagramSocketImplFactory
 {
-    static Class prefixImplClass = null;
+    static Class<?> prefixImplClass = null;
 
     /* the windows version. */
     private static float version;
--- a/src/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007,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
@@ -25,7 +25,6 @@
 package java.net;
 
 import java.io.IOException;
-import java.io.FileDescriptor;
 import sun.misc.SharedSecrets;
 import sun.misc.JavaIOFileDescriptorAccess;
 
@@ -215,11 +214,12 @@
         throw new IOException("Method not implemented!");
     }
 
-
+    @Deprecated
     protected void setTTL(byte ttl) throws IOException {
         throw new IOException("Method not implemented!");
     }
 
+    @Deprecated
     protected byte getTTL() throws IOException {
         throw new IOException("Method not implemented!");
     }
--- a/src/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java	Wed Oct 26 17:59:13 2011 -0700
@@ -68,7 +68,12 @@
 
     protected synchronized void create() throws SocketException {
         fd1 = new FileDescriptor();
-        super.create();
+        try {
+            super.create();
+        } catch (SocketException e) {
+            fd1 = null;
+            throw e;
+        }
     }
 
     protected synchronized void bind(int lport, InetAddress laddr)
@@ -94,10 +99,11 @@
         }
 
         if (optID == SO_BINDADDR) {
-            if (fd != null && fd1 != null) {
+            if ((fd != null && fd1 != null) && !connected) {
                 return anyLocalBoundAddr;
             }
-            return socketGetOption(optID);
+            int family = connectedAddress == null ? -1 : connectedAddress.family;
+            return socketLocalAddress(family);
         } else
             return super.getOption(optID);
     }
@@ -133,8 +139,10 @@
 
     protected native int getTimeToLive() throws IOException;
 
+    @Deprecated
     protected native void setTTL(byte ttl) throws IOException;
 
+    @Deprecated
     protected native byte getTTL() throws IOException;
 
     protected native void join(InetAddress inetaddr, NetworkInterface netIf)
@@ -154,6 +162,8 @@
 
     protected native void connect0(InetAddress address, int port) throws SocketException;
 
+    protected native Object socketLocalAddress(int family) throws SocketException;
+
     protected native void disconnect0(int family);
 
     /**
--- a/src/windows/classes/java/net/TwoStacksPlainSocketImpl.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/windows/classes/java/net/TwoStacksPlainSocketImpl.java	Wed Oct 26 17:59:13 2011 -0700
@@ -26,6 +26,7 @@
 
 import java.io.IOException;
 import java.io.FileDescriptor;
+import sun.net.ResourceManager;
 
 /*
  * This class defines the plain SocketImpl that is used for all
@@ -81,7 +82,12 @@
      */
     protected synchronized void create(boolean stream) throws IOException {
         fd1 = new FileDescriptor();
-        super.create(stream);
+        try {
+            super.create(stream);
+        } catch (IOException e) {
+            fd1 = null;
+            throw e;
+        }
     }
 
      /**
@@ -120,6 +126,9 @@
     protected void close() throws IOException {
         synchronized(fdLock) {
             if (fd != null || fd1 != null) {
+                if (!stream) {
+                    ResourceManager.afterUdpClose();
+                }
                 if (fdUseCount == 0) {
                     if (closePending) {
                         return;
--- a/src/windows/classes/sun/awt/windows/WComponentPeer.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/windows/classes/sun/awt/windows/WComponentPeer.java	Wed Oct 26 17:59:13 2011 -0700
@@ -615,6 +615,14 @@
         _dispose();
     }
 
+    public void disposeLater() {
+        postEvent(new InvocationEvent(Toolkit.getDefaultToolkit(), new Runnable() {
+            public void run() {
+                dispose();
+            }
+        }));
+    }
+
     public synchronized void setForeground(Color c) {
         foreground = c;
         _setForeground(c.getRGB());
--- a/src/windows/classes/sun/net/dns/ResolverConfigurationImpl.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/windows/classes/sun/net/dns/ResolverConfigurationImpl.java	Wed Oct 26 17:59:13 2011 -0700
@@ -57,8 +57,8 @@
     private static String os_nameservers;
 
     // Cached lists
-    private static LinkedList searchlist;
-    private static LinkedList nameservers;
+    private static LinkedList<String> searchlist;
+    private static LinkedList<String> nameservers;
 
     // Parse string that consists of token delimited by space or commas
     // and return LinkedHashMap
@@ -111,21 +111,23 @@
         opts = new OptionsImpl();
     }
 
+    @SuppressWarnings("unchecked") // clone()
     public List<String> searchlist() {
         synchronized (lock) {
             loadConfig();
 
             // List is mutable so return a shallow copy
-            return (List)searchlist.clone();
+            return (List<String>)searchlist.clone();
         }
     }
 
+    @SuppressWarnings("unchecked") // clone()
     public List<String> nameservers() {
         synchronized (lock) {
             loadConfig();
 
             // List is mutable so return a shallow copy
-            return (List)nameservers.clone();
+            return (List<String>)nameservers.clone();
          }
     }
 
--- a/src/windows/classes/sun/net/www/protocol/jar/JarFileFactory.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/windows/classes/sun/net/www/protocol/jar/JarFileFactory.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -148,7 +148,7 @@
 
     private Permission getPermission(JarFile jarFile) {
         try {
-            URLConnection uc = (URLConnection)getConnection(jarFile);
+            URLConnection uc = getConnection(jarFile);
             if (uc != null)
                 return uc.getPermission();
         } catch (IOException ioe) {
--- a/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c	Wed Oct 26 17:59:13 2011 -0700
@@ -2181,30 +2181,6 @@
         return getMulticastInterface(env, this, fd, fd1, opt);
     }
 
-    if (opt == java_net_SocketOptions_SO_BINDADDR) {
-        /* find out local IP address */
-        SOCKETADDRESS him;
-        int len = 0;
-        int port;
-        jobject iaObj;
-
-        len = sizeof (struct sockaddr_in);
-
-        if (fd == -1) {
-            fd = fd1; /* must be IPv6 only */
-            len = sizeof (struct SOCKADDR_IN6);
-        }
-
-        if (getsockname(fd, (struct sockaddr *)&him, &len) == -1) {
-            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                           "Error getting socket name");
-            return NULL;
-        }
-        iaObj = NET_SockaddrToInetAddress(env, (struct sockaddr *)&him, &port);
-
-        return iaObj;
-    }
-
     /*
      * Map the Java level socket option to the platform specific
      * level and option name.
@@ -2253,6 +2229,61 @@
 }
 
 /*
+ * Returns local address of the socket.
+ *
+ * Class:     java_net_TwoStacksPlainDatagramSocketImpl
+ * Method:    socketLocalAddress
+ * Signature: (I)Ljava/lang/Object;
+ */
+JNIEXPORT jobject JNICALL
+Java_java_net_TwoStacksPlainDatagramSocketImpl_socketLocalAddress(JNIEnv *env, jobject this,
+                                                      jint family) {
+
+    int fd=-1, fd1=-1;
+    SOCKETADDRESS him;
+    int len = 0;
+    int port;
+    jobject iaObj;
+    int ipv6_supported = ipv6_available();
+
+    fd = getFD(env, this);
+    if (ipv6_supported) {
+        fd1 = getFD1(env, this);
+    }
+
+    if (fd < 0 && fd1 < 0) {
+        JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
+                        "Socket closed");
+        return NULL;
+    }
+
+    /* find out local IP address */
+
+    len = sizeof (struct sockaddr_in);
+
+    /* family==-1 when socket is not connected */
+    if ((family == IPv6) || (family == -1 && fd == -1)) {
+        fd = fd1; /* must be IPv6 only */
+        len = sizeof (struct SOCKADDR_IN6);
+    }
+
+    if (fd == -1) {
+        JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
+                        "Socket closed");
+        return NULL;
+    }
+
+    if (getsockname(fd, (struct sockaddr *)&him, &len) == -1) {
+        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
+                       "Error getting socket name");
+        return NULL;
+    }
+    iaObj = NET_SockaddrToInetAddress(env, (struct sockaddr *)&him, &port);
+
+    return iaObj;
+}
+
+/*
  * Class:     java_net_TwoStacksPlainDatagramSocketImpl
  * Method:    setTimeToLive
  * Signature: (I)V
--- a/src/windows/native/sun/windows/awt_Component.cpp	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/windows/native/sun/windows/awt_Component.cpp	Wed Oct 26 17:59:13 2011 -0700
@@ -183,6 +183,7 @@
 jmethodID AwtComponent::getLocationOnScreenMID;
 jmethodID AwtComponent::replaceSurfaceDataMID;
 jmethodID AwtComponent::replaceSurfaceDataLaterMID;
+jmethodID AwtComponent::disposeLaterMID;
 
 HKL    AwtComponent::m_hkl = ::GetKeyboardLayout(0);
 LANGID AwtComponent::m_idLang = LOWORD(::GetKeyboardLayout(0));
@@ -246,6 +247,7 @@
     m_hCursorCache = NULL;
 
     m_bSubclassed = FALSE;
+    m_bPauseDestroy = FALSE;
 
     m_MessagesProcessing = 0;
     m_wheelRotationAmount = 0;
@@ -319,6 +321,12 @@
         m_brushBackground = NULL;
     }
 
+    if (m_bPauseDestroy) {
+        // AwtComponent::WmNcDestroy could be released now
+        m_bPauseDestroy = FALSE;
+        m_hwnd = NULL;
+    }
+
     // The component instance is deleted using AwtObject::Dispose() method
     AwtObject::Dispose();
 }
@@ -1377,6 +1385,7 @@
       case WM_CREATE: mr = WmCreate(); break;
       case WM_CLOSE:      mr = WmClose(); break;
       case WM_DESTROY:    mr = WmDestroy(); break;
+      case WM_NCDESTROY:  mr = WmNcDestroy(); break;
 
       case WM_ERASEBKGND:
           mr = WmEraseBkgnd((HDC)wParam, *(BOOL*)&retValue); break;
@@ -1965,10 +1974,24 @@
  */
 MsgRouting AwtComponent::WmDestroy()
 {
-    // fix for 6259348: we should enter the SyncCall critical section before
-    // disposing the native object, that is value 1 of lParam is intended for
-    if(m_peerObject != NULL) { // is not being terminating
-        AwtToolkit::GetInstance().SendMessage(WM_AWT_DISPOSE, (WPARAM)m_peerObject, (LPARAM)1);
+    return mrConsume;
+}
+
+/*
+ * This message should only be received when a window is destroyed by
+ * Windows, and not Java. It is sent only after child windows were destroyed.
+ */
+MsgRouting AwtComponent::WmNcDestroy()
+{
+    if (m_peerObject != NULL) { // is not being terminating
+        // Stay in this handler until AwtComponent::Dispose is called.
+        m_bPauseDestroy = TRUE;
+
+        JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
+        // Post invocation event for WObjectPeer.dispose to EDT
+        env->CallVoidMethod(m_peerObject, AwtComponent::disposeLaterMID);
+        // Wait until AwtComponent::Dispose is called
+        AwtToolkit::GetInstance().PumpToDestroy(this);
     }
 
     return mrConsume;
@@ -6300,6 +6323,7 @@
         env->GetMethodID(peerCls, "replaceSurfaceData", "()V");
     AwtComponent::replaceSurfaceDataLaterMID =
         env->GetMethodID(peerCls, "replaceSurfaceDataLater", "()V");
+    AwtComponent::disposeLaterMID = env->GetMethodID(peerCls, "disposeLater", "()V");
 
     DASSERT(AwtComponent::xID);
     DASSERT(AwtComponent::yID);
@@ -6318,6 +6342,8 @@
     DASSERT(AwtComponent::getLocationOnScreenMID);
     DASSERT(AwtComponent::replaceSurfaceDataMID);
     DASSERT(AwtComponent::replaceSurfaceDataLaterMID);
+    DASSERT(AwtComponent::disposeLaterMID);
+
 
     CATCH_BAD_ALLOC;
 }
--- a/src/windows/native/sun/windows/awt_Component.h	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/windows/native/sun/windows/awt_Component.h	Wed Oct 26 17:59:13 2011 -0700
@@ -119,6 +119,7 @@
     static jmethodID getLocationOnScreenMID;
     static jmethodID replaceSurfaceDataMID;
     static jmethodID replaceSurfaceDataLaterMID;
+    static jmethodID disposeLaterMID;
 
     static const UINT WmAwtIsComponent;
     static jint * masks; //InputEvent mask array
@@ -490,6 +491,7 @@
     virtual MsgRouting WmCreate() {return mrDoDefault;}
     virtual MsgRouting WmClose() {return mrDoDefault;}
     virtual MsgRouting WmDestroy();
+    virtual MsgRouting WmNcDestroy();
 
     virtual MsgRouting WmActivate(UINT nState, BOOL fMinimized, HWND opposite)
     {
@@ -711,6 +713,10 @@
         return m_MessagesProcessing == 0;
     }
 
+    BOOL IsDestroyPaused() const {
+        return m_bPauseDestroy;
+    }
+
 protected:
     static AwtComponent* GetComponentImpl(HWND hWnd);
 
@@ -752,6 +758,7 @@
     UINT m_mouseButtonClickAllowed;
 
     BOOL m_bSubclassed;
+    BOOL m_bPauseDestroy;
 
     COLORREF m_colorForeground;
     COLORREF m_colorBackground;
--- a/src/windows/native/sun/windows/awt_Toolkit.cpp	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/windows/native/sun/windows/awt_Toolkit.cpp	Wed Oct 26 17:59:13 2011 -0700
@@ -733,26 +733,13 @@
           return 0;
       }
       case WM_AWT_DISPOSE: {
-          BOOL canDispose = TRUE;
-          CriticalSection &syncCS = AwtToolkit::GetInstance().GetSyncCS();
-          int shouldEnterCriticalSection = (int)lParam;
-          if (shouldEnterCriticalSection == 1) {
-              canDispose = syncCS.TryEnter();
-          }
-          if (canDispose) {
-              if(wParam != NULL) {
-                  jobject self = (jobject)wParam;
-                  AwtObject *o = (AwtObject *) JNI_GET_PDATA(self);
-                  env->DeleteGlobalRef(self);
-                  if(o != NULL && theAwtObjectList.Remove(o)) {
-                      o->Dispose();
-                  }
-                  if (shouldEnterCriticalSection) {
-                      syncCS.Leave();
-                  }
+          if(wParam != NULL) {
+              jobject self = (jobject)wParam;
+              AwtObject *o = (AwtObject *) JNI_GET_PDATA(self);
+              env->DeleteGlobalRef(self);
+              if(o != NULL && theAwtObjectList.Remove(o)) {
+                  o->Dispose();
               }
-          } else {
-              AwtToolkit::GetInstance().PostMessage(WM_AWT_DISPOSE, wParam, lParam);
           }
           return 0;
       }
@@ -1340,25 +1327,46 @@
 
     while (!m_breakMessageLoop && (*lpPeekMessageFunc)(msg)) {
         foundOne = TRUE;
-        if (msg.message == WM_QUIT) {
-            m_breakMessageLoop = TRUE;
-            m_messageLoopResult = static_cast<UINT>(msg.wParam);
-            if (m_messageLoopResult == EXIT_ALL_ENCLOSING_LOOPS)
-                ::PostQuitMessage(static_cast<int>(msg.wParam));  // make sure all loops exit
-            break;
-        }
-        else if (msg.message != WM_NULL) {
-            /*
-             * The AWT in standalone mode (that is, dynamically loaded from the
-             * Java VM) doesn't have any translation tables to worry about, so
-             * TranslateAccelerator isn't called.
-             */
-
-            ::TranslateMessage(&msg);
-            ::DispatchMessage(&msg);
+        ProcessMsg(msg);
+    }
+    return foundOne;
+}
+
+void AwtToolkit::PumpToDestroy(class AwtComponent* p)
+{
+    MSG  msg;
+
+    DASSERT(AwtToolkit::PrimaryIdleFunc != NULL);
+    DASSERT(AwtToolkit::CommonPeekMessageFunc != NULL);
+
+    while (p->IsDestroyPaused() && !m_breakMessageLoop) {
+
+        PrimaryIdleFunc();
+
+        while (p->IsDestroyPaused() && !m_breakMessageLoop && CommonPeekMessageFunc(msg)) {
+            ProcessMsg(msg);
         }
     }
-    return foundOne;
+}
+
+void AwtToolkit::ProcessMsg(MSG& msg)
+{
+    if (msg.message == WM_QUIT) {
+        m_breakMessageLoop = TRUE;
+        m_messageLoopResult = static_cast<UINT>(msg.wParam);
+        if (m_messageLoopResult == EXIT_ALL_ENCLOSING_LOOPS)
+            ::PostQuitMessage(static_cast<int>(msg.wParam));  // make sure all loops exit
+    }
+    else if (msg.message != WM_NULL) {
+        /*
+        * The AWT in standalone mode (that is, dynamically loaded from the
+        * Java VM) doesn't have any translation tables to worry about, so
+        * TranslateAccelerator isn't called.
+        */
+
+        ::TranslateMessage(&msg);
+        ::DispatchMessage(&msg);
+    }
 }
 
 VOID CALLBACK
--- a/src/windows/native/sun/windows/awt_Toolkit.h	Mon Oct 24 09:58:47 2011 -0700
+++ b/src/windows/native/sun/windows/awt_Toolkit.h	Wed Oct 26 17:59:13 2011 -0700
@@ -305,6 +305,8 @@
 
     UINT MessageLoop(IDLEPROC lpIdleFunc, PEEKMESSAGEPROC lpPeekMessageFunc);
     BOOL PumpWaitingMessages(PEEKMESSAGEPROC lpPeekMessageFunc);
+    void PumpToDestroy(class AwtComponent* p);
+    void ProcessMsg(MSG& msg);
     BOOL PreProcessMsg(MSG& msg);
     BOOL PreProcessMouseMsg(class AwtComponent* p, MSG& msg);
     BOOL PreProcessKeyMsg(class AwtComponent* p, MSG& msg);
--- a/test/Makefile	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/Makefile	Wed Oct 26 17:59:13 2011 -0700
@@ -342,7 +342,7 @@
 
 # Expect JT_HOME to be set for jtreg tests. (home for jtreg)
 ifndef JT_HOME
-  JT_HOME = $(SLASH_JAVA)/re/jtreg/4.0/promoted/latest/binaries/jtreg
+  JT_HOME = $(SLASH_JAVA)/re/jtreg/4.1/promoted/latest/binaries/jtreg
   ifdef JPRT_JTREG_HOME
     JT_HOME = $(JPRT_JTREG_HOME)
   endif
@@ -353,19 +353,23 @@
   TESTDIRS = demo
 endif
 
-# Samevm settings (default is false)
-ifndef USE_JTREG_SAMEVM
-  USE_JTREG_SAMEVM=false
+# Agentvm settings (default is false)
+ifndef USE_JTREG_AGENTVM
+  USE_JTREG_AGENTVM=false
 endif
-# With samevm, you cannot use -javaoptions?
-ifeq ($(USE_JTREG_SAMEVM),true)
-  JTREG_SAMEVM_OPTION = -samevm
-  EXTRA_JTREG_OPTIONS += $(JTREG_SAMEVM_OPTION) $(JAVA_ARGS) $(JAVA_ARGS:%=-vmoption:%)
+# With agentvm, you cannot use -javaoptions?
+ifeq ($(USE_JTREG_AGENTVM),true)
+  JTREG_AGENTVM_OPTION = -agentvm
+  EXTRA_JTREG_OPTIONS += $(JTREG_AGENTVM_OPTION) $(JAVA_ARGS) $(JAVA_ARGS:%=-vmoption:%)
   JTREG_TEST_OPTIONS = $(JAVA_VM_ARGS:%=-vmoption:%)
 else
   JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_VM_ARGS:%=-vmoption:%)
 endif
 
+ifdef CONCURRENCY
+  EXTRA_JTREG_OPTIONS += -concurrency:$(CONCURRENCY)
+endif
+
 # Some tests annoy me and fail frequently
 PROBLEM_LIST=ProblemList.txt
 PROBLEM_LISTS=$(PROBLEM_LIST) $(wildcard closed/$(PROBLEM_LIST))
@@ -400,14 +404,14 @@
 define TestDirs
 $(foreach i,$1,$(wildcard ${i})) $(foreach i,$1,$(wildcard closed/${i}))
 endef
-# Running batches of tests with or without samevm
-define RunSamevmBatch
-$(ECHO) "Running tests in samevm mode: $?"
-$(MAKE) TEST_DEPENDENCIES="$?" TESTDIRS="$?" USE_JTREG_SAMEVM=true  UNIQUE_DIR=$@ jtreg_tests
+# Running batches of tests with or without agentvm
+define RunAgentvmBatch
+$(ECHO) "Running tests in agentvm mode: $?"
+$(MAKE) TEST_DEPENDENCIES="$?" TESTDIRS="$?" USE_JTREG_AGENTVM=true  UNIQUE_DIR=$@ jtreg_tests
 endef
 define RunOthervmBatch
 $(ECHO) "Running tests in othervm mode: $?"
-$(MAKE) TEST_DEPENDENCIES="$?" TESTDIRS="$?" USE_JTREG_SAMEVM=false UNIQUE_DIR=$@ jtreg_tests
+$(MAKE) TEST_DEPENDENCIES="$?" TESTDIRS="$?" USE_JTREG_AGENTVM=false UNIQUE_DIR=$@ jtreg_tests
 endef
 define SummaryInfo
 $(ECHO) "########################################################"
@@ -421,22 +425,22 @@
 JDK_ALL_TARGETS =
 
 # Stable othervm testruns (minus items from PROBLEM_LIST)
-#   Using samevm has problems, and doesn't help performance as much as others.
+#   Using agentvm has problems, and doesn't help performance as much as others.
 JDK_ALL_TARGETS += jdk_awt
 jdk_awt: $(call TestDirs, com/sun/awt java/awt sun/awt \
          javax/imageio javax/print sun/pisces)
 	$(call RunOthervmBatch)
 
-# Stable samevm testruns (minus items from PROBLEM_LIST)
+# Stable agentvm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_beans1
 jdk_beans1: $(call TestDirs, \
             java/beans/beancontext java/beans/PropertyChangeSupport \
             java/beans/Introspector java/beans/Performance \
             java/beans/VetoableChangeSupport java/beans/Statement)
-	$(call RunSamevmBatch)
+	$(call RunAgentvmBatch)
 
 # Stable othervm testruns (minus items from PROBLEM_LIST)
-#   Using samevm has serious problems with these tests
+#   Using agentvm has serious problems with these tests
 JDK_ALL_TARGETS += jdk_beans2
 jdk_beans2: $(call TestDirs, \
             java/beans/Beans java/beans/EventHandler java/beans/XMLDecoder \
@@ -444,7 +448,7 @@
 	$(call RunOthervmBatch)
 
 # Stable othervm testruns (minus items from PROBLEM_LIST)
-#   Using samevm has serious problems with these tests
+#   Using agentvm has serious problems with these tests
 JDK_ALL_TARGETS += jdk_beans3
 jdk_beans3: $(call TestDirs, java/beans/XMLEncoder)
 	$(call RunOthervmBatch)
@@ -453,24 +457,24 @@
 jdk_beans: jdk_beans1 jdk_beans2 jdk_beans3
 	@$(SummaryInfo)
 
-# Stable samevm testruns (minus items from PROBLEM_LIST)
+# Stable agentvm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_io
 jdk_io: $(call TestDirs, java/io)
-	$(call RunSamevmBatch)
+	$(call RunAgentvmBatch)
 
-# Stable samevm testruns (minus items from PROBLEM_LIST)
+# Stable agentvm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_lang
 jdk_lang: $(call TestDirs, java/lang)
-	$(call RunSamevmBatch)
+	$(call RunAgentvmBatch)
 
 # Stable othervm testruns (minus items from PROBLEM_LIST)
-#   Using samevm has serious problems with these tests
+#   Using agentvm has serious problems with these tests
 JDK_ALL_TARGETS += jdk_management1
 jdk_management1: $(call TestDirs, javax/management)
 	$(call RunOthervmBatch)
 
 # Stable othervm testruns (minus items from PROBLEM_LIST)
-#   Using samevm has serious problems with these tests
+#   Using agentvm has serious problems with these tests
 JDK_ALL_TARGETS += jdk_management2
 jdk_management2: $(call TestDirs, com/sun/jmx com/sun/management sun/management)
 	$(call RunOthervmBatch)
@@ -479,114 +483,114 @@
 jdk_management: jdk_management1 jdk_management2
 	@$(SummaryInfo)
 
-# Stable samevm testruns (minus items from PROBLEM_LIST)
+# Stable agentvm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_math
 jdk_math: $(call TestDirs, java/math)
-	$(call RunSamevmBatch)
+	$(call RunAgentvmBatch)
 
-# Stable samevm testruns (minus items from PROBLEM_LIST)
+# Stable agentvm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_misc
 jdk_misc: $(call TestDirs, \
           demo/jvmti demo/zipfs javax/naming javax/script \
           javax/smartcardio com/sun/jndi com/sun/xml sun/misc)
-	$(call RunSamevmBatch)
+	$(call RunAgentvmBatch)
 
-# Stable samevm testruns (minus items from PROBLEM_LIST)
+# Stable agentvm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_net
 jdk_net: $(call TestDirs, com/sun/net java/net sun/net)
-	$(call RunSamevmBatch)
+	$(call RunAgentvmBatch)
 
-# Stable samevm testruns (minus items from PROBLEM_LIST)
+# Stable agentvm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_nio1
 jdk_nio1: $(call TestDirs, java/nio/file)
-	$(call RunSamevmBatch)
+	$(call RunAgentvmBatch)
 
-# Stable samevm testruns (minus items from PROBLEM_LIST)
+# Stable agentvm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_nio2
 jdk_nio2: $(call TestDirs, java/nio/Buffer java/nio/ByteOrder \
           java/nio/channels java/nio/MappedByteBuffer)
 	$(call SharedLibraryPermissions,java/nio/channels)
-	$(call RunSamevmBatch)
+	$(call RunAgentvmBatch)
 
-# Stable samevm testruns (minus items from PROBLEM_LIST)
+# Stable agentvm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_nio3
 jdk_nio3: $(call TestDirs, sun/nio)
-	$(call RunSamevmBatch)
+	$(call RunAgentvmBatch)
 
 # All nio tests
 jdk_nio: jdk_nio1 jdk_nio2 jdk_nio3
 	@$(SummaryInfo)
 
-# Stable samevm testruns (minus items from PROBLEM_LIST)
+# Stable agentvm testruns (minus items from PROBLEM_LIST)
 jdk_sctp: $(call TestDirs, com/sun/nio/sctp)
-	$(call RunSamevmBatch)
+	$(call RunAgentvmBatch)
 
 # Stable othervm testruns (minus items from PROBLEM_LIST)
-#   Using samevm has serious problems with these tests
+#   Using agentvm has serious problems with these tests
 JDK_ALL_TARGETS += jdk_rmi
 jdk_rmi: $(call TestDirs, java/rmi javax/rmi sun/rmi)
 	$(call RunOthervmBatch)
 
-# Stable samevm testruns (minus items from PROBLEM_LIST)
+# Stable agentvm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_security1
 jdk_security1: $(call TestDirs, java/security)
-	$(call RunSamevmBatch)
+	$(call RunAgentvmBatch)
 
-# Stable samevm testruns (minus items from PROBLEM_LIST)
+# Stable agentvm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_security2
 jdk_security2: $(call TestDirs, javax/crypto javax/xml/crypto com/sun/crypto)
-	$(call RunSamevmBatch)
+	$(call RunAgentvmBatch)
 
-# Stable samevm testruns (minus items from PROBLEM_LIST)
+# Stable agentvm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_security3
 jdk_security3: $(call TestDirs, com/sun/security lib/security javax/security \
         sun/security com/sun/org/apache/xml/internal/security)
 	$(call SharedLibraryPermissions,sun/security)
-	$(call RunSamevmBatch)
+	$(call RunAgentvmBatch)
 
 # All security tests
 jdk_security: jdk_security1 jdk_security2 jdk_security3
 	@$(SummaryInfo)
 
-# Stable samevm testruns (minus items from PROBLEM_LIST)
+# Stable agentvm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_sound
 jdk_sound: $(call TestDirs, javax/sound)
-	$(call RunSamevmBatch)
+	$(call RunAgentvmBatch)
 
 # Stable othervm testruns (minus items from PROBLEM_LIST)
-#   Using samevm has problems, and doesn't help performance as much as others.
+#   Using agentvm has problems, and doesn't help performance as much as others.
 JDK_ALL_TARGETS += jdk_swing
 jdk_swing: $(call TestDirs, javax/swing sun/java2d \
            demo/jfc com/sun/java/swing)
 	$(call RunOthervmBatch)
 
-# Stable samevm testruns (minus items from PROBLEM_LIST)
+# Stable agentvm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_text
 jdk_text: $(call TestDirs, java/text sun/text)
-	$(call RunSamevmBatch)
+	$(call RunAgentvmBatch)
 
-# Stable samevm testruns (minus items from PROBLEM_LIST)
+# Stable agentvm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_tools1
 jdk_tools1: $(call TestDirs, com/sun/jdi)
-	$(call RunSamevmBatch)
+	$(call RunAgentvmBatch)
 
 # Stable othervm testruns (minus items from PROBLEM_LIST)
-#   Using samevm has serious problems with these tests
+#   Using agentvm has serious problems with these tests
 JDK_ALL_TARGETS += jdk_tools2
 jdk_tools2: $(call TestDirs, \
             com/sun/tools sun/jvmstat sun/tools tools vm \
             com/sun/servicetag com/sun/tracing)
 	$(call SharedLibraryPermissions,tools/launcher)
-	$(call RunSamevmBatch)
+	$(call RunAgentvmBatch)
 
 # All tools tests
 jdk_tools: jdk_tools1 jdk_tools2
 	@$(SummaryInfo)
 
-# Stable samevm testruns (minus items from PROBLEM_LIST)
+# Stable agentvm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_util
 jdk_util: $(call TestDirs, java/util sun/util)
-	$(call RunSamevmBatch)
+	$(call RunAgentvmBatch)
 
 # ------------------------------------------------------------------
 
@@ -603,7 +607,7 @@
 
 # Default JTREG to run (win32 script works for everybody)
 JTREG = $(JT_HOME)/win32/bin/jtreg
-# Add any extra options (samevm etc.)
+# Add any extra options (agentvm etc.)
 JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
 # Only run automatic tests
 JTREG_BASIC_OPTIONS += -a
--- a/test/ProblemList.txt	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/ProblemList.txt	Wed Oct 26 17:59:13 2011 -0700
@@ -43,11 +43,11 @@
 #
 # List items  are testnames followed by labels, all MUST BE commented
 #   as to why they are here and use a label:
-#     generic-all	Problems on all platforms
-#     generic-ARCH	Where ARCH is one of: sparc, sparcv9, x64, i586, etc.
-#     OSNAME-all	Where OSNAME is one of: solaris, linux, windows
-#     OSNAME-ARCH	Specific on to one OSNAME and ARCH, e.g. solaris-x64
-#     OSNAME-REV	Specific on to one OSNAME and REV, e.g. solaris-5.8
+#     generic-all       Problems on all platforms
+#     generic-ARCH      Where ARCH is one of: sparc, sparcv9, x64, i586, etc.
+#     OSNAME-all        Where OSNAME is one of: solaris, linux, windows
+#     OSNAME-ARCH       Specific on to one OSNAME and ARCH, e.g. solaris-x64
+#     OSNAME-REV        Specific on to one OSNAME and REV, e.g. solaris-5.8
 #
 # More than one label is allowed but must be on the same line.
 #
@@ -123,38 +123,38 @@
 java/awt/event/MouseEvent/AcceptExtraButton/AcceptExtraButton.java generic-all
 
 # Causes hang in samevm mode??? Solaris 11 i586
-java/awt/FullScreen/SetFSWindow/FSFrame.java			generic-all
+java/awt/FullScreen/SetFSWindow/FSFrame.java                    generic-all
 
 # Fails on solaris 11 i586, -client, in othervm mode not sure why
-java/awt/Component/PrintAllXcheckJNI/PrintAllXcheckJNI.java	generic-all
+java/awt/Component/PrintAllXcheckJNI/PrintAllXcheckJNI.java     generic-all
 java/awt/Focus/CloseDialogActivateOwnerTest/CloseDialogActivateOwnerTest.java generic-all
-java/awt/FontClass/FontAccess.java				generic-all
-java/awt/Mixing/HWDisappear.java				generic-all
-java/awt/Mixing/MixingInHwPanel.java				generic-all
-java/awt/Mouse/MaximizedFrameTest/MaximizedFrameTest.html	generic-all
+java/awt/FontClass/FontAccess.java                              generic-all
+java/awt/Mixing/HWDisappear.java                                generic-all
+java/awt/Mixing/MixingInHwPanel.java                            generic-all
+java/awt/Mouse/MaximizedFrameTest/MaximizedFrameTest.html       generic-all
 java/awt/Robot/AcceptExtraMouseButtons/AcceptExtraMouseButtons.java generic-all
-java/awt/Toolkit/SecurityTest/SecurityTest2.java		generic-all
-java/awt/image/mlib/MlibOpsTest.java				generic-all
+java/awt/Toolkit/SecurityTest/SecurityTest2.java                generic-all
+java/awt/image/mlib/MlibOpsTest.java                            generic-all
 
 # Fails on windows, othervm mode, various errors
-java/awt/Focus/NonFocusableWindowTest/NonfocusableOwnerTest.java	generic-all
-java/awt/Focus/OwnedWindowFocusIMECrashTest/OwnedWindowFocusIMECrashTest.java	generic-all
-java/awt/FullScreen/NoResizeEventOnDMChangeTest/NoResizeEventOnDMChangeTest.java	generic-all
-java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Standard.java	generic-all
-java/awt/event/KeyEvent/KeyTyped/CtrlASCII.html			generic-all
-java/awt/font/Threads/FontThread.java				generic-all
-java/awt/print/PrinterJob/PrtException.java			generic-all
+java/awt/Focus/NonFocusableWindowTest/NonfocusableOwnerTest.java        generic-all
+java/awt/Focus/OwnedWindowFocusIMECrashTest/OwnedWindowFocusIMECrashTest.java   generic-all
+java/awt/FullScreen/NoResizeEventOnDMChangeTest/NoResizeEventOnDMChangeTest.java        generic-all
+java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Standard.java      generic-all
+java/awt/event/KeyEvent/KeyTyped/CtrlASCII.html                 generic-all
+java/awt/font/Threads/FontThread.java                           generic-all
+java/awt/print/PrinterJob/PrtException.java                     generic-all
 
 # Fails with windows X64, othervm, -server
-com/sun/awt/Translucency/WindowOpacity.java			generic-all
-java/awt/EventDispatchThread/HandleExceptionOnEDT/HandleExceptionOnEDT.java		generic-all
-java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.html	generic-all
+com/sun/awt/Translucency/WindowOpacity.java                     generic-all
+java/awt/EventDispatchThread/HandleExceptionOnEDT/HandleExceptionOnEDT.java             generic-all
+java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.html generic-all
 java/awt/Focus/AppletInitialFocusTest/AppletInitialFocusTest1.html generic-all
 java/awt/Focus/FocusEmbeddedFrameTest/FocusEmbeddedFrameTest.java generic-all
-java/awt/Frame/LayoutOnMaximizeTest/LayoutOnMaximizeTest.java	generic-all
-java/awt/FullScreen/TranslucentWindow/TranslucentWindow.java	generic-all
-java/awt/Mixing/MixingOnShrinkingHWButton.java			generic-all
-java/awt/Mouse/MouseModifiersUnitTest/ExtraButtonDrag.java	generic-all
+java/awt/Frame/LayoutOnMaximizeTest/LayoutOnMaximizeTest.java   generic-all
+java/awt/FullScreen/TranslucentWindow/TranslucentWindow.java    generic-all
+java/awt/Mixing/MixingOnShrinkingHWButton.java                  generic-all
+java/awt/Mouse/MouseModifiersUnitTest/ExtraButtonDrag.java      generic-all
 
 ############################################################################
 
@@ -166,30 +166,30 @@
 #  So a large batch of beans tests are currently run with othervm mode.
 
 # Filed 6986807
-java/beans/Introspector/TestTypeResolver.java   		generic-all
+java/beans/Introspector/TestTypeResolver.java                   generic-all
 
 # Filed 6986813
-java/beans/Introspector/memory/Test4508780.java			generic-all
+java/beans/Introspector/memory/Test4508780.java                 generic-all
 
 # Linux, some kind of problems with X11 display
-java/beans/PropertyChangeSupport/Test4682386.java		generic-all
-java/beans/PropertyChangeSupport/TestSynchronization.java	generic-all
-java/beans/Statement/Test4653179.java				generic-all
+java/beans/PropertyChangeSupport/Test4682386.java               generic-all
+java/beans/PropertyChangeSupport/TestSynchronization.java       generic-all
+java/beans/Statement/Test4653179.java                           generic-all
 
 # Runs REALLY slow on Solaris sparc for some reason, both -client and -server
-java/beans/XMLEncoder/Test4625418.java				solaris-sparc
+java/beans/XMLEncoder/Test4625418.java                          solaris-sparc
 
 # Problems with samevm and setting security manager (speculation partially)
-java/beans/Introspector/4168475/Test4168475.java		generic-all
-java/beans/Introspector/4520754/Test4520754.java		generic-all
-java/beans/Introspector/6380849/TestBeanInfo.java		generic-all
-java/beans/Introspector/Test4144543.java			generic-all
+java/beans/Introspector/4168475/Test4168475.java                generic-all
+java/beans/Introspector/4520754/Test4520754.java                generic-all
+java/beans/Introspector/6380849/TestBeanInfo.java               generic-all
+java/beans/Introspector/Test4144543.java                        generic-all
 
 # Failed to call method solaris-sparc???
-java/beans/EventHandler/Test6788531.java		 	generic-all
+java/beans/EventHandler/Test6788531.java                        generic-all
 
 # Jar or class not found???
-java/beans/XMLEncoder/6329581/Test6329581.java		 	generic-all
+java/beans/XMLEncoder/6329581/Test6329581.java                  generic-all
 
 ############################################################################
 
@@ -199,26 +199,26 @@
 java/lang/invoke/InvokeDynamicPrintArgs.java                    generic-all
 
 # 7079093
-java/lang/instrument/ManifestTest.sh				windows-all
+java/lang/instrument/ManifestTest.sh                            windows-all
 
 ############################################################################
 
 # jdk_management
 
 # 6944188
-java/lang/management/ThreadMXBean/ThreadStateTest.java		generic-all
+java/lang/management/ThreadMXBean/ThreadStateTest.java          generic-all
 
 # 7067973
 java/lang/management/MemoryMXBean/CollectionUsageThreshold.java generic-all
 
 # Failing, bug was filed: 6959636
-javax/management/loading/LibraryLoader/LibraryLoaderTest.java	generic-all
+javax/management/loading/LibraryLoader/LibraryLoaderTest.java   generic-all
 
 # Access denied messages on windows/mks, filed 6954450
-sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh	windows-all
+sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh      windows-all
 
 # Fails on linux: KO: StringMonitor notification missed or not emitted
-javax/management/monitor/NonComparableAttributeValueTest.java	generic-all
+javax/management/monitor/NonComparableAttributeValueTest.java   generic-all
 
 # Port conflict? Fails with communication error
 sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.sh generic-all
@@ -229,10 +229,10 @@
 javax/management/remote/mandatory/connection/ReconnectTest.java generic-all
 
 # Solaris 10 sparc, NPE from org.omg.stub.javax.management.remote.rmi._RMIConnectionImpl_Tie._invoke
-javax/management/remote/mandatory/threads/ExecutorTest.java 	generic-all
+javax/management/remote/mandatory/threads/ExecutorTest.java     generic-all
 
 # Linux 32bit Fedora 9, IllegalStateException
-javax/management/monitor/RuntimeExceptionTest.java		generic-all
+javax/management/monitor/RuntimeExceptionTest.java              generic-all
 
 # Problems with rmi connection, othervm
 javax/management/remote/mandatory/subjectDelegation/SubjectDelegation2Test.java generic-all
@@ -241,16 +241,16 @@
 sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.sh generic-all
 
 # Fails with port already in use
-sun/management/jmxremote/bootstrap/RmiRegistrySslTest.sh	generic-all
+sun/management/jmxremote/bootstrap/RmiRegistrySslTest.sh        generic-all
 
 # Windows, connection can't last that long
-javax/management/eventService/LeaseTest.java			generic-all
+javax/management/eventService/LeaseTest.java                    generic-all
 
 # Linux othervm, X64, java.lang.Exception: Failed: ratio=102.4027795593753
-javax/management/remote/mandatory/notif/ListenerScaleTest.java	generic-all
+javax/management/remote/mandatory/notif/ListenerScaleTest.java  generic-all
 
 # Windows run seems to have triggered a hotspot gc error (see 6801625)
-com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.sh		generic-all
+com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.sh          generic-all
 
 # rmi problem? othervm, java.lang.reflect.UndeclaredThrowableException
 javax/management/remote/mandatory/subjectDelegation/SubjectDelegation3Test.java generic-all
@@ -259,30 +259,30 @@
 javax/management/remote/mandatory/notif/NotificationBufferDeadlockTest.java generic-all
 
 # Times out on solaris sparc, with othervm
-javax/management/eventService/AddRemoveListenerTest.java	generic-all
+javax/management/eventService/AddRemoveListenerTest.java        generic-all
 
 # Linux i586 and x64 -server, timed out waiting for threads to expire? othervm
-javax/management/eventService/EventClientThreadTest.java	generic-all
+javax/management/eventService/EventClientThreadTest.java        generic-all
 
 # Linux i586 -server, Expected to receive 20, but got 21, othervm
 #   Fails on Linux X64 -server 20!=21
-javax/management/eventService/FetchingTest.java			generic-all
+javax/management/eventService/FetchingTest.java                 generic-all
 
 # NPE on windows 2000 i586 -client and -server
-javax/management/eventService/CustomForwarderTest.java	 	windows-all
+javax/management/eventService/CustomForwarderTest.java          windows-all
 
 # Windows i586 failure, callback did not complete
-javax/management/eventService/LeaseManagerDeadlockTest.java 	windows-all
+javax/management/eventService/LeaseManagerDeadlockTest.java     windows-all
 
 # Port already in use
-sun/management/jmxremote/bootstrap/LocalManagementTest.sh 	generic-all
+sun/management/jmxremote/bootstrap/LocalManagementTest.sh       generic-all
 
 # Failed to initialize connector (also overflowing jtreg io buffers)
-sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh	 	generic-all
-sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh 	generic-all
+sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh          generic-all
+sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh       generic-all
 
 # Windows X64, java.lang.IllegalStateException
-javax/management/monitor/AttributeArbitraryDataTypeTest.java	generic-all
+javax/management/monitor/AttributeArbitraryDataTypeTest.java    generic-all
 
 ############################################################################
 
@@ -293,92 +293,89 @@
 # jdk_misc
 
 # Need to be marked othervm, or changed to be samevm safe
-com/sun/jndi/rmi/registry/RegistryContext/UnbindIdempotent.java	generic-all
+com/sun/jndi/rmi/registry/RegistryContext/UnbindIdempotent.java generic-all
 
 # Need to be marked othervm, or changed to be samevm safe
 com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java generic-all
 
 # Solaris sparc and others, exception in initializer
-javax/imageio/CachePremissionsTest/CachePermissionsTest.java 	generic-all
+javax/imageio/CachePremissionsTest/CachePermissionsTest.java    generic-all
 
 # Leaves file rgba_* open, fails with windows samevm
-javax/imageio/plugins/png/PngOutputTypeTest.java		generic-all
+javax/imageio/plugins/png/PngOutputTypeTest.java                generic-all
 
 # Suspect test.png file is left open, windows samevm problems
-javax/imageio/plugins/png/ITXtTest.java				generic-all
+javax/imageio/plugins/png/ITXtTest.java                         generic-all
 
 # Solaris sparc and others, failed to compile testcase
-javax/imageio/metadata/DOML3Node.java			 	generic-all
+javax/imageio/metadata/DOML3Node.java                           generic-all
 
 # One of these tests is leaving file IMGP1001.JPG open, windows samevm
-javax/imageio/plugins/jpeg/ConcurrentReadingTest.java		generic-all
-javax/imageio/plugins/jpeg/ReadingInterruptionTest.java		generic-all
+javax/imageio/plugins/jpeg/ConcurrentReadingTest.java           generic-all
+javax/imageio/plugins/jpeg/ReadingInterruptionTest.java         generic-all
 
 # One of these files is missing a close on writer_* files, windows samevm
-javax/imageio/plugins/jpeg/ConcurrentWritingTest.java		generic-all
-javax/imageio/plugins/jpeg/WritingInterruptionTest.java		generic-all
+javax/imageio/plugins/jpeg/ConcurrentWritingTest.java           generic-all
+javax/imageio/plugins/jpeg/WritingInterruptionTest.java         generic-all
 
 # Leaving file test.jpg open, windows samevm
-javax/imageio/plugins/jpeg/ReadAsGrayTest.java			generic-all
+javax/imageio/plugins/jpeg/ReadAsGrayTest.java                  generic-all
 
 # Missing close on file wbmp*, windows samevm
-javax/imageio/plugins/wbmp/CanDecodeTest.java			generic-all
+javax/imageio/plugins/wbmp/CanDecodeTest.java                   generic-all
 
 # Failures on OpenSolaris, cannot read input files? samevm issues?
-javax/imageio/metadata/BooleanAttributes.java			generic-all
-javax/imageio/plugins/bmp/BMPSubsamplingTest.java		generic-all
-javax/imageio/plugins/bmp/TopDownTest.java			generic-all
-javax/imageio/plugins/gif/EncodeSubImageTest.java		generic-all
-javax/imageio/plugins/gif/GifTransparencyTest.java		generic-all
-javax/imageio/plugins/png/GrayPngTest.java			generic-all
-javax/imageio/plugins/png/ItxtUtf8Test.java			generic-all
-javax/imageio/plugins/png/MergeStdCommentTest.java		generic-all
-javax/imageio/plugins/png/ShortHistogramTest.java		generic-all
-javax/imageio/plugins/shared/BitDepth.java			generic-all
+javax/imageio/metadata/BooleanAttributes.java                   generic-all
+javax/imageio/plugins/bmp/BMPSubsamplingTest.java               generic-all
+javax/imageio/plugins/bmp/TopDownTest.java                      generic-all
+javax/imageio/plugins/gif/EncodeSubImageTest.java               generic-all
+javax/imageio/plugins/gif/GifTransparencyTest.java              generic-all
+javax/imageio/plugins/png/GrayPngTest.java                      generic-all
+javax/imageio/plugins/png/ItxtUtf8Test.java                     generic-all
+javax/imageio/plugins/png/MergeStdCommentTest.java              generic-all
+javax/imageio/plugins/png/ShortHistogramTest.java               generic-all
+javax/imageio/plugins/shared/BitDepth.java                      generic-all
 
 # Exclude all javax/print tests, even if they passed, they may need samevm work
 
 # Times out on solaris-sparc, sparcv9, x64 -server, some on i586 -client
-javax/print/attribute/autosense/PrintAutoSenseData.java 	generic-all
-javax/print/attribute/Chroma.java			 	generic-all
-javax/print/attribute/CollateAttr.java			 	generic-all
-javax/print/attribute/PSCopiesFlavorTest.java		 	generic-all
-javax/print/LookupServices.java 			 	generic-all
-javax/print/TestRaceCond.java				 	generic-all
+javax/print/attribute/autosense/PrintAutoSenseData.java         generic-all
+javax/print/attribute/Chroma.java                               generic-all
+javax/print/attribute/CollateAttr.java                          generic-all
+javax/print/attribute/PSCopiesFlavorTest.java                   generic-all
+javax/print/LookupServices.java                                 generic-all
+javax/print/TestRaceCond.java                                   generic-all
 
 # These tests really require a printer (might all be windows only tests?)
-javax/print/CheckDupFlavor.java					generic-all
-javax/print/PrintSE/PrintSE.sh					generic-all
-javax/print/attribute/ChromaticityValues.java			generic-all
-javax/print/attribute/GetCopiesSupported.java			generic-all
-javax/print/attribute/SidesPageRangesTest.java			generic-all
-javax/print/attribute/SupportedPrintableAreas.java		generic-all
+javax/print/CheckDupFlavor.java                                 generic-all
+javax/print/PrintSE/PrintSE.sh                                  generic-all
+javax/print/attribute/ChromaticityValues.java                   generic-all
+javax/print/attribute/GetCopiesSupported.java                   generic-all
+javax/print/attribute/SidesPageRangesTest.java                  generic-all
+javax/print/attribute/SupportedPrintableAreas.java              generic-all
 javax/print/attribute/AttributeTest.java                        generic-all
 
 # Only print test left, excluding just because all print tests have been
-javax/print/attribute/MediaMappingsTest.java 			generic-all
+javax/print/attribute/MediaMappingsTest.java                    generic-all
 
 # Filed 7058852
-javax/sound/sampled/FileWriter/AlawEncoderSync.java		generic-all
+javax/sound/sampled/FileWriter/AlawEncoderSync.java             generic-all
 
 ############################################################################
 
 # jdk_net
 
 # Filed 7052625
-com/sun/net/httpserver/bugs/6725892/Test.java			generic-all
+com/sun/net/httpserver/bugs/6725892/Test.java                   generic-all
 
 # Filed 7036666
-com/sun/net/httpserver/Test9a.java				generic-all
+com/sun/net/httpserver/Test9a.java                              generic-all
 
 # 7079145 java/net/ipv6tests/UdpTest.java hang at IPv6 only data exchange
 java/net/ipv6tests/UdpTest.java                                 linux-all
 
-# 7079012
-java/net/NetworkInterface/NetParamsTest.java			solaris-all
-
 # 7081476
-java/net/InetSocketAddress/B6469803.java			generic-all
+java/net/InetSocketAddress/B6469803.java                        generic-all
 
 ############################################################################
 
@@ -388,10 +385,10 @@
 java/io/File/MaxPathLength.java                                 windows-all
 
 # 6671616
-java/io/File/BlockIsDirectory.java				solaris-all
+java/io/File/BlockIsDirectory.java                              solaris-all
 
 # 7076644
-java/io/File/Basic.java						windows-all
+java/io/File/Basic.java                                         windows-all
 
 ############################################################################
 
@@ -401,14 +398,14 @@
 java/nio/channels/Selector/Wakeup.java                          windows-all
 
 # 7076700
-java/nio/channels/SocketChannel/AdaptSocket.java		generic-all
+java/nio/channels/SocketChannel/AdaptSocket.java                generic-all
 
 ############################################################################
 
 # jdk_rmi
 
 # Port already in use, fails on sparc, othervm
-java/rmi/reliability/benchmark/runRmiBench.sh			generic-all
+java/rmi/reliability/benchmark/runRmiBench.sh                   generic-all
 
 # Already in use port issues? othervm solaris
 java/rmi/activation/rmidViaInheritedChannel/InheritedChannelNotServerSocket.java generic-all
@@ -418,21 +415,21 @@
 java/rmi/transport/dgcDeadLock/TestImpl_Stub.java                       generic-all
 
 # Address already in use, othervm mode, solaris
-java/rmi/activation/Activatable/elucidateNoSuchMethod/ElucidateNoSuchMethod.java	generic-all
-java/rmi/activation/Activatable/forceLogSnapshot/ForceLogSnapshot.java	generic-all
+java/rmi/activation/Activatable/elucidateNoSuchMethod/ElucidateNoSuchMethod.java        generic-all
+java/rmi/activation/Activatable/forceLogSnapshot/ForceLogSnapshot.java  generic-all
 
 # Registry already running on port, solaris
-java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java	generic-all
+java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java      generic-all
 
 # Fails on Linux 32 and 64bit -server?, impl not garbage collected???
-java/rmi/transport/pinLastArguments/PinLastArguments.java	generic-all
+java/rmi/transport/pinLastArguments/PinLastArguments.java       generic-all
 
 # Times out on solaris sparc
-java/rmi/server/RemoteServer/AddrInUse.java			generic-all
+java/rmi/server/RemoteServer/AddrInUse.java                     generic-all
 
 # Connection error on Windows i586 -server
 #  Also connection errors in othervm on Solaris 10 sparc, same port???
-sun/rmi/transport/tcp/DeadCachedConnection.java 	 	generic-all
+sun/rmi/transport/tcp/DeadCachedConnection.java                 generic-all
 
 # Connection errors in othervm on Solaris 10 sparc, same port???
 java/rmi/activation/Activatable/checkActivateRef/CheckActivateRef.java generic-all
@@ -478,20 +475,20 @@
 # jdk_security
 
 # Failing on Solaris i586, 3/9/2010, not a -samevm issue (jdk_security3)
-sun/security/pkcs11/Secmod/AddPrivateKey.java			solaris-i586
-sun/security/pkcs11/ec/ReadCertificates.java			solaris-i586
-sun/security/pkcs11/ec/ReadPKCS12.java				solaris-i586
-sun/security/pkcs11/ec/TestCurves.java				solaris-i586
-sun/security/pkcs11/ec/TestECDSA.java				solaris-i586
-#sun/security/pkcs11/ec/TestECGenSpec.java			solaris-i586
-#sun/security/pkcs11/ec/TestKeyFactory.java			solaris-i586
-sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java		solaris-i586
+sun/security/pkcs11/Secmod/AddPrivateKey.java                   solaris-i586
+sun/security/pkcs11/ec/ReadCertificates.java                    solaris-i586
+sun/security/pkcs11/ec/ReadPKCS12.java                          solaris-i586
+sun/security/pkcs11/ec/TestCurves.java                          solaris-i586
+sun/security/pkcs11/ec/TestECDSA.java                           solaris-i586
+#sun/security/pkcs11/ec/TestECGenSpec.java                      solaris-i586
+#sun/security/pkcs11/ec/TestKeyFactory.java                     solaris-i586
+sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java            solaris-i586
 
 # Directly references PKCS11 class
 sun/security/pkcs11/Provider/Absolute.java                      windows-x64
 
 # Fails on Fedora 9/Ubuntu 10.04 64bit, PKCS11Exception: CKR_DEVICE_ERROR
-sun/security/pkcs11/KeyAgreement/TestDH.java			generic-all
+sun/security/pkcs11/KeyAgreement/TestDH.java                    generic-all
 
 # Run too slow on Solaris 10 sparc
 sun/security/ssl/com/sun/net/ssl/internal/ssl/InputRecord/SSLSocketTimeoutNulls.java solaris-sparc
@@ -508,14 +505,14 @@
 
 # Times out on windows X64, othervm mode
 #    Solaris sparc and sparcv9 -server, timeout
-sun/security/ssl/javax/net/ssl/NewAPIs/SessionTimeOutTests.java	generic-all
+sun/security/ssl/javax/net/ssl/NewAPIs/SessionTimeOutTests.java generic-all
 
 # Various failures on Linux Fedora 9 X64, othervm mode
 sun/security/ssl/javax/net/ssl/NewAPIs/SSLEngine/TestAllSuites.java generic-all
-sun/security/ssl/sanity/ciphersuites/CheckCipherSuites.java	generic-all
+sun/security/ssl/sanity/ciphersuites/CheckCipherSuites.java     generic-all
 
 # Various failures on Linux Fedora 9 X64, othervm mode
-sun/security/ssl/sanity/interop/ClientJSSEServerJSSE.java	generic-all
+sun/security/ssl/sanity/interop/ClientJSSEServerJSSE.java       generic-all
 
 # 7079203 sun/security/tools/keytool/printssl.sh fails on solaris with timeout
 sun/security/tools/keytool/printssl.sh                          solaris-all
@@ -524,7 +521,7 @@
 sun/security/tools/jarsigner/ec.sh                             solaris-all
 
 # 7081817
-sun/security/provider/certpath/X509CertPath/IllegalCertiticates.java 	generic-all
+sun/security/provider/certpath/X509CertPath/IllegalCertiticates.java    generic-all
 
 # 7041639, Solaris DSA keypair generation bug (Note: jdk_util also affected)
 java/security/KeyPairGenerator/SolarisShortDSA.java             solaris-all
@@ -541,57 +538,57 @@
 # jdk_swing (not using samevm)
 
 # Fails on solaris 11 i586, with othervm
-javax/swing/JFileChooser/6570445/bug6570445.java		generic-all
-javax/swing/JFileChooser/6738668/bug6738668.java		generic-all
-javax/swing/JPopupMenu/6675802/bug6675802.java			generic-all
-javax/swing/system/6799345/TestShutdown.java			generic-all
+javax/swing/JFileChooser/6570445/bug6570445.java                generic-all
+javax/swing/JFileChooser/6738668/bug6738668.java                generic-all
+javax/swing/JPopupMenu/6675802/bug6675802.java                  generic-all
+javax/swing/system/6799345/TestShutdown.java                    generic-all
 
 ############################################################################
 
 # jdk_text
 
 # Linux x64 occasional errors, no details
-java/text/Bidi/Bug6665028.java				 	linux-x64
+java/text/Bidi/Bug6665028.java                                  linux-x64
 
 ############################################################################
 
 # jdk_tools
 
 # Filed 6952105
-com/sun/jdi/SuspendThreadTest.java				generic-all
+com/sun/jdi/SuspendThreadTest.java                              generic-all
 
 # Filed 6653793
-com/sun/jdi/RedefineCrossEvent.java				generic-all
+com/sun/jdi/RedefineCrossEvent.java                             generic-all
 
 # Filed 6987312
-com/sun/jdi/DoubleAgentTest.java				generic-all
+com/sun/jdi/DoubleAgentTest.java                                generic-all
 
 # Filed 7020857
-com/sun/jdi/FieldWatchpoints.java				generic-all
+com/sun/jdi/FieldWatchpoints.java                               generic-all
 
 # Filed 6402201
-com/sun/jdi/ProcessAttachTest.sh				generic-all
+com/sun/jdi/ProcessAttachTest.sh                                generic-all
 
 # Filed 6986875
-sun/tools/jps/jps-Vvml.sh					generic-all
+sun/tools/jps/jps-Vvml.sh                                       generic-all
 
 # Filed 6979016
-sun/tools/jconsole/ResourceCheckTest.sh				generic-all
+sun/tools/jconsole/ResourceCheckTest.sh                         generic-all
 
 ############################################################################
 
 # jdk_util
 
 # Filed 7027061
-java/util/Locale/Bug6989440.java				windows-all
+java/util/Locale/Bug6989440.java                                windows-all
 
 # Filed 6933803
-java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java	generic-all
+java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java  generic-all
 
 # Filed 7022325
 # Fails with assertion error on windows
 #   11 separate stacktraces created... file reuse problem?
-java/util/zip/ZipFile/ReadLongZipFileName.java			generic-all
+java/util/zip/ZipFile/ReadLongZipFileName.java                  generic-all
 
 # Filed 6772009
 java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java generic-all
--- a/test/com/sun/jdi/sde/MangleStepTest.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/com/sun/jdi/sde/MangleStepTest.java	Wed Oct 26 17:59:13 2011 -0700
@@ -10,11 +10,11 @@
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE
  *  @run compile MangleStepTest.java
  *  @run compile -g  onion/pickle/Mangle.java
- *  @run main MangleStepTest unset
- *  @run main MangleStepTest Java
- *  @run main MangleStepTest XYZ
- *  @run main MangleStepTest Rats
- *  @run main MangleStepTest bogus
+ *  @run main/othervm MangleStepTest unset
+ *  @run main/othervm MangleStepTest Java
+ *  @run main/othervm MangleStepTest XYZ
+ *  @run main/othervm MangleStepTest Rats
+ *  @run main/othervm MangleStepTest bogus
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/jndi/ldap/LdapsReadTimeoutTest.java	Wed Oct 26 17:59:13 2011 -0700
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 7094377
+ * @summary Com.sun.jndi.ldap.read.timeout doesn't work with ldaps.
+ */
+
+import java.net.Socket;
+import java.net.ServerSocket;
+import java.io.*;
+import javax.naming.*;
+import javax.naming.directory.*;
+import java.util.Hashtable;
+
+public class LdapsReadTimeoutTest {
+
+    public static void main(String[] args) throws Exception {
+        boolean passed = false;
+
+        // create the server
+        try (Server server = Server.create()) {
+            // Set up the environment for creating the initial context
+            Hashtable<String,Object> env = new Hashtable<>(11);
+            env.put(Context.INITIAL_CONTEXT_FACTORY,
+                "com.sun.jndi.ldap.LdapCtxFactory");
+            env.put("com.sun.jndi.ldap.connect.timeout", "1000");
+            env.put("com.sun.jndi.ldap.read.timeout", "1000");
+            env.put(Context.PROVIDER_URL, "ldaps://localhost:" + server.port());
+
+
+            // Create initial context
+            DirContext ctx = new InitialDirContext(env);
+            try {
+                System.out.println("LDAP Client: Connected to the Server");
+
+                SearchControls scl = new SearchControls();
+                scl.setSearchScope(SearchControls.SUBTREE_SCOPE);
+                System.out.println("Performing Search");
+                NamingEnumeration<SearchResult> answer =
+                    ctx.search("ou=People,o=JNDITutorial", "(objectClass=*)", scl);
+            } finally {
+                // Close the context when we're done
+                ctx.close();
+            }
+        } catch (NamingException e) {
+            passed = true;
+            e.printStackTrace();
+        }
+
+        if (!passed) {
+            throw new Exception("Read timeout test failed," +
+                         " read timeout exception not thrown");
+        }
+        System.out.println("The test PASSED");
+    }
+
+    static class Server implements Runnable, Closeable {
+        private final ServerSocket ss;
+        private Socket sref;
+
+        private Server(ServerSocket ss) {
+            this.ss = ss;
+        }
+
+        static Server create() throws IOException {
+            Server server = new Server(new ServerSocket(0));
+            new Thread(server).start();
+            return server;
+        }
+
+        int port() {
+            return ss.getLocalPort();
+        }
+
+        public void run() {
+            try (Socket s = ss.accept()) {
+                sref = s;
+                System.out.println("Server: Connection accepted");
+                BufferedInputStream bis =
+                    new BufferedInputStream(s.getInputStream());
+                byte[] buf = new byte[100];
+                int n;
+                do {
+                    n = bis.read(buf);
+                } while (n > 0);
+            } catch (IOException e) {
+                // ignore
+            }
+        }
+
+        public void close() throws IOException {
+            ss.close();
+            sref.close();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/io/etc/FileDescriptorSharing.java	Wed Oct 26 17:59:13 2011 -0700
@@ -0,0 +1,336 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6322678 7082769
+ * @summary FileInputStream/FileOutputStream/RandomAccessFile allow file descriptor
+ *          to be closed while still in use.
+ * @run main/othervm FileDescriptorSharing
+ */
+
+import java.io.*;
+import java.nio.channels.FileChannel;
+import java.nio.channels.FileLock;
+import java.util.concurrent.CountDownLatch;
+
+public class FileDescriptorSharing {
+
+    final static int numFiles = 10;
+    volatile static boolean fail;
+
+    public static void main(String[] args) throws Exception {
+        TestFinalizer();
+        TestMultipleFD();
+        TestIsValid();
+        MultiThreadedFD();
+    }
+
+    /**
+     * We shouldn't discard a file descriptor until all streams have
+     * finished with it
+     */
+    private static void TestFinalizer() throws Exception {
+        FileDescriptor fd = null;
+        File tempFile = new File("TestFinalizer1.txt");
+        tempFile.deleteOnExit();
+        try (Writer writer = new FileWriter(tempFile)) {
+            for (int i=0; i<5; i++) {
+                writer.write("test file content test file content");
+            }
+        }
+
+        FileInputStream fis1 = new FileInputStream(tempFile);
+        fd = fis1.getFD();
+        // Create a new FIS based on the existing FD (so the two FIS's share the same native fd)
+        try (FileInputStream fis2 = new FileInputStream(fd)) {
+            // allow fis1 to be gc'ed
+            fis1 = null;
+            int ret = 0;
+            while(ret >= 0) {
+                // encourage gc
+                System.gc();
+                // read from fis2 - when fis1 is gc'ed and finalizer is run, read will fail
+                System.out.print(".");
+                ret = fis2.read();
+            }
+        }
+
+        // variation of above. Use RandomAccessFile to obtain a filedescriptor
+        File testFinalizerFile = new File("TestFinalizer");
+        RandomAccessFile raf = new RandomAccessFile(testFinalizerFile, "rw");
+        raf.writeBytes("test file content test file content");
+        raf.seek(0L);
+        fd = raf.getFD();
+        try (FileInputStream fis3 = new FileInputStream(fd)) {
+            // allow raf to be gc'ed
+            raf = null;
+            int ret = 0;
+            while (ret >= 0) {
+                // encourage gc
+                System.gc();
+                /*
+                 * read from fis3 - when raf is gc'ed and finalizer is run,
+                 * fd should still be valid.
+                 */
+                System.out.print(".");
+                ret = fis3.read();
+            }
+            if(!fd.valid()) {
+                throw new RuntimeException("TestFinalizer() : FileDescriptor should be valid");
+            }
+        } finally {
+            testFinalizerFile.delete();
+        }
+    }
+
+    /**
+     * Exercise FileDispatcher close()/preClose()
+     */
+    private static void TestMultipleFD() throws Exception {
+        RandomAccessFile raf = null;
+        FileOutputStream fos = null;
+        FileInputStream fis = null;
+        FileChannel fc = null;
+        FileLock fileLock = null;
+
+        File test1 = new File("test1");
+        try {
+            raf = new RandomAccessFile(test1, "rw");
+            fos = new FileOutputStream(raf.getFD());
+            fis = new FileInputStream(raf.getFD());
+            fc = raf.getChannel();
+            fileLock = fc.lock();
+            raf.setLength(0L);
+            fos.flush();
+            fos.write("TEST".getBytes());
+        } finally {
+            if (fileLock != null) fileLock.release();
+            if (fis != null) fis.close();
+            if (fos != null) fos.close();
+            if (raf != null) raf.close();
+            test1.delete();
+        }
+
+        /*
+         * Close out in different order to ensure FD is not
+         * closed out too early
+         */
+        File test2 = new File("test2");
+        try {
+            raf = new RandomAccessFile(test2, "rw");
+            fos = new FileOutputStream(raf.getFD());
+            fis = new FileInputStream(raf.getFD());
+            fc = raf.getChannel();
+            fileLock = fc.lock();
+            raf.setLength(0L);
+            fos.flush();
+            fos.write("TEST".getBytes());
+        } finally {
+            if (fileLock != null) fileLock.release();
+            if (raf != null) raf.close();
+            if (fos != null) fos.close();
+            if (fis != null) fis.close();
+            test2.delete();
+        }
+
+        // one more time, fos first this time
+        File test3 = new File("test3");
+        try {
+            raf = new RandomAccessFile(test3, "rw");
+            fos = new FileOutputStream(raf.getFD());
+            fis = new FileInputStream(raf.getFD());
+            fc = raf.getChannel();
+            fileLock = fc.lock();
+            raf.setLength(0L);
+            fos.flush();
+            fos.write("TEST".getBytes());
+        } finally {
+            if (fileLock != null) fileLock.release();
+            if (fos != null) fos.close();
+            if (raf != null) raf.close();
+            if (fis != null) fis.close();
+            test3.delete();
+        }
+    }
+
+    /**
+     * Similar to TestMultipleFD() but this time we
+     * just get and use FileDescriptor.valid() for testing.
+     */
+    private static void TestIsValid() throws Exception {
+        FileDescriptor fd = null;
+        RandomAccessFile raf = null;
+        FileOutputStream fos = null;
+        FileInputStream fis = null;
+        FileChannel fc = null;
+
+        File test1 = new File("test1");
+        try {
+            raf = new RandomAccessFile(test1, "rw");
+            fd = raf.getFD();
+            fos = new FileOutputStream(fd);
+            fis = new FileInputStream(fd);
+        } finally {
+            try {
+                if (fis != null) fis.close();
+                if (fos != null) fos.close();
+                if (!fd.valid()) {
+                    throw new RuntimeException("FileDescriptor should be valid");
+                }
+                if (raf != null) raf.close();
+                if (fd.valid()) {
+                    throw new RuntimeException("close() called and FileDescriptor still valid");
+                }
+            } finally {
+                if (raf != null) raf.close();
+                test1.delete();
+            }
+        }
+
+        /*
+         * Close out in different order to ensure FD is not
+         * closed out too early
+         */
+        File test2 = new File("test2");
+        try {
+            raf = new RandomAccessFile(test2, "rw");
+            fd = raf.getFD();
+            fos = new FileOutputStream(fd);
+            fis = new FileInputStream(fd);
+        } finally {
+            try {
+                if (raf != null) raf.close();
+                if (fos != null) fos.close();
+                if (!fd.valid()) {
+                    throw new RuntimeException("FileDescriptor should be valid");
+                }
+                if (fis != null) fis.close();
+                if (fd.valid()) {
+                    throw new RuntimeException("close() called and FileDescriptor still valid");
+                }
+            } finally {
+                test2.delete();
+            }
+        }
+
+        // one more time, fos first this time
+        File test3 = new File("test3");
+        try {
+            raf = new RandomAccessFile(test3, "rw");
+            fd = raf.getFD();
+            fos = new FileOutputStream(fd);
+            fis = new FileInputStream(fd);
+        } finally {
+            try {
+                if (fos != null) fos.close();
+                if (raf != null) raf.close();
+                if (!fd.valid()) {
+                    throw new RuntimeException("FileDescriptor should be valid");
+                }
+                if (fis != null) fis.close();
+                if (fd.valid()) {
+                    throw new RuntimeException("close() called and FileDescriptor still valid");
+                }
+            } finally {
+                test3.delete();
+            }
+        }
+    }
+
+    /**
+     * Test concurrent access to the same fd.useCount field
+     */
+    private static void MultiThreadedFD() throws Exception {
+        RandomAccessFile raf = null;
+        FileDescriptor fd = null;
+        int numThreads = 2;
+        CountDownLatch done = new CountDownLatch(numThreads);
+        OpenClose[] fileOpenClose = new OpenClose[numThreads];
+        File MultipleThreadedFD = new File("MultipleThreadedFD");
+        try {
+            raf = new RandomAccessFile(MultipleThreadedFD, "rw");
+            fd = raf.getFD();
+            for(int count=0;count<numThreads;count++) {
+                fileOpenClose[count] = new OpenClose(fd, done);
+                fileOpenClose[count].start();
+            }
+            done.await();
+        } finally {
+            try {
+                if(raf != null) raf.close();
+                // fd should now no longer be valid
+                if(fd.valid()) {
+                    throw new RuntimeException("FileDescriptor should not be valid");
+                }
+                // OpenClose thread tests failed
+                if(fail) {
+                    throw new RuntimeException("OpenClose thread tests failed.");
+                }
+            } finally {
+                MultipleThreadedFD.delete();
+            }
+        }
+    }
+
+    /**
+     * A thread which will open and close a number of FileInputStreams and
+     * FileOutputStreams referencing the same native file descriptor.
+     */
+    private static class OpenClose extends Thread {
+        private FileDescriptor fd = null;
+        private CountDownLatch done;
+        FileInputStream[] fisArray = new FileInputStream[numFiles];
+        FileOutputStream[] fosArray = new FileOutputStream[numFiles];
+
+        OpenClose(FileDescriptor filedescriptor, CountDownLatch done) {
+            this.fd = filedescriptor;
+            this.done = done;
+        }
+
+        public void run() {
+             try {
+                 for(int i=0;i<numFiles;i++) {
+                     fisArray[i] = new FileInputStream(fd);
+                     fosArray[i] = new FileOutputStream(fd);
+                 }
+
+                 // Now close out
+                 for(int i=0;i<numFiles;i++) {
+                     if(fisArray[i] != null) fisArray[i].close();
+                     if(fosArray[i] != null) fosArray[i].close();
+                 }
+
+             } catch(IOException ioe) {
+                 System.out.println("OpenClose encountered IO issue :" + ioe);
+                 fail = true;
+             } finally {
+                 if (!fd.valid()) { // fd should still be valid given RAF reference
+                     System.out.println("OpenClose: FileDescriptor should be valid");
+                     fail = true;
+                 }
+                 done.countDown();
+             }
+         }
+    }
+}
--- a/test/java/lang/Double/ParseHexFloatingPoint.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/lang/Double/ParseHexFloatingPoint.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
 
 
 import java.util.regex.*;
-import sun.misc.FpUtils;
 import sun.misc.DoubleConsts;
 
 public class ParseHexFloatingPoint {
@@ -227,7 +226,7 @@
             new PairSD("0x1.000000000000001p-1075",     Double.MIN_VALUE),
 
             // More subnormal rounding tests
-            new PairSD("0x0.fffffffffffff7fffffp-1022", FpUtils.nextDown(DoubleConsts.MIN_NORMAL)),
+            new PairSD("0x0.fffffffffffff7fffffp-1022", Math.nextDown(DoubleConsts.MIN_NORMAL)),
             new PairSD("0x0.fffffffffffff8p-1022",      DoubleConsts.MIN_NORMAL),
             new PairSD("0x0.fffffffffffff800000001p-1022",DoubleConsts.MIN_NORMAL),
             new PairSD("0x0.fffffffffffff80000000000000001p-1022",DoubleConsts.MIN_NORMAL),
@@ -242,10 +241,10 @@
             new PairSD("0x1.fffffffffffff8p1023",       infinityD),
             new PairSD("0x1.fffffffffffff8000001p1023", infinityD),
 
-            new PairSD("0x1.ffffffffffffep1023",        FpUtils.nextDown(Double.MAX_VALUE)),
-            new PairSD("0x1.ffffffffffffe0000p1023",    FpUtils.nextDown(Double.MAX_VALUE)),
-            new PairSD("0x1.ffffffffffffe8p1023",       FpUtils.nextDown(Double.MAX_VALUE)),
-            new PairSD("0x1.ffffffffffffe7p1023",       FpUtils.nextDown(Double.MAX_VALUE)),
+            new PairSD("0x1.ffffffffffffep1023",        Math.nextDown(Double.MAX_VALUE)),
+            new PairSD("0x1.ffffffffffffe0000p1023",    Math.nextDown(Double.MAX_VALUE)),
+            new PairSD("0x1.ffffffffffffe8p1023",       Math.nextDown(Double.MAX_VALUE)),
+            new PairSD("0x1.ffffffffffffe7p1023",       Math.nextDown(Double.MAX_VALUE)),
             new PairSD("0x1.ffffffffffffeffffffp1023",  Double.MAX_VALUE),
             new PairSD("0x1.ffffffffffffe8000001p1023", Double.MAX_VALUE),
         };
@@ -284,8 +283,8 @@
         };
 
         double [] answers = {
-            FpUtils.nextDown(FpUtils.nextDown(2.0)),
-            FpUtils.nextDown(2.0),
+            Math.nextDown(Math.nextDown(2.0)),
+            Math.nextDown(2.0),
             2.0
         };
 
--- a/test/java/lang/Double/ToHexString.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/lang/Double/ToHexString.java	Wed Oct 26 17:59:13 2011 -0700
@@ -29,7 +29,6 @@
  */
 
 import java.util.regex.*;
-import sun.misc.FpUtils;
 import sun.misc.DoubleConsts;
 
 public class ToHexString {
--- a/test/java/lang/Math/CeilAndFloorTests.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/lang/Math/CeilAndFloorTests.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,6 @@
  * @summary Check for correct implementation of Math.ceil and Math.floor
  */
 
-import sun.misc.FpUtils;
 import sun.misc.DoubleConsts;
 
 public class CeilAndFloorTests {
@@ -69,7 +68,7 @@
 
         for(int i = Double.MIN_EXPONENT; i <= Double.MAX_EXPONENT; i++) {
             double powerOfTwo   = Math.scalb(1.0, i);
-            double neighborDown = FpUtils.nextDown(powerOfTwo);
+            double neighborDown = Math.nextDown(powerOfTwo);
             double neighborUp   = Math.nextUp(powerOfTwo);
 
             if (i < 0) {
@@ -114,7 +113,7 @@
 
         for(int i = -(0x10000); i <= 0x10000; i++) {
             double d = (double) i;
-            double neighborDown = FpUtils.nextDown(d);
+            double neighborDown = Math.nextDown(d);
             double neighborUp   = Math.nextUp(d);
 
             failures += testCeilCase( d, d);
@@ -140,8 +139,8 @@
         double [][] testCases = {
             { Double.MIN_VALUE,                           1.0},
             {-Double.MIN_VALUE,                          -0.0},
-            { FpUtils.nextDown(DoubleConsts.MIN_NORMAL),  1.0},
-            {-FpUtils.nextDown(DoubleConsts.MIN_NORMAL), -0.0},
+            { Math.nextDown(DoubleConsts.MIN_NORMAL),     1.0},
+            {-Math.nextDown(DoubleConsts.MIN_NORMAL),    -0.0},
             { DoubleConsts.MIN_NORMAL,                    1.0},
             {-DoubleConsts.MIN_NORMAL,                   -0.0},
 
@@ -157,8 +156,8 @@
             { 2.5,                                        3.0},
             {-2.5,                                       -2.0},
 
-            { FpUtils.nextDown(1.0),                      1.0},
-            { FpUtils.nextDown(-1.0),                    -1.0},
+            { Math.nextDown(1.0),                         1.0},
+            { Math.nextDown(-1.0),                       -1.0},
 
             { Math.nextUp(1.0),                           2.0},
             { Math.nextUp(-1.0),                         -0.0},
@@ -166,17 +165,17 @@
             { 0x1.0p51,                                 0x1.0p51},
             {-0x1.0p51,                                -0x1.0p51},
 
-            { FpUtils.nextDown(0x1.0p51),               0x1.0p51},
+            { Math.nextDown(0x1.0p51),                  0x1.0p51},
             {-Math.nextUp(0x1.0p51),                   -0x1.0p51},
 
             { Math.nextUp(0x1.0p51),                    0x1.0p51+1},
-            {-FpUtils.nextDown(0x1.0p51),              -0x1.0p51+1},
+            {-Math.nextDown(0x1.0p51),                 -0x1.0p51+1},
 
-            { FpUtils.nextDown(0x1.0p52),               0x1.0p52},
+            { Math.nextDown(0x1.0p52),                  0x1.0p52},
             {-Math.nextUp(0x1.0p52),                   -0x1.0p52-1.0},
 
             { Math.nextUp(0x1.0p52),                    0x1.0p52+1.0},
-            {-FpUtils.nextDown(0x1.0p52),              -0x1.0p52+1.0},
+            {-Math.nextDown(0x1.0p52),                 -0x1.0p52+1.0},
         };
 
         for(double[] testCase : testCases) {
--- a/test/java/lang/Math/CubeRootTests.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/lang/Math/CubeRootTests.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,6 @@
  * @author Joseph D. Darcy
  */
 
-import sun.misc.FpUtils;
 import sun.misc.DoubleConsts;
 
 public class CubeRootTests {
@@ -95,14 +94,14 @@
 
         // Test cbrt(2^(3n)) = 2^n.
         for(int i = 18; i <= DoubleConsts.MAX_EXPONENT/3; i++) {
-            failures += testCubeRootCase(FpUtils.scalb(1.0, 3*i),
-                                         FpUtils.scalb(1.0, i) );
+            failures += testCubeRootCase(Math.scalb(1.0, 3*i),
+                                         Math.scalb(1.0, i) );
         }
 
         // Test cbrt(2^(-3n)) = 2^-n.
-        for(int i = -1; i >= FpUtils.ilogb(Double.MIN_VALUE)/3; i--) {
-            failures += testCubeRootCase(FpUtils.scalb(1.0, 3*i),
-                                         FpUtils.scalb(1.0, i) );
+        for(int i = -1; i >= DoubleConsts.MIN_SUB_EXPONENT/3; i--) {
+            failures += testCubeRootCase(Math.scalb(1.0, 3*i),
+                                         Math.scalb(1.0, i) );
         }
 
         // Test random perfect cubes.  Create double values with
@@ -110,10 +109,10 @@
         // significant bits in the significand set; 17*3 = 51, which
         // is less than the number of bits in a double's significand.
         long exponentBits1 =
-            Double.doubleToLongBits(FpUtils.scalb(1.0, 55)) &
+            Double.doubleToLongBits(Math.scalb(1.0, 55)) &
             DoubleConsts.EXP_BIT_MASK;
         long exponentBits2=
-            Double.doubleToLongBits(FpUtils.scalb(1.0, -55)) &
+            Double.doubleToLongBits(Math.scalb(1.0, -55)) &
             DoubleConsts.EXP_BIT_MASK;
         for(int i = 0; i < 100; i++) {
             // Take 16 bits since the 17th bit is implicit in the
@@ -177,16 +176,16 @@
 
             err = d - StrictMath.pow(y1, 3);
             if (err != 0.0) {
-                if(FpUtils.isNaN(err)) {
+                if(Double.isNaN(err)) {
                     failures++;
                     System.err.println("Encountered unexpected NaN value: d = " + d +
                                        "\tcbrt(d) = " + y1);
                 } else {
                     if (err < 0.0) {
-                        err_adjacent = StrictMath.pow(FpUtils.nextUp(y1), 3) - d;
+                        err_adjacent = StrictMath.pow(Math.nextUp(y1), 3) - d;
                     }
                     else  { // (err > 0.0)
-                        err_adjacent = StrictMath.pow(FpUtils.nextAfter(y1,0.0), 3) - d;
+                        err_adjacent = StrictMath.pow(Math.nextAfter(y1,0.0), 3) - d;
                     }
 
                     if (Math.abs(err) > Math.abs(err_adjacent)) {
@@ -200,16 +199,16 @@
 
             err = d - StrictMath.pow(y2, 3);
             if (err != 0.0) {
-                if(FpUtils.isNaN(err)) {
+                if(Double.isNaN(err)) {
                     failures++;
                     System.err.println("Encountered unexpected NaN value: d = " + d +
                                        "\tcbrt(d) = " + y2);
                 } else {
                     if (err < 0.0) {
-                        err_adjacent = StrictMath.pow(FpUtils.nextUp(y2), 3) - d;
+                        err_adjacent = StrictMath.pow(Math.nextUp(y2), 3) - d;
                     }
                     else  { // (err > 0.0)
-                        err_adjacent = StrictMath.pow(FpUtils.nextAfter(y2,0.0), 3) - d;
+                        err_adjacent = StrictMath.pow(Math.nextAfter(y2,0.0), 3) - d;
                     }
 
                     if (Math.abs(err) > Math.abs(err_adjacent)) {
@@ -242,13 +241,13 @@
 
             // Test near cbrt(2^(3n)) = 2^n.
             for(int i = 18; i <= DoubleConsts.MAX_EXPONENT/3; i++) {
-                double pc = FpUtils.scalb(1.0, 3*i);
+                double pc = Math.scalb(1.0, 3*i);
 
                 pcNeighbors[2] = pc;
-                pcNeighbors[1] = FpUtils.nextDown(pc);
-                pcNeighbors[0] = FpUtils.nextDown(pcNeighbors[1]);
-                pcNeighbors[3] = FpUtils.nextUp(pc);
-                pcNeighbors[4] = FpUtils.nextUp(pcNeighbors[3]);
+                pcNeighbors[1] = Math.nextDown(pc);
+                pcNeighbors[0] = Math.nextDown(pcNeighbors[1]);
+                pcNeighbors[3] = Math.nextUp(pc);
+                pcNeighbors[4] = Math.nextUp(pcNeighbors[3]);
 
                 for(int j = 0; j < pcNeighbors.length; j++) {
                     pcNeighborsCbrt[j] =           Math.cbrt(pcNeighbors[j]);
@@ -280,14 +279,14 @@
             }
 
             // Test near cbrt(2^(-3n)) = 2^-n.
-            for(int i = -1; i >= FpUtils.ilogb(Double.MIN_VALUE)/3; i--) {
-                double pc = FpUtils.scalb(1.0, 3*i);
+            for(int i = -1; i >= DoubleConsts.MIN_SUB_EXPONENT/3; i--) {
+                double pc = Math.scalb(1.0, 3*i);
 
                 pcNeighbors[2] = pc;
-                pcNeighbors[1] = FpUtils.nextDown(pc);
-                pcNeighbors[0] = FpUtils.nextDown(pcNeighbors[1]);
-                pcNeighbors[3] = FpUtils.nextUp(pc);
-                pcNeighbors[4] = FpUtils.nextUp(pcNeighbors[3]);
+                pcNeighbors[1] = Math.nextDown(pc);
+                pcNeighbors[0] = Math.nextDown(pcNeighbors[1]);
+                pcNeighbors[3] = Math.nextUp(pc);
+                pcNeighbors[4] = Math.nextUp(pcNeighbors[3]);
 
                 for(int j = 0; j < pcNeighbors.length; j++) {
                     pcNeighborsCbrt[j] =           Math.cbrt(pcNeighbors[j]);
--- a/test/java/lang/Math/Expm1Tests.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/lang/Math/Expm1Tests.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@
  */
 
 import sun.misc.DoubleConsts;
-import sun.misc.FpUtils;
 
 /*
  * The Taylor expansion of expxm1(x) = exp(x) -1 is
@@ -82,7 +81,7 @@
 
         // For |x| < 2^-54 expm1(x) ~= x
         for(int i = DoubleConsts.MIN_SUB_EXPONENT; i <= -54; i++) {
-            double d = FpUtils.scalb(2, i);
+            double d = Math.scalb(2, i);
             failures += testExpm1Case(d, d);
             failures += testExpm1Case(-d, -d);
         }
@@ -101,7 +100,7 @@
 
         // For x > 710, expm1(x) should be infinity
         for(int i = 10; i <= DoubleConsts.MAX_EXPONENT; i++) {
-            double d = FpUtils.scalb(2, i);
+            double d = Math.scalb(2, i);
             failures += testExpm1Case(d, infinityD);
         }
 
@@ -118,7 +117,7 @@
         }
 
         for(int i = 7; i <= DoubleConsts.MAX_EXPONENT; i++) {
-            double d = -FpUtils.scalb(2, i);
+            double d = -Math.scalb(2, i);
             failures += testExpm1CaseWithUlpDiff(d, -1.0, 1, reachedLimit);
         }
 
@@ -143,10 +142,10 @@
                 double pc = StrictMath.log(2)*i;
 
                 pcNeighbors[2] = pc;
-                pcNeighbors[1] = FpUtils.nextDown(pc);
-                pcNeighbors[0] = FpUtils.nextDown(pcNeighbors[1]);
-                pcNeighbors[3] = FpUtils.nextUp(pc);
-                pcNeighbors[4] = FpUtils.nextUp(pcNeighbors[3]);
+                pcNeighbors[1] = Math.nextDown(pc);
+                pcNeighbors[0] = Math.nextDown(pcNeighbors[1]);
+                pcNeighbors[3] = Math.nextUp(pc);
+                pcNeighbors[4] = Math.nextUp(pcNeighbors[3]);
 
                 for(int j = 0; j < pcNeighbors.length; j++) {
                     pcNeighborsExpm1[j]       =       Math.expm1(pcNeighbors[j]);
--- a/test/java/lang/Math/HyperbolicTests.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/lang/Math/HyperbolicTests.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@
  */
 
 import sun.misc.DoubleConsts;
-import sun.misc.FpUtils;
 
 public class HyperbolicTests {
     private HyperbolicTests(){}
@@ -266,7 +265,7 @@
         // double significand.
 
         for(int i = DoubleConsts.MIN_SUB_EXPONENT; i < -27; i++) {
-            double d = FpUtils.scalb(2.0, i);
+            double d = Math.scalb(2.0, i);
 
             // Result and expected are the same.
             failures += testSinhCaseWithUlpDiff(d, d, 2.5);
@@ -280,7 +279,7 @@
         long trans22 = Double.doubleToLongBits(22.0);
         // (approximately) largest value such that exp shouldn't
         // overflow
-        long transExpOvfl = Double.doubleToLongBits(FpUtils.nextDown(709.7827128933841));
+        long transExpOvfl = Double.doubleToLongBits(Math.nextDown(709.7827128933841));
 
         for(long i = trans22;
             i < transExpOvfl;
@@ -344,7 +343,7 @@
         // sinh(x) overflows for values greater than 710; in
         // particular, it overflows for all 2^i, i > 10.
         for(int i = 10; i <= DoubleConsts.MAX_EXPONENT; i++) {
-            double d = FpUtils.scalb(2.0, i);
+            double d = Math.scalb(2.0, i);
 
             // Result and expected are the same.
             failures += testSinhCaseWithUlpDiff(d,
@@ -625,7 +624,7 @@
         // rounded.
 
         for(int i = DoubleConsts.MIN_SUB_EXPONENT; i < -27; i++) {
-            double d = FpUtils.scalb(2.0, i);
+            double d = Math.scalb(2.0, i);
 
             // Result and expected are the same.
             failures += testCoshCaseWithUlpDiff(d, 1.0, 2.5);
@@ -639,7 +638,7 @@
         long trans22 = Double.doubleToLongBits(22.0);
         // (approximately) largest value such that exp shouldn't
         // overflow
-        long transExpOvfl = Double.doubleToLongBits(FpUtils.nextDown(709.7827128933841));
+        long transExpOvfl = Double.doubleToLongBits(Math.nextDown(709.7827128933841));
 
         for(long i = trans22;
             i < transExpOvfl;
@@ -703,7 +702,7 @@
         // cosh(x) overflows for values greater than 710; in
         // particular, it overflows for all 2^i, i > 10.
         for(int i = 10; i <= DoubleConsts.MAX_EXPONENT; i++) {
-            double d = FpUtils.scalb(2.0, i);
+            double d = Math.scalb(2.0, i);
 
             // Result and expected are the same.
             failures += testCoshCaseWithUlpDiff(d,
@@ -984,7 +983,7 @@
         // double significand.
 
         for(int i = DoubleConsts.MIN_SUB_EXPONENT; i < -27; i++) {
-            double d = FpUtils.scalb(2.0, i);
+            double d = Math.scalb(2.0, i);
 
             // Result and expected are the same.
             failures += testTanhCaseWithUlpDiff(d, d, 2.5);
@@ -998,7 +997,7 @@
         }
 
         for(int i = 5; i <= DoubleConsts.MAX_EXPONENT; i++) {
-            double d = FpUtils.scalb(2.0, i);
+            double d = Math.scalb(2.0, i);
 
             failures += testTanhCaseWithUlpDiff(d, 1.0, 2.5);
         }
--- a/test/java/lang/Math/HypotTests.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/lang/Math/HypotTests.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -90,7 +90,7 @@
         for(int i = DoubleConsts.MIN_SUB_EXPONENT;
             i <= DoubleConsts.MAX_EXPONENT;
             i++) {
-            double input = FpUtils.scalb(2, i);
+            double input = Math.scalb(2, i);
             failures += testHypotCase(input, 0.0, input);
         }
 
@@ -126,7 +126,7 @@
         for(int i = 0; i < 1000; i++) {
             double d = rand.nextDouble();
             // Scale d to have an exponent equal to MAX_EXPONENT -15
-            d = FpUtils.scalb(d, DoubleConsts.MAX_EXPONENT
+            d = Math.scalb(d, DoubleConsts.MAX_EXPONENT
                                  -15 - FpUtils.ilogb(d));
             for(int j = 0; j <= 13; j += 1) {
                 failures += testHypotCase(3*d, 4*d, 5*d, 2.5);
@@ -153,13 +153,13 @@
 
 
             for(int i = -18; i <= 18; i++) {
-                double pc = FpUtils.scalb(1.0, i);
+                double pc = Math.scalb(1.0, i);
 
                 pcNeighbors[2] = pc;
-                pcNeighbors[1] = FpUtils.nextDown(pc);
-                pcNeighbors[0] = FpUtils.nextDown(pcNeighbors[1]);
-                pcNeighbors[3] = FpUtils.nextUp(pc);
-                pcNeighbors[4] = FpUtils.nextUp(pcNeighbors[3]);
+                pcNeighbors[1] = Math.nextDown(pc);
+                pcNeighbors[0] = Math.nextDown(pcNeighbors[1]);
+                pcNeighbors[3] = Math.nextUp(pc);
+                pcNeighbors[4] = Math.nextUp(pcNeighbors[3]);
 
                 for(int j = 0; j < pcNeighbors.length; j++) {
                     pcNeighborsHypot[j]       =       Math.hypot(2.0, pcNeighbors[j]);
--- a/test/java/lang/Math/IeeeRecommendedTests.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/lang/Math/IeeeRecommendedTests.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -177,7 +177,7 @@
             }
 
             if (i > FloatConsts.MIN_EXPONENT) {
-                float po2minus = FpUtils.nextAfter(po2,
+                float po2minus = Math.nextAfter(po2,
                                                  Float.NEGATIVE_INFINITY);
                 failures += testGetExponentCase(po2minus, i-1);
             }
@@ -205,7 +205,7 @@
             // Test largest value in next smaller binade
             if (i >= 3) {// (i == 1) would test 0.0;
                          // (i == 2) would just retest MIN_VALUE
-                testGetExponentCase(FpUtils.nextAfter(top, 0.0f),
+                testGetExponentCase(Math.nextAfter(top, 0.0f),
                                     FloatConsts.MIN_EXPONENT - 1);
 
                 if( i >= 10) {
@@ -284,7 +284,7 @@
             }
 
             if (i > DoubleConsts.MIN_EXPONENT) {
-                double po2minus = FpUtils.nextAfter(po2,
+                double po2minus = Math.nextAfter(po2,
                                                     Double.NEGATIVE_INFINITY);
                 failures += testGetExponentCase(po2minus, i-1);
             }
@@ -312,7 +312,7 @@
             // Test largest value in next smaller binade
             if (i >= 3) {// (i == 1) would test 0.0;
                          // (i == 2) would just retest MIN_VALUE
-                testGetExponentCase(FpUtils.nextAfter(top, 0.0),
+                testGetExponentCase(Math.nextAfter(top, 0.0),
                                     DoubleConsts.MIN_EXPONENT - 1);
 
                 if( i >= 10) {
@@ -623,8 +623,11 @@
         };
 
         for(int i = 0; i < testCases.length; i++) {
-            failures+=Tests.test("FpUtils.nextDown(float)",
-                                 testCases[i][0], FpUtils.nextDown(testCases[i][0]), testCases[i][1]);
+            failures+=Tests.test("Math.nextDown(float)",
+                                 testCases[i][0], Math.nextDown(testCases[i][0]), testCases[i][1]);
+
+            failures+=Tests.test("StrictMath.nextDown(float)",
+                                 testCases[i][0], StrictMath.nextDown(testCases[i][0]), testCases[i][1]);
         }
 
         return failures;
@@ -659,8 +662,11 @@
         };
 
         for(int i = 0; i < testCases.length; i++) {
-            failures+=Tests.test("FpUtils.nextDown(double)",
-                                 testCases[i][0], FpUtils.nextDown(testCases[i][0]), testCases[i][1]);
+            failures+=Tests.test("Math.nextDown(double)",
+                                 testCases[i][0], Math.nextDown(testCases[i][0]), testCases[i][1]);
+
+            failures+=Tests.test("StrictMath.nextDown(double)",
+                                 testCases[i][0], StrictMath.nextDown(testCases[i][0]), testCases[i][1]);
         }
 
         return failures;
@@ -706,8 +712,8 @@
                                  FpUtils.isNaN(testCases[i]), (i ==0));
 
             // isFinite
-            failures+=Tests.test("FpUtils.isFinite(float)", testCases[i],
-                                 FpUtils.isFinite(testCases[i]), (i >= 3));
+            failures+=Tests.test("Float.isFinite(float)", testCases[i],
+                                 Float.isFinite(testCases[i]), (i >= 3));
 
             // isInfinite
             failures+=Tests.test("FpUtils.isInfinite(float)", testCases[i],
@@ -756,8 +762,8 @@
                                  FpUtils.isNaN(testCases[i]), (i ==0));
 
             // isFinite
-            failures+=Tests.test("FpUtils.isFinite(double)", testCases[i],
-                                 FpUtils.isFinite(testCases[i]), (i >= 3));
+            failures+=Tests.test("Double.isFinite(double)", testCases[i],
+                                 Double.isFinite(testCases[i]), (i >= 3));
 
             // isInfinite
             failures+=Tests.test("FpUtils.isInfinite(double)", testCases[i],
@@ -1061,7 +1067,7 @@
                     float value = someTestCases[i];
                     failures+=testScalbCase(value,
                                             scaleFactor,
-                                            FpUtils.copySign( (scaleFactor>0?infinityF:0.0f), value) );
+                                            Math.copySign( (scaleFactor>0?infinityF:0.0f), value) );
                 }
             }
         }
@@ -1095,7 +1101,7 @@
                 failures+=testScalbCase(value,
                                         scaleFactor,
                                         (FpUtils.ilogb(value) +j > FloatConsts.MAX_EXPONENT ) ?
-                                        FpUtils.copySign(infinityF, value) : // overflow
+                                        Math.copySign(infinityF, value) : // overflow
                                         // calculate right answer
                                         twoToTheMaxExp*(twoToTheMaxExp*(scale*value)) );
                 scale*=2.0f;
@@ -1268,7 +1274,7 @@
                     double value = someTestCases[i];
                     failures+=testScalbCase(value,
                                             scaleFactor,
-                                            FpUtils.copySign( (scaleFactor>0?infinityD:0.0), value) );
+                                            Math.copySign( (scaleFactor>0?infinityD:0.0), value) );
                 }
             }
         }
@@ -1302,7 +1308,7 @@
                 failures+=testScalbCase(value,
                                         scaleFactor,
                                         (FpUtils.ilogb(value) +j > DoubleConsts.MAX_EXPONENT ) ?
-                                        FpUtils.copySign(infinityD, value) : // overflow
+                                        Math.copySign(infinityD, value) : // overflow
                                         // calculate right answer
                                         twoToTheMaxExp*(twoToTheMaxExp*(scale*value)) );
                 scale*=2.0;
@@ -1423,7 +1429,7 @@
 
             // Create power of two
             float po2 = powerOfTwoF(i);
-            expected = FpUtils.scalb(1.0f, i - (FloatConsts.SIGNIFICAND_WIDTH-1));
+            expected = Math.scalb(1.0f, i - (FloatConsts.SIGNIFICAND_WIDTH-1));
 
             failures += testUlpCase(po2, expected);
 
@@ -1443,7 +1449,7 @@
             }
 
             if (i > FloatConsts.MIN_EXPONENT) {
-                float po2minus = FpUtils.nextAfter(po2,
+                float po2minus = Math.nextAfter(po2,
                                                    Float.NEGATIVE_INFINITY);
                 failures += testUlpCase(po2minus, expected/2.0f);
             }
@@ -1470,7 +1476,7 @@
             // Test largest value in next smaller binade
             if (i >= 3) {// (i == 1) would test 0.0;
                          // (i == 2) would just retest MIN_VALUE
-                testUlpCase(FpUtils.nextAfter(top, 0.0f),
+                testUlpCase(Math.nextAfter(top, 0.0f),
                             Float.MIN_VALUE);
 
                 if( i >= 10) {
@@ -1528,7 +1534,7 @@
 
             // Create power of two
             double po2 = powerOfTwoD(i);
-            expected = FpUtils.scalb(1.0, i - (DoubleConsts.SIGNIFICAND_WIDTH-1));
+            expected = Math.scalb(1.0, i - (DoubleConsts.SIGNIFICAND_WIDTH-1));
 
             failures += testUlpCase(po2, expected);
 
@@ -1548,7 +1554,7 @@
             }
 
             if (i > DoubleConsts.MIN_EXPONENT) {
-                double po2minus = FpUtils.nextAfter(po2,
+                double po2minus = Math.nextAfter(po2,
                                                     Double.NEGATIVE_INFINITY);
                 failures += testUlpCase(po2minus, expected/2.0f);
             }
@@ -1575,7 +1581,7 @@
             // Test largest value in next smaller binade
             if (i >= 3) {// (i == 1) would test 0.0;
                          // (i == 2) would just retest MIN_VALUE
-                testUlpCase(FpUtils.nextAfter(top, 0.0f),
+                testUlpCase(Math.nextAfter(top, 0.0f),
                             Double.MIN_VALUE);
 
                 if( i >= 10) {
--- a/test/java/lang/Math/Log10Tests.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/lang/Math/Log10Tests.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,6 @@
  * @author Joseph D. Darcy
  */
 
-import sun.misc.FpUtils;
 import sun.misc.DoubleConsts;
 
 public class Log10Tests {
@@ -98,13 +97,13 @@
         // within a few ulps of log(x)/log(10)
         for(int i = 0; i < 10000; i++) {
             double input = Double.longBitsToDouble(rand.nextLong());
-            if(! FpUtils.isFinite(input))
+            if(! Double.isFinite(input))
                 continue; // avoid testing NaN and infinite values
             else {
                 input = Math.abs(input);
 
                 double expected = StrictMath.log(input)/LN_10;
-                if( ! FpUtils.isFinite(expected))
+                if( ! Double.isFinite(expected))
                     continue; // if log(input) overflowed, try again
                 else {
                     double result;
@@ -153,16 +152,16 @@
             for(int i = 0; i < half; i++) {
                 if (i == 0) {
                     input[half] = 1.0;
-                    up   = FpUtils.nextUp(1.0);
-                    down = FpUtils.nextDown(1.0);
+                    up   = Math.nextUp(1.0);
+                    down = Math.nextDown(1.0);
                 } else {
                     input[half + i] = up;
                     input[half - i] = down;
-                    up   = FpUtils.nextUp(up);
-                    down = FpUtils.nextDown(down);
+                    up   = Math.nextUp(up);
+                    down = Math.nextDown(down);
                 }
             }
-            input[0] = FpUtils.nextDown(input[1]);
+            input[0] = Math.nextDown(input[1]);
 
             for(int i = 0; i < neighbors.length; i++) {
                 neighbors[i] =          Math.log10(input[i]);
--- a/test/java/lang/Math/Log1pTests.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/lang/Math/Log1pTests.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -88,14 +88,14 @@
 
         // For |x| < 2^-54 log1p(x) ~= x
         for(int i = DoubleConsts.MIN_SUB_EXPONENT; i <= -54; i++) {
-            double d = FpUtils.scalb(2, i);
+            double d = Math.scalb(2, i);
             failures += testLog1pCase(d, d);
             failures += testLog1pCase(-d, -d);
         }
 
         // For x > 2^53 log1p(x) ~= log(x)
         for(int i = 53; i <= DoubleConsts.MAX_EXPONENT; i++) {
-            double d = FpUtils.scalb(2, i);
+            double d = Math.scalb(2, i);
             failures += testLog1pCaseWithUlpDiff(d, StrictMath.log(d), 2.001);
         }
 
@@ -105,7 +105,7 @@
         for(int i = 0; i < 1000; i++) {
             double d = rand.nextDouble();
 
-            d = FpUtils.scalb(d, -53 - FpUtils.ilogb(d));
+            d = Math.scalb(d, -53 - FpUtils.ilogb(d));
 
             for(int j = -53; j <= 52; j++) {
                 failures += testLog1pCaseWithUlpDiff(d, hp15cLogp(d), 5);
@@ -135,10 +135,10 @@
                 double pc = StrictMath.pow(Math.E, i) - 1;
 
                 pcNeighbors[2] = pc;
-                pcNeighbors[1] = FpUtils.nextDown(pc);
-                pcNeighbors[0] = FpUtils.nextDown(pcNeighbors[1]);
-                pcNeighbors[3] = FpUtils.nextUp(pc);
-                pcNeighbors[4] = FpUtils.nextUp(pcNeighbors[3]);
+                pcNeighbors[1] = Math.nextDown(pc);
+                pcNeighbors[0] = Math.nextDown(pcNeighbors[1]);
+                pcNeighbors[3] = Math.nextUp(pc);
+                pcNeighbors[4] = Math.nextUp(pcNeighbors[3]);
 
                 for(int j = 0; j < pcNeighbors.length; j++) {
                     pcNeighborsLog1p[j]       =       Math.log1p(pcNeighbors[j]);
@@ -202,5 +202,4 @@
             throw new RuntimeException();
         }
     }
-
 }
--- a/test/java/lang/Math/Rint.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/lang/Math/Rint.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,8 @@
  * @test
  * @bug 4101566 4831589
  * @summary Check for correct implementation of Math.rint(double)
- *
  */
 
-import sun.misc.FpUtils;
 import sun.misc.DoubleConsts;
 
 public class Rint {
@@ -48,28 +46,28 @@
 
     public static void main(String args[]) {
         int failures = 0;
-        double twoToThe52 = FpUtils.scalb(1.0, 52); // 2^52
+        double twoToThe52 = Math.scalb(1.0, 52); // 2^52
 
         double [][] testCases = {
             {0.0,                               0.0},
             {Double.MIN_VALUE,                  0.0},
-            {FpUtils.nextDown(DoubleConsts.MIN_NORMAL), 0.0},
+            {Math.nextDown(DoubleConsts.MIN_NORMAL), 0.0},
             {DoubleConsts.MIN_NORMAL,           0.0},
 
             {0.2,                               0.0},
 
-            {FpUtils.nextDown(0.5),             0.0},
-            {                 0.5,              0.0},
-            {  FpUtils.nextUp(0.5),             1.0},
+            {Math.nextDown(0.5),             0.0},
+            {              0.5,              0.0},
+            {  Math.nextUp(0.5),             1.0},
 
             {0.7,                               1.0},
-            {FpUtils.nextDown(1.0),             1.0},
-            {                 1.0,              1.0},
-            {  FpUtils.nextUp(1.0),             1.0},
+            {Math.nextDown(1.0),             1.0},
+            {              1.0,              1.0},
+            {  Math.nextUp(1.0),             1.0},
 
-            {FpUtils.nextDown(1.5),             1.0},
-            {                 1.5,              2.0},
-            {  FpUtils.nextUp(1.5),             2.0},
+            {Math.nextDown(1.5),             1.0},
+            {              1.5,              2.0},
+            {  Math.nextUp(1.5),             2.0},
 
             {4.2,                               4.0},
             {4.5,                               4.0},
@@ -81,19 +79,19 @@
 
             {150000.75,                         150001.0},
             {300000.5,                          300000.0},
-            {FpUtils.nextUp(300000.5),          300001.0},
-            {FpUtils.nextDown(300000.75),       300001.0},
+            {Math.nextUp(300000.5),          300001.0},
+            {Math.nextDown(300000.75),       300001.0},
             {300000.75,                         300001.0},
-            {FpUtils.nextUp(300000.75),         300001.0},
+            {Math.nextUp(300000.75),         300001.0},
             {300000.99,                         300001.0},
             {262144.75,                         262145.0}, //(2^18 ) + 0.75
             {499998.75,                         499999.0},
             {524287.75,                         524288.0}, //(2^19 -1) + 0.75
             {524288.75,                         524289.0},
 
-            {FpUtils.nextDown(twoToThe52),      twoToThe52},
+            {Math.nextDown(twoToThe52),      twoToThe52},
             {twoToThe52,                        twoToThe52},
-            {FpUtils.nextUp(twoToThe52),        FpUtils.nextUp(twoToThe52)},
+            {Math.nextUp(twoToThe52),        Math.nextUp(twoToThe52)},
 
             {Double.MAX_VALUE,          Double.MAX_VALUE},
             {Double.POSITIVE_INFINITY,  Double.POSITIVE_INFINITY},
@@ -118,5 +116,4 @@
             throw new RuntimeException();
         }
     }
-
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/math/BigInteger/TestValueExact.java	Wed Oct 26 17:59:13 2011 -0700
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6371401
+ * @summary Tests of fooValueExact methods
+ * @author Joseph D. Darcy
+ */
+import java.math.BigInteger;
+
+public class TestValueExact {
+    public static void main(String... args) {
+        int errors = 0;
+
+        errors += testLongValueExact();
+        errors += testIntValueExact();
+        errors += testShortValueExact();
+        errors += testByteValueExact();
+
+        if (errors > 0)
+            throw new RuntimeException();
+    }
+
+    private static int testLongValueExact() {
+        int errors = 0;
+        BigInteger[] inRange = {
+            BigInteger.valueOf(Long.MIN_VALUE),
+            BigInteger.ZERO,
+            BigInteger.valueOf(Long.MAX_VALUE)
+        };
+
+        BigInteger[] outOfRange = {
+            BigInteger.valueOf(Long.MIN_VALUE).subtract(BigInteger.ONE),
+            BigInteger.valueOf(Long.MAX_VALUE).add(BigInteger.ONE)
+        };
+
+        for (BigInteger bi : inRange) {
+            if (bi.longValueExact() != bi.longValue()) {
+                System.err.println("Mismatching int conversion for " + bi);
+                errors++;
+            }
+        }
+
+        for (BigInteger bi : outOfRange) {
+            try {
+                long value = bi.longValueExact();
+                System.err.println("Failed to get expected exception on " +
+                                   bi + " got " + value);
+                errors++;
+            } catch(ArithmeticException ae) {
+                ; // Expected
+            }
+        }
+        return errors;
+    }
+
+    private static int testIntValueExact() {
+        int errors = 0;
+        BigInteger[] inRange = {
+            BigInteger.valueOf(Integer.MIN_VALUE),
+            BigInteger.ZERO,
+            BigInteger.ONE,
+            BigInteger.TEN,
+            BigInteger.valueOf(Integer.MAX_VALUE)
+        };
+
+        BigInteger[] outOfRange = {
+            BigInteger.valueOf((long)Integer.MIN_VALUE - 1),
+            BigInteger.valueOf((long)Integer.MAX_VALUE + 1)
+        };
+
+        for (BigInteger bi : inRange) {
+            if (bi.intValueExact() != bi.intValue()) {
+                System.err.println("Mismatching int conversion for " + bi);
+                errors++;
+            }
+        }
+
+        for (BigInteger bi : outOfRange) {
+            try {
+                int value = bi.intValueExact();
+                System.err.println("Failed to get expected exception on " +
+                                   bi + " got " + value);
+                errors++;
+            } catch(ArithmeticException ae) {
+                ; // Expected
+            }
+        }
+        return errors;
+    }
+
+    private static int testShortValueExact() {
+        int errors = 0;
+        BigInteger[] inRange = {
+            BigInteger.valueOf(Short.MIN_VALUE),
+            BigInteger.ZERO,
+            BigInteger.ONE,
+            BigInteger.TEN,
+            BigInteger.valueOf(Short.MAX_VALUE)
+        };
+
+        BigInteger[] outOfRange = {
+            BigInteger.valueOf((long)Integer.MIN_VALUE - 1),
+            BigInteger.valueOf((long)Integer.MIN_VALUE),
+            BigInteger.valueOf(   (int)Short.MIN_VALUE - 1),
+            BigInteger.valueOf(   (int)Short.MAX_VALUE + 1),
+            BigInteger.valueOf((long)Integer.MAX_VALUE),
+            BigInteger.valueOf((long)Integer.MAX_VALUE + 1)
+        };
+
+        for (BigInteger bi : inRange) {
+            if (bi.shortValueExact() != bi.shortValue()) {
+                System.err.println("Mismatching short  conversion for " + bi);
+                errors++;
+            }
+        }
+
+        for (BigInteger bi : outOfRange) {
+            try {
+                int value = bi.shortValueExact();
+                System.err.println("Failed to get expected exception on " +
+                                   bi + " got " + value);
+                errors++;
+            } catch(ArithmeticException ae) {
+                ; // Expected
+            }
+        }
+        return errors;
+    }
+
+    private static int testByteValueExact() {
+        int errors = 0;
+        BigInteger[] inRange = {
+            BigInteger.valueOf(Byte.MIN_VALUE),
+            BigInteger.valueOf(0),
+            BigInteger.ONE,
+            BigInteger.TEN,
+            BigInteger.valueOf(Byte.MAX_VALUE)
+        };
+
+        BigInteger[] outOfRange = {
+            BigInteger.valueOf((long)Integer.MIN_VALUE - 1),
+            BigInteger.valueOf((long)Integer.MIN_VALUE),
+            BigInteger.valueOf(   (int)Short.MIN_VALUE - 1),
+            BigInteger.valueOf(   (int)Short.MIN_VALUE),
+            BigInteger.valueOf(    (int)Byte.MIN_VALUE - 1),
+            BigInteger.valueOf(    (int)Byte.MAX_VALUE + 1),
+            BigInteger.valueOf(   (int)Short.MAX_VALUE + 1),
+            BigInteger.valueOf(   (int)Short.MAX_VALUE),
+            BigInteger.valueOf((long)Integer.MAX_VALUE),
+            BigInteger.valueOf((long)Integer.MAX_VALUE + 1)
+        };
+
+        for (BigInteger bi : inRange) {
+            if (bi.byteValueExact() != bi.byteValue()) {
+                System.err.println("Mismatching byte conversion for " + bi);
+                errors++;
+            }
+        }
+
+        for (BigInteger bi : outOfRange) {
+            try {
+                int value = bi.byteValueExact();
+                System.err.println("Failed to get expected exception on " +
+                                   bi + " got " + value);
+                errors++;
+            } catch(ArithmeticException ae) {
+                ; // Expected
+            }
+        }
+        return errors;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/net/CookieHandler/NullUriCookieTest.java	Wed Oct 26 17:59:13 2011 -0700
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6953455
+ * @summary CookieStore.add() cannot handle null URI parameter
+ */
+
+import java.net.CookieManager;
+import java.net.CookieStore;
+import java.net.HttpCookie;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.List;
+
+public class NullUriCookieTest {
+    static boolean fail = false;
+
+    public static void main(String[] args) throws Exception {
+        checkCookieNullUri();
+    }
+
+    static void checkCookieNullUri() throws Exception {
+        //get a cookie store implementation and add a cookie to the store with null URI
+        CookieStore cookieStore = (new CookieManager()).getCookieStore();
+        HttpCookie cookie = new HttpCookie("MY_COOKIE", "MY_COOKIE_VALUE");
+        cookie.setDomain("foo.com");
+        cookieStore.add(null, cookie);
+
+        //Retrieve added cookie
+        URI uri = new URI("http://foo.com");
+        List<HttpCookie> addedCookieList = cookieStore.get(uri);
+
+        //Verify CookieStore behaves well
+        if (addedCookieList.size() != 1) {
+           fail = true;
+        }
+        checkFail("Abnormal size of cookie jar");
+
+        for (HttpCookie chip : addedCookieList) {
+            if (!chip.equals(cookie)) {
+                 fail = true;
+            }
+        }
+        checkFail("Cookie not retrieved from Cookie Jar");
+        boolean ret = cookieStore.remove(null,cookie);
+        if (!ret) {
+            fail = true;
+        }
+        checkFail("Abnormal removal behaviour from Cookie Jar");
+    }
+
+    static void checkFail(String exp) {
+        if (fail) {
+            throw new RuntimeException(exp);
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/net/DatagramSocket/ChangingAddress.java	Wed Oct 26 17:59:13 2011 -0700
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @bug 7084030
+ * @summary Tests that DatagramSocket.getLocalAddress returns the right local
+ *          address after connect/disconnect.
+ */
+import java.net.*;
+
+public class ChangingAddress {
+
+    static void check(DatagramSocket ds, InetAddress expected) {
+        InetAddress actual = ds.getLocalAddress();
+        if (!expected.equals(actual)) {
+            throw new RuntimeException("Expected:"+expected+" Actual"+
+                                       actual);
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        InetAddress lh = InetAddress.getLocalHost();
+        SocketAddress remote = new InetSocketAddress(lh, 1234);
+        InetAddress wildcard = InetAddress.getByAddress
+                               ("localhost", new byte[]{0,0,0,0});
+        try (DatagramSocket ds = new DatagramSocket()) {
+            check(ds, wildcard);
+
+            ds.connect(remote);
+            check(ds, lh);
+
+            ds.disconnect();
+            check(ds, wildcard);
+       }
+    }
+}
--- a/test/java/net/URLConnection/Redirect307Test.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/net/URLConnection/Redirect307Test.java	Wed Oct 26 17:59:13 2011 -0700
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 4380568
+ * @bug 4380568 7095949
  * @summary  HttpURLConnection does not support 307 redirects
  */
 import java.io.*;
@@ -31,10 +31,9 @@
 
 class RedirServer extends Thread {
 
-    ServerSocket s;
-    Socket   s1;
-    InputStream  is;
-    OutputStream os;
+    static final int TIMEOUT = 10 * 1000;
+
+    ServerSocket ss;
     int port;
 
     String reply1Part1 = "HTTP/1.1 307 Temporary Redirect\r\n" +
@@ -46,10 +45,10 @@
         "Content-Type: text/html; charset=iso-8859-1\r\n\r\n" +
         "<html>Hello</html>";
 
-    RedirServer (ServerSocket y) {
-        s = y;
-        port = s.getLocalPort();
-        System.out.println("Server created listening on " + port);
+    RedirServer (ServerSocket ss) throws IOException {
+        this.ss = ss;
+        this.ss.setSoTimeout(TIMEOUT);
+        port = this.ss.getLocalPort();
     }
 
     String reply2 = "HTTP/1.1 200 Ok\r\n" +
@@ -59,74 +58,63 @@
         "Content-Type: text/html; charset=iso-8859-1\r\n\r\n" +
         "World";
 
+    static final byte[] requestEnd = new byte[] {'\r', '\n', '\r', '\n' };
+
+    // Read until the end of a HTTP request
+    void readOneRequest(InputStream is) throws IOException {
+        int requestEndCount = 0, r;
+        while ((r = is.read()) != -1) {
+            if (r == requestEnd[requestEndCount]) {
+                requestEndCount++;
+                if (requestEndCount == 4) {
+                    break;
+                }
+            } else {
+                requestEndCount = 0;
+            }
+        }
+    }
+
     public void run () {
         try {
-            s1 = s.accept ();
-            is = s1.getInputStream ();
-            os = s1.getOutputStream ();
-            is.read ();
-            String reply = reply1Part1 + port + reply1Part2;
-            os.write (reply.getBytes());
-            os.close();
+            try (Socket s = ss.accept()) {
+                s.setSoTimeout(TIMEOUT);
+                readOneRequest(s.getInputStream());
+                String reply = reply1Part1 + port + reply1Part2;
+                s.getOutputStream().write(reply.getBytes());
+            }
+
             /* wait for redirected connection */
-            s.setSoTimeout (5000);
-            s1 = s.accept ();
-            is = s1.getInputStream ();
-            os = s1.getOutputStream ();
-            is.read();
-            os.write (reply2.getBytes());
-            os.close();
-        }
-        catch (Exception e) {
-            /* Just need thread to terminate */
-            System.out.println("Server: caught " + e);
+            try (Socket s = ss.accept()) {
+                s.setSoTimeout(TIMEOUT);
+                readOneRequest(s.getInputStream());
+                s.getOutputStream().write(reply2.getBytes());
+            }
+        } catch (Exception e) {
             e.printStackTrace();
         } finally {
-            try { s.close(); } catch (IOException unused) {}
+            try { ss.close(); } catch (IOException unused) {}
         }
     }
 };
 
-
 public class Redirect307Test {
-
-    public static final int DELAY = 10;
-
     public static void main(String[] args) throws Exception {
-        int port;
-        RedirServer server;
-        ServerSocket sock;
+        ServerSocket sock = new ServerSocket(0);
+        int port = sock.getLocalPort();
+        RedirServer server = new RedirServer(sock);
+        server.start();
 
-        try {
-            sock = new ServerSocket (0);
-            port = sock.getLocalPort ();
-        }
-        catch (Exception e) {
-            System.out.println ("Exception: " + e);
-            return;
-        }
-
-        server = new RedirServer(sock);
-        server.start ();
+        URL url = new URL("http://localhost:" + port);
+        URLConnection conURL =  url.openConnection();
+        conURL.setDoInput(true);
+        conURL.setAllowUserInteraction(false);
+        conURL.setUseCaches(false);
 
-        try  {
-
-            String s = "http://localhost:" + port;
-            URL url = new URL(s);
-            URLConnection conURL =  url.openConnection();
-
-            conURL.setDoInput(true);
-            conURL.setAllowUserInteraction(false);
-            conURL.setUseCaches(false);
-
-            InputStream in = conURL.getInputStream();
+        try (InputStream in = conURL.getInputStream()) {
             if ((in.read() != (int)'W') || (in.read()!=(int)'o')) {
                 throw new RuntimeException ("Unexpected string read");
             }
         }
-        catch(IOException e) {
-            e.printStackTrace();
-            throw new RuntimeException ("Exception caught + " + e);
-        }
     }
 }
--- a/test/java/net/URLConnection/RedirectLimit.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/net/URLConnection/RedirectLimit.java	Wed Oct 26 17:59:13 2011 -0700
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 4458085
+ * @bug 4458085 7095949
  * @summary  Redirects Limited to 5
  */
 
@@ -57,29 +57,43 @@
     final ServerSocket ss;
     final int port;
 
-    RedirLimitServer(ServerSocket ss) {
+    RedirLimitServer(ServerSocket ss) throws IOException {
         this.ss = ss;
-        port = ss.getLocalPort();
+        port = this.ss.getLocalPort();
+        this.ss.setSoTimeout(TIMEOUT);
+    }
+
+    static final byte[] requestEnd = new byte[] {'\r', '\n', '\r', '\n' };
+
+    // Read until the end of a HTTP request
+    void readOneRequest(InputStream is) throws IOException {
+        int requestEndCount = 0, r;
+        while ((r = is.read()) != -1) {
+            if (r == requestEnd[requestEndCount]) {
+                requestEndCount++;
+                if (requestEndCount == 4) {
+                    break;
+                }
+            } else {
+                requestEndCount = 0;
+            }
+        }
     }
 
     public void run() {
         try {
-            ss.setSoTimeout(TIMEOUT);
             for (int i=0; i<NUM_REDIRECTS; i++) {
                 try (Socket s = ss.accept()) {
                     s.setSoTimeout(TIMEOUT);
-                    InputStream is = s.getInputStream();
-                    OutputStream os = s.getOutputStream();
-                    is.read();
+                    readOneRequest(s.getInputStream());
                     String reply = reply1 + port + "/redirect" + i + reply2;
-                    os.write(reply.getBytes());
+                    s.getOutputStream().write(reply.getBytes());
                 }
             }
             try (Socket s = ss.accept()) {
-                InputStream is = s.getInputStream();
-                OutputStream os = s.getOutputStream();
-                is.read();
-                os.write(reply3.getBytes());
+                s.setSoTimeout(TIMEOUT);
+                readOneRequest(s.getInputStream());
+                s.getOutputStream().write(reply3.getBytes());
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -96,21 +110,17 @@
         RedirLimitServer server = new RedirLimitServer(ss);
         server.start();
 
-        InputStream in = null;
-        try {
-            URL url = new URL("http://localhost:" + port);
-            URLConnection conURL =  url.openConnection();
+        URL url = new URL("http://localhost:" + port);
+        URLConnection conURL =  url.openConnection();
 
-            conURL.setDoInput(true);
-            conURL.setAllowUserInteraction(false);
-            conURL.setUseCaches(false);
+        conURL.setDoInput(true);
+        conURL.setAllowUserInteraction(false);
+        conURL.setUseCaches(false);
 
-            in = conURL.getInputStream();
+        try (InputStream in = conURL.getInputStream()) {
             if ((in.read() != (int)'W') || (in.read()!=(int)'o')) {
                 throw new RuntimeException("Unexpected string read");
             }
-        } finally {
-            if ( in != null ) { in.close(); }
         }
     }
 }
--- a/test/java/util/Formatter/Basic-X.java.template	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/util/Formatter/Basic-X.java.template	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,6 @@
 import java.text.DateFormatSymbols;
 import java.util.*;
 #if[double]
-import sun.misc.FpUtils;
 import sun.misc.DoubleConsts;
 #end[double]
 
@@ -1301,9 +1300,9 @@
         test("%.11a", "0x1.00000000000p-1022", DoubleConsts.MIN_NORMAL);
         test("%.1a", "0x1.0p-1022", DoubleConsts.MIN_NORMAL);
         test("%.11a", "0x1.00000000000p-1022",
-             FpUtils.nextDown(DoubleConsts.MIN_NORMAL));
+             Math.nextDown(DoubleConsts.MIN_NORMAL));
         test("%.1a", "0x1.0p-1022",
-             FpUtils.nextDown(DoubleConsts.MIN_NORMAL));
+             Math.nextDown(DoubleConsts.MIN_NORMAL));
         test("%.11a", "0x1.ffffffffffep-1023",
              Double.parseDouble("0x0.fffffffffffp-1022"));
         test("%.1a", "0x1.0p-1022",
--- a/test/java/util/Formatter/BasicBigDecimal.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/util/Formatter/BasicBigDecimal.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
 
 
 
-
 import static java.util.Calendar.*;
 
 
--- a/test/java/util/Formatter/BasicBigInteger.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/util/Formatter/BasicBigInteger.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
 
 
 
-
 import static java.util.Calendar.*;
 
 
--- a/test/java/util/Formatter/BasicBoolean.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/util/Formatter/BasicBoolean.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
 
 
 
-
 import static java.util.Calendar.*;
 
 
--- a/test/java/util/Formatter/BasicBooleanObject.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/util/Formatter/BasicBooleanObject.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
 
 
 
-
 import static java.util.Calendar.*;
 
 
--- a/test/java/util/Formatter/BasicByte.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/util/Formatter/BasicByte.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
 
 
 
-
 import static java.util.Calendar.*;
 
 
--- a/test/java/util/Formatter/BasicByteObject.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/util/Formatter/BasicByteObject.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
 
 
 
-
 import static java.util.Calendar.*;
 
 
--- a/test/java/util/Formatter/BasicChar.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/util/Formatter/BasicChar.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
 
 
 
-
 import static java.util.Calendar.*;
 
 
--- a/test/java/util/Formatter/BasicCharObject.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/util/Formatter/BasicCharObject.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
 
 
 
-
 import static java.util.Calendar.*;
 
 
--- a/test/java/util/Formatter/BasicDateTime.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/util/Formatter/BasicDateTime.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
 
 
 
-
 import static java.util.Calendar.*;
 
 import static java.util.SimpleTimeZone.*;
--- a/test/java/util/Formatter/BasicDouble.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/util/Formatter/BasicDouble.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,6 @@
 import java.text.DateFormatSymbols;
 import java.util.*;
 
-import sun.misc.FpUtils;
 import sun.misc.DoubleConsts;
 
 
@@ -1301,9 +1300,9 @@
         test("%.11a", "0x1.00000000000p-1022", DoubleConsts.MIN_NORMAL);
         test("%.1a", "0x1.0p-1022", DoubleConsts.MIN_NORMAL);
         test("%.11a", "0x1.00000000000p-1022",
-             FpUtils.nextDown(DoubleConsts.MIN_NORMAL));
+             Math.nextDown(DoubleConsts.MIN_NORMAL));
         test("%.1a", "0x1.0p-1022",
-             FpUtils.nextDown(DoubleConsts.MIN_NORMAL));
+             Math.nextDown(DoubleConsts.MIN_NORMAL));
         test("%.11a", "0x1.ffffffffffep-1023",
              Double.parseDouble("0x0.fffffffffffp-1022"));
         test("%.1a", "0x1.0p-1022",
--- a/test/java/util/Formatter/BasicDoubleObject.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/util/Formatter/BasicDoubleObject.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
 
 
 
-
 import static java.util.Calendar.*;
 
 
--- a/test/java/util/Formatter/BasicFloat.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/util/Formatter/BasicFloat.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
 
 
 
-
 import static java.util.Calendar.*;
 
 
--- a/test/java/util/Formatter/BasicFloatObject.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/util/Formatter/BasicFloatObject.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
 
 
 
-
 import static java.util.Calendar.*;
 
 
--- a/test/java/util/Formatter/BasicInt.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/util/Formatter/BasicInt.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
 
 
 
-
 import static java.util.Calendar.*;
 
 
--- a/test/java/util/Formatter/BasicIntObject.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/util/Formatter/BasicIntObject.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
 
 
 
-
 import static java.util.Calendar.*;
 
 
--- a/test/java/util/Formatter/BasicLong.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/util/Formatter/BasicLong.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
 
 
 
-
 import static java.util.Calendar.*;
 
 
--- a/test/java/util/Formatter/BasicLongObject.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/util/Formatter/BasicLongObject.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
 
 
 
-
 import static java.util.Calendar.*;
 
 
--- a/test/java/util/Formatter/BasicShort.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/util/Formatter/BasicShort.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
 
 
 
-
 import static java.util.Calendar.*;
 
 
--- a/test/java/util/Formatter/BasicShortObject.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/util/Formatter/BasicShortObject.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
 
 
 
-
 import static java.util.Calendar.*;
 
 
--- a/test/java/util/Locale/Bug6989440.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/util/Locale/Bug6989440.java	Wed Oct 26 17:59:13 2011 -0700
@@ -37,26 +37,49 @@
 import sun.util.LocaleServiceProviderPool;
 
 public class Bug6989440 {
-    public static void main(String[] args) {
-        TestThread t1 = new TestThread(LocaleNameProvider.class);
-        TestThread t2 = new TestThread(TimeZoneNameProvider.class);
-        TestThread t3 = new TestThread(DateFormatProvider.class);
+    static volatile boolean failed;  // false
+    static final int THREADS = 50;
 
-        t1.start();
-        t2.start();
-        t3.start();
+    public static void main(String[] args) throws Exception {
+        Thread[] threads = new Thread[THREADS];
+        for (int i=0; i<threads.length; i++)
+            threads[i] = new TestThread();
+        for (int i=0; i<threads.length; i++)
+            threads[i].start();
+        for (int i=0; i<threads.length; i++)
+            threads[i].join();
+
+        if (failed)
+            throw new RuntimeException("Failed: check output");
     }
 
     static class TestThread extends Thread {
         private Class<? extends LocaleServiceProvider> cls;
+        private static int count;
 
         public TestThread(Class<? extends LocaleServiceProvider> providerClass) {
             cls = providerClass;
         }
 
+        public TestThread() {
+            int which = count++ % 3;
+            switch (which) {
+                case 0 : cls = LocaleNameProvider.class; break;
+                case 1 : cls = TimeZoneNameProvider.class; break;
+                case 2 : cls = DateFormatProvider.class; break;
+                default : throw new AssertionError("Should not reach here");
+            }
+        }
+
         public void run() {
-            LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(cls);
-            pool.getAvailableLocales();
+            try {
+                LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(cls);
+                pool.getAvailableLocales();
+            } catch (Exception e) {
+                System.out.println(e);
+                e.printStackTrace();
+                failed = true;
+            }
         }
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/concurrent/ScheduledThreadPoolExecutor/ZeroCorePoolSize.java	Wed Oct 26 17:59:13 2011 -0700
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7091003
+ * @summary ScheduledExecutorService never executes Runnable
+ *          with corePoolSize of zero
+ * @author Chris Hegarty
+ */
+
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Verify that tasks can be run even with a core pool size of 0.
+ */
+public class ZeroCorePoolSize {
+
+    volatile boolean taskRun;
+
+    void test(String[] args) throws Throwable {
+
+        ScheduledThreadPoolExecutor pool = new ScheduledThreadPoolExecutor(0);
+        Runnable task = new Runnable() {
+            public void run() {
+                taskRun = true;
+            }
+        };
+        check(pool.getCorePoolSize() == 0);
+
+        pool.schedule(task, 1, TimeUnit.SECONDS);
+
+        pool.shutdown();
+        check(pool.awaitTermination(20L, TimeUnit.SECONDS));
+        check(pool.getCorePoolSize() == 0);
+        check(taskRun);
+    }
+
+    //--------------------- Infrastructure ---------------------------
+    volatile int passed = 0, failed = 0;
+    void pass() {passed++;}
+    void fail() {failed++; Thread.dumpStack();}
+    void fail(String msg) {System.err.println(msg); fail();}
+    void unexpected(Throwable t) {failed++; t.printStackTrace();}
+    void check(boolean cond) {if (cond) pass(); else fail();}
+    void equal(Object x, Object y) {
+        if (x == null ? y == null : x.equals(y)) pass();
+        else fail(x + " not equal to " + y);}
+    public static void main(String[] args) throws Throwable {
+        new ZeroCorePoolSize().instanceMain(args);}
+    void instanceMain(String[] args) throws Throwable {
+        try {test(args);} catch (Throwable t) {unexpected(t);}
+        System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
+        if (failed > 0) throw new AssertionError("Some tests failed");}
+    abstract class F {abstract void f() throws Throwable;}
+    void THROWS(Class<? extends Throwable> k, F... fs) {
+        for (F f : fs)
+            try {f.f(); fail("Expected " + k.getName() + " not thrown");}
+            catch (Throwable t) {
+                if (k.isAssignableFrom(t.getClass())) pass();
+                else unexpected(t);}}
+}
--- a/test/java/util/logging/ParentLoggersTest.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/java/util/logging/ParentLoggersTest.java	Wed Oct 26 17:59:13 2011 -0700
@@ -6,7 +6,7 @@
  * @author  ss45998
  *
  * @build ParentLoggersTest
- * @run main ParentLoggersTest
+ * @run main/othervm ParentLoggersTest
  */
 
 /*
--- a/test/javax/security/auth/Subject/Synch.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/javax/security/auth/Subject/Synch.java	Wed Oct 26 17:59:13 2011 -0700
@@ -35,15 +35,15 @@
 import javax.security.auth.x500.X500Principal;
 
 public class Synch {
+    static volatile boolean finished = false;
     public static void main(String[] args) {
         Subject subject = new Subject();
         final Set principals = subject.getPrincipals();
         principals.add(new X500Principal("CN=Alice"));
         new Thread() {
-            { setDaemon(true); }
             public void run() {
                 Principal last = new X500Principal("CN=Bob");
-                for (int i = 0; true; i++) {
+                for (int i = 0; !finished; i++) {
                     Principal next = new X500Principal("CN=Bob" + i);
                     principals.add(next);
                     principals.remove(last);
@@ -70,5 +70,6 @@
                     }
                 });
         }
+        finished = true;
     }
 }
--- a/test/javax/security/auth/Subject/Synch2.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/javax/security/auth/Subject/Synch2.java	Wed Oct 26 17:59:13 2011 -0700
@@ -35,6 +35,7 @@
 import javax.security.auth.x500.X500Principal;
 
 public class Synch2 {
+    static volatile boolean finished = false;
     public static void main(String[] args) {
         System.setSecurityManager(new SecurityManager());
         Subject subject = new Subject();
@@ -44,12 +45,11 @@
         credentials.add("Dummy credential");
         new Thread() {
             {
-                setDaemon(true);
                 start();
             }
             public void run() {
                 X500Principal p = new X500Principal("CN=Bob");
-                while (true) {
+                while (!finished) {
                     principals.add(p);
                     principals.remove(p);
                 }
@@ -62,5 +62,6 @@
                 }
             }
         }
+        finished = true;
     }
 }
--- a/test/javax/security/auth/Subject/Synch3.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/javax/security/auth/Subject/Synch3.java	Wed Oct 26 17:59:13 2011 -0700
@@ -33,18 +33,18 @@
 import javax.security.auth.x500.X500Principal;
 
 public class Synch3 {
+    static volatile boolean finished = false;
     public static void main(String[] args) {
         Subject subject = new Subject();
         final Set principals = subject.getPrincipals();
         principals.add(new X500Principal("CN=Alice"));
         new Thread() {
             {
-                setDaemon(true);
                 start();
             }
             public void run() {
                 X500Principal p = new X500Principal("CN=Bob");
-                while (true) {
+                while (!finished) {
                     principals.add(p);
                     principals.remove(p);
                 }
@@ -53,5 +53,6 @@
         for (int i = 0; i < 1000; i++) {
             subject.getPrincipals(X500Principal.class);
         }
+        finished = true;
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JColorChooser/Test6827032.java	Wed Oct 26 17:59:13 2011 -0700
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6827032
+ * @summary Color chooser with drag enabled shouldn't throw NPE
+ * @author Peter Zhelezniakov
+ * @library ../regtesthelpers
+ */
+
+import sun.awt.SunToolkit;
+
+import java.awt.*;
+import java.awt.event.*;
+
+import javax.swing.*;
+import javax.swing.plaf.nimbus.NimbusLookAndFeel;
+
+
+public class Test6827032 {
+
+    private static volatile Point point;
+    private static JColorChooser cc;
+
+    public static void main(String[] args) throws Exception {
+        UIManager.setLookAndFeel(new NimbusLookAndFeel());
+
+        Robot robot = new Robot();
+        robot.setAutoDelay(50);
+
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                createAndShowGUI();
+            }
+        });
+
+        toolkit.realSync();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                Component previewPanel = Util.findSubComponent(cc, "javax.swing.colorchooser.DefaultPreviewPanel");
+                point = previewPanel.getLocationOnScreen();
+            }
+        });
+
+        point.translate(5, 5);
+
+        robot.mouseMove(point.x, point.y);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+    }
+
+
+    private static void createAndShowGUI() {
+        JFrame frame = new JFrame(Test6827032.class.getName());
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        cc = new JColorChooser();
+        cc.setDragEnabled(true);
+        frame.add(cc);
+        frame.pack();
+        frame.setVisible(true);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/SwingUtilities/7088744/bug7088744.java	Wed Oct 26 17:59:13 2011 -0700
@@ -0,0 +1,221 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+   @bug 7088744
+   @summary SwingUtilities.isMiddleMouseButton does not work with ALT/Meta keys
+   @author Pavel Porvatov
+*/
+
+import sun.awt.SunToolkit;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.InputEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+
+public class bug7088744 {
+    private static volatile JLabel label;
+
+    private static volatile Point point;
+
+    private static final int MOUSE_CLICKED = 1;
+    private static final int MOUSE_PRESSED = 2;
+    private static final int MOUSE_RELEASED = 3;
+
+    // Pair with (EventType, Mouse Button)
+    private static final int[][] BUTTON_EVENTS_SEQUENCE = {
+            {MOUSE_PRESSED, 1},
+            {MOUSE_PRESSED, 2},
+            {MOUSE_PRESSED, 3},
+            {MOUSE_RELEASED, 1},
+            {MOUSE_CLICKED, 1},
+            {MOUSE_RELEASED, 2},
+            {MOUSE_CLICKED, 2},
+            {MOUSE_RELEASED, 3},
+            {MOUSE_CLICKED, 3}
+    };
+
+    private static int eventCount;
+
+    public static void main(String[] args) throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                Component source = new JLabel();
+
+                MouseEvent mouseEventNoButtons = new MouseEvent(source, 0, System.currentTimeMillis(),
+                        Event.ALT_MASK | Event.META_MASK | InputEvent.ALT_DOWN_MASK | InputEvent.META_DOWN_MASK,
+                        0, 0, 0, false, MouseEvent.NOBUTTON);
+
+                // isLeftMouseButton
+                if (SwingUtilities.isLeftMouseButton(mouseEventNoButtons)) {
+                    throw new RuntimeException("SwingUtilities.isLeftMouseButton fails 1");
+                }
+
+                if (!SwingUtilities.isLeftMouseButton(new MouseEvent(source, 0, System.currentTimeMillis(),
+                        InputEvent.BUTTON1_MASK, 0, 0, 1, false, MouseEvent.BUTTON1))) {
+                    throw new RuntimeException("SwingUtilities.isLeftMouseButton fails 2");
+                }
+
+                if (!SwingUtilities.isLeftMouseButton(new MouseEvent(source, 0, System.currentTimeMillis(),
+                        InputEvent.BUTTON1_DOWN_MASK, 0, 0, 1, false, MouseEvent.BUTTON1))) {
+                    throw new RuntimeException("SwingUtilities.isLeftMouseButton fails 3");
+                }
+
+                // isMiddleMouseButton
+                if (SwingUtilities.isMiddleMouseButton(mouseEventNoButtons)) {
+                    throw new RuntimeException("SwingUtilities.isMiddleMouseButton fails 1");
+                }
+
+                if (!SwingUtilities.isMiddleMouseButton(new MouseEvent(source, 0, System.currentTimeMillis(),
+                        InputEvent.BUTTON2_MASK, 0, 0, 1, false, MouseEvent.BUTTON2))) {
+                    throw new RuntimeException("SwingUtilities.isMiddleMouseButton fails 2");
+                }
+
+                if (!SwingUtilities.isMiddleMouseButton(new MouseEvent(source, 0, System.currentTimeMillis(),
+                        InputEvent.BUTTON2_DOWN_MASK, 0, 0, 1, false, MouseEvent.BUTTON2))) {
+                    throw new RuntimeException("SwingUtilities.isMiddleMouseButton fails 3");
+                }
+
+                // isRightMouseButton
+                if (SwingUtilities.isRightMouseButton(mouseEventNoButtons)) {
+                    throw new RuntimeException("SwingUtilities.isRightMouseButton fails 1");
+                }
+
+                if (!SwingUtilities.isRightMouseButton(new MouseEvent(source, 0, System.currentTimeMillis(),
+                        InputEvent.BUTTON3_MASK, 0, 0, 1, false, MouseEvent.BUTTON3))) {
+                    throw new RuntimeException("SwingUtilities.isRightMouseButton fails 2");
+                }
+
+                if (!SwingUtilities.isRightMouseButton(new MouseEvent(source, 0, System.currentTimeMillis(),
+                        InputEvent.BUTTON3_DOWN_MASK, 0, 0, 1, false, MouseEvent.BUTTON3))) {
+                    throw new RuntimeException("SwingUtilities.isRightMouseButton fails 3");
+                }
+            }
+        });
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                JFrame frame = new JFrame();
+
+                label = new JLabel("A label");
+
+                label.addMouseListener(new MouseAdapter() {
+                    public void mouseClicked(MouseEvent e) {
+                        processEvent(MOUSE_CLICKED, e);
+                    }
+
+                    public void mousePressed(MouseEvent e) {
+                        processEvent(MOUSE_PRESSED, e);
+                    }
+
+                    public void mouseReleased(MouseEvent e) {
+                        processEvent(MOUSE_RELEASED, e);
+                    }
+                });
+                frame.add(label);
+                frame.setSize(200, 100);
+                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+                frame.setVisible(true);
+            }
+        });
+
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+
+        toolkit.realSync();
+
+        // On Linux platforms realSync doesn't guaranties setSize completion
+        Thread.sleep(1000);
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                point = label.getLocationOnScreen();
+            }
+        });
+
+        Robot robot = new Robot();
+
+        robot.setAutoDelay(100);
+        robot.mouseMove(point.x, point.y);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mousePress(InputEvent.BUTTON2_MASK);
+        robot.mousePress(InputEvent.BUTTON3_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON2_MASK);
+        robot.mouseRelease(InputEvent.BUTTON3_MASK);
+
+        toolkit.realSync();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                if (eventCount != BUTTON_EVENTS_SEQUENCE.length) {
+                    throw new RuntimeException("Not all events received");
+                }
+
+            }
+        });
+
+        System.out.println("Test passed");
+    }
+
+    private static void processEvent(int eventType, MouseEvent e) {
+        if (eventCount >= BUTTON_EVENTS_SEQUENCE.length) {
+            throw new RuntimeException("Unexpected event " + e);
+        }
+
+        int[] arr = BUTTON_EVENTS_SEQUENCE[eventCount];
+
+        if (arr[0] != eventType) {
+            throw new RuntimeException("Unexpected eventType " + eventType + "on step " + eventCount);
+        }
+
+        boolean result;
+
+        switch (arr[1]) {
+            case 1:
+                result = SwingUtilities.isLeftMouseButton(e);
+
+                break;
+
+            case 2:
+                result = SwingUtilities.isMiddleMouseButton(e);
+
+                break;
+
+            case 3:
+                result = SwingUtilities.isRightMouseButton(e);
+
+                break;
+
+            default:
+                throw new RuntimeException("Incorrect arr[1] on step " + eventCount);
+        }
+
+        if (!result) {
+            throw new RuntimeException("Test failed on step " + eventCount);
+        }
+
+        eventCount++;
+    }
+}
--- a/test/javax/swing/regtesthelpers/Util.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/javax/swing/regtesthelpers/Util.java	Wed Oct 26 17:59:13 2011 -0700
@@ -116,4 +116,28 @@
 
         System.out.println("Got OOME");
     }
+
+    /**
+     * Find a sub component by class name.
+     * Always run this method on the EDT thread
+     */
+    public static Component findSubComponent(Component parent, String className) {
+        String parentClassName = parent.getClass().getName();
+
+        if (parentClassName.contains(className)) {
+            return parent;
+        }
+
+        if (parent instanceof Container) {
+            for (Component child : ((Container) parent).getComponents()) {
+                Component subComponent = findSubComponent(child, className);
+
+                if (subComponent != null) {
+                    return subComponent;
+                }
+            }
+        }
+
+        return null;
+    }
 }
--- a/test/sun/jvmstat/perfdata/PrologSanity/PrologSizeSanityCheck.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/jvmstat/perfdata/PrologSanity/PrologSizeSanityCheck.java	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
 /*
  * @test
  * @bug 4990825
+ * @run main/othervm -XX:+UsePerfData  PrologSizeSanityCheck
  * @summary prolog size and overflow sanity checks
  */
 
--- a/test/sun/misc/JarIndex/metaInfFilenames/Basic.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/misc/JarIndex/metaInfFilenames/Basic.java	Wed Oct 26 17:59:13 2011 -0700
@@ -154,7 +154,7 @@
     /* run javac <args> */
     static void compile(String... args) {
         debug("Running: javac " + Arrays.toString(args));
-        com.sun.tools.javac.main.Main compiler = new com.sun.tools.javac.main.Main("javac");
+        com.sun.tools.javac.Main compiler = new com.sun.tools.javac.Main();
         if (compiler.compile(args) != 0) {
              throw new RuntimeException("javac failed: args=" + Arrays.toString(args));
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/krb5/auto/AcceptorSubKey.java	Wed Oct 26 17:59:13 2011 -0700
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7077646
+ * @summary gssapi wrap for CFX per-message tokens always set FLAG_ACCEPTOR_SUBKEY
+ * @compile -XDignore.symbol.file AcceptorSubKey.java
+ * @run main/othervm AcceptorSubKey
+ */
+
+import java.util.Arrays;
+import sun.security.jgss.GSSUtil;
+
+// The basic krb5 test skeleton you can copy from
+public class AcceptorSubKey {
+
+    public static void main(String[] args) throws Exception {
+
+        new OneKDC(null).writeJAASConf();
+
+        Context c, s;
+        c = Context.fromJAAS("client");
+        s = Context.fromJAAS("server");
+
+        c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_SPNEGO_MECH_OID);
+        s.startAsServer(GSSUtil.GSS_SPNEGO_MECH_OID);
+
+        Context.handshake(c, s);
+
+        byte[] msg = "i say high --".getBytes();
+        byte[] wrapped = s.wrap(msg, false);
+
+        // FLAG_ACCEPTOR_SUBKEY is 4
+        int flagOn = wrapped[2] & 4;
+        if (flagOn != 0) {
+            throw new Exception("Java GSS should not have set acceptor subkey");
+        }
+
+        s.dispose();
+        c.dispose();
+    }
+}
--- a/test/sun/security/krb5/auto/Context.java	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/security/krb5/auto/Context.java	Wed Oct 26 17:59:13 2011 -0700
@@ -375,6 +375,89 @@
         }
     }
 
+    public byte[] wrap(byte[] t, final boolean privacy)
+            throws Exception {
+        return doAs(new Action() {
+            @Override
+            public byte[] run(Context me, byte[] input) throws Exception {
+                System.out.printf("wrap %s privacy from %s: ", privacy?"with":"without", me.name);
+                MessageProp p1 = new MessageProp(0, privacy);
+                byte[] out;
+                if (usingStream) {
+                    ByteArrayOutputStream os = new ByteArrayOutputStream();
+                    me.x.wrap(new ByteArrayInputStream(input), os, p1);
+                    out = os.toByteArray();
+                } else {
+                    out = me.x.wrap(input, 0, input.length, p1);
+                }
+                System.out.println(printProp(p1));
+                return out;
+            }
+        }, t);
+    }
+
+    public byte[] unwrap(byte[] t, final boolean privacy)
+            throws Exception {
+        return doAs(new Action() {
+            @Override
+            public byte[] run(Context me, byte[] input) throws Exception {
+                System.out.printf("unwrap %s privacy from %s: ", privacy?"with":"without", me.name);
+                MessageProp p1 = new MessageProp(0, privacy);
+                byte[] bytes;
+                if (usingStream) {
+                    ByteArrayOutputStream os = new ByteArrayOutputStream();
+                    me.x.unwrap(new ByteArrayInputStream(input), os, p1);
+                    bytes = os.toByteArray();
+                } else {
+                    bytes = me.x.unwrap(input, 0, input.length, p1);
+                }
+                System.out.println(printProp(p1));
+                return bytes;
+            }
+        }, t);
+    }
+
+    public byte[] getMic(byte[] t) throws Exception {
+        return doAs(new Action() {
+            @Override
+            public byte[] run(Context me, byte[] input) throws Exception {
+                MessageProp p1 = new MessageProp(0, true);
+                byte[] bytes;
+                p1 = new MessageProp(0, true);
+                System.out.printf("getMic from %s: ", me.name);
+                if (usingStream) {
+                    ByteArrayOutputStream os = new ByteArrayOutputStream();
+                    me.x.getMIC(new ByteArrayInputStream(input), os, p1);
+                    bytes = os.toByteArray();
+                } else {
+                    bytes = me.x.getMIC(input, 0, input.length, p1);
+                }
+                System.out.println(printProp(p1));
+                return bytes;
+            }
+        }, t);
+    }
+
+    public void verifyMic(byte[] t, final byte[] msg) throws Exception {
+        doAs(new Action() {
+            @Override
+            public byte[] run(Context me, byte[] input) throws Exception {
+                MessageProp p1 = new MessageProp(0, true);
+                System.out.printf("verifyMic from %s: ", me.name);
+                if (usingStream) {
+                    me.x.verifyMIC(new ByteArrayInputStream(input),
+                            new ByteArrayInputStream(msg), p1);
+                } else {
+                    me.x.verifyMIC(input, 0, input.length,
+                            msg, 0, msg.length,
+                            p1);
+                }
+                System.out.println(printProp(p1));
+                return null;
+            }
+        }, t);
+    }
+
     /**
      * Transmits a message from one Context to another. The sender wraps the
      * message and sends it to the receiver. The receiver unwraps it, creates
@@ -390,73 +473,13 @@
         final byte[] messageBytes = message.getBytes();
         System.out.printf("-------------------- TRANSMIT from %s to %s------------------------\n",
                 s1.name, s2.name);
-
-        byte[] t = s1.doAs(new Action() {
-            @Override
-            public byte[] run(Context me, byte[] dummy) throws Exception {
-                System.out.println("wrap");
-                MessageProp p1 = new MessageProp(0, true);
-                byte[] out;
-                if (usingStream) {
-                    ByteArrayOutputStream os = new ByteArrayOutputStream();
-                    me.x.wrap(new ByteArrayInputStream(messageBytes), os, p1);
-                    out = os.toByteArray();
-                } else {
-                    out = me.x.wrap(messageBytes, 0, messageBytes.length, p1);
-                }
-                System.out.println(printProp(p1));
-                return out;
-            }
-        }, null);
-
-        t = s2.doAs(new Action() {
-            @Override
-            public byte[] run(Context me, byte[] input) throws Exception {
-                MessageProp p1 = new MessageProp(0, true);
-                byte[] bytes;
-                if (usingStream) {
-                    ByteArrayOutputStream os = new ByteArrayOutputStream();
-                    me.x.unwrap(new ByteArrayInputStream(input), os, p1);
-                    bytes = os.toByteArray();
-                } else {
-                    bytes = me.x.unwrap(input, 0, input.length, p1);
-                }
-                if (!Arrays.equals(messageBytes, bytes))
-                    throw new Exception("wrap/unwrap mismatch");
-                System.out.println("unwrap");
-                System.out.println(printProp(p1));
-                p1 = new MessageProp(0, true);
-                System.out.println("getMIC");
-                if (usingStream) {
-                    ByteArrayOutputStream os = new ByteArrayOutputStream();
-                    me.x.getMIC(new ByteArrayInputStream(messageBytes), os, p1);
-                    bytes = os.toByteArray();
-                } else {
-                    bytes = me.x.getMIC(messageBytes, 0, messageBytes.length, p1);
-                }
-                System.out.println(printProp(p1));
-                return bytes;
-            }
-        }, t);
-
-        // Re-unwrap should make p2.isDuplicateToken() returns true
-        s1.doAs(new Action() {
-            @Override
-            public byte[] run(Context me, byte[] input) throws Exception {
-                MessageProp p1 = new MessageProp(0, true);
-                System.out.println("verifyMIC");
-                if (usingStream) {
-                    me.x.verifyMIC(new ByteArrayInputStream(input),
-                            new ByteArrayInputStream(messageBytes), p1);
-                } else {
-                    me.x.verifyMIC(input, 0, input.length,
-                            messageBytes, 0, messageBytes.length,
-                            p1);
-                }
-                System.out.println(printProp(p1));
-                return null;
-            }
-        }, t);
+        byte[] wrapped = s1.wrap(messageBytes, true);
+        byte[] unwrapped = s2.unwrap(wrapped, true);
+        if (!Arrays.equals(messageBytes, unwrapped)) {
+            throw new Exception("wrap/unwrap mismatch");
+        }
+        byte[] mic = s2.getMic(unwrapped);
+        s1.verifyMic(mic, messageBytes);
     }
 
     /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/krb5/auto/NoInitNoKeytab.java	Wed Oct 26 17:59:13 2011 -0700
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7089889
+ * @summary Krb5LoginModule.login() throws an exception if used without a keytab
+ * @compile -XDignore.symbol.file NoInitNoKeytab.java
+ * @run main/othervm NoInitNoKeytab
+ */
+
+import java.io.FileOutputStream;
+import sun.security.jgss.GSSUtil;
+
+// The basic krb5 test skeleton you can copy from
+public class NoInitNoKeytab {
+
+    public static void main(String[] args) throws Exception {
+
+        new OneKDC(null).writeJAASConf();
+        try (FileOutputStream fos =
+                new FileOutputStream(OneKDC.JAAS_CONF, true)) {
+            fos.write((
+                "noinit {\n" +
+                "    com.sun.security.auth.module.Krb5LoginModule required\n" +
+                "    principal=\"" + OneKDC.USER + "\"\n" +
+                "    useKeyTab=false\n" +
+                "    isInitiator=false\n" +
+                "    storeKey=true;\n};\n").getBytes());
+        }
+        Context c, s;
+        c = Context.fromJAAS("client");
+        s = Context.fromJAAS("noinit");
+
+        c.startAsClient(OneKDC.USER, GSSUtil.GSS_SPNEGO_MECH_OID);
+        s.startAsServer(GSSUtil.GSS_SPNEGO_MECH_OID);
+
+        Context.handshake(c, s);
+
+        Context.transmit("i say high --", c, s);
+        Context.transmit("   you say low", s, c);
+
+        s.dispose();
+        c.dispose();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/krb5/auto/RRC.java	Wed Oct 26 17:59:13 2011 -0700
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7077640
+ * @summary gss wrap for cfx doesn't handle rrc != 0
+ * @compile -XDignore.symbol.file RRC.java
+ * @run main/othervm RRC
+ */
+
+import java.util.Arrays;
+import sun.security.jgss.GSSUtil;
+
+// The basic krb5 test skeleton you can copy from
+public class RRC {
+
+    public static void main(String[] args) throws Exception {
+
+        new OneKDC(null).writeJAASConf();
+
+        Context c, s;
+        c = Context.fromJAAS("client");
+        s = Context.fromJAAS("server");
+
+        c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_SPNEGO_MECH_OID);
+        s.startAsServer(GSSUtil.GSS_SPNEGO_MECH_OID);
+
+        Context.handshake(c, s);
+
+        byte[] msg = "i say high --".getBytes();
+        byte[] wrapped = c.wrap(msg, false);
+
+        // Simulate RRC equals to EC
+        int rrc = wrapped[5];
+        byte[] rotated = new byte[wrapped.length];
+        System.arraycopy(wrapped, 0, rotated, 0, 16);
+        System.arraycopy(wrapped, wrapped.length-rrc, rotated, 16, rrc);
+        System.arraycopy(wrapped, 16, rotated, 16+rrc, wrapped.length-16-rrc);
+        rotated[7] = (byte)rrc;
+
+        byte[] unwrapped = s.unwrap(rotated, false);
+        if (!Arrays.equals(msg, unwrapped)) {
+            throw new Exception("Failure");
+        }
+
+        s.dispose();
+        c.dispose();
+    }
+}
--- a/test/sun/tools/common/ApplicationSetup.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/common/ApplicationSetup.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -43,7 +43,7 @@
 {
   appOutput="${TESTCLASSES}/Application.out"
 
-  ${JAVA} -classpath "${TESTCLASSES}" "$@" > "$appOutput" 2>&1 &
+  ${JAVA} -XX:+UsePerfData -classpath "${TESTCLASSES}" "$@" > "$appOutput" 2>&1 &
   appJavaPid="$!"
   appOtherPid=
   appPidList="$appJavaPid"
@@ -131,7 +131,7 @@
 #
 stopApplication()
 {
-  $JAVA -classpath "${TESTCLASSES}" ShutdownSimpleApplication $1
+  $JAVA -XX:+UsePerfData -classpath "${TESTCLASSES}" ShutdownSimpleApplication $1
 }
 
 
--- a/test/sun/tools/jinfo/Basic.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jinfo/Basic.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -46,39 +46,39 @@
 
 if [ $isWindows = false ]; then
     # -sysprops option
-    ${JINFO} -sysprops $appJavaPid
+    ${JINFO} -J-XX:+UsePerfData -sysprops $appJavaPid
     if [ $? != 0 ]; then failed=1; fi
 
     # -flags option
-    ${JINFO} -flags $appJavaPid
+    ${JINFO} -J-XX:+UsePerfData -flags $appJavaPid
     if [ $? != 0 ]; then failed=1; fi
 
     # no option
-    ${JINFO} $appJavaPid
+    ${JINFO} -J-XX:+UsePerfData $appJavaPid
     if [ $? != 0 ]; then failed=1; fi
 
 fi
 
 
 # -flag option
-${JINFO} -flag +PrintGC $appJavaPid
+${JINFO} -J-XX:+UsePerfData -flag +PrintGC $appJavaPid
 if [ $? != 0 ]; then failed=1; fi 
 
-${JINFO} -flag -PrintGC $appJavaPid
+${JINFO} -J-XX:+UsePerfData -flag -PrintGC $appJavaPid
 if [ $? != 0 ]; then failed=1; fi
 
-${JINFO} -flag PrintGC $appJavaPid
+${JINFO} -J-XX:+UsePerfData -flag PrintGC $appJavaPid
 if [ $? != 0 ]; then failed=1; fi
 
 if $isSolaris; then
 
-    ${JINFO} -flag +ExtendedDTraceProbes $appJavaPid
+    ${JINFO} -J-XX:+UsePerfData -flag +ExtendedDTraceProbes $appJavaPid
     if [ $? != 0 ]; then failed=1; fi
 
-    ${JINFO} -flag -ExtendedDTraceProbes $appJavaPid
+    ${JINFO} -J-XX:+UsePerfData -flag -ExtendedDTraceProbes $appJavaPid
     if [ $? != 0 ]; then failed=1; fi
 
-    ${JINFO} -flag ExtendedDTraceProbes $appJavaPid
+    ${JINFO} -J-XX:+UsePerfData -flag ExtendedDTraceProbes $appJavaPid
     if [ $? != 0 ]; then failed=1; fi
 
 fi
--- a/test/sun/tools/jmap/Basic.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jmap/Basic.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -45,15 +45,15 @@
 failed=0
 
 # -histo[:live] option
-${JMAP} -histo $appJavaPid
+${JMAP} -J-XX:+UsePerfData -histo $appJavaPid
 if [ $? != 0 ]; then failed=1; fi
 
-${JMAP} -histo:live $appJavaPid
+${JMAP} -J-XX:+UsePerfData -histo:live $appJavaPid
 if [ $? != 0 ]; then failed=1; fi
 
 # -dump option
 DUMPFILE="java_pid${appJavaPid}.hprof"
-${JMAP} -dump:format=b,file=${DUMPFILE} $appJavaPid
+${JMAP} -J-XX:+UsePerfData -dump:format=b,file=${DUMPFILE} $appJavaPid
 if [ $? != 0 ]; then failed=1; fi
 
 # check that heap dump is parsable
@@ -64,7 +64,7 @@
 rm ${DUMPFILE}
 
 # -dump:live option
-${JMAP} -dump:live,format=b,file=${DUMPFILE} $appJavaPid
+${JMAP} -J-XX:+UsePerfData -dump:live,format=b,file=${DUMPFILE} $appJavaPid
 if [ $? != 0 ]; then failed=1; fi
 
 # check that heap dump is parsable
--- a/test/sun/tools/jps/jps-Defaults.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jps/jps-Defaults.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JPS="${TESTJAVA}/bin/jps"
 
-${JPS} 2>&1 | awk -f ${TESTSRC}/jps_Output1.awk
+${JPS} -J-XX:+UsePerfData 2>&1 | awk -f ${TESTSRC}/jps_Output1.awk
--- a/test/sun/tools/jps/jps-V_2.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jps/jps-V_2.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011,Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JPS="${TESTJAVA}/bin/jps"
 
-${JPS} -J-XX:Flags=${TESTSRC}/vmflags -V | awk -f ${TESTSRC}/jps-V_Output2.awk
+${JPS} -J-XX:+UsePerfData -J-XX:Flags=${TESTSRC}/vmflags -V | awk -f ${TESTSRC}/jps-V_Output2.awk
--- a/test/sun/tools/jps/jps-Vm_2.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jps/jps-Vm_2.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JPS="${TESTJAVA}/bin/jps"
 
-${JPS} -J-XX:Flags=${TESTSRC}/vmflags -Vm | awk -f ${TESTSRC}/jps-Vm_Output2.awk
+${JPS} -J-XX:+UsePerfData -J-XX:Flags=${TESTSRC}/vmflags -Vm | awk -f ${TESTSRC}/jps-Vm_Output2.awk
--- a/test/sun/tools/jps/jps-Vvm.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jps/jps-Vvm.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JPS="${TESTJAVA}/bin/jps"
 
-${JPS} -J-XX:Flags=${TESTSRC}/vmflags -Vvm | awk -f ${TESTSRC}/jps-Vvm_Output1.awk
+${JPS} -J-XX:+UsePerfData -J-XX:Flags=${TESTSRC}/vmflags -Vvm | awk -f ${TESTSRC}/jps-Vvm_Output1.awk
--- a/test/sun/tools/jps/jps-Vvml.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jps/jps-Vvml.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JPS="${TESTJAVA}/bin/jps"
 
-${JPS} -J-XX:Flags=${TESTSRC}/vmflags -Vvml | awk -f ${TESTSRC}/jps-Vvml_Output1.awk
+${JPS} -J-XX:+UsePerfData -J-XX:Flags=${TESTSRC}/vmflags -Vvml | awk -f ${TESTSRC}/jps-Vvml_Output1.awk
--- a/test/sun/tools/jps/jps-Vvml_2.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jps/jps-Vvml_2.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -47,6 +47,10 @@
 # any args to Sleeper.main() or any jvm flags or options, as we
 # need to inspect jps output for the no args condition.
 #
+# Note: this test can not pass on a VM with UsePerfData disabled by default,
+# and we can not set -XX:+UsePerfData as that invalidates the test premise of
+# there being no jvm flags
+
 ${JAVA} -cp ${TESTCLASSES} Sleeper &
 SLEEPER_PID=$!
 
--- a/test/sun/tools/jps/jps-help.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jps/jps-help.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,7 @@
 JPS="${TESTJAVA}/bin/jps"
 
 rm -f jps.out 2>/dev/null
-${JPS} -? > jps.out 2>&1
+${JPS} -J-XX:+UsePerfData -? > jps.out 2>&1
 
 diff -w jps.out ${TESTSRC}/usage.out
 if [ $? != 0 ]
@@ -44,7 +44,7 @@
 fi
 
 rm -f jps.out 2>/dev/null
-${JPS} -help > jps.out 2>&1
+${JPS} -J-XX:+UsePerfData -help > jps.out 2>&1
 
 diff -w jps.out ${TESTSRC}/usage.out
 if [ $? != 0 ]
--- a/test/sun/tools/jps/jps-l_1.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jps/jps-l_1.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JPS="${TESTJAVA}/bin/jps"
 
-${JPS} -l 2>&1 | awk -f ${TESTSRC}/jps-l_Output1.awk
+${JPS} -J-XX:+UsePerfData -l 2>&1 | awk -f ${TESTSRC}/jps-l_Output1.awk
--- a/test/sun/tools/jps/jps-l_2.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jps/jps-l_2.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JPS="${TESTJAVA}/bin/jps"
 
-${JPS} -l | awk -f ${TESTSRC}/jps-l_Output2.awk
+${JPS} -J-XX:+UsePerfData -l | awk -f ${TESTSRC}/jps-l_Output2.awk
--- a/test/sun/tools/jps/jps-lm.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jps/jps-lm.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JPS="${TESTJAVA}/bin/jps"
 
-${JPS} -lm | awk -f ${TESTSRC}/jps-lm_Output1.awk
+${JPS} -J-XX:+UsePerfData -lm | awk -f ${TESTSRC}/jps-lm_Output1.awk
--- a/test/sun/tools/jps/jps-m.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jps/jps-m.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JPS="${TESTJAVA}/bin/jps"
 
-${JPS} -m | awk -f ${TESTSRC}/jps-m_Output1.awk
+${JPS} -J-XX:+UsePerfData -m | awk -f ${TESTSRC}/jps-m_Output1.awk
--- a/test/sun/tools/jps/jps-m_2.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jps/jps-m_2.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -46,10 +46,10 @@
 # any args to Sleeper.main(), as we need to inspect jps output
 # for the no args condition.
 #
-${JAVA} -cp ${TESTCLASSES} Sleeper &
+${JAVA} -XX:+UsePerfData -cp ${TESTCLASSES} Sleeper &
 SLEEPER_PID=$!
 
-${JPS} -m | awk -f ${TESTSRC}/jps-m_Output2.awk
+${JPS} -J-XX:+UsePerfData -m | awk -f ${TESTSRC}/jps-m_Output2.awk
 RC=$?
 
 cleanup
--- a/test/sun/tools/jps/jps-q.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jps/jps-q.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JPS="${TESTJAVA}/bin/jps"
 
-${JPS} -q | awk -f ${TESTSRC}/jps-q_Output1.awk
+${JPS} -J-XX:+UsePerfData -q | awk -f ${TESTSRC}/jps-q_Output1.awk
--- a/test/sun/tools/jps/jps-v_1.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jps/jps-v_1.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JPS="${TESTJAVA}/bin/jps"
 
-${JPS} -J-XX:+UseParallelGC -v | awk -f ${TESTSRC}/jps-v_Output1.awk
+${JPS} -J-XX:+UsePerfData -J-XX:+UseParallelGC -v | awk -f ${TESTSRC}/jps-v_Output1.awk
--- a/test/sun/tools/jps/jps-vm_1.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jps/jps-vm_1.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JPS="${TESTJAVA}/bin/jps"
 
-${JPS} -J-XX:+UseParallelGC -vm | awk -f ${TESTSRC}/jps-vm_Output1.awk
+${JPS} -J-XX:+UsePerfData -J-XX:+UseParallelGC -vm | awk -f ${TESTSRC}/jps-vm_Output1.awk
--- a/test/sun/tools/jstack/Basic.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstack/Basic.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -45,11 +45,11 @@
 failed=0
 
 # normal
-$JSTACK $appJavaPid 2>&1
+$JSTACK -J-XX:+UsePerfData $appJavaPid 2>&1
 if [ $? != 0 ]; then failed=1; fi
 
 # long
-$JSTACK -l $appJavaPid 2>&1
+$JSTACK -J-XX:+UsePerfData -l $appJavaPid 2>&1
 if [ $? != 0 ]; then failed=1; fi
 
 set -e
--- a/test/sun/tools/jstat/jstatClassOutput1.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstat/jstatClassOutput1.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JSTAT="${TESTJAVA}/bin/jstat"
 
-${JSTAT} -class 0 2>&1 | awk -f ${TESTSRC}/classOutput1.awk
+${JSTAT} -J-XX:+UsePerfData -class 0 2>&1 | awk -f ${TESTSRC}/classOutput1.awk
--- a/test/sun/tools/jstat/jstatClassloadOutput1.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstat/jstatClassloadOutput1.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 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
@@ -33,4 +33,4 @@
 
 JSTAT="${TESTJAVA}/bin/jstat"
 
-${JSTAT} -classload -J-Djstat.showUnsupported=true 0 2>&1 | awk -f ${TESTSRC}/classloadOutput1.awk
+${JSTAT} -J-XX:+UsePerfData -classload -J-Djstat.showUnsupported=true 0 2>&1 | awk -f ${TESTSRC}/classloadOutput1.awk
--- a/test/sun/tools/jstat/jstatCompilerOutput1.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstat/jstatCompilerOutput1.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JSTAT="${TESTJAVA}/bin/jstat"
 
-${JSTAT} -compiler 0 2>&1 | awk -f ${TESTSRC}/compilerOutput1.awk
+${JSTAT} -J-XX:+UsePerfData -compiler 0 2>&1 | awk -f ${TESTSRC}/compilerOutput1.awk
--- a/test/sun/tools/jstat/jstatFileURITest1.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstat/jstatFileURITest1.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -40,12 +40,12 @@
     # characters into forward slash characters in an effort to convert
     # TESTSRC into a canonical form useable as URI path.
     cp ${TESTSRC}/hsperfdata_3433 .
-    ${JSTAT} -gcutil file:/`pwd`/hsperfdata_3433 2>&1 | awk -f ${TESTSRC}/fileURITest1.awk
+    ${JSTAT} -J-XX:+UsePerfData -gcutil file:/`pwd`/hsperfdata_3433 2>&1 | awk -f ${TESTSRC}/fileURITest1.awk
     RC=$?
     rm -f hsperfdata_3433 2>&1 > /dev/null
     ;;
 *)
-    ${JSTAT} -gcutil file:${TESTSRC}/hsperfdata_3433 2>&1 | awk -f ${TESTSRC}/fileURITest1.awk
+    ${JSTAT} -J-XX:+UsePerfData -gcutil file:${TESTSRC}/hsperfdata_3433 2>&1 | awk -f ${TESTSRC}/fileURITest1.awk
     RC=$?
     ;;
 esac
--- a/test/sun/tools/jstat/jstatGcCapacityOutput1.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstat/jstatGcCapacityOutput1.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JSTAT="${TESTJAVA}/bin/jstat"
 
-${JSTAT} -gccapacity 0 2>&1 | awk -f ${TESTSRC}/gcCapacityOutput1.awk
+${JSTAT} -J-XX:+UsePerfData -gccapacity 0 2>&1 | awk -f ${TESTSRC}/gcCapacityOutput1.awk
--- a/test/sun/tools/jstat/jstatGcCauseOutput1.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstat/jstatGcCauseOutput1.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -37,4 +37,4 @@
 # class machine, ergonomics will automatically use UseParallelGC.
 # The UseParallelGC collector does not currently update the gc cause counters.
 
-${JSTAT} -J-XX:+UseSerialGC -gccause 0 2>&1 | awk -f ${TESTSRC}/gcCauseOutput1.awk
+${JSTAT} -J-XX:+UsePerfData -J-XX:+UseSerialGC -gccause 0 2>&1 | awk -f ${TESTSRC}/gcCauseOutput1.awk
--- a/test/sun/tools/jstat/jstatGcNewCapacityOutput1.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstat/jstatGcNewCapacityOutput1.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JSTAT="${TESTJAVA}/bin/jstat"
 
-${JSTAT} -gcnewcapacity 0 2>&1 | awk -f ${TESTSRC}/gcNewCapacityOutput1.awk
+${JSTAT} -J-XX:+UsePerfData -gcnewcapacity 0 2>&1 | awk -f ${TESTSRC}/gcNewCapacityOutput1.awk
--- a/test/sun/tools/jstat/jstatGcNewOutput1.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstat/jstatGcNewOutput1.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JSTAT="${TESTJAVA}/bin/jstat"
 
-${JSTAT} -gcnew 0 2>&1 | awk -f ${TESTSRC}/gcNewOutput1.awk
+${JSTAT} -J-XX:+UsePerfData -gcnew 0 2>&1 | awk -f ${TESTSRC}/gcNewOutput1.awk
--- a/test/sun/tools/jstat/jstatGcOldCapacityOutput1.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstat/jstatGcOldCapacityOutput1.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JSTAT="${TESTJAVA}/bin/jstat"
 
-${JSTAT} -gcoldcapacity 0 2>&1 | awk -f ${TESTSRC}/gcOldCapacityOutput1.awk
+${JSTAT} -J-XX:+UsePerfData -gcoldcapacity 0 2>&1 | awk -f ${TESTSRC}/gcOldCapacityOutput1.awk
--- a/test/sun/tools/jstat/jstatGcOldOutput1.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstat/jstatGcOldOutput1.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JSTAT="${TESTJAVA}/bin/jstat"
 
-${JSTAT} -gcold 0 2>&1 | awk -f ${TESTSRC}/gcOldOutput1.awk
+${JSTAT} -J-XX:+UsePerfData -gcold 0 2>&1 | awk -f ${TESTSRC}/gcOldOutput1.awk
--- a/test/sun/tools/jstat/jstatGcOutput1.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstat/jstatGcOutput1.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JSTAT="${TESTJAVA}/bin/jstat"
 
-${JSTAT} -gc 0 2>&1 | awk -f ${TESTSRC}/gcOutput1.awk
+${JSTAT} -J-XX:+UsePerfData -gc 0 2>&1 | awk -f ${TESTSRC}/gcOutput1.awk
--- a/test/sun/tools/jstat/jstatGcPermCapacityOutput1.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstat/jstatGcPermCapacityOutput1.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JSTAT="${TESTJAVA}/bin/jstat"
 
-${JSTAT} -gcpermcapacity 0 2>&1 | awk -f ${TESTSRC}/gcPermCapacityOutput1.awk
+${JSTAT} -J-XX:+UsePerfData -gcpermcapacity 0 2>&1 | awk -f ${TESTSRC}/gcPermCapacityOutput1.awk
--- a/test/sun/tools/jstat/jstatHelp.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstat/jstatHelp.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,7 @@
 JSTAT="${TESTJAVA}/bin/jstat"
 
 rm -f jstat.out 2>/dev/null
-${JSTAT} -? > jstat.out 2>&1
+${JSTAT} -J-XX:+UsePerfData -? > jstat.out 2>&1
 
 diff -w jstat.out ${TESTSRC}/usage.out
 if [ $? != 0 ]
@@ -43,7 +43,7 @@
 fi
 
 rm -f jstat.out 2>/dev/null
-${JSTAT} -help > jstat.out 2>&1
+${JSTAT} -J-XX:+UsePerfData -help > jstat.out 2>&1
 
 diff -w jstat.out ${TESTSRC}/usage.out
 if [ $? != 0 ]
--- a/test/sun/tools/jstat/jstatLineCounts1.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstat/jstatLineCounts1.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JSTAT="${TESTJAVA}/bin/jstat"
 
-${JSTAT} -gcutil 0 250 5 2>&1 | awk -f ${TESTSRC}/lineCounts1.awk
+${JSTAT} -J-XX:+UsePerfData -gcutil 0 250 5 2>&1 | awk -f ${TESTSRC}/lineCounts1.awk
--- a/test/sun/tools/jstat/jstatLineCounts2.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstat/jstatLineCounts2.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JSTAT="${TESTJAVA}/bin/jstat"
 
-${JSTAT} -gcutil 0 2>&1 | awk -f ${TESTSRC}/lineCounts2.awk
+${JSTAT} -J-XX:+UsePerfData -gcutil 0 2>&1 | awk -f ${TESTSRC}/lineCounts2.awk
--- a/test/sun/tools/jstat/jstatLineCounts3.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstat/jstatLineCounts3.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JSTAT="${TESTJAVA}/bin/jstat"
 
-${JSTAT} -gcutil -h 10 0 250 10 2>&1 | awk -f ${TESTSRC}/lineCounts3.awk
+${JSTAT} -J-XX:+UsePerfData -gcutil -h 10 0 250 10 2>&1 | awk -f ${TESTSRC}/lineCounts3.awk
--- a/test/sun/tools/jstat/jstatLineCounts4.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstat/jstatLineCounts4.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JSTAT="${TESTJAVA}/bin/jstat"
 
-${JSTAT} -gcutil -h 10 0 250 11 2>&1 | awk -f ${TESTSRC}/lineCounts4.awk
+${JSTAT} -J-XX:+UsePerfData -gcutil -h 10 0 250 11 2>&1 | awk -f ${TESTSRC}/lineCounts4.awk
--- a/test/sun/tools/jstat/jstatOptions1.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstat/jstatOptions1.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,8 +33,8 @@
 JSTAT="${TESTJAVA}/bin/jstat"
 
 rm -f jstat.out1 jstat.out2 2>/dev/null
-${JSTAT} -options > jstat.out1 2>&1
-${JSTAT} -options -J-Djstat.showUnsupported=true > jstat.out2 2>&1
+${JSTAT} -J-XX:+UsePerfData -options > jstat.out1 2>&1
+${JSTAT} -J-XX:+UsePerfData -options -J-Djstat.showUnsupported=true > jstat.out2 2>&1
 
 diff -w jstat.out1 ${TESTSRC}/options1.out
 diff -w jstat.out2 ${TESTSRC}/options2.out
--- a/test/sun/tools/jstat/jstatPrintCompilationOutput1.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstat/jstatPrintCompilationOutput1.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -35,4 +35,4 @@
 
 # run with -Xcomp as jstat may complete too quickly to assure
 # that compilation occurs.
-${JSTAT} -J-Xcomp -printcompilation 0 2>&1 | awk -f ${TESTSRC}/printCompilationOutput1.awk
+${JSTAT} -J-XX:+UsePerfData -J-Xcomp -printcompilation 0 2>&1 | awk -f ${TESTSRC}/printCompilationOutput1.awk
--- a/test/sun/tools/jstat/jstatSnap1.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstat/jstatSnap1.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JSTAT="${TESTJAVA}/bin/jstat"
 
-${JSTAT} -snap 0 2>&1 | awk -f ${TESTSRC}/snap1.awk
+${JSTAT} -J-XX:+UsePerfData -snap 0 2>&1 | awk -f ${TESTSRC}/snap1.awk
--- a/test/sun/tools/jstat/jstatSnap2.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstat/jstatSnap2.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JSTAT="${TESTJAVA}/bin/jstat"
 
-${JSTAT} -J-Djstat.showUnsupported=true -snap 0 2>&1 | awk -f ${TESTSRC}/snap2.awk
+${JSTAT} -J-XX:+UsePerfData -J-Djstat.showUnsupported=true -snap 0 2>&1 | awk -f ${TESTSRC}/snap2.awk
--- a/test/sun/tools/jstat/jstatTimeStamp1.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstat/jstatTimeStamp1.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,4 +33,4 @@
 
 JSTAT="${TESTJAVA}/bin/jstat"
 
-${JSTAT} -gcutil -t 0 2>&1 | awk -f ${TESTSRC}/timeStamp1.awk
+${JSTAT} -J-XX:+UsePerfData -gcutil -t 0 2>&1 | awk -f ${TESTSRC}/timeStamp1.awk
--- a/test/sun/tools/jstatd/jstatdDefaults.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstatd/jstatdDefaults.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -45,13 +45,13 @@
 
 JSTATD_OUT="jstatd_$$.out"
 
-${JSTATD} -J-Djava.security.policy=${TESTSRC}/all.policy 2>&1 > ${JSTATD_OUT} &
+${JSTATD} -J-XX:+UsePerfData -J-Djava.security.policy=${TESTSRC}/all.policy 2>&1 > ${JSTATD_OUT} &
 JSTATD_PID=$!
 
 echo "jstatd started as pid ${JSTATD_PID}"
 sleep 3
 
-${JPS} ${HOSTNAME} 2>&1 | awk -f ${TESTSRC}/jpsOutput1.awk
+${JPS} -J-XX:+UsePerfData ${HOSTNAME} 2>&1 | awk -f ${TESTSRC}/jpsOutput1.awk
 
 if [ $? -ne 0 ]
 then
@@ -60,7 +60,7 @@
     exit 1
 fi
 
-${JSTAT} -gcutil ${JSTATD_PID}@${HOSTNAME} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
+${JSTAT} -J-XX:+UsePerfData -gcutil ${JSTATD_PID}@${HOSTNAME} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
 RC=$?
 
 if [ ${RC} -ne 0 ]
--- a/test/sun/tools/jstatd/jstatdExternalRegistry.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstatd/jstatdExternalRegistry.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -53,19 +53,19 @@
 RMIREGISTRY_OUT="rmiregistry_$$.out"
 JSTATD_OUT="jstatd_$$.out"
 
-${RMIREGISTRY} ${PORT} > ${RMIREGISTRY_OUT} 2>&1 &
+${RMIREGISTRY} -J-XX:+UsePerfData ${PORT} > ${RMIREGISTRY_OUT} 2>&1 &
 RMIREGISTRY_PID=$!
 
 echo "rmiregistry started on port ${PORT} as pid ${RMIREGISTRY_PID}"
 sleep 3
 
-${JSTATD} -J-Djava.security.policy=${TESTSRC}/all.policy -p ${PORT} > ${JSTATD_OUT} 2>&1 &
+${JSTATD} -J-XX:+UsePerfData -J-Djava.security.policy=${TESTSRC}/all.policy -p ${PORT} > ${JSTATD_OUT} 2>&1 &
 JSTATD_PID=$!
 
 echo "jstatd started as pid ${JSTATD_PID}"
 sleep 3
 
-${JPS} ${HOSTNAME}:${PORT} 2>&1 | awk -f ${TESTSRC}/jpsOutput1.awk
+${JPS} -J-XX:+UsePerfData ${HOSTNAME}:${PORT} 2>&1 | awk -f ${TESTSRC}/jpsOutput1.awk
 
 if [ $? -ne 0 ]
 then
@@ -73,7 +73,7 @@
     exit 1
 fi
 
-${JSTAT} -gcutil ${JSTATD_PID}@${HOSTNAME}:${PORT} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
+${JSTAT} -J-XX:+UsePerfData -gcutil ${JSTATD_PID}@${HOSTNAME}:${PORT} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
 RC=$?
 
 if [ ${RC} -ne 0 ]
--- a/test/sun/tools/jstatd/jstatdPort.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstatd/jstatdPort.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -50,13 +50,13 @@
 
 JSTATD_OUT="jstatd_$$.out"
 
-${JSTATD} -J-Djava.security.policy=${TESTSRC}/all.policy -p ${PORT} 2>&1 > ${JSTATD_OUT} &
+${JSTATD} -J-XX:+UsePerfData -J-Djava.security.policy=${TESTSRC}/all.policy -p ${PORT} 2>&1 > ${JSTATD_OUT} &
 JSTATD_PID=$!
 
 echo "jstatd started as pid ${JSTATD_PID} on port ${PORT}"
 sleep 3
 
-${JPS} ${HOSTNAME}:${PORT} 2>&1 | awk -f ${TESTSRC}/jpsOutput1.awk
+${JPS} -J-XX:+UsePerfData ${HOSTNAME}:${PORT} 2>&1 | tee jps.out | awk -f ${TESTSRC}/jpsOutput1.awk
 
 if [ $? -ne 0 ]
 then
@@ -65,7 +65,7 @@
     exit 1
 fi
 
-${JSTAT} -gcutil ${JSTATD_PID}@${HOSTNAME}:${PORT} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
+${JSTAT} -J-XX:+UsePerfData -gcutil ${JSTATD_PID}@${HOSTNAME}:${PORT} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
 RC=$?
 
 if [ ${RC} -ne 0 ]
--- a/test/sun/tools/jstatd/jstatdServerName.sh	Mon Oct 24 09:58:47 2011 -0700
+++ b/test/sun/tools/jstatd/jstatdServerName.sh	Wed Oct 26 17:59:13 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -54,20 +54,20 @@
 JSTATD_1_OUT="jstatd_$$_1.out"
 JSTATD_2_OUT="jstatd_$$_2.out"
 
-${JSTATD} -J-Djava.security.policy=${TESTSRC}/all.policy -p ${PORT_1} 2>&1 > ${JSTATD_1_OUT} &
+${JSTATD} -J-XX:+UsePerfData -J-Djava.security.policy=${TESTSRC}/all.policy -p ${PORT_1} 2>&1 > ${JSTATD_1_OUT} &
 JSTATD_1_PID=$!
 
 echo "first jstatd started as pid ${JSTATD_1_PID} on port ${PORT_1} with default server name"
 sleep 3
 
-${JSTATD} -J-Djava.security.policy=${TESTSRC}/all.policy -p ${PORT_2} -n ${SERVERNAME} 2>&1 > ${JSTATD_2_OUT} &
+${JSTATD} -J-XX:+UsePerfData -J-Djava.security.policy=${TESTSRC}/all.policy -p ${PORT_2} -n ${SERVERNAME} 2>&1 > ${JSTATD_2_OUT} &
 JSTATD_2_PID=$!
 
 echo "second jstatd started as pid ${JSTATD_2_PID} on port ${PORT_2} with name ${SERVERNAME}"
 sleep 3
 
-echo "running: ${JPS} ${HOSTNAME}:${PORT_1}"
-${JPS} ${HOSTNAME}:${PORT_1} 2>&1 | awk -f ${TESTSRC}/jpsOutput1.awk
+echo "running: ${JPS} -J-XX:+UsePerfData ${HOSTNAME}:${PORT_1}"
+${JPS} -J-XX:+UsePerfData ${HOSTNAME}:${PORT_1} 2>&1 | awk -f ${TESTSRC}/jpsOutput1.awk
 
 if [ $? -ne 0 ]
 then
@@ -76,8 +76,8 @@
     exit 1
 fi
 
-echo "running: ${JPS} ${HOSTNAME}:${PORT_2}/${SERVERNAME}"
-${JPS} ${HOSTNAME}:${PORT_2}/${SERVERNAME} 2>&1 | awk -f ${TESTSRC}/jpsOutput1.awk
+echo "running: ${JPS} -J-XX:+UsePerfData ${HOSTNAME}:${PORT_2}/${SERVERNAME}"
+${JPS} -J-XX:+UsePerfData ${HOSTNAME}:${PORT_2}/${SERVERNAME} 2>&1 | awk -f ${TESTSRC}/jpsOutput1.awk
 
 if [ $? -ne 0 ]
 then
@@ -86,8 +86,8 @@
     exit 1
 fi
 
-echo "running: ${JSTAT} -gcutil ${JSTATD_1_PID}@${HOSTNAME}:${PORT_1} 250 5"
-${JSTAT} -gcutil ${JSTATD_1_PID}@${HOSTNAME}:${PORT_1} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
+echo "running: ${JSTAT} -J-XX:+UsePerfData -gcutil ${JSTATD_1_PID}@${HOSTNAME}:${PORT_1} 250 5"
+${JSTAT} -J-XX:+UsePerfData -gcutil ${JSTATD_1_PID}@${HOSTNAME}:${PORT_1} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
 RC=$?
 
 if [ ${RC} -ne 0 ]
@@ -95,8 +95,8 @@
     echo "jstat output differs from expected output"
 fi
 
-echo "running: ${JSTAT} -gcutil ${JSTATD_1_PID}@${HOSTNAME}:${PORT_2}/${SERVERNAME} 250 5"
-${JSTAT} -gcutil ${JSTATD_1_PID}@${HOSTNAME}:${PORT_2}/${SERVERNAME} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
+echo "running: ${JSTAT} -J-XX:+UsePerfData -gcutil ${JSTATD_1_PID}@${HOSTNAME}:${PORT_2}/${SERVERNAME} 250 5"
+${JSTAT} -J-XX:+UsePerfData -gcutil ${JSTATD_1_PID}@${HOSTNAME}:${PORT_2}/${SERVERNAME} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
 RC=$?
 
 if [ ${RC} -ne 0 ]