Merge
authorjmasa
Fri, 11 Jul 2014 05:59:08 -0700
changeset 25501 1e2ffa5a345d
parent 25500 4d2e06147d1e (current diff)
parent 25499 1750481336d1 (diff)
child 25502 92dc8bd62c69
Merge
jdk/make/mapfiles/libnpt/mapfile-vers
jdk/src/share/classes/sun/management/manifest
jdk/src/share/classes/sun/misc/Timeable.java
jdk/src/share/classes/sun/misc/Timer.java
jdk/src/share/npt/README.txt
jdk/src/share/npt/npt.c
jdk/src/share/npt/npt.h
jdk/src/share/npt/utf.c
jdk/src/share/npt/utf.h
jdk/src/solaris/npt/npt_md.h
jdk/src/solaris/npt/utf_md.c
jdk/src/solaris/npt/utf_md.h
jdk/src/windows/npt/npt_md.h
jdk/src/windows/npt/utf_md.c
jdk/src/windows/npt/utf_md.h
jdk/test/sun/security/pkcs11/nss/src/MD5SUMS
jdk/test/sun/security/pkcs11/nss/src/SHA1SUMS
jdk/test/sun/security/pkcs11/nss/src/nss-3.13.1.tar.gz
jdk/test/sun/tools/jhat/HatRun.java
langtools/test/com/sun/javadoc/testOrdering/pkg1/ZZTop.java
langtools/test/tools/javac/varargs/6313164/T6313164.out
--- a/.hgtags	Wed Jul 09 16:44:30 2014 +0200
+++ b/.hgtags	Fri Jul 11 05:59:08 2014 -0700
@@ -261,3 +261,5 @@
 4a09f5d30be844ac6f714bdb0f63d8c3c08b9a98 jdk9-b16
 410bccbded9e9cce80f1e13ad221e37ae97a3986 jdk9-b17
 c5495e25c7258ab5f96a1ae14610887d76d2be63 jdk9-b18
+2dcf544eb7ed5ac6a3f7813a32e33acea7442405 jdk9-b19
+89731ae72a761afdf4262e8b9513f302f6563f89 jdk9-b20
--- a/.hgtags-top-repo	Wed Jul 09 16:44:30 2014 +0200
+++ b/.hgtags-top-repo	Fri Jul 11 05:59:08 2014 -0700
@@ -261,3 +261,5 @@
 cf22a728521f91a4692b433d39d730a0a1b23155 jdk9-b16
 24152ee0ee1abef54a8bab04c099261dba7bcca5 jdk9-b17
 65abab59f783fcf02ff8e133431c252f9e5f07d5 jdk9-b18
+75a08df650eb3126bab0c4d15241f5886162393c jdk9-b19
+ee4fd72b2ec3d92497f37163352f294aa695c6fb jdk9-b20
--- a/common/autoconf/flags.m4	Wed Jul 09 16:44:30 2014 +0200
+++ b/common/autoconf/flags.m4	Fri Jul 11 05:59:08 2014 -0700
@@ -116,15 +116,15 @@
   AC_SUBST(RC_FLAGS)
 
   if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
-    # FIXME: likely bug, should be CCXXFLAGS_JDK? or one for C or CXX.
-    CCXXFLAGS="$CCXXFLAGS -nologo"
+    # silence copyright notice and other headers.
+    COMMON_CCXXFLAGS="$COMMON_CCXXFLAGS -nologo"
   fi
 
   if test "x$SYSROOT" != "x"; then
     if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
       if test "x$OPENJDK_TARGET_OS" = xsolaris; then
         # Solaris Studio does not have a concept of sysroot. Instead we must
-        # make sure the default include and lib dirs are appended to each 
+        # make sure the default include and lib dirs are appended to each
         # compile and link command line.
         SYSROOT_CFLAGS="-I$SYSROOT/usr/include"
         SYSROOT_LDFLAGS="-L$SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \
@@ -302,6 +302,7 @@
   # Debug symbols
   if test "x$TOOLCHAIN_TYPE" = xgcc; then
     if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then
+      # reduce from default "-g2" option to save space
       CFLAGS_DEBUG_SYMBOLS="-g1"
       CXXFLAGS_DEBUG_SYMBOLS="-g1"
     else
@@ -313,6 +314,7 @@
     CXXFLAGS_DEBUG_SYMBOLS="-g"
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
     CFLAGS_DEBUG_SYMBOLS="-g -xs"
+    # FIXME: likely a bug, this disables debug symbols rather than enables them
     CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs"
   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
     CFLAGS_DEBUG_SYMBOLS="-g"
@@ -321,6 +323,31 @@
   AC_SUBST(CFLAGS_DEBUG_SYMBOLS)
   AC_SUBST(CXXFLAGS_DEBUG_SYMBOLS)
 
+  # bounds, memory and behavior checking options
+  if test "x$TOOLCHAIN_TYPE" = xgcc; then
+    case $DEBUG_LEVEL in
+    release )
+      # no adjustment
+      ;;
+    fastdebug )
+      # Add compile time bounds checks.
+      CFLAGS_DEBUG_OPTIONS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1"
+      CXXFLAGS_DEBUG_OPTIONS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1"
+      ;;
+    slowdebug )
+      # Add runtime bounds checks and symbol info.
+      CFLAGS_DEBUG_OPTIONS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all --param ssp-buffer-size=1"
+      CXXFLAGS_DEBUG_OPTIONS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all --param ssp-buffer-size=1"
+      if test "x$HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR" = "xtrue"; then
+        CFLAGS_DEBUG_OPTIONS="$CFLAGS_DEBUG_OPTIONS  $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG"
+        CXXFLAGS_DEBUG_OPTIONS="$CXXFLAGS_DEBUG_OPTIONS $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG"
+      fi
+      ;;
+    esac
+  fi
+  AC_SUBST(CFLAGS_DEBUG_OPTIONS)
+  AC_SUBST(CXXFLAGS_DEBUG_OPTIONS)
+
   # Optimization levels
   if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
     CC_HIGHEST="$CC_HIGHEST -fns -fsimple -fsingle -xbuiltin=%all -xdepend -xrestrict -xlibmil"
@@ -330,10 +357,12 @@
       C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xalias_level=basic -xregs=no%frameptr"
       C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr"
       C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr"
+      C_O_FLAG_DEBUG="-xregs=no%frameptr"
       C_O_FLAG_NONE="-xregs=no%frameptr"
       CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xregs=no%frameptr"
       CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz -xregs=no%frameptr"
       CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr"
+      CXX_O_FLAG_DEBUG="-xregs=no%frameptr"
       CXX_O_FLAG_NONE="-xregs=no%frameptr"
       if test "x$OPENJDK_TARGET_CPU_BITS" = "x32"; then
         C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xchip=pentium"
@@ -343,10 +372,12 @@
       C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xalias_level=basic -xprefetch=auto,explicit -xchip=ultra"
       C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0"
       C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0"
+      C_O_FLAG_DEBUG=""
       C_O_FLAG_NONE=""
       CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra"
       CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
       CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
+      C_O_FLAG_DEBUG=""
       CXX_O_FLAG_NONE=""
     fi
   else
@@ -359,13 +390,17 @@
         C_O_FLAG_HIGHEST="-Os"
         C_O_FLAG_HI="-Os"
         C_O_FLAG_NORM="-Os"
-        C_O_FLAG_NONE=""
       else
         C_O_FLAG_HIGHEST="-O3"
         C_O_FLAG_HI="-O3"
         C_O_FLAG_NORM="-O2"
-        C_O_FLAG_NONE="-O0"
       fi
+      if test "x$HAS_CFLAG_OPTIMIZE_DEBUG" = "xtrue"; then
+        C_O_FLAG_DEBUG="$CFLAG_OPTIMIZE_DEBUG_FLAG"
+      else
+        C_O_FLAG_DEBUG="-O0"
+      fi
+      C_O_FLAG_NONE="-O0"
     elif test "x$TOOLCHAIN_TYPE" = xclang; then
       if test "x$OPENJDK_TARGET_OS" = xmacosx; then
         # On MacOSX we optimize for size, something
@@ -373,37 +408,63 @@
         C_O_FLAG_HIGHEST="-Os"
         C_O_FLAG_HI="-Os"
         C_O_FLAG_NORM="-Os"
-        C_O_FLAG_NONE=""
       else
         C_O_FLAG_HIGHEST="-O3"
         C_O_FLAG_HI="-O3"
         C_O_FLAG_NORM="-O2"
-        C_O_FLAG_NONE="-O0"
       fi
+      C_O_FLAG_DEBUG="-O0"
+      C_O_FLAG_NONE="-O0"
     elif test "x$TOOLCHAIN_TYPE" = xxlc; then
       C_O_FLAG_HIGHEST="-O3"
       C_O_FLAG_HI="-O3 -qstrict"
       C_O_FLAG_NORM="-O2"
-      C_O_FLAG_NONE=""
+      C_O_FLAG_DEBUG="-qnoopt"
+      C_O_FLAG_NONE="-qnoop"
     elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
       C_O_FLAG_HIGHEST="-O2"
       C_O_FLAG_HI="-O1"
       C_O_FLAG_NORM="-O1"
+      C_O_FLAG_DEBUG="-Od"
       C_O_FLAG_NONE="-Od"
     fi
     CXX_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST"
     CXX_O_FLAG_HI="$C_O_FLAG_HI"
     CXX_O_FLAG_NORM="$C_O_FLAG_NORM"
+    CXX_O_FLAG_DEBUG="$C_O_FLAG_DEBUG"
     CXX_O_FLAG_NONE="$C_O_FLAG_NONE"
   fi
 
+  # Adjust optimization flags according to debug level.
+  case $DEBUG_LEVEL in
+    release )
+      # no adjustment
+      ;;
+    fastdebug )
+      # Not quite so much optimization
+      C_O_FLAG_HI="$C_O_FLAG_NORM"
+      CXX_O_FLAG_HI="$CXX_O_FLAG_NORM"
+      ;;
+    slowdebug )
+      # Disable optimization
+      C_O_FLAG_HIGHEST="$C_O_FLAG_DEBUG"
+      C_O_FLAG_HI="$C_O_FLAG_DEBUG"
+      C_O_FLAG_NORM="$C_O_FLAG_DEBUG"
+      CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_DEBUG"
+      CXX_O_FLAG_HI="$CXX_O_FLAG_DEBUG"
+      CXX_O_FLAG_NORM="$CXX_O_FLAG_DEBUG"
+      ;;
+  esac
+
   AC_SUBST(C_O_FLAG_HIGHEST)
   AC_SUBST(C_O_FLAG_HI)
   AC_SUBST(C_O_FLAG_NORM)
+  AC_SUBST(C_O_FLAG_DEBUG)
   AC_SUBST(C_O_FLAG_NONE)
   AC_SUBST(CXX_O_FLAG_HIGHEST)
   AC_SUBST(CXX_O_FLAG_HI)
   AC_SUBST(CXX_O_FLAG_NORM)
+  AC_SUBST(CXX_O_FLAG_DEBUG)
   AC_SUBST(CXX_O_FLAG_NONE)
 ])
 
@@ -461,11 +522,12 @@
   # Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build.
   #
 
-  # Setup compiler/platform specific flags to CFLAGS_JDK,
-  # CXXFLAGS_JDK and CCXXFLAGS_JDK (common to C and CXX?)
+  # Setup compiler/platform specific flags into
+  #    CFLAGS_JDK    - C Compiler flags
+  #    CXXFLAGS_JDK  - C++ Compiler flags
+  #    COMMON_CCXXFLAGS_JDK - common to C and C++
   if test "x$TOOLCHAIN_TYPE" = xgcc; then
-    # these options are used for both C and C++ compiles
-    CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Wall -Wno-parentheses -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
+    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wno-parentheses -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
         -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
     case $OPENJDK_TARGET_CPU_ARCH in
       arm )
@@ -477,31 +539,31 @@
         CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
         ;;
       * )
-        CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer"
+        COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer"
         CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
         ;;
     esac
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
-    CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
+    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
     if test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then
-      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB"
+      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB"
       CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE"
     fi
-  
+
     CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal"
     CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX -norunpath -xnolib"
   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
     CFLAGS_JDK="$CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
     CXXFLAGS_JDK="$CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
-    CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
+    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
     -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \
     -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
     -DWIN32 -DIAL"
     if test "x$OPENJDK_TARGET_CPU" = xx86_64; then
-      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_AMD64_ -Damd64"
+      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_AMD64_ -Damd64"
     else
-      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_X86_ -Dx86"
+      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_X86_ -Dx86"
     fi
   fi
 
@@ -509,28 +571,20 @@
 
   # Adjust flags according to debug level.
   case $DEBUG_LEVEL in
-    fastdebug )
-      CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS"
-      CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS"
-      C_O_FLAG_HI="$C_O_FLAG_NORM"
-      C_O_FLAG_NORM="$C_O_FLAG_NORM"
-      CXX_O_FLAG_HI="$CXX_O_FLAG_NORM"
-      CXX_O_FLAG_NORM="$CXX_O_FLAG_NORM"
+    fastdebug | slowdebug )
+      CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS $CFLAGS_DEBUG_OPTIONS"
+      CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS $CXXFLAGS_DEBUG_OPTIONS"
       JAVAC_FLAGS="$JAVAC_FLAGS -g"
       ;;
-    slowdebug )
-      CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS"
-      CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS"
-      C_O_FLAG_HI="$C_O_FLAG_NONE"
-      C_O_FLAG_NORM="$C_O_FLAG_NONE"
-      CXX_O_FLAG_HI="$CXX_O_FLAG_NONE"
-      CXX_O_FLAG_NORM="$CXX_O_FLAG_NONE"
-      JAVAC_FLAGS="$JAVAC_FLAGS -g"
+    release )
+      ;;
+    * )
+      AC_MSG_ERROR([Unrecognized \$DEBUG_LEVEL: $DEBUG_LEVEL])
       ;;
   esac
 
   # Setup LP64
-  CCXXFLAGS_JDK="$CCXXFLAGS_JDK $ADD_LP64"
+  COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK $ADD_LP64"
 
   # Set some common defines. These works for all compilers, but assume
   # -D is universally accepted.
@@ -543,49 +597,49 @@
     #   Note: -Dmacro         is the same as    #define macro 1
     #         -Dmacro=        is the same as    #define macro
     if test "x$OPENJDK_TARGET_OS" = xsolaris; then
-      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN="
+      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_LITTLE_ENDIAN="
     else
-      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN"
+      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_LITTLE_ENDIAN"
     fi
   else
     # Same goes for _BIG_ENDIAN. Do we really need to set *ENDIAN on Solaris if they
     # are defined in the system?
     if test "x$OPENJDK_TARGET_OS" = xsolaris; then
-      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN="
+      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_BIG_ENDIAN="
     else
-      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN"
+      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_BIG_ENDIAN"
     fi
   fi
-  
+
   # Setup target OS define. Use OS target name but in upper case.
   OPENJDK_TARGET_OS_UPPERCASE=`$ECHO $OPENJDK_TARGET_OS | $TR 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D$OPENJDK_TARGET_OS_UPPERCASE"
+  COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D$OPENJDK_TARGET_OS_UPPERCASE"
 
   # Setup target CPU
-  CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY"
-  
+  COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY"
+
   # Setup debug/release defines
   if test "x$DEBUG_LEVEL" = xrelease; then
-    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DNDEBUG"
+    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DNDEBUG"
     if test "x$OPENJDK_TARGET_OS" = xsolaris; then
-      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DTRIMMED"
+      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DTRIMMED"
     fi
   else
-    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DDEBUG"
+    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DDEBUG"
   fi
 
   # Setup release name
-  CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DRELEASE='\"\$(RELEASE)\"'"
+  COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DRELEASE='\"\$(RELEASE)\"'"
 
 
   # Set some additional per-OS defines.
   if test "x$OPENJDK_TARGET_OS" = xmacosx; then
-    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
+    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
   elif test "x$OPENJDK_TARGET_OS" = xaix; then
     # FIXME: PPC64 should not be here.
-    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DPPC64"
+    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DPPC64"
   elif test "x$OPENJDK_TARGET_OS" = xbsd; then
-    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_ALLBSD_SOURCE"
+    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE"
   fi
 
   # Additional macosx handling
@@ -595,22 +649,22 @@
       # FIXME: clean this up, and/or move it elsewhere.
 
       # Setting these parameters makes it an error to link to macosx APIs that are
-      # newer than the given OS version and makes the linked binaries compatible 
+      # newer than the given OS version and makes the linked binaries compatible
       # even if built on a newer version of the OS.
       # The expected format is X.Y.Z
       MACOSX_VERSION_MIN=10.7.0
       AC_SUBST(MACOSX_VERSION_MIN)
-    
+
       # The macro takes the version with no dots, ex: 1070
       # Let the flags variables get resolved in make for easier override on make
       # command line.
-      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
+      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
       LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
     fi
   fi
 
   # Setup some hard coded includes
-  CCXXFLAGS_JDK="$CCXXFLAGS_JDK \
+  COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \
       -I${JDK_OUTPUTDIR}/include \
       -I${JDK_OUTPUTDIR}/include/$OPENJDK_TARGET_OS \
       -I${JDK_TOPDIR}/src/share/javavm/export \
@@ -619,12 +673,12 @@
       -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/native/common"
 
   # The shared libraries are compiled using the picflag.
-  CFLAGS_JDKLIB="$CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
-  CXXFLAGS_JDKLIB="$CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA "
+  CFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
+  CXXFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA "
 
   # Executable flags
-  CFLAGS_JDKEXE="$CCXXFLAGS_JDK $CFLAGS_JDK"
-  CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK"
+  CFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK"
+  CXXFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK"
 
   AC_SUBST(CFLAGS_JDKLIB)
   AC_SUBST(CFLAGS_JDKEXE)
@@ -633,6 +687,7 @@
 
   # Setup LDFLAGS et al.
   #
+
   # Now this is odd. The JDK native libraries have to link against libjvm.so
   # On 32-bit machines there is normally two distinct libjvm.so:s, client and server.
   # Which should we link to? Are we lucky enough that the binary api to the libjvm.so library
@@ -648,39 +703,93 @@
     fi
     # TODO: make -debug optional "--disable-full-debug-symbols"
     LDFLAGS_JDK="$LDFLAGS_JDK -debug"
-    LDFLAGS_JDKLIB="${LDFLAGS_JDK} -dll -libpath:${JDK_OUTPUTDIR}/lib"
-    LDFLAGS_JDKLIB_SUFFIX=""
+  elif test "x$TOOLCHAIN_TYPE" = xgcc; then
+    # If this is a --hash-style=gnu system, use --hash-style=both, why?
+    # We have previously set HAS_GNU_HASH if this is the case
+    if test -n "$HAS_GNU_HASH"; then
+      LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both"
+    fi
+    if test "x$OPENJDK_TARGET_OS" = xlinux; then
+      # And since we now know that the linker is gnu, then add -z defs, to forbid
+      # undefined symbols in object files.
+      LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs"
+      case $DEBUG_LEVEL in
+        release )
+          # tell linker to optimize libraries.
+          # Should this be supplied to the OSS linker as well?
+          LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1"
+          ;;
+        slowdebug )
+          if test "x$HAS_LINKER_NOW" = "xtrue"; then
+            # do relocations at load
+            LDFLAGS_JDK="$LDFLAGS_JDK $LINKER_NOW_FLAG"
+            LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LINKER_NOW_FLAG"
+          fi
+          if test "x$HAS_LINKER_RELRO" = "xtrue"; then
+            # mark relocations read only
+            LDFLAGS_JDK="$LDFLAGS_JDK $LINKER_RELRO_FLAG"
+            LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LINKER_RELRO_FLAG"
+          fi
+          ;;
+        fastdebug )
+          if test "x$HAS_LINKER_RELRO" = "xtrue"; then
+            # mark relocations read only
+            LDFLAGS_JDK="$LDFLAGS_JDK $LINKER_RELRO_FLAG"
+            LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LINKER_RELRO_FLAG"
+          fi
+          ;;
+        * )
+          AC_MSG_ERROR([Unrecognized \$DEBUG_LEVEL: $DEBUG_LEVEL])
+          ;;
+        esac
+    fi
+  elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
+    LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext"
+    LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
+  fi
+
+  if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
+    # If undefined behaviour detection is enabled then we need to tell linker.
+    case $DEBUG_LEVEL in
+      release | fastdebug )
+        ;;
+      slowdebug )
+        AC_MSG_WARN([$HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR])
+        if test "x$HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR" = "xtrue"; then
+          # enable undefined behaviour checking
+          LDFLAGS_JDK="$LDFLAGS_JDK `$ECHO -n $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG | sed -e "s/[ ]*\([^ ]\+\)/ -Xlinker \1/g"`"
+          LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK `$ECHO -n $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG | sed -e "s/[ ]*\([^ ]\+\)/ -Xlinker \1/g"`"
+        fi
+        ;;
+      * )
+        AC_MSG_ERROR([Unrecognized \$DEBUG_LEVEL: $DEBUG_LEVEL])
+        ;;
+    esac
+  fi
+
+  # Customize LDFLAGS for executables
+
+  LDFLAGS_JDKEXE="${LDFLAGS_JDK}"
+
+  if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
     if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then
       LDFLAGS_STACK_SIZE=1048576
     else
       LDFLAGS_STACK_SIZE=327680
     fi
-    LDFLAGS_JDKEXE="${LDFLAGS_JDK} /STACK:$LDFLAGS_STACK_SIZE"
+    LDFLAGS_JDKEXE="${LDFLAGS_JDKEXE} /STACK:$LDFLAGS_STACK_SIZE"
+  elif test "x$OPENJDK_TARGET_OS" = xlinux; then
+    LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined"
+  fi
+
+  # Customize LDFLAGS for libs
+  LDFLAGS_JDKLIB="${LDFLAGS_JDK}"
+
+  if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
+    LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -dll -libpath:${JDK_OUTPUTDIR}/lib"
+    LDFLAGS_JDKLIB_SUFFIX=""
   else
-    if test "x$TOOLCHAIN_TYPE" = xgcc; then
-      # If this is a --hash-style=gnu system, use --hash-style=both, why?
-      # We have previously set HAS_GNU_HASH if this is the case
-      if test -n "$HAS_GNU_HASH"; then
-        LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both "
-      fi
-      if test "x$OPENJDK_TARGET_OS" = xlinux; then
-        # And since we now know that the linker is gnu, then add -z defs, to forbid
-        # undefined symbols in object files.
-        LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs"
-        if test "x$DEBUG_LEVEL" = "xrelease"; then
-          # When building release libraries, tell the linker optimize them.
-          # Should this be supplied to the OSS linker as well?
-          LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1"
-        fi
-      fi
-    fi
-
-    if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
-      LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext"
-      LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
-    fi
-
-    LDFLAGS_JDKLIB="${LDFLAGS_JDK} $SHARED_LIBRARY_FLAGS \
+    LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB}  ${SHARED_LIBRARY_FLAGS} \
         -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}"
 
     # On some platforms (mac) the linker warns about non existing -L dirs.
@@ -701,12 +810,8 @@
     if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
       LDFLAGS_JDKLIB_SUFFIX="$LDFLAGS_JDKLIB_SUFFIX -lc"
     fi
+  fi
 
-    LDFLAGS_JDKEXE="${LDFLAGS_JDK}"
-    if test "x$OPENJDK_TARGET_OS" = xlinux; then
-      LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined"
-    fi
-  fi
   AC_SUBST(LDFLAGS_JDKLIB)
   AC_SUBST(LDFLAGS_JDKEXE)
   AC_SUBST(LDFLAGS_JDKLIB_SUFFIX)
@@ -714,7 +819,6 @@
   AC_SUBST(LDFLAGS_CXX_JDK)
 ])
 
-
 # FLAGS_COMPILER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE],
 #                                   [RUN-IF-FALSE])
 # ------------------------------------------------------------
@@ -727,7 +831,7 @@
   saved_cflags="$CFLAGS"
   CFLAGS="$CFLAGS $1"
   AC_LANG_PUSH([C])
-  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], 
+  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [],
       [supports=no])
   AC_LANG_POP([C])
   CFLAGS="$saved_cflags"
@@ -735,7 +839,7 @@
   saved_cxxflags="$CXXFLAGS"
   CXXFLAGS="$CXXFLAG $1"
   AC_LANG_PUSH([C++])
-  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], 
+  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [],
       [supports=no])
   AC_LANG_POP([C++])
   CXXFLAGS="$saved_cxxflags"
@@ -748,6 +852,31 @@
   fi
 ])
 
+# FLAGS_LINKER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE],
+#                                    [RUN-IF-FALSE])
+# ------------------------------------------------------------
+# Check that the linker support an argument
+AC_DEFUN([FLAGS_LINKER_CHECK_ARGUMENTS],
+[
+  AC_MSG_CHECKING([if linker supports "$1"])
+  supports=yes
+
+  saved_ldflags="$LDFLAGS"
+  LDFLAGS="$LDFLAGS $1"
+  AC_LANG_PUSH([C])
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
+      [], [supports=no])
+  AC_LANG_POP([C])
+  LDFLAGS="$saved_ldflags"
+
+  AC_MSG_RESULT([$supports])
+  if test "x$supports" = "xyes" ; then
+    m4_ifval([$2], [$2], [:])
+  else
+    m4_ifval([$3], [$3], [:])
+  fi
+])
+
 AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_MISC],
 [
   # Some Zero and Shark settings.
--- a/common/autoconf/generated-configure.sh	Wed Jul 09 16:44:30 2014 +0200
+++ b/common/autoconf/generated-configure.sh	Fri Jul 11 05:59:08 2014 -0700
@@ -692,13 +692,17 @@
 LEGACY_EXTRA_CXXFLAGS
 LEGACY_EXTRA_CFLAGS
 CXX_O_FLAG_NONE
+CXX_O_FLAG_DEBUG
 CXX_O_FLAG_NORM
 CXX_O_FLAG_HI
 CXX_O_FLAG_HIGHEST
 C_O_FLAG_NONE
+C_O_FLAG_DEBUG
 C_O_FLAG_NORM
 C_O_FLAG_HI
 C_O_FLAG_HIGHEST
+CXXFLAGS_DEBUG_OPTIONS
+CFLAGS_DEBUG_OPTIONS
 CXXFLAGS_DEBUG_SYMBOLS
 CFLAGS_DEBUG_SYMBOLS
 CXX_FLAG_DEPS
@@ -2346,6 +2350,52 @@
 
 } # ac_fn_objc_try_compile
 
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 test -x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
 # ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES
 # ---------------------------------------------------------
 # Tests whether HEADER exists, giving a warning if it cannot be compiled using
@@ -3761,13 +3811,18 @@
 
 
 
-
 # FLAGS_COMPILER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE],
 #                                   [RUN-IF-FALSE])
 # ------------------------------------------------------------
 # Check that the c and c++ compilers support an argument
 
 
+# FLAGS_LINKER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE],
+#                                    [RUN-IF-FALSE])
+# ------------------------------------------------------------
+# Check that the linker support an argument
+
+
 
 
 #
@@ -4253,7 +4308,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1399969244
+DATE_WHEN_GENERATED=1402614845
 
 ###############################################################################
 #
@@ -40264,6 +40319,8 @@
 
 
 
+
+
   # The package path is used only on macosx?
   # FIXME: clean this up, and/or move it elsewhere.
   PACKAGE_PATH=/opt/local
@@ -40289,6 +40346,242 @@
     # If this is a --hash-style=gnu system, use --hash-style=both, why?
     HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'`
     # This is later checked when setting flags.
+
+    # "-Og" suppported for GCC 4.8 and later
+    CFLAG_OPTIMIZE_DEBUG_FLAG="-Og"
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"$CFLAG_OPTIMIZE_DEBUG_FLAG\"" >&5
+$as_echo_n "checking if compiler supports \"$CFLAG_OPTIMIZE_DEBUG_FLAG\"... " >&6; }
+  supports=yes
+
+  saved_cflags="$CFLAGS"
+  CFLAGS="$CFLAGS $CFLAG_OPTIMIZE_DEBUG_FLAG"
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  supports=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+  CFLAGS="$saved_cflags"
+
+  saved_cxxflags="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAG $CFLAG_OPTIMIZE_DEBUG_FLAG"
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int i;
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+else
+  supports=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+  CXXFLAGS="$saved_cxxflags"
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
+$as_echo "$supports" >&6; }
+  if test "x$supports" = "xyes" ; then
+    HAS_CFLAG_OPTIMIZE_DEBUG=true
+  else
+    HAS_CFLAG_OPTIMIZE_DEBUG=false
+  fi
+
+
+    # "-fsanitize=undefined" supported for GCC 4.9 and later
+    CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG="-fsanitize=undefined -fsanitize-recover"
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"$CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG\"" >&5
+$as_echo_n "checking if compiler supports \"$CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG\"... " >&6; }
+  supports=yes
+
+  saved_cflags="$CFLAGS"
+  CFLAGS="$CFLAGS $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG"
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  supports=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+  CFLAGS="$saved_cflags"
+
+  saved_cxxflags="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAG $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG"
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int i;
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+else
+  supports=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+  CXXFLAGS="$saved_cxxflags"
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
+$as_echo "$supports" >&6; }
+  if test "x$supports" = "xyes" ; then
+    HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR=true
+  else
+    HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR=false
+  fi
+
+
+    # "-z relro" supported in GNU binutils 2.17 and later
+    LINKER_RELRO_FLAG="-Xlinker -z -Xlinker relro"
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linker supports \"$LINKER_RELRO_FLAG\"" >&5
+$as_echo_n "checking if linker supports \"$LINKER_RELRO_FLAG\"... " >&6; }
+  supports=yes
+
+  saved_ldflags="$LDFLAGS"
+  LDFLAGS="$LDFLAGS $LINKER_RELRO_FLAG"
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+else
+  supports=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+  LDFLAGS="$saved_ldflags"
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
+$as_echo "$supports" >&6; }
+  if test "x$supports" = "xyes" ; then
+    HAS_LINKER_RELRO=true
+  else
+    HAS_LINKER_RELRO=false
+  fi
+
+
+    # "-z now" supported in GNU binutils 2.11 and later
+    LINKER_NOW_FLAG="-Xlinker -z -Xlinker now"
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linker supports \"$LINKER_NOW_FLAG\"" >&5
+$as_echo_n "checking if linker supports \"$LINKER_NOW_FLAG\"... " >&6; }
+  supports=yes
+
+  saved_ldflags="$LDFLAGS"
+  LDFLAGS="$LDFLAGS $LINKER_NOW_FLAG"
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+else
+  supports=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+  LDFLAGS="$saved_ldflags"
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
+$as_echo "$supports" >&6; }
+  if test "x$supports" = "xyes" ; then
+    HAS_LINKER_NOW=true
+  else
+    HAS_LINKER_NOW=false
+  fi
+
   fi
 
   # Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed
@@ -40297,8 +40590,8 @@
   if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$TOOLCHAIN_TYPE" = xgcc; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken SuSE 'ld' which only understands anonymous version tags in executables" >&5
 $as_echo_n "checking for broken SuSE 'ld' which only understands anonymous version tags in executables... " >&6; }
-    echo "SUNWprivate_1.1 { local: *; };" > version-script.map
-    echo "int main() { }" > main.c
+    $ECHO "SUNWprivate_1.1 { local: *; };" > version-script.map
+    $ECHO "int main() { }" > main.c
     if $CXX -Xlinker -version-script=version-script.map main.c 2>&5 >&5; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
@@ -40768,8 +41061,8 @@
 
 
   if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
-    # FIXME: likely bug, should be CCXXFLAGS_JDK? or one for C or CXX.
-    CCXXFLAGS="$CCXXFLAGS -nologo"
+    # silence copyright notice and other headers.
+    COMMON_CCXXFLAGS="$COMMON_CCXXFLAGS -nologo"
   fi
 
   if test "x$SYSROOT" != "x"; then
@@ -40803,7 +41096,6 @@
 
 # Now we can test some aspects on the target using configure macros.
 
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
 if ${ac_cv_header_stdc+:} false; then :
@@ -41488,6 +41780,7 @@
   # Debug symbols
   if test "x$TOOLCHAIN_TYPE" = xgcc; then
     if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then
+      # reduce from default "-g2" option to save space
       CFLAGS_DEBUG_SYMBOLS="-g1"
       CXXFLAGS_DEBUG_SYMBOLS="-g1"
     else
@@ -41499,6 +41792,7 @@
     CXXFLAGS_DEBUG_SYMBOLS="-g"
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
     CFLAGS_DEBUG_SYMBOLS="-g -xs"
+    # FIXME: likely a bug, this disables debug symbols rather than enables them
     CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs"
   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
     CFLAGS_DEBUG_SYMBOLS="-g"
@@ -41507,6 +41801,31 @@
 
 
 
+  # bounds, memory and behavior checking options
+  if test "x$TOOLCHAIN_TYPE" = xgcc; then
+    case $DEBUG_LEVEL in
+    release )
+      # no adjustment
+      ;;
+    fastdebug )
+      # Add compile time bounds checks.
+      CFLAGS_DEBUG_OPTIONS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1"
+      CXXFLAGS_DEBUG_OPTIONS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1"
+      ;;
+    slowdebug )
+      # Add runtime bounds checks and symbol info.
+      CFLAGS_DEBUG_OPTIONS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all --param ssp-buffer-size=1"
+      CXXFLAGS_DEBUG_OPTIONS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all --param ssp-buffer-size=1"
+      if test "x$HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR" = "xtrue"; then
+        CFLAGS_DEBUG_OPTIONS="$CFLAGS_DEBUG_OPTIONS  $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG"
+        CXXFLAGS_DEBUG_OPTIONS="$CXXFLAGS_DEBUG_OPTIONS $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG"
+      fi
+      ;;
+    esac
+  fi
+
+
+
   # Optimization levels
   if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
     CC_HIGHEST="$CC_HIGHEST -fns -fsimple -fsingle -xbuiltin=%all -xdepend -xrestrict -xlibmil"
@@ -41516,10 +41835,12 @@
       C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xalias_level=basic -xregs=no%frameptr"
       C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr"
       C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr"
+      C_O_FLAG_DEBUG="-xregs=no%frameptr"
       C_O_FLAG_NONE="-xregs=no%frameptr"
       CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xregs=no%frameptr"
       CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz -xregs=no%frameptr"
       CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr"
+      CXX_O_FLAG_DEBUG="-xregs=no%frameptr"
       CXX_O_FLAG_NONE="-xregs=no%frameptr"
       if test "x$OPENJDK_TARGET_CPU_BITS" = "x32"; then
         C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xchip=pentium"
@@ -41529,10 +41850,12 @@
       C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xalias_level=basic -xprefetch=auto,explicit -xchip=ultra"
       C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0"
       C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0"
+      C_O_FLAG_DEBUG=""
       C_O_FLAG_NONE=""
       CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra"
       CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
       CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
+      C_O_FLAG_DEBUG=""
       CXX_O_FLAG_NONE=""
     fi
   else
@@ -41545,13 +41868,17 @@
         C_O_FLAG_HIGHEST="-Os"
         C_O_FLAG_HI="-Os"
         C_O_FLAG_NORM="-Os"
-        C_O_FLAG_NONE=""
       else
         C_O_FLAG_HIGHEST="-O3"
         C_O_FLAG_HI="-O3"
         C_O_FLAG_NORM="-O2"
-        C_O_FLAG_NONE="-O0"
-      fi
+      fi
+      if test "x$HAS_CFLAG_OPTIMIZE_DEBUG" = "xtrue"; then
+        C_O_FLAG_DEBUG="$CFLAG_OPTIMIZE_DEBUG_FLAG"
+      else
+        C_O_FLAG_DEBUG="-O0"
+      fi
+      C_O_FLAG_NONE="-O0"
     elif test "x$TOOLCHAIN_TYPE" = xclang; then
       if test "x$OPENJDK_TARGET_OS" = xmacosx; then
         # On MacOSX we optimize for size, something
@@ -41559,30 +41886,56 @@
         C_O_FLAG_HIGHEST="-Os"
         C_O_FLAG_HI="-Os"
         C_O_FLAG_NORM="-Os"
-        C_O_FLAG_NONE=""
       else
         C_O_FLAG_HIGHEST="-O3"
         C_O_FLAG_HI="-O3"
         C_O_FLAG_NORM="-O2"
-        C_O_FLAG_NONE="-O0"
-      fi
+      fi
+      C_O_FLAG_DEBUG="-O0"
+      C_O_FLAG_NONE="-O0"
     elif test "x$TOOLCHAIN_TYPE" = xxlc; then
       C_O_FLAG_HIGHEST="-O3"
       C_O_FLAG_HI="-O3 -qstrict"
       C_O_FLAG_NORM="-O2"
-      C_O_FLAG_NONE=""
+      C_O_FLAG_DEBUG="-qnoopt"
+      C_O_FLAG_NONE="-qnoop"
     elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
       C_O_FLAG_HIGHEST="-O2"
       C_O_FLAG_HI="-O1"
       C_O_FLAG_NORM="-O1"
+      C_O_FLAG_DEBUG="-Od"
       C_O_FLAG_NONE="-Od"
     fi
     CXX_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST"
     CXX_O_FLAG_HI="$C_O_FLAG_HI"
     CXX_O_FLAG_NORM="$C_O_FLAG_NORM"
+    CXX_O_FLAG_DEBUG="$C_O_FLAG_DEBUG"
     CXX_O_FLAG_NONE="$C_O_FLAG_NONE"
   fi
 
+  # Adjust optimization flags according to debug level.
+  case $DEBUG_LEVEL in
+    release )
+      # no adjustment
+      ;;
+    fastdebug )
+      # Not quite so much optimization
+      C_O_FLAG_HI="$C_O_FLAG_NORM"
+      CXX_O_FLAG_HI="$CXX_O_FLAG_NORM"
+      ;;
+    slowdebug )
+      # Disable optimization
+      C_O_FLAG_HIGHEST="$C_O_FLAG_DEBUG"
+      C_O_FLAG_HI="$C_O_FLAG_DEBUG"
+      C_O_FLAG_NORM="$C_O_FLAG_DEBUG"
+      CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_DEBUG"
+      CXX_O_FLAG_HI="$CXX_O_FLAG_DEBUG"
+      CXX_O_FLAG_NORM="$CXX_O_FLAG_DEBUG"
+      ;;
+  esac
+
+
+
 
 
 
@@ -41660,11 +42013,12 @@
   # Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build.
   #
 
-  # Setup compiler/platform specific flags to CFLAGS_JDK,
-  # CXXFLAGS_JDK and CCXXFLAGS_JDK (common to C and CXX?)
+  # Setup compiler/platform specific flags into
+  #    CFLAGS_JDK    - C Compiler flags
+  #    CXXFLAGS_JDK  - C++ Compiler flags
+  #    COMMON_CCXXFLAGS_JDK - common to C and C++
   if test "x$TOOLCHAIN_TYPE" = xgcc; then
-    # these options are used for both C and C++ compiles
-    CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Wall -Wno-parentheses -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
+    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wno-parentheses -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
         -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
     case $OPENJDK_TARGET_CPU_ARCH in
       arm )
@@ -41676,14 +42030,14 @@
         CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
         ;;
       * )
-        CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer"
+        COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer"
         CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
         ;;
     esac
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
-    CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
+    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
     if test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then
-      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB"
+      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB"
       CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE"
     fi
 
@@ -41693,14 +42047,14 @@
     CFLAGS_JDK="$CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
     CXXFLAGS_JDK="$CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
-    CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
+    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
     -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \
     -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
     -DWIN32 -DIAL"
     if test "x$OPENJDK_TARGET_CPU" = xx86_64; then
-      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_AMD64_ -Damd64"
-    else
-      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_X86_ -Dx86"
+      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_AMD64_ -Damd64"
+    else
+      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_X86_ -Dx86"
     fi
   fi
 
@@ -41708,28 +42062,20 @@
 
   # Adjust flags according to debug level.
   case $DEBUG_LEVEL in
-    fastdebug )
-      CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS"
-      CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS"
-      C_O_FLAG_HI="$C_O_FLAG_NORM"
-      C_O_FLAG_NORM="$C_O_FLAG_NORM"
-      CXX_O_FLAG_HI="$CXX_O_FLAG_NORM"
-      CXX_O_FLAG_NORM="$CXX_O_FLAG_NORM"
+    fastdebug | slowdebug )
+      CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS $CFLAGS_DEBUG_OPTIONS"
+      CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS $CXXFLAGS_DEBUG_OPTIONS"
       JAVAC_FLAGS="$JAVAC_FLAGS -g"
       ;;
-    slowdebug )
-      CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS"
-      CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS"
-      C_O_FLAG_HI="$C_O_FLAG_NONE"
-      C_O_FLAG_NORM="$C_O_FLAG_NONE"
-      CXX_O_FLAG_HI="$CXX_O_FLAG_NONE"
-      CXX_O_FLAG_NORM="$CXX_O_FLAG_NONE"
-      JAVAC_FLAGS="$JAVAC_FLAGS -g"
+    release )
+      ;;
+    * )
+      as_fn_error $? "Unrecognized \$DEBUG_LEVEL: $DEBUG_LEVEL" "$LINENO" 5
       ;;
   esac
 
   # Setup LP64
-  CCXXFLAGS_JDK="$CCXXFLAGS_JDK $ADD_LP64"
+  COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK $ADD_LP64"
 
   # Set some common defines. These works for all compilers, but assume
   # -D is universally accepted.
@@ -41742,49 +42088,49 @@
     #   Note: -Dmacro         is the same as    #define macro 1
     #         -Dmacro=        is the same as    #define macro
     if test "x$OPENJDK_TARGET_OS" = xsolaris; then
-      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN="
-    else
-      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN"
+      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_LITTLE_ENDIAN="
+    else
+      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_LITTLE_ENDIAN"
     fi
   else
     # Same goes for _BIG_ENDIAN. Do we really need to set *ENDIAN on Solaris if they
     # are defined in the system?
     if test "x$OPENJDK_TARGET_OS" = xsolaris; then
-      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN="
-    else
-      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN"
+      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_BIG_ENDIAN="
+    else
+      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_BIG_ENDIAN"
     fi
   fi
 
   # Setup target OS define. Use OS target name but in upper case.
   OPENJDK_TARGET_OS_UPPERCASE=`$ECHO $OPENJDK_TARGET_OS | $TR 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D$OPENJDK_TARGET_OS_UPPERCASE"
+  COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D$OPENJDK_TARGET_OS_UPPERCASE"
 
   # Setup target CPU
-  CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY"
+  COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY"
 
   # Setup debug/release defines
   if test "x$DEBUG_LEVEL" = xrelease; then
-    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DNDEBUG"
+    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DNDEBUG"
     if test "x$OPENJDK_TARGET_OS" = xsolaris; then
-      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DTRIMMED"
-    fi
-  else
-    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DDEBUG"
+      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DTRIMMED"
+    fi
+  else
+    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DDEBUG"
   fi
 
   # Setup release name
-  CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DRELEASE='\"\$(RELEASE)\"'"
+  COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DRELEASE='\"\$(RELEASE)\"'"
 
 
   # Set some additional per-OS defines.
   if test "x$OPENJDK_TARGET_OS" = xmacosx; then
-    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
+    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
   elif test "x$OPENJDK_TARGET_OS" = xaix; then
     # FIXME: PPC64 should not be here.
-    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DPPC64"
+    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DPPC64"
   elif test "x$OPENJDK_TARGET_OS" = xbsd; then
-    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_ALLBSD_SOURCE"
+    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE"
   fi
 
   # Additional macosx handling
@@ -41803,13 +42149,13 @@
       # The macro takes the version with no dots, ex: 1070
       # Let the flags variables get resolved in make for easier override on make
       # command line.
-      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
+      COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
       LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
     fi
   fi
 
   # Setup some hard coded includes
-  CCXXFLAGS_JDK="$CCXXFLAGS_JDK \
+  COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \
       -I${JDK_OUTPUTDIR}/include \
       -I${JDK_OUTPUTDIR}/include/$OPENJDK_TARGET_OS \
       -I${JDK_TOPDIR}/src/share/javavm/export \
@@ -41818,12 +42164,12 @@
       -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/native/common"
 
   # The shared libraries are compiled using the picflag.
-  CFLAGS_JDKLIB="$CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
-  CXXFLAGS_JDKLIB="$CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA "
+  CFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
+  CXXFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA "
 
   # Executable flags
-  CFLAGS_JDKEXE="$CCXXFLAGS_JDK $CFLAGS_JDK"
-  CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK"
+  CFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK"
+  CXXFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK"
 
 
 
@@ -41832,6 +42178,7 @@
 
   # Setup LDFLAGS et al.
   #
+
   # Now this is odd. The JDK native libraries have to link against libjvm.so
   # On 32-bit machines there is normally two distinct libjvm.so:s, client and server.
   # Which should we link to? Are we lucky enough that the binary api to the libjvm.so library
@@ -41847,39 +42194,94 @@
     fi
     # TODO: make -debug optional "--disable-full-debug-symbols"
     LDFLAGS_JDK="$LDFLAGS_JDK -debug"
-    LDFLAGS_JDKLIB="${LDFLAGS_JDK} -dll -libpath:${JDK_OUTPUTDIR}/lib"
-    LDFLAGS_JDKLIB_SUFFIX=""
+  elif test "x$TOOLCHAIN_TYPE" = xgcc; then
+    # If this is a --hash-style=gnu system, use --hash-style=both, why?
+    # We have previously set HAS_GNU_HASH if this is the case
+    if test -n "$HAS_GNU_HASH"; then
+      LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both"
+    fi
+    if test "x$OPENJDK_TARGET_OS" = xlinux; then
+      # And since we now know that the linker is gnu, then add -z defs, to forbid
+      # undefined symbols in object files.
+      LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs"
+      case $DEBUG_LEVEL in
+        release )
+          # tell linker to optimize libraries.
+          # Should this be supplied to the OSS linker as well?
+          LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1"
+          ;;
+        slowdebug )
+          if test "x$HAS_LINKER_NOW" = "xtrue"; then
+            # do relocations at load
+            LDFLAGS_JDK="$LDFLAGS_JDK $LINKER_NOW_FLAG"
+            LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LINKER_NOW_FLAG"
+          fi
+          if test "x$HAS_LINKER_RELRO" = "xtrue"; then
+            # mark relocations read only
+            LDFLAGS_JDK="$LDFLAGS_JDK $LINKER_RELRO_FLAG"
+            LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LINKER_RELRO_FLAG"
+          fi
+          ;;
+        fastdebug )
+          if test "x$HAS_LINKER_RELRO" = "xtrue"; then
+            # mark relocations read only
+            LDFLAGS_JDK="$LDFLAGS_JDK $LINKER_RELRO_FLAG"
+            LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LINKER_RELRO_FLAG"
+          fi
+          ;;
+        * )
+          as_fn_error $? "Unrecognized \$DEBUG_LEVEL: $DEBUG_LEVEL" "$LINENO" 5
+          ;;
+        esac
+    fi
+  elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
+    LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext"
+    LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
+  fi
+
+  if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
+    # If undefined behaviour detection is enabled then we need to tell linker.
+    case $DEBUG_LEVEL in
+      release | fastdebug )
+        ;;
+      slowdebug )
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR" >&5
+$as_echo "$as_me: WARNING: $HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR" >&2;}
+        if test "x$HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR" = "xtrue"; then
+          # enable undefined behaviour checking
+          LDFLAGS_JDK="$LDFLAGS_JDK `$ECHO -n $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG | sed -e "s/ *\(^ \+\)/ -Xlinker \1/g"`"
+          LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK `$ECHO -n $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG | sed -e "s/ *\(^ \+\)/ -Xlinker \1/g"`"
+        fi
+        ;;
+      * )
+        as_fn_error $? "Unrecognized \$DEBUG_LEVEL: $DEBUG_LEVEL" "$LINENO" 5
+        ;;
+    esac
+  fi
+
+  # Customize LDFLAGS for executables
+
+  LDFLAGS_JDKEXE="${LDFLAGS_JDK}"
+
+  if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
     if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then
       LDFLAGS_STACK_SIZE=1048576
     else
       LDFLAGS_STACK_SIZE=327680
     fi
-    LDFLAGS_JDKEXE="${LDFLAGS_JDK} /STACK:$LDFLAGS_STACK_SIZE"
-  else
-    if test "x$TOOLCHAIN_TYPE" = xgcc; then
-      # If this is a --hash-style=gnu system, use --hash-style=both, why?
-      # We have previously set HAS_GNU_HASH if this is the case
-      if test -n "$HAS_GNU_HASH"; then
-        LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both "
-      fi
-      if test "x$OPENJDK_TARGET_OS" = xlinux; then
-        # And since we now know that the linker is gnu, then add -z defs, to forbid
-        # undefined symbols in object files.
-        LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs"
-        if test "x$DEBUG_LEVEL" = "xrelease"; then
-          # When building release libraries, tell the linker optimize them.
-          # Should this be supplied to the OSS linker as well?
-          LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1"
-        fi
-      fi
-    fi
-
-    if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
-      LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext"
-      LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
-    fi
-
-    LDFLAGS_JDKLIB="${LDFLAGS_JDK} $SHARED_LIBRARY_FLAGS \
+    LDFLAGS_JDKEXE="${LDFLAGS_JDKEXE} /STACK:$LDFLAGS_STACK_SIZE"
+  elif test "x$OPENJDK_TARGET_OS" = xlinux; then
+    LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined"
+  fi
+
+  # Customize LDFLAGS for libs
+  LDFLAGS_JDKLIB="${LDFLAGS_JDK}"
+
+  if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
+    LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -dll -libpath:${JDK_OUTPUTDIR}/lib"
+    LDFLAGS_JDKLIB_SUFFIX=""
+  else
+    LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB}  ${SHARED_LIBRARY_FLAGS} \
         -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}"
 
     # On some platforms (mac) the linker warns about non existing -L dirs.
@@ -41900,11 +42302,6 @@
     if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
       LDFLAGS_JDKLIB_SUFFIX="$LDFLAGS_JDKLIB_SUFFIX -lc"
     fi
-
-    LDFLAGS_JDKEXE="${LDFLAGS_JDK}"
-    if test "x$OPENJDK_TARGET_OS" = xlinux; then
-      LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined"
-    fi
   fi
 
 
--- a/common/autoconf/toolchain.m4	Wed Jul 09 16:44:30 2014 +0200
+++ b/common/autoconf/toolchain.m4	Fri Jul 11 05:59:08 2014 -0700
@@ -24,11 +24,11 @@
 #
 
 ########################################################################
-# This file is responsible for detecting, verifying and setting up the 
-# toolchain, i.e. the compiler, linker and related utilities. It will setup 
+# This file is responsible for detecting, verifying and setting up the
+# toolchain, i.e. the compiler, linker and related utilities. It will setup
 # proper paths to the binaries, but it will not setup any flags.
 #
-# The binaries used is determined by the toolchain type, which is the family of 
+# The binaries used is determined by the toolchain type, which is the family of
 # compilers and related tools that are used.
 ########################################################################
 
@@ -83,7 +83,7 @@
   AC_SUBST(SHARED_LIBRARY)
   AC_SUBST(STATIC_LIBRARY)
   AC_SUBST(OBJ_SUFFIX)
-  AC_SUBST(EXE_SUFFIX)  
+  AC_SUBST(EXE_SUFFIX)
 ])
 
 # Determine which toolchain type to use, and make sure it is valid for this
@@ -117,7 +117,7 @@
     # First toolchain type in the list is the default
     DEFAULT_TOOLCHAIN=${VALID_TOOLCHAINS%% *}
   fi
-  
+
   if test "x$with_toolchain_type" = xlist; then
     # List all toolchains
     AC_MSG_NOTICE([The following toolchains are valid on this platform:])
@@ -126,7 +126,7 @@
       TOOLCHAIN_DESCRIPTION=${!toolchain_var_name}
       $PRINTF "  %-10s  %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION"
     done
-    
+
     exit 0
   elif test "x$with_toolchain_type" != x; then
     # User override; check that it is valid
@@ -168,10 +168,10 @@
     AC_MSG_NOTICE([Using default toolchain $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)])
   else
     AC_MSG_NOTICE([Using user selected toolchain $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION). Default toolchain is $DEFAULT_TOOLCHAIN.])
-  fi 
+  fi
 ])
 
-# Before we start detecting the toolchain executables, we might need some 
+# Before we start detecting the toolchain executables, we might need some
 # special setup, e.g. additional paths etc.
 AC_DEFUN_ONCE([TOOLCHAIN_PRE_DETECTION],
 [
@@ -184,7 +184,7 @@
   ORG_OBJCFLAGS="$OBJCFLAGS"
 
   # On Windows, we need to detect the visual studio installation first.
-  # This will change the PATH, but we need to keep that new PATH even 
+  # This will change the PATH, but we need to keep that new PATH even
   # after toolchain detection is done, since the compiler (on x86) uses
   # it for DLL resolution in runtime.
   if test "x$OPENJDK_BUILD_OS" = "xwindows" && test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then
@@ -208,7 +208,7 @@
     PATH="/usr/ccs/bin:$PATH"
   fi
 
-  # Finally add TOOLCHAIN_PATH at the beginning, to allow --with-tools-dir to 
+  # Finally add TOOLCHAIN_PATH at the beginning, to allow --with-tools-dir to
   # override all other locations.
   if test "x$TOOLCHAIN_PATH" != x; then
     PATH=$TOOLCHAIN_PATH:$PATH
@@ -254,7 +254,7 @@
       AC_MSG_NOTICE([The result from running with --version was: "$ALT_VERSION_OUTPUT"])
       AC_MSG_ERROR([A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.])
     fi
-    # Remove usage instructions (if present), and 
+    # Remove usage instructions (if present), and
     # collapse compiler output into a single line
     COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \
         $SED -e 's/ *@<:@Uu@:>@sage:.*//'`
@@ -282,7 +282,7 @@
     # There is no specific version flag, but all output starts with a version string.
     # First line typically looks something like:
     # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
-    COMPILER_VERSION_OUTPUT=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'`    
+    COMPILER_VERSION_OUTPUT=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'`
     # Check that this is likely to be Microsoft CL.EXE.
     $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Microsoft.*Compiler" > /dev/null
     if test $? -ne 0; then
@@ -360,7 +360,7 @@
     AC_MSG_NOTICE([Will use user supplied compiler $1=[$]$1])
     if test "x`basename [$]$1`" = "x[$]$1"; then
       # A command without a complete path is provided, search $PATH.
-      
+
       AC_PATH_PROGS(POTENTIAL_$1, [$]$1)
       if test "x$POTENTIAL_$1" != x; then
         $1=$POTENTIAL_$1
@@ -375,12 +375,12 @@
     fi
   else
     # No user supplied value. Locate compiler ourselves.
-    
+
     # If we are cross compiling, assume cross compilation tools follows the
     # cross compilation standard where they are prefixed with the autoconf
-    # standard name for the target. For example the binary 
+    # standard name for the target. For example the binary
     # i686-sun-solaris2.10-gcc will cross compile for i686-sun-solaris2.10.
-    # If we are not cross compiling, then the default compiler name will be 
+    # If we are not cross compiling, then the default compiler name will be
     # used.
 
     $1=
@@ -450,9 +450,9 @@
   TOOLCHAIN_CHECK_COMPILER_VERSION([$1], [$COMPILER_NAME])
 ])
 
-# Detect the core components of the toolchain, i.e. the compilers (CC and CXX), 
-# preprocessor (CPP and CXXCPP), the linker (LD), the assembler (AS) and the 
-# archiver (AR). Verify that the compilers are correct according to the 
+# Detect the core components of the toolchain, i.e. the compilers (CC and CXX),
+# preprocessor (CPP and CXXCPP), the linker (LD), the assembler (AS) and the
+# archiver (AR). Verify that the compilers are correct according to the
 # toolchain type.
 AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_CORE],
 [
@@ -529,7 +529,7 @@
 ])
 
 # Setup additional tools that is considered a part of the toolchain, but not the
-# core part. Many of these are highly platform-specific and do not exist, 
+# core part. Many of these are highly platform-specific and do not exist,
 # and/or are not needed on all platforms.
 AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA],
 [
@@ -551,7 +551,7 @@
     AC_CHECK_PROG([DUMPBIN], [dumpbin], [dumpbin],,,)
     BASIC_FIXUP_EXECUTABLE(DUMPBIN)
   fi
-  
+
   if test "x$OPENJDK_TARGET_OS" = xsolaris; then
     BASIC_PATH_PROGS(STRIP, strip)
     BASIC_FIXUP_EXECUTABLE(STRIP)
@@ -559,7 +559,7 @@
     BASIC_FIXUP_EXECUTABLE(NM)
     BASIC_PATH_PROGS(GNM, gnm)
     BASIC_FIXUP_EXECUTABLE(GNM)
-    
+
     BASIC_PATH_PROGS(MCS, mcs)
     BASIC_FIXUP_EXECUTABLE(MCS)
   elif test "x$OPENJDK_TARGET_OS" != xwindows; then
@@ -592,17 +592,17 @@
 
 # Setup the build tools (i.e, the compiler and linker used to build programs
 # that should be run on the build platform, not the target platform, as a build
-# helper). Since the non-cross-compile case uses the normal, target compilers 
+# helper). Since the non-cross-compile case uses the normal, target compilers
 # for this, we can only do this after these have been setup.
 AC_DEFUN_ONCE([TOOLCHAIN_SETUP_BUILD_COMPILERS],
-[  
+[
   if test "x$COMPILE_TYPE" = "xcross"; then
     # Now we need to find a C/C++ compiler that can build executables for the
     # build platform. We can't use the AC_PROG_CC macro, since it can only be
     # used once. Also, we need to do this without adding a tools dir to the
     # path, otherwise we might pick up cross-compilers which don't use standard
     # naming.
-    
+
     # FIXME: we should list the discovered compilers as an exclude pattern!
     # If we do that, we can do this detection before POST_DETECTION, and still
     # find the build compilers in the tools dir, if needed.
@@ -690,15 +690,39 @@
     # If this is a --hash-style=gnu system, use --hash-style=both, why?
     HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'`
     # This is later checked when setting flags.
+
+    # "-Og" suppported for GCC 4.8 and later
+    CFLAG_OPTIMIZE_DEBUG_FLAG="-Og"
+    FLAGS_COMPILER_CHECK_ARGUMENTS([$CFLAG_OPTIMIZE_DEBUG_FLAG],
+      [HAS_CFLAG_OPTIMIZE_DEBUG=true],
+      [HAS_CFLAG_OPTIMIZE_DEBUG=false])
+
+    # "-fsanitize=undefined" supported for GCC 4.9 and later
+    CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG="-fsanitize=undefined -fsanitize-recover"
+    FLAGS_COMPILER_CHECK_ARGUMENTS([$CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG],
+      [HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR=true],
+      [HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR=false])
+
+    # "-z relro" supported in GNU binutils 2.17 and later
+    LINKER_RELRO_FLAG="-Xlinker -z -Xlinker relro"
+    FLAGS_LINKER_CHECK_ARGUMENTS([$LINKER_RELRO_FLAG],
+      [HAS_LINKER_RELRO=true],
+      [HAS_LINKER_RELRO=false])
+
+    # "-z now" supported in GNU binutils 2.11 and later
+    LINKER_NOW_FLAG="-Xlinker -z -Xlinker now"
+    FLAGS_LINKER_CHECK_ARGUMENTS([$LINKER_NOW_FLAG],
+      [HAS_LINKER_NOW=true],
+      [HAS_LINKER_NOW=false])
   fi
 
-  # Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed 
+  # Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed
   # in executable.'
   USING_BROKEN_SUSE_LD=no
   if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$TOOLCHAIN_TYPE" = xgcc; then
     AC_MSG_CHECKING([for broken SuSE 'ld' which only understands anonymous version tags in executables])
-    echo "SUNWprivate_1.1 { local: *; };" > version-script.map
-    echo "int main() { }" > main.c
+    $ECHO "SUNWprivate_1.1 { local: *; };" > version-script.map
+    $ECHO "int main() { }" > main.c
     if $CXX -Xlinker -version-script=version-script.map main.c 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD; then
       AC_MSG_RESULT(no)
       USING_BROKEN_SUSE_LD=no
--- a/corba/.hgtags	Wed Jul 09 16:44:30 2014 +0200
+++ b/corba/.hgtags	Fri Jul 11 05:59:08 2014 -0700
@@ -261,3 +261,5 @@
 422ef9d29d84f571453f015c4cb8713c3af70ee4 jdk9-b16
 4c75c2ca7cf3e0618315879acf17f42c8fcd0c09 jdk9-b17
 77565aaaa2bb814e94817e92d680168052a25395 jdk9-b18
+eecc1b6adc7e193d00a0641eb0963add5a4c06e8 jdk9-b19
+87f36eecb1665012d01c5cf102494e591c943ea6 jdk9-b20
--- a/hotspot/.hgtags	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/.hgtags	Fri Jul 11 05:59:08 2014 -0700
@@ -421,3 +421,5 @@
 b14e7c0b7d3ec04127f565cda1d84122e205680c jdk9-b16
 14b656df31c2cb09c505921061e79977823de71a jdk9-b17
 871fd128548480095e0dc3fc34c422666baeec75 jdk9-b18
+d4cffb3ae6213c66c7522ebffe0349360a45f0ef jdk9-b19
+c1af79d122ec9f715fa29312b5e91763f3a4dfc4 jdk9-b20
--- a/hotspot/make/bsd/makefiles/gcc.make	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/make/bsd/makefiles/gcc.make	Fri Jul 11 05:59:08 2014 -0700
@@ -280,16 +280,7 @@
 
 # optimization control flags (Used by fastdebug and release variants)
 OPT_CFLAGS/NOOPT=-O0
-ifeq ($(USE_CLANG), true)
-  # Clang does not support -Og
-  OPT_CFLAGS/DEBUG=-O0
-else ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
-  # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
-  OPT_CFLAGS/DEBUG=-Og
-else
-  # Allow no optimizations.
- OPT_CFLAGS/DEBUG=-O0
-endif
+OPT_CFLAGS/DEBUG=-O0
 OPT_CFLAGS/SIZE=-Os
 OPT_CFLAGS/SPEED=-O3
 
@@ -457,16 +448,8 @@
   CFLAGS += -flimit-debug-info
 endif
 
-ifeq ($(USE_CLANG), true)
-  # Clang does not support -Og
-  DEBUG_CFLAGS=-O0
-else ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
-  # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
-  DEBUG_CFLAGS=-Og
-else
-  # Allow no optimizations.
-  DEBUG_CFLAGS=-O0
-endif
+# Allow no optimizations.
+DEBUG_CFLAGS=-O0
 
 # DEBUG_BINARIES uses full -g debug information for all configs
 ifeq ($(DEBUG_BINARIES), true)
--- a/hotspot/make/linux/Makefile	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/make/linux/Makefile	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
 # 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,8 +67,12 @@
   endif
 endif
 # C1 is not ported on ppc64, so we cannot build a tiered VM:
-ifeq ($(ARCH),ppc64)
-  FORCE_TIERED=0
+# Notice: after 8046471 ARCH will be 'ppc' for top-level ppc64 builds but
+# 'ppc64' for HotSpot-only ppc64 builds. Need to detect both variants here!
+ifneq (,$(findstring $(ARCH), ppc ppc64))
+  ifeq ($(ARCH_DATA_MODEL), 64)
+    FORCE_TIERED=0
+  endif
 endif
 
 ifdef LP64
--- a/hotspot/make/linux/makefiles/defs.make	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/make/linux/makefiles/defs.make	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -108,7 +108,9 @@
 endif
 
 # PPC
-ifneq (,$(findstring $(ARCH), ppc))
+# Notice: after 8046471 ARCH will be 'ppc' for top-level ppc64 builds but
+# 'ppc64' for HotSpot-only ppc64 builds. Need to detect both variants here!
+ifneq (,$(findstring $(ARCH), ppc ppc64))
   ifeq ($(ARCH_DATA_MODEL), 64)
     MAKE_ARGS        += LP64=1
     PLATFORM         = linux-ppc64
--- a/hotspot/make/linux/makefiles/dtrace.make	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/make/linux/makefiles/dtrace.make	Fri Jul 11 05:59:08 2014 -0700
@@ -40,7 +40,14 @@
 ifneq ($(ALT_SDT_H),)
   SDT_H_FILE = $(ALT_SDT_H)
 else
-  SDT_H_FILE = /usr/include/sys/sdt.h
+  ifeq ($(USE_CLANG), true)
+    # Clang doesn't support the -print-sysroot option and there is no known equivalent
+    # option, so fall back to using / as sysroot
+    SDT_SYSROOT=
+  else
+    SDT_SYSROOT=$(shell $(CXX) -print-sysroot)
+  endif
+  SDT_H_FILE = $(SDT_SYSROOT)/usr/include/sys/sdt.h
 endif
 
 DTRACE_ENABLED = $(shell test -f $(SDT_H_FILE) && echo $(SDT_H_FILE))
--- a/hotspot/make/linux/makefiles/gcc.make	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/make/linux/makefiles/gcc.make	Fri Jul 11 05:59:08 2014 -0700
@@ -231,13 +231,7 @@
 
 # optimization control flags (Used by fastdebug and release variants)
 OPT_CFLAGS/NOOPT=-O0
-ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
-  # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
-  OPT_CFLAGS/DEBUG=-Og
-else
-  # Allow no optimizations.
-  OPT_CFLAGS/DEBUG=-O0
-endif
+OPT_CFLAGS/DEBUG=-O0
 OPT_CFLAGS/SIZE=-Os
 OPT_CFLAGS/SPEED=-O3
 
@@ -344,13 +338,8 @@
   CFLAGS += -flimit-debug-info
 endif
 
-ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
-  # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
-  DEBUG_CFLAGS=-Og
-else
-  # Allow no optimizations.
-  DEBUG_CFLAGS=-O0
-endif
+# Allow no optimizations.
+DEBUG_CFLAGS=-O0
 
 # DEBUG_BINARIES uses full -g debug information for all configs
 ifeq ($(DEBUG_BINARIES), true)
--- a/hotspot/make/solaris/makefiles/gcc.make	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/make/solaris/makefiles/gcc.make	Fri Jul 11 05:59:08 2014 -0700
@@ -127,13 +127,7 @@
 
 # optimization control flags (Used by fastdebug and release variants)
 OPT_CFLAGS/NOOPT=-O0
-ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
-  # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
-  OPT_CFLAGS/DEBUG=-Og
-+else
-  # Allow no optimizations.
-  OPT_CFLAGS/DEBUG=-O0
-endif
+OPT_CFLAGS/DEBUG=-O0
 OPT_CFLAGS/SIZE=-Os
 OPT_CFLAGS/SPEED=-O3
 
@@ -229,14 +223,8 @@
 #------------------------------------------------------------------------
 # Debug flags
 
-ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
-  # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
-  DEBUG_CFLAGS=-Og
-else
-  # Allow no optimizations.
-  DEBUG_CFLAGS=-O0
-endif
-
+# Allow no optimizations.
+DEBUG_CFLAGS=-O0
 
 # Use the stabs format for debugging information (this is the default
 # on gcc-2.91). It's good enough, has all the information about line
--- a/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012, 2014 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -693,7 +693,7 @@
   // PPC 1, section 4.6.7 Floating-Point Compare Instructions
   fcmpu( CCR7, F24, F25);
 
-  tty->print_cr("\ntest_asm disassembly (0x%lx 0x%lx):", code()->insts_begin(), code()->insts_end());
+  tty->print_cr("\ntest_asm disassembly (0x%lx 0x%lx):", p2i(code()->insts_begin()), p2i(code()->insts_end()));
   code()->decode();
 }
 
--- a/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -175,7 +175,7 @@
   if (TraceICs) {
     ResourceMark rm;
     tty->print_cr("CompiledStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s",
-                  instruction_address(),
+                  p2i(instruction_address()),
                   callee->name_and_sig_as_C_string());
   }
 
--- a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012, 2014 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -140,7 +140,7 @@
 void frame::patch_pc(Thread* thread, address pc) {
   if (TracePcPatching) {
     tty->print_cr("patch_pc at address " PTR_FORMAT " [" PTR_FORMAT " -> " PTR_FORMAT "]",
-                  &((address*) _sp)[-1], ((address*) _sp)[-1], pc);
+                  p2i(&((address*) _sp)[-1]), p2i(((address*) _sp)[-1]), p2i(pc));
   }
   own_abi()->lr = (uint64_t)pc;
   _cb = CodeCache::find_blob(pc);
--- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012, 2014 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -3099,7 +3099,7 @@
 };
 
 static void stop_on_request(int tp, const char* msg) {
-  tty->print("PPC assembly code requires stop: (%s) %s\n", (void *)stop_types[tp%/*stop_end*/4], msg);
+  tty->print("PPC assembly code requires stop: (%s) %s\n", stop_types[tp%/*stop_end*/4], msg);
   guarantee(false, err_msg("PPC assembly code requires stop: %s", msg));
 }
 
--- a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012, 2014 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -464,7 +464,7 @@
                  strstr(adaptername, "linkTo") == NULL);    // static linkers don't have MH
   const char* mh_reg_name = has_mh ? "R23_method_handle" : "G23";
   tty->print_cr("MH %s %s="INTPTR_FORMAT " sp=" INTPTR_FORMAT,
-                adaptername, mh_reg_name, (intptr_t) mh, entry_sp);
+                adaptername, mh_reg_name, (intptr_t) mh, (intptr_t) entry_sp);
 
   if (Verbose) {
     tty->print_cr("Registers:");
--- a/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2012, 2013 SAP AG. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012, 2014 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -147,9 +147,9 @@
   address addr = addr_at(0);
 
   if (!NativeCall::is_call_at(addr)) {
-    tty->print_cr("not a NativeCall at " PTR_FORMAT, addr);
+    tty->print_cr("not a NativeCall at " PTR_FORMAT, p2i(addr));
     // TODO: PPC port: Disassembler::decode(addr - 20, addr + 20, tty);
-    fatal(err_msg("not a NativeCall at " PTR_FORMAT, addr));
+    fatal(err_msg("not a NativeCall at " PTR_FORMAT, p2i(addr)));
   }
 }
 #endif // ASSERT
@@ -160,9 +160,9 @@
 
   NativeInstruction::verify();
   if (!NativeFarCall::is_far_call_at(addr)) {
-    tty->print_cr("not a NativeFarCall at " PTR_FORMAT, addr);
+    tty->print_cr("not a NativeFarCall at " PTR_FORMAT, p2i(addr));
     // TODO: PPC port: Disassembler::decode(addr, 20, 20, tty);
-    fatal(err_msg("not a NativeFarCall at " PTR_FORMAT, addr));
+    fatal(err_msg("not a NativeFarCall at " PTR_FORMAT, p2i(addr)));
   }
 }
 #endif // ASSERT
@@ -306,9 +306,9 @@
     if (! (cb != NULL && MacroAssembler::is_calculate_address_from_global_toc_at(addr, cb->content_begin())) &&
         ! (cb != NULL && MacroAssembler::is_set_narrow_oop(addr, cb->content_begin())) &&
         ! MacroAssembler::is_bl(*((int*) addr))) {
-      tty->print_cr("not a NativeMovConstReg at " PTR_FORMAT, addr);
+      tty->print_cr("not a NativeMovConstReg at " PTR_FORMAT, p2i(addr));
       // TODO: PPC port: Disassembler::decode(addr, 20, 20, tty);
-      fatal(err_msg("not a NativeMovConstReg at " PTR_FORMAT, addr));
+      fatal(err_msg("not a NativeMovConstReg at " PTR_FORMAT, p2i(addr)));
     }
   }
 }
@@ -344,9 +344,9 @@
 
   NativeInstruction::verify();
   if (!NativeJump::is_jump_at(addr)) {
-    tty->print_cr("not a NativeJump at " PTR_FORMAT, addr);
+    tty->print_cr("not a NativeJump at " PTR_FORMAT, p2i(addr));
     // TODO: PPC port: Disassembler::decode(addr, 20, 20, tty);
-    fatal(err_msg("not a NativeJump at " PTR_FORMAT, addr));
+    fatal(err_msg("not a NativeJump at " PTR_FORMAT, p2i(addr)));
   }
 }
 #endif // ASSERT
--- a/hotspot/src/cpu/ppc/vm/ppc.ad	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/cpu/ppc/vm/ppc.ad	Fri Jul 11 05:59:08 2014 -0700
@@ -1329,7 +1329,7 @@
 
   if (!false /* TODO: PPC port C->is_frameless_method()*/) {
     st->print("save return pc\n\t");
-    st->print("push frame %d\n\t", -framesize);
+    st->print("push frame %ld\n\t", -framesize);
   }
 }
 #endif
--- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -32,12 +32,6 @@
 #include "runtime/stubCodeGenerator.hpp"
 #include "utilities/defaultStream.hpp"
 #include "vm_version_ppc.hpp"
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
 
 # include <sys/sysinfo.h>
 
@@ -352,7 +346,7 @@
 
   if (PrintAssembly) {
     ttyLocker ttyl;
-    tty->print_cr("Decoding section size detection stub at " INTPTR_FORMAT " before execution:", code);
+    tty->print_cr("Decoding section size detection stub at " INTPTR_FORMAT " before execution:", p2i(code));
     Disassembler::decode((u_char*)code, (u_char*)code_end, tty);
     tty->print_cr("Time loop1 :%f", loop1_seconds);
     tty->print_cr("Time loop2 :%f", loop2_seconds);
@@ -435,7 +429,7 @@
   // Print the detection code.
   if (PrintAssembly) {
     ttyLocker ttyl;
-    tty->print_cr("Decoding cpu-feature detection stub at " INTPTR_FORMAT " before execution:", code);
+    tty->print_cr("Decoding cpu-feature detection stub at " INTPTR_FORMAT " before execution:", p2i(code));
     Disassembler::decode((u_char*)code, (u_char*)code_end, tty);
   }
 
@@ -468,7 +462,7 @@
   // Print the detection code.
   if (PrintAssembly) {
     ttyLocker ttyl;
-    tty->print_cr("Decoding cpu-feature detection stub at " INTPTR_FORMAT " after execution:", code);
+    tty->print_cr("Decoding cpu-feature detection stub at " INTPTR_FORMAT " after execution:", p2i(code));
     Disassembler::decode((u_char*)code, (u_char*)code_end, tty);
   }
 
--- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,7 @@
 #include "runtime/biasedLocking.hpp"
 #include "runtime/interfaceSupport.hpp"
 #include "runtime/objectMonitor.hpp"
-#include "runtime/os.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/stubRoutines.hpp"
 #include "utilities/macros.hpp"
--- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -28,12 +28,6 @@
 #include "runtime/java.hpp"
 #include "runtime/stubCodeGenerator.hpp"
 #include "vm_version_sparc.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
 
 int VM_Version::_features = VM_Version::unknown_m;
 const char* VM_Version::_features_str = "";
--- a/hotspot/src/cpu/x86/vm/frame_x86.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -33,7 +33,7 @@
 #include "runtime/handles.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/monitorChunk.hpp"
-#include "runtime/os.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/signature.hpp"
 #include "runtime/stubCodeGenerator.hpp"
 #include "runtime/stubRoutines.hpp"
--- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -29,18 +29,6 @@
 #include "runtime/java.hpp"
 #include "runtime/stubCodeGenerator.hpp"
 #include "vm_version_x86.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 
 int VM_Version::_cpu;
--- a/hotspot/src/cpu/zero/vm/vm_version_zero.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/cpu/zero/vm/vm_version_zero.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -29,11 +29,5 @@
 #include "runtime/java.hpp"
 #include "runtime/stubCodeGenerator.hpp"
 #include "vm_version_zero.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 // This file is intentionally empty
--- a/hotspot/src/os/aix/vm/attachListener_aix.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/os/aix/vm/attachListener_aix.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012, 2013 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -25,7 +25,7 @@
 
 #include "precompiled.hpp"
 #include "runtime/interfaceSupport.hpp"
-#include "runtime/os.hpp"
+#include "runtime/os.inline.hpp"
 #include "services/attachListener.hpp"
 #include "services/dtraceAttacher.hpp"
 
--- a/hotspot/src/os/aix/vm/os_aix.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/os/aix/vm/os_aix.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -42,6 +42,7 @@
 #include "memory/filemap.hpp"
 #include "mutex_aix.inline.hpp"
 #include "oops/oop.inline.hpp"
+#include "os_aix.inline.hpp"
 #include "os_share_aix.hpp"
 #include "porting_aix.hpp"
 #include "prims/jniFastGetField.hpp"
@@ -2807,12 +2808,10 @@
   return DontYieldALot;
 }
 
-void os::yield() {
+void os::naked_yield() {
   sched_yield();
 }
 
-os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN; }
-
 ////////////////////////////////////////////////////////////////////////////////
 // thread priority support
 
@@ -3069,7 +3068,7 @@
 
   for (int n = 0; !osthread->sr.is_suspended(); n++) {
     for (int i = 0; i < RANDOMLY_LARGE_INTEGER2 && !osthread->sr.is_suspended(); i++) {
-      os::yield();
+      os::naked_yield();
     }
 
     // timeout, try to cancel the request
@@ -3103,7 +3102,7 @@
     if (sr_notify(osthread) == 0) {
       for (int n = 0; n < RANDOMLY_LARGE_INTEGER && !osthread->sr.is_running(); n++) {
         for (int i = 0; i < 100 && !osthread->sr.is_running(); i++) {
-          os::yield();
+          os::naked_yield();
         }
       }
     } else {
--- a/hotspot/src/os/aix/vm/os_aix.inline.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/os/aix/vm/os_aix.inline.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012, 2013 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -26,8 +26,6 @@
 #ifndef OS_AIX_VM_OS_AIX_INLINE_HPP
 #define OS_AIX_VM_OS_AIX_INLINE_HPP
 
-#include "runtime/atomic.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
 #include "runtime/os.hpp"
 
 // System includes
@@ -45,18 +43,6 @@
   return pthread_getspecific((pthread_key_t)index);
 }
 
-inline const char* os::file_separator() {
-  return "/";
-}
-
-inline const char* os::line_separator() {
-  return "\n";
-}
-
-inline const char* os::path_separator() {
-  return ":";
-}
-
 // File names are case-sensitive on windows only
 inline int os::file_name_strcmp(const char* s1, const char* s2) {
   return strcmp(s1, s2);
--- a/hotspot/src/os/bsd/vm/attachListener_bsd.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/os/bsd/vm/attachListener_bsd.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * 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,7 +24,7 @@
 
 #include "precompiled.hpp"
 #include "runtime/interfaceSupport.hpp"
-#include "runtime/os.hpp"
+#include "runtime/os.inline.hpp"
 #include "services/attachListener.hpp"
 #include "services/dtraceAttacher.hpp"
 
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -36,6 +36,7 @@
 #include "memory/filemap.hpp"
 #include "mutex_bsd.inline.hpp"
 #include "oops/oop.inline.hpp"
+#include "os_bsd.inline.hpp"
 #include "os_share_bsd.hpp"
 #include "prims/jniFastGetField.hpp"
 #include "prims/jvm.h"
@@ -2595,12 +2596,10 @@
   return DontYieldALot;
 }
 
-void os::yield() {
+void os::naked_yield() {
   sched_yield();
 }
 
-os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN; }
-
 ////////////////////////////////////////////////////////////////////////////////
 // thread priority support
 
@@ -4217,22 +4216,12 @@
   return abstime;
 }
 
-
-// Test-and-clear _Event, always leaves _Event set to 0, returns immediately.
-// Conceptually TryPark() should be equivalent to park(0).
-
-int os::PlatformEvent::TryPark() {
-  for (;;) {
-    const int v = _Event;
-    guarantee((v == 0) || (v == 1), "invariant");
-    if (Atomic::cmpxchg(0, &_Event, v) == v) return v;
-  }
-}
-
 void os::PlatformEvent::park() {       // AKA "down()"
   // Invariant: Only the thread associated with the Event/PlatformEvent
   // may call park().
   // TODO: assert that _Assoc != NULL or _Assoc == Self
+  assert(_nParked == 0, "invariant");
+
   int v;
   for (;;) {
       v = _Event;
@@ -4332,8 +4321,7 @@
   //    1 :=> 1
   //   -1 :=> either 0 or 1; must signal target thread
   //          That is, we can safely transition _Event from -1 to either
-  //          0 or 1. Forcing 1 is slightly more efficient for back-to-back
-  //          unpark() calls.
+  //          0 or 1.
   // See also: "Semaphores in Plan 9" by Mullender & Cox
   //
   // Note: Forcing a transition from "-1" to "1" on an unpark() means
@@ -4540,10 +4528,9 @@
 }
 
 void Parker::unpark() {
-  int s, status;
-  status = pthread_mutex_lock(_mutex);
+  int status = pthread_mutex_lock(_mutex);
   assert(status == 0, "invariant");
-  s = _counter;
+  const int s = _counter;
   _counter = 1;
   if (s < 1) {
      if (WorkAroundNPTLTimedWaitHang) {
--- a/hotspot/src/os/bsd/vm/os_bsd.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/os/bsd/vm/os_bsd.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -219,7 +219,6 @@
     int  fired() { return _Event; }
     void park();
     void unpark();
-    int  TryPark();
     int  park(jlong millis);
     void SetAssociation(Thread * a) { _Assoc = a; }
 };
--- a/hotspot/src/os/bsd/vm/os_bsd.inline.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/os/bsd/vm/os_bsd.inline.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -25,8 +25,6 @@
 #ifndef OS_BSD_VM_OS_BSD_INLINE_HPP
 #define OS_BSD_VM_OS_BSD_INLINE_HPP
 
-#include "runtime/atomic.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
 #include "runtime/os.hpp"
 
 // System includes
@@ -40,18 +38,6 @@
   return pthread_getspecific((pthread_key_t)index);
 }
 
-inline const char* os::file_separator() {
-  return "/";
-}
-
-inline const char* os::line_separator() {
-  return "\n";
-}
-
-inline const char* os::path_separator() {
-  return ":";
-}
-
 // File names are case-sensitive on windows only
 inline int os::file_name_strcmp(const char* s1, const char* s2) {
   return strcmp(s1, s2);
--- a/hotspot/src/os/linux/vm/attachListener_linux.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/os/linux/vm/attachListener_linux.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * 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,7 +24,7 @@
 
 #include "precompiled.hpp"
 #include "runtime/interfaceSupport.hpp"
-#include "runtime/os.hpp"
+#include "runtime/os.inline.hpp"
 #include "services/attachListener.hpp"
 #include "services/dtraceAttacher.hpp"
 
--- a/hotspot/src/os/linux/vm/os_linux.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/os/linux/vm/os_linux.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -36,6 +36,7 @@
 #include "memory/filemap.hpp"
 #include "mutex_linux.inline.hpp"
 #include "oops/oop.inline.hpp"
+#include "os_linux.inline.hpp"
 #include "os_share_linux.hpp"
 #include "prims/jniFastGetField.hpp"
 #include "prims/jvm.h"
@@ -3790,12 +3791,10 @@
   return DontYieldALot;
 }
 
-void os::yield() {
+void os::naked_yield() {
   sched_yield();
 }
 
-os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN; }
-
 ////////////////////////////////////////////////////////////////////////////////
 // thread priority support
 
@@ -5456,22 +5455,12 @@
   return abstime;
 }
 
-
-// Test-and-clear _Event, always leaves _Event set to 0, returns immediately.
-// Conceptually TryPark() should be equivalent to park(0).
-
-int os::PlatformEvent::TryPark() {
-  for (;;) {
-    const int v = _Event;
-    guarantee((v == 0) || (v == 1), "invariant");
-    if (Atomic::cmpxchg(0, &_Event, v) == v) return v;
-  }
-}
-
 void os::PlatformEvent::park() {       // AKA "down()"
   // Invariant: Only the thread associated with the Event/PlatformEvent
   // may call park().
   // TODO: assert that _Assoc != NULL or _Assoc == Self
+  assert(_nParked == 0, "invariant");
+
   int v;
   for (;;) {
       v = _Event;
@@ -5571,8 +5560,7 @@
   //    1 :=> 1
   //   -1 :=> either 0 or 1; must signal target thread
   //          That is, we can safely transition _Event from -1 to either
-  //          0 or 1. Forcing 1 is slightly more efficient for back-to-back
-  //          unpark() calls.
+  //          0 or 1.
   // See also: "Semaphores in Plan 9" by Mullender & Cox
   //
   // Note: Forcing a transition from "-1" to "1" on an unpark() means
@@ -5800,10 +5788,9 @@
 }
 
 void Parker::unpark() {
-  int s, status;
-  status = pthread_mutex_lock(_mutex);
+  int status = pthread_mutex_lock(_mutex);
   assert(status == 0, "invariant");
-  s = _counter;
+  const int s = _counter;
   _counter = 1;
   if (s < 1) {
     // thread might be parked
--- a/hotspot/src/os/linux/vm/os_linux.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/os/linux/vm/os_linux.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -315,7 +315,6 @@
     int  fired() { return _Event; }
     void park();
     void unpark();
-    int  TryPark();
     int  park(jlong millis); // relative timed-wait only
     void SetAssociation(Thread * a) { _Assoc = a; }
 };
--- a/hotspot/src/os/linux/vm/os_linux.inline.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/os/linux/vm/os_linux.inline.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -25,8 +25,6 @@
 #ifndef OS_LINUX_VM_OS_LINUX_INLINE_HPP
 #define OS_LINUX_VM_OS_LINUX_INLINE_HPP
 
-#include "runtime/atomic.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
 #include "runtime/os.hpp"
 
 // System includes
@@ -40,18 +38,6 @@
   return pthread_getspecific((pthread_key_t)index);
 }
 
-inline const char* os::file_separator() {
-  return "/";
-}
-
-inline const char* os::line_separator() {
-  return "\n";
-}
-
-inline const char* os::path_separator() {
-  return ":";
-}
-
 // File names are case-sensitive on windows only
 inline int os::file_name_strcmp(const char* s1, const char* s2) {
   return strcmp(s1, s2);
--- a/hotspot/src/os/posix/vm/os_posix.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/os/posix/vm/os_posix.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,8 +22,16 @@
  *
  */
 
+#include "runtime/os.hpp"
+
 #ifndef OS_POSIX_VM_OS_POSIX_HPP
 #define OS_POSIX_VM_OS_POSIX_HPP
+
+// File conventions
+static const char* file_separator() { return "/"; }
+static const char* line_separator() { return "\n"; }
+static const char* path_separator() { return ":"; }
+
 class Posix {
   friend class os;
 
--- a/hotspot/src/os/solaris/vm/attachListener_solaris.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/os/solaris/vm/attachListener_solaris.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * 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,7 +24,7 @@
 
 #include "precompiled.hpp"
 #include "runtime/interfaceSupport.hpp"
-#include "runtime/os.hpp"
+#include "runtime/os.inline.hpp"
 #include "services/attachListener.hpp"
 #include "services/dtraceAttacher.hpp"
 
--- a/hotspot/src/os/solaris/vm/os_solaris.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/os/solaris/vm/os_solaris.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -37,6 +37,7 @@
 #include "mutex_solaris.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "os_share_solaris.hpp"
+#include "os_solaris.inline.hpp"
 #include "prims/jniFastGetField.hpp"
 #include "prims/jvm.h"
 #include "prims/jvm_misc.hpp"
@@ -3172,20 +3173,14 @@
   }
 }
 
-// Caveat: Solaris os::yield() causes a thread-state transition whereas
-// the linux and win32 implementations do not.  This should be checked.
-
-void os::yield() {
-  // Yields to all threads with same or greater priority
-  os::sleep(Thread::current(), 0, false);
-}
-
 // Note that yield semantics are defined by the scheduling class to which
 // the thread currently belongs.  Typically, yield will _not yield to
 // other equal or higher priority threads that reside on the dispatch queues
 // of other CPUs.
 
-os::YieldResult os::NakedYield() { thr_yield(); return os::YIELD_UNKNOWN; }
+void os::naked_yield() {
+  thr_yield();
+}
 
 // Interface for setting lwp priorities.  If we are using T2 libthread,
 // which forces the use of BoundThreads or we manually set UseBoundThreads,
@@ -5439,20 +5434,11 @@
   return abstime;
 }
 
-// Test-and-clear _Event, always leaves _Event set to 0, returns immediately.
-// Conceptually TryPark() should be equivalent to park(0).
-
-int os::PlatformEvent::TryPark() {
-  for (;;) {
-    const int v = _Event;
-    guarantee((v == 0) || (v == 1), "invariant");
-    if (Atomic::cmpxchg(0, &_Event, v) == v) return v;
-  }
-}
-
 void os::PlatformEvent::park() {           // AKA: down()
   // Invariant: Only the thread associated with the Event/PlatformEvent
   // may call park().
+  assert(_nParked == 0, "invariant");
+
   int v;
   for (;;) {
       v = _Event;
@@ -5539,8 +5525,7 @@
   //    1 :=> 1
   //   -1 :=> either 0 or 1; must signal target thread
   //          That is, we can safely transition _Event from -1 to either
-  //          0 or 1. Forcing 1 is slightly more efficient for back-to-back
-  //          unpark() calls.
+  //          0 or 1.
   // See also: "Semaphores in Plan 9" by Mullender & Cox
   //
   // Note: Forcing a transition from "-1" to "1" on an unpark() means
@@ -5744,10 +5729,9 @@
 }
 
 void Parker::unpark() {
-  int s, status;
-  status = os::Solaris::mutex_lock(_mutex);
+  int status = os::Solaris::mutex_lock(_mutex);
   assert(status == 0, "invariant");
-  s = _counter;
+  const int s = _counter;
   _counter = 1;
   status = os::Solaris::mutex_unlock(_mutex);
   assert(status == 0, "invariant");
--- a/hotspot/src/os/solaris/vm/os_solaris.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/os/solaris/vm/os_solaris.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -332,7 +332,6 @@
     int  fired() { return _Event; }
     void park();
     int  park(jlong millis);
-    int  TryPark();
     void unpark();
 };
 
--- a/hotspot/src/os/solaris/vm/os_solaris.inline.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/os/solaris/vm/os_solaris.inline.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -25,8 +25,6 @@
 #ifndef OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP
 #define OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP
 
-#include "runtime/atomic.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
 #include "runtime/os.hpp"
 
 // System includes
@@ -39,10 +37,6 @@
 #include <netdb.h>
 #include <setjmp.h>
 
-inline const char* os::file_separator() { return "/"; }
-inline const char* os::line_separator() { return "\n"; }
-inline const char* os::path_separator() { return ":"; }
-
 // File names are case-sensitive on windows only
 inline int os::file_name_strcmp(const char* s1, const char* s2) {
   return strcmp(s1, s2);
--- a/hotspot/src/os/windows/vm/decoder_windows.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/os/windows/vm/decoder_windows.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * 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,6 +25,7 @@
 #include "precompiled.hpp"
 #include "prims/jvm.h"
 #include "runtime/arguments.hpp"
+#include "runtime/os.hpp"
 #include "decoder_windows.hpp"
 
 WindowsDecoder::WindowsDecoder() {
--- a/hotspot/src/os/windows/vm/os_windows.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/os/windows/vm/os_windows.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -40,6 +40,7 @@
 #include "mutex_windows.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "os_share_windows.hpp"
+#include "os_windows.inline.hpp"
 #include "prims/jniFastGetField.hpp"
 #include "prims/jvm.h"
 #include "prims/jvm_misc.hpp"
@@ -3514,18 +3515,15 @@
 
 typedef BOOL (WINAPI * STTSignature)(void);
 
-os::YieldResult os::NakedYield() {
+void os::naked_yield() {
   // Use either SwitchToThread() or Sleep(0)
   // Consider passing back the return value from SwitchToThread().
   if (os::Kernel32Dll::SwitchToThreadAvailable()) {
-    return SwitchToThread() ? os::YIELD_SWITCHED : os::YIELD_NONEREADY;
+    SwitchToThread();
   } else {
     Sleep(0);
   }
-  return os::YIELD_UNKNOWN;
-}
-
-void os::yield() {  os::NakedYield(); }
+}
 
 // Win32 only gives you access to seven real priorities at a time,
 // so we compress Java's ten down to seven.  It would be better
@@ -4875,8 +4873,7 @@
   //    1 :=> 1
   //   -1 :=> either 0 or 1; must signal target thread
   //          That is, we can safely transition _Event from -1 to either
-  //          0 or 1. Forcing 1 is slightly more efficient for back-to-back
-  //          unpark() calls.
+  //          0 or 1.
   // See also: "Semaphores in Plan 9" by Mullender & Cox
   //
   // Note: Forcing a transition from "-1" to "1" on an unpark() means
--- a/hotspot/src/os/windows/vm/os_windows.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/os/windows/vm/os_windows.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -29,6 +29,11 @@
 // Information about the protection of the page at address '0' on this os.
 static bool zero_page_read_protected() { return true; }
 
+// File conventions
+static const char* file_separator() { return "\\"; }
+static const char* line_separator() { return "\r\n"; }
+static const char* path_separator() { return ";"; }
+
 class win32 {
   friend class os;
 
--- a/hotspot/src/os/windows/vm/os_windows.inline.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/os/windows/vm/os_windows.inline.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -25,13 +25,8 @@
 #ifndef OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP
 #define OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP
 
-#include "runtime/atomic.inline.hpp"
-#include "runtime/orderAccess.inline.hpp"
 #include "runtime/os.hpp"
 
-inline const char* os::file_separator()                { return "\\"; }
-inline const char* os::line_separator()                { return "\r\n"; }
-inline const char* os::path_separator()                { return ";"; }
 inline const char* os::dll_file_extension()            { return ".dll"; }
 
 inline const int os::default_file_open_flags() { return O_BINARY | O_NOINHERIT;}
--- a/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2012, 2013 SAP AG. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012, 2014 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -307,7 +307,7 @@
                // doesn't work for us. We use:
                ((NativeInstruction*)pc)->is_safepoint_poll()) {
         if (TraceTraps) {
-          tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", pc);
+          tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", p2i(pc));
         }
         stub = SharedRuntime::get_poll_stub(pc);
       }
@@ -316,7 +316,7 @@
       else if (sig == SIGTRAP && TrapBasedICMissChecks &&
                nativeInstruction_at(pc)->is_sigtrap_ic_miss_check()) {
         if (TraceTraps) {
-          tty->print_cr("trap: ic_miss_check at " INTPTR_FORMAT " (SIGTRAP)", pc);
+          tty->print_cr("trap: ic_miss_check at " INTPTR_FORMAT " (SIGTRAP)", p2i(pc));
         }
         stub = SharedRuntime::get_ic_miss_stub();
       }
@@ -325,7 +325,7 @@
       else if (sig == SIGTRAP && TrapBasedNullChecks &&
                nativeInstruction_at(pc)->is_sigtrap_null_check()) {
         if (TraceTraps) {
-          tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGTRAP)", pc);
+          tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGTRAP)", p2i(pc));
         }
         stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
       }
@@ -335,7 +335,7 @@
                CodeCache::contains((void*) pc) &&
                !MacroAssembler::needs_explicit_null_check((intptr_t) info->si_addr)) {
         if (TraceTraps) {
-          tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGSEGV)", pc);
+          tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGSEGV)", p2i(pc));
         }
         stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
       }
@@ -345,7 +345,7 @@
       else if (sig == SIGTRAP && TrapBasedRangeChecks &&
                nativeInstruction_at(pc)->is_sigtrap_range_check()) {
         if (TraceTraps) {
-          tty->print_cr("trap: range_check at " INTPTR_FORMAT " (SIGTRAP)", pc);
+          tty->print_cr("trap: range_check at " INTPTR_FORMAT " (SIGTRAP)", p2i(pc));
         }
         stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
       }
@@ -572,7 +572,7 @@
   st->cr();
 
   intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc);
-  st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", sp);
+  st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", p2i(sp));
   print_hex_dump(st, (address)sp, (address)(sp + 128), sizeof(intptr_t));
   st->cr();
 
@@ -580,7 +580,7 @@
   // point to garbage if entry point in an nmethod is corrupted. Leave
   // this at the end, and hope for the best.
   address pc = os::Linux::ucontext_get_pc(uc);
-  st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc);
+  st->print_cr("Instructions: (pc=" PTR_FORMAT ")", p2i(pc));
   print_hex_dump(st, pc - 64, pc + 64, /*instrsize=*/4);
   st->cr();
 }
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1997,7 +1997,13 @@
   if (!UseInlineCaches && is_loaded && code == Bytecodes::_invokevirtual
       && !target->can_be_statically_bound()) {
     // Find a vtable index if one is available
-    vtable_index = target->resolve_vtable_index(calling_klass, callee_holder);
+    // For arrays, callee_holder is Object. Resolving the call with
+    // Object would allow an illegal call to finalize() on an
+    // array. We use holder instead: illegal calls to finalize() won't
+    // be compiled as vtable calls (IC call resolution will catch the
+    // illegal call) and the few legal calls on array types won't be
+    // either.
+    vtable_index = target->resolve_vtable_index(calling_klass, holder);
   }
 #endif
 
--- a/hotspot/src/share/vm/ci/ciConstantPoolCache.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/ci/ciConstantPoolCache.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -38,7 +38,7 @@
                                  int expected_size) {
   _elements =
     new (arena) GrowableArray<void*>(arena, expected_size, 0, 0);
-  _keys = new (arena) GrowableArray<intptr_t>(arena, expected_size, 0, 0);
+  _keys = new (arena) GrowableArray<int>(arena, expected_size, 0, 0);
 }
 
 // ------------------------------------------------------------------
--- a/hotspot/src/share/vm/ci/ciConstantPoolCache.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/ci/ciConstantPoolCache.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -35,7 +35,7 @@
 // Usage note: this klass has nothing to do with ConstantPoolCache*.
 class ciConstantPoolCache : public ResourceObj {
 private:
-  GrowableArray<intptr_t>*   _keys;
+  GrowableArray<int>*   _keys;
   GrowableArray<void*>* _elements;
 
   int find(int index);
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -4590,8 +4590,9 @@
             Exceptions::fthrow(
               THREAD_AND_LOCATION,
               vmSymbols::java_lang_VerifyError(),
-              "class %s overrides final method %s.%s",
+              "class %s overrides final method %s.%s%s",
               this_klass->external_name(),
+              super_m->method_holder()->external_name(),
               name->as_C_string(),
               signature->as_C_string()
             );
--- a/hotspot/src/share/vm/classfile/classLoader.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/classfile/classLoader.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -52,6 +52,7 @@
 #include "runtime/interfaceSupport.hpp"
 #include "runtime/java.hpp"
 #include "runtime/javaCalls.hpp"
+#include "runtime/os.hpp"
 #include "runtime/threadCritical.hpp"
 #include "runtime/timer.hpp"
 #include "services/management.hpp"
@@ -59,22 +60,6 @@
 #include "utilities/events.hpp"
 #include "utilities/hashtable.hpp"
 #include "utilities/hashtable.inline.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
-
 
 // Entry points in zip.dll for loading zip/jar file entries
 
--- a/hotspot/src/share/vm/classfile/classLoaderData.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -579,6 +579,7 @@
 // GC root of class loader data created.
 ClassLoaderData* ClassLoaderDataGraph::_head = NULL;
 ClassLoaderData* ClassLoaderDataGraph::_unloading = NULL;
+ClassLoaderData* ClassLoaderDataGraph::_saved_unloading = NULL;
 ClassLoaderData* ClassLoaderDataGraph::_saved_head = NULL;
 
 bool ClassLoaderDataGraph::_should_purge = false;
@@ -707,7 +708,9 @@
 
 void ClassLoaderDataGraph::classes_unloading_do(void f(Klass* const)) {
   assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!");
-  for (ClassLoaderData* cld = _unloading; cld != NULL; cld = cld->next()) {
+  // Only walk the head until any clds not purged from prior unloading
+  // (CMS doesn't purge right away).
+  for (ClassLoaderData* cld = _unloading; cld != _saved_unloading; cld = cld->next()) {
     cld->classes_do(f);
   }
 }
@@ -765,6 +768,11 @@
   ClassLoaderData* data = _head;
   ClassLoaderData* prev = NULL;
   bool seen_dead_loader = false;
+
+  // Save previous _unloading pointer for CMS which may add to unloading list before
+  // purging and we don't want to rewalk the previously unloaded class loader data.
+  _saved_unloading = _unloading;
+
   // mark metadata seen on the stack and code cache so we can delete
   // unneeded entries.
   bool has_redefined_a_class = JvmtiExport::has_redefined_a_class();
--- a/hotspot/src/share/vm/classfile/classLoaderData.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/classfile/classLoaderData.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -66,6 +66,7 @@
   static ClassLoaderData* _unloading;
   // CMS support.
   static ClassLoaderData* _saved_head;
+  static ClassLoaderData* _saved_unloading;
   static bool _should_purge;
 
   static ClassLoaderData* add(Handle class_loader, bool anonymous, TRAPS);
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -618,6 +618,8 @@
       assert(comp_mirror.not_null(), "must have a mirror");
 
       // Two-way link between the array klass and its component mirror:
+      // (array_klass) k -> mirror -> component_mirror -> array_klass -> k
+      set_component_mirror(mirror(), comp_mirror());
       ArrayKlass::cast(k())->set_component_mirror(comp_mirror());
       set_array_klass(comp_mirror(), k());
     } else {
@@ -679,6 +681,16 @@
   java_class->obj_field_put(_protection_domain_offset, pd);
 }
 
+void java_lang_Class::set_component_mirror(oop java_class, oop comp_mirror) {
+  if (_component_mirror_offset != 0) {
+    java_class->obj_field_put(_component_mirror_offset, comp_mirror);
+  }
+}
+oop java_lang_Class::component_mirror(oop java_class) {
+  assert(_component_mirror_offset != 0, "must be set");
+  return java_class->obj_field(_component_mirror_offset);
+}
+
 oop java_lang_Class::init_lock(oop java_class) {
   assert(_init_lock_offset != 0, "must be set");
   return java_class->obj_field(_init_lock_offset);
@@ -875,6 +887,10 @@
                  klass_oop, vmSymbols::classLoader_name(),
                  vmSymbols::classloader_signature());
 
+  compute_optional_offset(_component_mirror_offset,
+                 klass_oop, vmSymbols::componentType_name(),
+                 vmSymbols::class_signature());
+
   CLASS_INJECTED_FIELDS(INJECTED_FIELD_COMPUTE_OFFSET);
 }
 
@@ -3097,6 +3113,7 @@
 int java_lang_Class::_static_oop_field_count_offset;
 int java_lang_Class::_class_loader_offset;
 int java_lang_Class::_protection_domain_offset;
+int java_lang_Class::_component_mirror_offset;
 int java_lang_Class::_init_lock_offset;
 int java_lang_Class::_signers_offset;
 GrowableArray<Klass*>* java_lang_Class::_fixup_mirror_list = NULL;
--- a/hotspot/src/share/vm/classfile/javaClasses.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/classfile/javaClasses.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -241,6 +241,7 @@
   static int _init_lock_offset;
   static int _signers_offset;
   static int _class_loader_offset;
+  static int _component_mirror_offset;
 
   static bool offsets_computed;
   static int classRedefinedCount_offset;
@@ -250,6 +251,7 @@
   static void set_init_lock(oop java_class, oop init_lock);
   static void set_protection_domain(oop java_class, oop protection_domain);
   static void set_class_loader(oop java_class, oop class_loader);
+  static void set_component_mirror(oop java_class, oop comp_mirror);
   static void initialize_mirror_fields(KlassHandle k, Handle mirror, Handle protection_domain, TRAPS);
  public:
   static void compute_offsets();
@@ -291,6 +293,7 @@
   // Support for embedded per-class oops
   static oop  protection_domain(oop java_class);
   static oop  init_lock(oop java_class);
+  static oop  component_mirror(oop java_class);
   static objArrayOop  signers(oop java_class);
   static void set_signers(oop java_class, objArrayOop signers);
 
--- a/hotspot/src/share/vm/classfile/vmSymbols.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -573,6 +573,7 @@
   template(serializeAgentPropertiesToByteArray_name,   "serializeAgentPropertiesToByteArray")                     \
   template(classRedefinedCount_name,                   "classRedefinedCount")                                     \
   template(classLoader_name,                           "classLoader")                                             \
+  template(componentType_name,                         "componentType")                                           \
                                                                                                                   \
   /* trace signatures */                                                                                          \
   TRACE_TEMPLATES(template)                                                                                       \
--- a/hotspot/src/share/vm/code/stubs.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/code/stubs.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * 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,21 +27,6 @@
 
 #include "asm/codeBuffer.hpp"
 #include "memory/allocation.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 // The classes in this file provide a simple framework for the
 // management of little pieces of machine code - or stubs -
--- a/hotspot/src/share/vm/code/vtableStubs.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/code/vtableStubs.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "code/vtableStubs.hpp"
+#include "compiler/compileBroker.hpp"
 #include "compiler/disassembler.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
@@ -62,6 +63,7 @@
    // If changing the name, update the other file accordingly.
     BufferBlob* blob = BufferBlob::create("vtable chunks", bytes);
     if (blob == NULL) {
+      CompileBroker::handle_full_code_cache();
       return NULL;
     }
     _chunk = blob->content_begin();
--- a/hotspot/src/share/vm/compiler/compileBroker.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/compiler/compileBroker.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1048,7 +1048,7 @@
   }
 
   // Let go of Threads_lock before yielding
-  os::yield(); // make sure that the compiler thread is started early (especially helpful on SOLARIS)
+  os::naked_yield(); // make sure that the compiler thread is started early (especially helpful on SOLARIS)
 
   return compiler_thread;
 }
--- a/hotspot/src/share/vm/compiler/disassembler.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/compiler/disassembler.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -30,6 +30,7 @@
 #include "memory/cardTableModRefBS.hpp"
 #include "runtime/fprofiler.hpp"
 #include "runtime/handles.inline.hpp"
+#include "runtime/os.hpp"
 #include "runtime/stubCodeGenerator.hpp"
 #include "runtime/stubRoutines.hpp"
 #ifdef TARGET_ARCH_x86
--- a/hotspot/src/share/vm/compiler/disassembler.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/compiler/disassembler.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
  * 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,21 +27,6 @@
 
 #include "asm/codeBuffer.hpp"
 #include "runtime/globals.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 class decode_env;
 
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -29,6 +29,7 @@
 #include "memory/sharedHeap.hpp"
 #include "runtime/globals.hpp"
 #include "runtime/mutex.hpp"
+#include "runtime/orderAccess.inline.hpp"
 #include "runtime/vmThread.hpp"
 
 template <>
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
 #include "memory/memRegion.hpp"
 #include "oops/markOop.hpp"
 #include "runtime/mutex.hpp"
+#include "runtime/orderAccess.hpp"
 #include "utilities/debug.hpp"
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/ostream.hpp"
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * 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,21 +30,6 @@
 #include "runtime/os.hpp"
 #include "utilities/bitMap.inline.hpp"
 #include "services/memTracker.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 bool
 ParMarkBitMap::initialize(MemRegion covered_region)
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -26,21 +26,6 @@
 #include "gc_implementation/parallelScavenge/psVirtualspace.hpp"
 #include "runtime/os.hpp"
 #include "runtime/virtualspace.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
--- a/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -134,7 +134,7 @@
     Threads::add(res);
     Thread::start(res);
   }
-  os::yield(); // This seems to help with initial start-up of SLT
+  os::naked_yield(); // This seems to help with initial start-up of SLT
   return res;
 }
 
--- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -2783,11 +2783,11 @@
       if (TraceExceptions) {
         ttyLocker ttyl;
         ResourceMark rm;
-        tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")", except_oop->print_value_string(), (void*)except_oop());
+        tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")", except_oop->print_value_string(), p2i(except_oop()));
         tty->print_cr(" thrown in interpreter method <%s>", METHOD->print_value_string());
         tty->print_cr(" at bci %d, continuing at %d for thread " INTPTR_FORMAT,
-                      istate->bcp() - (intptr_t)METHOD->code_base(),
-                      continuation_bci, THREAD);
+                      (int)(istate->bcp() - METHOD->code_base()),
+                      (int)continuation_bci, p2i(THREAD));
       }
       // for AbortVMOnException flag
       NOT_PRODUCT(Exceptions::debug_check_abort(except_oop));
@@ -2799,11 +2799,11 @@
     if (TraceExceptions) {
       ttyLocker ttyl;
       ResourceMark rm;
-      tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")", except_oop->print_value_string(), (void*)except_oop());
+      tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")", except_oop->print_value_string(), p2i(except_oop()));
       tty->print_cr(" thrown in interpreter method <%s>", METHOD->print_value_string());
       tty->print_cr(" at bci %d, unwinding for thread " INTPTR_FORMAT,
-                    istate->bcp() - (intptr_t)METHOD->code_base(),
-                    THREAD);
+                    (int)(istate->bcp() - METHOD->code_base()),
+                    p2i(THREAD));
     }
     // for AbortVMOnException flag
     NOT_PRODUCT(Exceptions::debug_check_abort(except_oop));
@@ -3402,7 +3402,7 @@
   tty->print_cr("osr._osr_buf: " INTPTR_FORMAT, (uintptr_t) this->_result._osr._osr_buf);
   tty->print_cr("osr._osr_entry: " INTPTR_FORMAT, (uintptr_t) this->_result._osr._osr_entry);
   tty->print_cr("prev_link: " INTPTR_FORMAT, (uintptr_t) this->_prev_link);
-  tty->print_cr("native_mirror: " INTPTR_FORMAT, (void*) this->_oop_temp);
+  tty->print_cr("native_mirror: " INTPTR_FORMAT, (uintptr_t) this->_oop_temp);
   tty->print_cr("stack_base: " INTPTR_FORMAT, (uintptr_t) this->_stack_base);
   tty->print_cr("stack_limit: " INTPTR_FORMAT, (uintptr_t) this->_stack_limit);
   tty->print_cr("monitor_base: " INTPTR_FORMAT, (uintptr_t) this->_monitor_base);
--- a/hotspot/src/share/vm/interpreter/bytecodeInterpreterProfiling.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreterProfiling.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2012, 2013 SAP AG. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012, 2014 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -86,11 +86,11 @@
                   " \t-> " PTR_FORMAT "(%d)",                                  \
                 (int) THREAD->osthread()->thread_id(),                         \
                 BCI(),                                                         \
-                MDX(),                                                         \
+                p2i(MDX()),                                                    \
                 (MDX() == NULL                                                 \
                  ? 0                                                           \
                  : istate->method()->method_data()->dp_to_di((address)MDX())), \
-                mdx,                                                           \
+                p2i(mdx),                                                      \
                 istate->method()->method_data()->dp_to_di((address)mdx)        \
                 );                                                             \
   };                                                                           \
@@ -107,7 +107,7 @@
     MethodData *md = istate->method()->method_data();                          \
     tty->cr();                                                                 \
     tty->print("method data at mdx " PTR_FORMAT "(0) for",                     \
-               md->data_layout_at(md->bci_to_di(0)));                          \
+               p2i(md->data_layout_at(md->bci_to_di(0))));                     \
     istate->method()->print_short_name(tty);                                   \
     tty->cr();                                                                 \
     if (md != NULL) {                                                          \
@@ -115,7 +115,7 @@
       address mdx = (address) MDX();                                           \
       if (mdx != NULL) {                                                       \
         tty->print_cr("current mdx " PTR_FORMAT "(%d)",                        \
-                      mdx,                                                     \
+                      p2i(mdx),                                                \
                       istate->method()->method_data()->dp_to_di(mdx));         \
       }                                                                        \
     } else {                                                                   \
--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1093,6 +1093,7 @@
 address SignatureHandlerLibrary::set_handler_blob() {
   BufferBlob* handler_blob = BufferBlob::create("native signature handlers", blob_size);
   if (handler_blob == NULL) {
+    CompileBroker::handle_full_code_cache();
     return NULL;
   }
   address handler = handler_blob->code_begin();
--- a/hotspot/src/share/vm/interpreter/oopMapCache.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/interpreter/oopMapCache.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -180,7 +180,7 @@
   }
 }
 
-bool InterpreterOopMap::is_empty() {
+bool InterpreterOopMap::is_empty() const {
   bool result = _method == NULL;
   assert(_method != NULL || (_bci == 0 &&
     (_mask_size == 0 || _mask_size == USHRT_MAX) &&
@@ -196,7 +196,7 @@
   for (int i = 0; i < N; i++) _bit_mask[i] = 0;
 }
 
-void InterpreterOopMap::iterate_oop(OffsetClosure* oop_closure) {
+void InterpreterOopMap::iterate_oop(OffsetClosure* oop_closure) const {
   int n = number_of_entries();
   int word_index = 0;
   uintptr_t value = 0;
@@ -238,7 +238,7 @@
 #endif
 
 
-void InterpreterOopMap::print() {
+void InterpreterOopMap::print() const {
   int n = number_of_entries();
   tty->print("oop map for ");
   method()->print_value();
@@ -469,7 +469,7 @@
   }
 }
 
-inline unsigned int OopMapCache::hash_value_for(methodHandle method, int bci) {
+inline unsigned int OopMapCache::hash_value_for(methodHandle method, int bci) const {
   // We use method->code_size() rather than method->identity_hash() below since
   // the mark may not be present if a pointer to the method is already reversed.
   return   ((unsigned int) bci)
@@ -522,7 +522,7 @@
 
 void OopMapCache::lookup(methodHandle method,
                          int bci,
-                         InterpreterOopMap* entry_for) {
+                         InterpreterOopMap* entry_for) const {
   MutexLocker x(&_mut);
 
   OopMapCacheEntry* entry = NULL;
--- a/hotspot/src/share/vm/interpreter/oopMapCache.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/interpreter/oopMapCache.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -101,32 +101,31 @@
 
   // access methods
   Method*        method() const                  { return _method; }
-  void           set_method(Method* v)         { _method = v; }
+  void           set_method(Method* v)           { _method = v; }
   int            bci() const                     { return _bci; }
   void           set_bci(int v)                  { _bci = v; }
   int            mask_size() const               { return _mask_size; }
   void           set_mask_size(int v)            { _mask_size = v; }
-  int            number_of_entries() const       { return mask_size() / bits_per_entry; }
   // Test bit mask size and return either the in-line bit mask or allocated
   // bit mask.
-  uintptr_t*  bit_mask()                         { return (uintptr_t*)(mask_size() <= small_mask_limit ? (intptr_t)_bit_mask : _bit_mask[0]); }
+  uintptr_t*  bit_mask() const                   { return (uintptr_t*)(mask_size() <= small_mask_limit ? (intptr_t)_bit_mask : _bit_mask[0]); }
 
   // return the word size of_bit_mask.  mask_size() <= 4 * MAX_USHORT
-  size_t mask_word_size() {
+  size_t mask_word_size() const {
     return (mask_size() + BitsPerWord - 1) / BitsPerWord;
   }
 
-  uintptr_t entry_at(int offset)            { int i = offset * bits_per_entry; return bit_mask()[i / BitsPerWord] >> (i % BitsPerWord); }
+  uintptr_t entry_at(int offset) const           { int i = offset * bits_per_entry; return bit_mask()[i / BitsPerWord] >> (i % BitsPerWord); }
 
-  void set_expression_stack_size(int sz)    { _expression_stack_size = sz; }
+  void set_expression_stack_size(int sz)         { _expression_stack_size = sz; }
 
 #ifdef ENABLE_ZAP_DEAD_LOCALS
-  bool is_dead(int offset)                       { return (entry_at(offset) & (1 << dead_bit_number)) != 0; }
+  bool is_dead(int offset) const                 { return (entry_at(offset) & (1 << dead_bit_number)) != 0; }
 #endif
 
   // Lookup
-  bool match(methodHandle method, int bci)       { return _method == method() && _bci == bci; }
-  bool is_empty();
+  bool match(methodHandle method, int bci) const { return _method == method() && _bci == bci; }
+  bool is_empty() const;
 
   // Initialization
   void initialize();
@@ -141,12 +140,13 @@
   // in-line), allocate the space from a Resource area.
   void resource_copy(OopMapCacheEntry* from);
 
-  void iterate_oop(OffsetClosure* oop_closure);
-  void print();
+  void iterate_oop(OffsetClosure* oop_closure) const;
+  void print() const;
 
-  bool is_oop  (int offset)                      { return (entry_at(offset) & (1 << oop_bit_number )) != 0; }
+  int number_of_entries() const                  { return mask_size() / bits_per_entry; }
+  bool is_oop (int offset) const                 { return (entry_at(offset) & (1 << oop_bit_number )) != 0; }
 
-  int expression_stack_size()                    { return _expression_stack_size; }
+  int expression_stack_size() const              { return _expression_stack_size; }
 
 #ifdef ENABLE_ZAP_DEAD_LOCALS
   void iterate_all(OffsetClosure* oop_closure, OffsetClosure* value_closure, OffsetClosure* dead_closure);
@@ -161,10 +161,10 @@
 
   OopMapCacheEntry* _array;
 
-  unsigned int hash_value_for(methodHandle method, int bci);
+  unsigned int hash_value_for(methodHandle method, int bci) const;
   OopMapCacheEntry* entry_at(int i) const;
 
-  Mutex _mut;
+  mutable Mutex _mut;
 
   void flush();
 
@@ -177,7 +177,7 @@
 
   // Returns the oopMap for (method, bci) in parameter "entry".
   // Returns false if an oop map was not found.
-  void lookup(methodHandle method, int bci, InterpreterOopMap* entry);
+  void lookup(methodHandle method, int bci, InterpreterOopMap* entry) const;
 
   // Compute an oop map without updating the cache or grabbing any locks (for debugging)
   static void compute_one_oop_map(methodHandle method, int bci, InterpreterOopMap* entry);
--- a/hotspot/src/share/vm/memory/allocation.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/memory/allocation.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -36,22 +36,6 @@
 #include "services/memTracker.hpp"
 #include "utilities/ostream.hpp"
 
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
-
 void* StackObj::operator new(size_t size)     throw() { ShouldNotCallThis(); return 0; }
 void  StackObj::operator delete(void* p)              { ShouldNotCallThis(); }
 void* StackObj::operator new [](size_t size)  throw() { ShouldNotCallThis(); return 0; }
--- a/hotspot/src/share/vm/memory/gcLocker.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/memory/gcLocker.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -29,19 +29,6 @@
 #include "memory/genCollectedHeap.hpp"
 #include "memory/universe.hpp"
 #include "oops/oop.hpp"
-#include "runtime/thread.inline.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 // The direct lock/unlock calls do not force a collection if an unlock
 // decrements the count to zero. Avoid calling these if at all possible.
--- a/hotspot/src/share/vm/memory/metaspaceShared.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/memory/metaspaceShared.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -35,6 +35,7 @@
 #include "memory/metaspaceShared.hpp"
 #include "oops/objArrayOop.hpp"
 #include "oops/oop.inline.hpp"
+#include "runtime/os.hpp"
 #include "runtime/signature.hpp"
 #include "runtime/vm_operations.hpp"
 #include "runtime/vmThread.hpp"
--- a/hotspot/src/share/vm/oops/oopsHierarchy.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/oops/oopsHierarchy.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -124,7 +124,7 @@
   operator oopDesc* () const volatile { return obj(); }
   operator intptr_t* () const         { return (intptr_t*)obj(); }
   operator PromotedObject* () const   { return (PromotedObject*)obj(); }
-  operator markOop () const           { return markOop(obj()); }
+  operator markOop () const volatile  { return markOop(obj()); }
   operator address   () const         { return (address)obj(); }
 
   // from javaCalls.cpp
--- a/hotspot/src/share/vm/opto/callGenerator.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/opto/callGenerator.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -871,8 +871,11 @@
           Node*             receiver_node = kit.argument(0);
           const TypeOopPtr* receiver_type = gvn.type(receiver_node)->isa_oopptr();
           // call_does_dispatch and vtable_index are out-parameters.  They might be changed.
-          target = C->optimize_virtual_call(caller, jvms->bci(), klass, target, receiver_type,
-                                            is_virtual,
+          // optimize_virtual_call() takes 2 different holder
+          // arguments for a corner case that doesn't apply here (see
+          // Parse::do_call())
+          target = C->optimize_virtual_call(caller, jvms->bci(), klass, klass,
+                                            target, receiver_type, is_virtual,
                                             call_does_dispatch, vtable_index);  // out-parameters
           // We lack profiling at this call but type speculation may
           // provide us with a type
--- a/hotspot/src/share/vm/opto/compile.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/opto/compile.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -29,6 +29,7 @@
 #include "classfile/systemDictionary.hpp"
 #include "code/exceptionHandlerTable.hpp"
 #include "code/nmethod.hpp"
+#include "compiler/compileBroker.hpp"
 #include "compiler/compileLog.hpp"
 #include "compiler/disassembler.hpp"
 #include "compiler/oopMap.hpp"
@@ -555,6 +556,7 @@
     if (scratch_buffer_blob() == NULL) {
       // Let CompilerBroker disable further compilations.
       record_failure("Not enough space for scratch buffer in CodeCache");
+      CompileBroker::handle_full_code_cache();
       return;
     }
   }
--- a/hotspot/src/share/vm/opto/compile.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/opto/compile.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -852,8 +852,8 @@
 
   // Helper functions to identify inlining potential at call-site
   ciMethod* optimize_virtual_call(ciMethod* caller, int bci, ciInstanceKlass* klass,
-                                  ciMethod* callee, const TypeOopPtr* receiver_type,
-                                  bool is_virtual,
+                                  ciKlass* holder, ciMethod* callee,
+                                  const TypeOopPtr* receiver_type, bool is_virtual,
                                   bool &call_does_dispatch, int &vtable_index);
   ciMethod* optimize_inlining(ciMethod* caller, int bci, ciInstanceKlass* klass,
                               ciMethod* callee, const TypeOopPtr* receiver_type);
--- a/hotspot/src/share/vm/opto/doCall.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/opto/doCall.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -468,8 +468,14 @@
     Node* receiver_node             = stack(sp() - nargs);
     const TypeOopPtr* receiver_type = _gvn.type(receiver_node)->isa_oopptr();
     // call_does_dispatch and vtable_index are out-parameters.  They might be changed.
-    callee = C->optimize_virtual_call(method(), bci(), klass, orig_callee, receiver_type,
-                                      is_virtual,
+    // For arrays, klass below is Object. When vtable calls are used,
+    // resolving the call with Object would allow an illegal call to
+    // finalize() on an array. We use holder instead: illegal calls to
+    // finalize() won't be compiled as vtable calls (IC call
+    // resolution will catch the illegal call) and the few legal calls
+    // on array types won't be either.
+    callee = C->optimize_virtual_call(method(), bci(), klass, holder, orig_callee,
+                                      receiver_type, is_virtual,
                                       call_does_dispatch, vtable_index);  // out-parameters
     speculative_receiver_type = receiver_type != NULL ? receiver_type->speculative_type() : NULL;
   }
@@ -940,8 +946,8 @@
 
 
 ciMethod* Compile::optimize_virtual_call(ciMethod* caller, int bci, ciInstanceKlass* klass,
-                                         ciMethod* callee, const TypeOopPtr* receiver_type,
-                                         bool is_virtual,
+                                         ciKlass* holder, ciMethod* callee,
+                                         const TypeOopPtr* receiver_type, bool is_virtual,
                                          bool& call_does_dispatch, int& vtable_index) {
   // Set default values for out-parameters.
   call_does_dispatch = true;
@@ -956,7 +962,7 @@
     call_does_dispatch = false;
   } else if (!UseInlineCaches && is_virtual && callee->is_loaded()) {
     // We can make a vtable call at this site
-    vtable_index = callee->resolve_vtable_index(caller->holder(), klass);
+    vtable_index = callee->resolve_vtable_index(caller->holder(), holder);
   }
   return callee;
 }
@@ -979,8 +985,10 @@
   ciInstanceKlass* actual_receiver = klass;
   if (receiver_type != NULL) {
     // Array methods are all inherited from Object, and are monomorphic.
+    // finalize() call on array is not allowed.
     if (receiver_type->isa_aryptr() &&
-        callee->holder() == env()->Object_klass()) {
+        callee->holder() == env()->Object_klass() &&
+        callee->name() != ciSymbol::finalize_method_name()) {
       return callee;
     }
 
--- a/hotspot/src/share/vm/opto/output.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/opto/output.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1163,6 +1163,7 @@
   // Have we run out of code space?
   if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) {
     C->record_failure("CodeCache is full");
+    CompileBroker::handle_full_code_cache();
     return NULL;
   }
   // Configure the code buffer.
@@ -1487,6 +1488,7 @@
       cb->insts()->maybe_expand_to_ensure_remaining(MAX_inst_size);
       if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) {
         C->record_failure("CodeCache is full");
+        CompileBroker::handle_full_code_cache();
         return;
       }
 
@@ -1643,6 +1645,7 @@
   // One last check for failed CodeBuffer::expand:
   if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) {
     C->record_failure("CodeCache is full");
+    CompileBroker::handle_full_code_cache();
     return;
   }
 
--- a/hotspot/src/share/vm/opto/parse.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/opto/parse.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -557,8 +557,9 @@
 
   float   dynamic_branch_prediction(float &cnt);
   float   branch_prediction(float &cnt, BoolTest::mask btest, int target_bci);
-  bool    seems_never_taken(float prob);
-  bool    seems_stable_comparison(BoolTest::mask btest, Node* c);
+  bool    seems_never_taken(float prob) const;
+  bool    path_is_suitable_for_uncommon_trap(float prob) const;
+  bool    seems_stable_comparison() const;
 
   void    do_ifnull(BoolTest::mask btest, Node* c);
   void    do_if(BoolTest::mask btest, Node* c);
--- a/hotspot/src/share/vm/opto/parse2.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/opto/parse2.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -886,7 +886,7 @@
 // some branches (e.g., _213_javac.Assembler.eliminate) validly produce
 // very small but nonzero probabilities, which if confused with zero
 // counts would keep the program recompiling indefinitely.
-bool Parse::seems_never_taken(float prob) {
+bool Parse::seems_never_taken(float prob) const {
   return prob < PROB_MIN;
 }
 
@@ -898,7 +898,7 @@
 // already acting in a stable fashion.  If the comparison
 // seems stable, we will put an expensive uncommon trap
 // on the untaken path.
-bool Parse::seems_stable_comparison(BoolTest::mask btest, Node* cmp) {
+bool Parse::seems_stable_comparison() const {
   if (C->too_many_traps(method(), bci(), Deoptimization::Reason_unstable_if)) {
     return false;
   }
@@ -1127,6 +1127,14 @@
   }
 }
 
+bool Parse::path_is_suitable_for_uncommon_trap(float prob) const {
+  // Don't want to speculate on uncommon traps when running with -Xcomp
+  if (!UseInterpreter) {
+    return false;
+  }
+  return (seems_never_taken(prob) && seems_stable_comparison());
+}
+
 //----------------------------adjust_map_after_if------------------------------
 // Adjust the JVM state to reflect the result of taking this path.
 // Basically, it means inspecting the CmpNode controlling this
@@ -1140,7 +1148,7 @@
 
   bool is_fallthrough = (path == successor_for_bci(iter().next_bci()));
 
-  if (seems_never_taken(prob) && seems_stable_comparison(btest, c)) {
+  if (path_is_suitable_for_uncommon_trap(prob)) {
     repush_if_args();
     uncommon_trap(Deoptimization::Reason_unstable_if,
                   Deoptimization::Action_reinterpret,
--- a/hotspot/src/share/vm/prims/jni.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/prims/jni.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -80,18 +80,6 @@
 #include "utilities/dtrace.hpp"
 #include "utilities/events.hpp"
 #include "utilities/histogram.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 static jint CurrentVersion = JNI_VERSION_1_8;
 
@@ -3337,7 +3325,7 @@
     directBufferSupportInitializeEnded = 1;
   } else {
     while (!directBufferSupportInitializeEnded && !directBufferSupportInitializeFailed) {
-      os::yield();
+      os::naked_yield();
     }
   }
 
--- a/hotspot/src/share/vm/prims/jvm.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/prims/jvm.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -53,7 +53,7 @@
 #include "runtime/javaCalls.hpp"
 #include "runtime/jfieldIDWorkaround.hpp"
 #include "runtime/orderAccess.inline.hpp"
-#include "runtime/os.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/perfData.hpp"
 #include "runtime/reflection.hpp"
 #include "runtime/thread.inline.hpp"
@@ -3042,7 +3042,7 @@
   if (ConvertYieldToSleep) {
     os::sleep(thread, MinSleepInterval, false);
   } else {
-    os::yield();
+    os::naked_yield();
   }
 JVM_END
 
@@ -3072,7 +3072,7 @@
     // It appears that in certain GUI contexts, it may be beneficial to do a short sleep
     // for SOLARIS
     if (ConvertSleepToYield) {
-      os::yield();
+      os::naked_yield();
     } else {
       ThreadState old_state = thread->osthread()->get_state();
       thread->osthread()->set_state(SLEEPING);
--- a/hotspot/src/share/vm/prims/jvmtiExport.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiExport.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -47,6 +47,7 @@
 #include "runtime/interfaceSupport.hpp"
 #include "runtime/objectMonitor.hpp"
 #include "runtime/objectMonitor.inline.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/thread.inline.hpp"
 #include "runtime/vframe.hpp"
 #include "services/attachListener.hpp"
--- a/hotspot/src/share/vm/prims/nativeLookup.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/prims/nativeLookup.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -41,21 +41,6 @@
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/signature.hpp"
 #include "utilities/macros.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 
 static void mangle_name_on(outputStream* st, Symbol* name, int begin, int end) {
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -37,26 +37,12 @@
 #include "runtime/arguments.hpp"
 #include "runtime/globals_extension.hpp"
 #include "runtime/java.hpp"
+#include "runtime/os.hpp"
 #include "services/management.hpp"
 #include "services/memTracker.hpp"
 #include "utilities/defaultStream.hpp"
 #include "utilities/macros.hpp"
 #include "utilities/taskqueue.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
--- a/hotspot/src/share/vm/runtime/arguments.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/arguments.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -26,6 +26,7 @@
 #define SHARE_VM_RUNTIME_ARGUMENTS_HPP
 
 #include "runtime/java.hpp"
+#include "runtime/os.hpp"
 #include "runtime/perfData.hpp"
 #include "utilities/debug.hpp"
 #include "utilities/top.hpp"
--- a/hotspot/src/share/vm/runtime/atomic.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/atomic.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,23 +23,6 @@
  */
 
 #include "precompiled.hpp"
-#include "runtime/atomic.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
-
 #include "runtime/atomic.inline.hpp"
 
 jbyte Atomic::cmpxchg(jbyte exchange_value, volatile jbyte* dest, jbyte compare_value) {
--- a/hotspot/src/share/vm/runtime/frame.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/frame.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -40,6 +40,7 @@
 #include "runtime/handles.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/monitorChunk.hpp"
+#include "runtime/os.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/signature.hpp"
 #include "runtime/stubCodeGenerator.hpp"
--- a/hotspot/src/share/vm/runtime/globals.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1130,29 +1130,30 @@
           "Use LWP-based instead of libthread-based synchronization "       \
           "(SPARC only)")                                                   \
                                                                             \
-  product(ccstr, SyncKnobs, NULL,                                           \
-          "(Unstable) Various monitor synchronization tunables")            \
-                                                                            \
-  product(intx, EmitSync, 0,                                                \
-          "(Unsafe, Unstable) "                                             \
-          "Control emission of inline sync fast-path code")                 \
+  experimental(ccstr, SyncKnobs, NULL,                                      \
+               "(Unstable) Various monitor synchronization tunables")       \
+                                                                            \
+  experimental(intx, EmitSync, 0,                                           \
+               "(Unsafe, Unstable) "                                        \
+               "Control emission of inline sync fast-path code")            \
                                                                             \
   product(intx, MonitorBound, 0, "Bound Monitor population")                \
                                                                             \
   product(bool, MonitorInUseLists, false, "Track Monitors for Deflation")   \
                                                                             \
-  product(intx, SyncFlags, 0, "(Unsafe, Unstable) Experimental Sync flags") \
-                                                                            \
-  product(intx, SyncVerbose, 0, "(Unstable)")                               \
-                                                                            \
-  product(intx, ClearFPUAtPark, 0, "(Unsafe, Unstable)")                    \
-                                                                            \
-  product(intx, hashCode, 5,                                                \
-          "(Unstable) select hashCode generation algorithm")                \
-                                                                            \
-  product(intx, WorkAroundNPTLTimedWaitHang, 1,                             \
-          "(Unstable, Linux-specific) "                                     \
-          "avoid NPTL-FUTEX hang pthread_cond_timedwait")                   \
+  experimental(intx, SyncFlags, 0, "(Unsafe, Unstable) "                    \
+               "Experimental Sync flags")                                   \
+                                                                            \
+  experimental(intx, SyncVerbose, 0, "(Unstable)")                          \
+                                                                            \
+  experimental(intx, ClearFPUAtPark, 0, "(Unsafe, Unstable)")               \
+                                                                            \
+  experimental(intx, hashCode, 5,                                           \
+               "(Unstable) select hashCode generation algorithm")           \
+                                                                            \
+  experimental(intx, WorkAroundNPTLTimedWaitHang, 1,                        \
+               "(Unstable, Linux-specific) "                                \
+               "avoid NPTL-FUTEX hang pthread_cond_timedwait")              \
                                                                             \
   product(bool, FilterSpuriousWakeups, true,                                \
           "When true prevents OS-level spurious, or premature, wakeups "    \
--- a/hotspot/src/share/vm/runtime/handles.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/handles.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -29,18 +29,6 @@
 #include "runtime/atomic.inline.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/thread.inline.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
--- a/hotspot/src/share/vm/runtime/icache.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/icache.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -34,6 +34,9 @@
   ResourceMark rm;
 
   BufferBlob* b = BufferBlob::create("flush_icache_stub", ICache::stub_size);
+  if (b == NULL) {
+    vm_exit_out_of_memory(ICache::stub_size, OOM_MALLOC_ERROR, "CodeCache: no space for flush_icache_stub");
+  }
   CodeBuffer c(b);
 
   ICacheStubGenerator g(&c);
--- a/hotspot/src/share/vm/runtime/interfaceSupport.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/interfaceSupport.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -32,6 +32,7 @@
 #include "runtime/init.hpp"
 #include "runtime/interfaceSupport.hpp"
 #include "runtime/orderAccess.inline.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/threadLocalStorage.hpp"
 #include "runtime/vframe.hpp"
 #include "utilities/preserveException.hpp"
--- a/hotspot/src/share/vm/runtime/javaCalls.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/javaCalls.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * 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,6 +37,7 @@
 #include "runtime/interfaceSupport.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/mutexLocker.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/signature.hpp"
 #include "runtime/stubRoutines.hpp"
 #include "runtime/thread.inline.hpp"
--- a/hotspot/src/share/vm/runtime/mutex.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/mutex.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,4 +1,3 @@
-
 /*
  * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -488,7 +487,6 @@
   for (;;) {
     assert(_OnDeck == ESelf, "invariant");
     if (TrySpin(Self)) break;
-    // CONSIDER: if ESelf->TryPark() && TryLock() break ...
     // It's probably wise to spin only if we *actually* blocked
     // CONSIDER: check the lockbyte, if it remains set then
     // preemptively drain the cxq into the EntryList.
--- a/hotspot/src/share/vm/runtime/mutexLocker.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/mutexLocker.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "runtime/mutexLocker.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/safepoint.hpp"
 #include "runtime/thread.inline.hpp"
 #include "runtime/threadLocalStorage.hpp"
--- a/hotspot/src/share/vm/runtime/mutexLocker.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/mutexLocker.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -27,21 +27,6 @@
 
 #include "memory/allocation.hpp"
 #include "runtime/mutex.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 // Mutexes used in the VM.
 
--- a/hotspot/src/share/vm/runtime/objectMonitor.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/objectMonitor.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -43,24 +43,12 @@
 #include "utilities/dtrace.hpp"
 #include "utilities/macros.hpp"
 #include "utilities/preserveException.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 #if defined(__GNUC__) && !defined(IA64) && !defined(PPC64)
   // Need to inhibit inlining for older versions of GCC to avoid build-time failures
-  #define ATTR __attribute__((noinline))
+  #define NOINLINE __attribute__((noinline))
 #else
-  #define ATTR
+  #define NOINLINE
 #endif
 
 
@@ -115,38 +103,39 @@
 // The knob* variables are effectively final.  Once set they should
 // never be modified hence.  Consider using __read_mostly with GCC.
 
-int ObjectMonitor::Knob_Verbose    = 0;
-int ObjectMonitor::Knob_SpinLimit  = 5000;    // derived by an external tool -
-static int Knob_LogSpins           = 0;       // enable jvmstat tally for spins
-static int Knob_HandOff            = 0;
-static int Knob_ReportSettings     = 0;
+int ObjectMonitor::Knob_Verbose     = 0;
+int ObjectMonitor::Knob_VerifyInUse = 0;
+int ObjectMonitor::Knob_SpinLimit   = 5000;    // derived by an external tool -
+static int Knob_LogSpins            = 0;       // enable jvmstat tally for spins
+static int Knob_HandOff             = 0;
+static int Knob_ReportSettings      = 0;
 
-static int Knob_SpinBase           = 0;       // Floor AKA SpinMin
-static int Knob_SpinBackOff        = 0;       // spin-loop backoff
-static int Knob_CASPenalty         = -1;      // Penalty for failed CAS
-static int Knob_OXPenalty          = -1;      // Penalty for observed _owner change
-static int Knob_SpinSetSucc        = 1;       // spinners set the _succ field
-static int Knob_SpinEarly          = 1;
-static int Knob_SuccEnabled        = 1;       // futile wake throttling
-static int Knob_SuccRestrict       = 0;       // Limit successors + spinners to at-most-one
-static int Knob_MaxSpinners        = -1;      // Should be a function of # CPUs
-static int Knob_Bonus              = 100;     // spin success bonus
-static int Knob_BonusB             = 100;     // spin success bonus
-static int Knob_Penalty            = 200;     // spin failure penalty
-static int Knob_Poverty            = 1000;
-static int Knob_SpinAfterFutile    = 1;       // Spin after returning from park()
-static int Knob_FixedSpin          = 0;
-static int Knob_OState             = 3;       // Spinner checks thread state of _owner
-static int Knob_UsePause           = 1;
-static int Knob_ExitPolicy         = 0;
-static int Knob_PreSpin            = 10;      // 20-100 likely better
-static int Knob_ResetEvent         = 0;
-static int BackOffMask             = 0;
+static int Knob_SpinBase            = 0;       // Floor AKA SpinMin
+static int Knob_SpinBackOff         = 0;       // spin-loop backoff
+static int Knob_CASPenalty          = -1;      // Penalty for failed CAS
+static int Knob_OXPenalty           = -1;      // Penalty for observed _owner change
+static int Knob_SpinSetSucc         = 1;       // spinners set the _succ field
+static int Knob_SpinEarly           = 1;
+static int Knob_SuccEnabled         = 1;       // futile wake throttling
+static int Knob_SuccRestrict        = 0;       // Limit successors + spinners to at-most-one
+static int Knob_MaxSpinners         = -1;      // Should be a function of # CPUs
+static int Knob_Bonus               = 100;     // spin success bonus
+static int Knob_BonusB              = 100;     // spin success bonus
+static int Knob_Penalty             = 200;     // spin failure penalty
+static int Knob_Poverty             = 1000;
+static int Knob_SpinAfterFutile     = 1;       // Spin after returning from park()
+static int Knob_FixedSpin           = 0;
+static int Knob_OState              = 3;       // Spinner checks thread state of _owner
+static int Knob_UsePause            = 1;
+static int Knob_ExitPolicy          = 0;
+static int Knob_PreSpin             = 10;      // 20-100 likely better
+static int Knob_ResetEvent          = 0;
+static int BackOffMask              = 0;
 
-static int Knob_FastHSSEC          = 0;
-static int Knob_MoveNotifyee       = 2;       // notify() - disposition of notifyee
-static int Knob_QMode              = 0;       // EntryList-cxq policy - queue discipline
-static volatile int InitDone       = 0;
+static int Knob_FastHSSEC           = 0;
+static int Knob_MoveNotifyee        = 2;       // notify() - disposition of notifyee
+static int Knob_QMode               = 0;       // EntryList-cxq policy - queue discipline
+static volatile int InitDone        = 0;
 
 #define TrySpin TrySpin_VaryDuration
 
@@ -211,7 +200,7 @@
 //   on EntryList|cxq.  That is, spinning relieves contention on the "inner"
 //   locks and monitor metadata.
 //
-//   Cxq points to the the set of Recently Arrived Threads attempting entry.
+//   Cxq points to the set of Recently Arrived Threads attempting entry.
 //   Because we push threads onto _cxq with CAS, the RATs must take the form of
 //   a singly-linked LIFO.  We drain _cxq into EntryList  at unlock-time when
 //   the unlocking thread notices that EntryList is null but _cxq is != null.
@@ -281,13 +270,12 @@
   }
 }
 
-void ATTR ObjectMonitor::enter(TRAPS) {
+void NOINLINE ObjectMonitor::enter(TRAPS) {
   // The following code is ordered to check the most common cases first
   // and to reduce RTS->RTO cache line upgrades on SPARC and IA32 processors.
   Thread * const Self = THREAD;
-  void * cur;
 
-  cur = Atomic::cmpxchg_ptr(Self, &_owner, NULL);
+  void * cur = Atomic::cmpxchg_ptr (Self, &_owner, NULL);
   if (cur == NULL) {
      // Either ASSERT _recursions == 0 or explicitly set _recursions = 0.
      assert(_recursions == 0   , "invariant");
@@ -447,26 +435,24 @@
 // Callers must compensate as needed.
 
 int ObjectMonitor::TryLock (Thread * Self) {
-   for (;;) {
-      void * own = _owner;
-      if (own != NULL) return 0;
-      if (Atomic::cmpxchg_ptr (Self, &_owner, NULL) == NULL) {
-         // Either guarantee _recursions == 0 or set _recursions = 0.
-         assert(_recursions == 0, "invariant");
-         assert(_owner == Self, "invariant");
-         // CONSIDER: set or assert that OwnerIsThread == 1
-         return 1;
-      }
-      // The lock had been free momentarily, but we lost the race to the lock.
-      // Interference -- the CAS failed.
-      // We can either return -1 or retry.
-      // Retry doesn't make as much sense because the lock was just acquired.
-      if (true) return -1;
-   }
+  void * own = _owner;
+  if (own != NULL) return 0;
+  if (Atomic::cmpxchg_ptr (Self, &_owner, NULL) == NULL) {
+    // Either guarantee _recursions == 0 or set _recursions = 0.
+    assert(_recursions == 0, "invariant");
+    assert(_owner == Self, "invariant");
+    // CONSIDER: set or assert that OwnerIsThread == 1
+    return 1;
+  }
+  // The lock had been free momentarily, but we lost the race to the lock.
+  // Interference -- the CAS failed.
+  // We can either return -1 or retry.
+  // Retry doesn't make as much sense because the lock was just acquired.
+  return -1;
 }
 
-void ATTR ObjectMonitor::EnterI (TRAPS) {
-    Thread * Self = THREAD;
+void NOINLINE ObjectMonitor::EnterI (TRAPS) {
+    Thread * const Self = THREAD;
     assert(Self->is_Java_thread(), "invariant");
     assert(((JavaThread *) Self)->thread_state() == _thread_blocked   , "invariant");
 
@@ -562,7 +548,7 @@
         Atomic::cmpxchg_ptr(Self, &_Responsible, NULL);
     }
 
-    // The lock have been released while this thread was occupied queueing
+    // The lock might have been released while this thread was occupied queueing
     // itself onto _cxq.  To close the race and avoid "stranding" and
     // progress-liveness failure we must resample-retry _owner before parking.
     // Note the Dekker/Lamport duality: ST cxq; MEMBAR; LD Owner.
@@ -714,7 +700,7 @@
 // Knob_Reset and Knob_SpinAfterFutile support and restructuring the
 // loop accordingly.
 
-void ATTR ObjectMonitor::ReenterI (Thread * Self, ObjectWaiter * SelfNode) {
+void NOINLINE ObjectMonitor::ReenterI (Thread * Self, ObjectWaiter * SelfNode) {
     assert(Self != NULL                , "invariant");
     assert(SelfNode != NULL            , "invariant");
     assert(SelfNode->_thread == Self   , "invariant");
@@ -802,6 +788,7 @@
     OrderAccess::fence();      // see comments at the end of EnterI()
 }
 
+// By convention we unlink a contending thread from EntryList|cxq immediately
 // after the thread acquires the lock in ::enter().  Equally, we could defer
 // unlinking the thread until ::exit()-time.
 
@@ -822,7 +809,7 @@
         assert(prv == NULL || prv->TState == ObjectWaiter::TS_ENTER, "invariant");
         TEVENT(Unlink from EntryList);
     } else {
-        guarantee(SelfNode->TState == ObjectWaiter::TS_CXQ, "invariant");
+        assert(SelfNode->TState == ObjectWaiter::TS_CXQ, "invariant");
         // Inopportune interleaving -- Self is still on the cxq.
         // This usually means the enqueue of self raced an exiting thread.
         // Normally we'll find Self near the front of the cxq, so
@@ -862,10 +849,12 @@
         TEVENT(Unlink from cxq);
     }
 
+#ifdef ASSERT
     // Diagnostic hygiene ...
     SelfNode->_prev  = (ObjectWaiter *) 0xBAD;
     SelfNode->_next  = (ObjectWaiter *) 0xBAD;
     SelfNode->TState = ObjectWaiter::TS_RUN;
+#endif
 }
 
 // -----------------------------------------------------------------------------
@@ -918,9 +907,15 @@
 // the integral of the # of active timers at any instant over time).
 // Both impinge on OS scalability.  Given that, at most one thread parked on
 // a monitor will use a timer.
+//
+// There is also the risk of a futile wake-up. If we drop the lock
+// another thread can reacquire the lock immediately, and we can
+// then wake a thread unnecessarily. This is benign, and we've
+// structured the code so the windows are short and the frequency
+// of such futile wakups is low.
 
-void ATTR ObjectMonitor::exit(bool not_suspended, TRAPS) {
-   Thread * Self = THREAD;
+void NOINLINE ObjectMonitor::exit(bool not_suspended, TRAPS) {
+   Thread * const Self = THREAD;
    if (THREAD != _owner) {
      if (THREAD->is_lock_owned((address) _owner)) {
        // Transmute _owner from a BasicLock pointer to a Thread address.
@@ -932,14 +927,17 @@
        _recursions = 0;
        OwnerIsThread = 1;
      } else {
-       // NOTE: we need to handle unbalanced monitor enter/exit
-       // in native code by throwing an exception.
-       // TODO: Throw an IllegalMonitorStateException ?
+       // Apparent unbalanced locking ...
+       // Naively we'd like to throw IllegalMonitorStateException.
+       // As a practical matter we can neither allocate nor throw an
+       // exception as ::exit() can be called from leaf routines.
+       // see x86_32.ad Fast_Unlock() and the I1 and I2 properties.
+       // Upon deeper reflection, however, in a properly run JVM the only
+       // way we should encounter this situation is in the presence of
+       // unbalanced JNI locking. TODO: CheckJNICalls.
+       // See also: CR4414101
        TEVENT(Exit - Throw IMSX);
-       assert(false, "Non-balanced monitor enter/exit!");
-       if (false) {
-          THROW(vmSymbols::java_lang_IllegalMonitorStateException());
-       }
+       assert(false, "Non-balanced monitor enter/exit! Likely JNI locking");
        return;
      }
    }
@@ -988,6 +986,7 @@
             return;
          }
          TEVENT(Inflated exit - complex egress);
+         // Other threads are blocked trying to acquire the lock.
 
          // Normally the exiting thread is responsible for ensuring succession,
          // but if other successors are ready or other entering threads are spinning
@@ -1154,9 +1153,9 @@
       if (w != NULL) {
           // I'd like to write: guarantee (w->_thread != Self).
           // But in practice an exiting thread may find itself on the EntryList.
-          // Lets say thread T1 calls O.wait().  Wait() enqueues T1 on O's waitset and
+          // Let's say thread T1 calls O.wait().  Wait() enqueues T1 on O's waitset and
           // then calls exit().  Exit release the lock by setting O._owner to NULL.
-          // Lets say T1 then stalls.  T2 acquires O and calls O.notify().  The
+          // Let's say T1 then stalls.  T2 acquires O and calls O.notify().  The
           // notify() operation moves T1 from O's waitset to O's EntryList. T2 then
           // release the lock "O".  T2 resumes immediately after the ST of null into
           // _owner, above.  T2 notices that the EntryList is populated, so it
@@ -1273,10 +1272,13 @@
 //       MEMBAR
 //       LD Self_>_suspend_flags
 //
+// UPDATE 2007-10-6: since I've replaced the native Mutex/Monitor subsystem
+// with a more efficient implementation, the need to use "FastHSSEC" has
+// decreased. - Dave
 
 
 bool ObjectMonitor::ExitSuspendEquivalent (JavaThread * jSelf) {
-   int Mode = Knob_FastHSSEC;
+   const int Mode = Knob_FastHSSEC;
    if (Mode && !jSelf->is_external_suspend()) {
       assert(jSelf->is_suspend_equivalent(), "invariant");
       jSelf->clear_suspend_equivalent();
@@ -1425,7 +1427,7 @@
 // Wait/Notify/NotifyAll
 //
 // Note: a subset of changes to ObjectMonitor::wait()
-// will need to be replicated in complete_exit above
+// will need to be replicated in complete_exit
 void ObjectMonitor::wait(jlong millis, bool interruptible, TRAPS) {
    Thread * const Self = THREAD;
    assert(Self->is_Java_thread(), "Must be Java thread!");
@@ -2280,12 +2282,12 @@
   assert(_event != NULL, "invariant");
 }
 
-void ObjectWaiter::wait_reenter_begin(ObjectMonitor *mon) {
+void ObjectWaiter::wait_reenter_begin(ObjectMonitor * const mon) {
   JavaThread *jt = (JavaThread *)this->_thread;
   _active = JavaThreadBlockedOnMonitorEnterState::wait_reenter_begin(jt, mon);
 }
 
-void ObjectWaiter::wait_reenter_end(ObjectMonitor *mon) {
+void ObjectWaiter::wait_reenter_end(ObjectMonitor * const mon) {
   JavaThread *jt = (JavaThread *)this->_thread;
   JavaThreadBlockedOnMonitorEnterState::wait_reenter_end(jt, _active);
 }
@@ -2467,6 +2469,7 @@
   #define SETKNOB(x) { Knob_##x = kvGetInt (knobs, #x, Knob_##x); }
   SETKNOB(ReportSettings);
   SETKNOB(Verbose);
+  SETKNOB(VerifyInUse);
   SETKNOB(FixedSpin);
   SETKNOB(SpinLimit);
   SETKNOB(SpinBase);
--- a/hotspot/src/share/vm/runtime/objectMonitor.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/objectMonitor.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -311,6 +311,7 @@
 
  public:
   static int Knob_Verbose;
+  static int Knob_VerifyInUse;
   static int Knob_SpinLimit;
   void* operator new (size_t size) throw() {
     return AllocateHeap(size, mtInternal);
--- a/hotspot/src/share/vm/runtime/os.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/os.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -46,7 +46,7 @@
 #include "runtime/java.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/mutexLocker.hpp"
-#include "runtime/os.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/stubRoutines.hpp"
 #include "runtime/thread.inline.hpp"
 #include "services/attachListener.hpp"
@@ -54,18 +54,6 @@
 #include "services/threadService.hpp"
 #include "utilities/defaultStream.hpp"
 #include "utilities/events.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 # include <signal.h>
 
--- a/hotspot/src/share/vm/runtime/os.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/os.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -442,16 +442,7 @@
   // ms = 0, will sleep for the least amount of time allowed by the OS.
   static void naked_short_sleep(jlong ms);
   static void infinite_sleep(); // never returns, use with CAUTION
-  static void yield();        // Yields to all threads with same priority
-  enum YieldResult {
-    YIELD_SWITCHED = 1,         // caller descheduled, other ready threads exist & ran
-    YIELD_NONEREADY = 0,        // No other runnable/ready threads.
-                                // platform-specific yield return immediately
-    YIELD_UNKNOWN = -1          // Unknown: platform doesn't support _SWITCHED or _NONEREADY
-    // YIELD_SWITCHED and YIELD_NONREADY imply the platform supports a "strong"
-    // yield that can be used in lieu of blocking.
-  } ;
-  static YieldResult NakedYield () ;
+  static void naked_yield () ;
   static OSReturn set_priority(Thread* thread, ThreadPriority priority);
   static OSReturn get_priority(const Thread* const thread, ThreadPriority& priority);
 
@@ -629,11 +620,6 @@
   static void     print_jni_name_prefix_on(outputStream* st, int args_size);
   static void     print_jni_name_suffix_on(outputStream* st, int args_size);
 
-  // File conventions
-  static const char* file_separator();
-  static const char* line_separator();
-  static const char* path_separator();
-
   // Init os specific system properties values
   static void init_system_properties_values();
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/runtime/os.inline.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ *
+ */
+
+#ifndef SHARE_VM_RUNTIME_OS_INLINE_HPP
+#define SHARE_VM_RUNTIME_OS_INLINE_HPP
+
+#include "runtime/os.hpp"
+
+#ifdef TARGET_OS_FAMILY_linux
+# include "os_linux.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_solaris
+# include "os_solaris.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_windows
+# include "os_windows.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_aix
+# include "os_aix.inline.hpp"
+#endif
+#ifdef TARGET_OS_FAMILY_bsd
+# include "os_bsd.inline.hpp"
+#endif
+
+#endif // SHARE_VM_RUNTIME_OS_INLINE_HPP
--- a/hotspot/src/share/vm/runtime/safepoint.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/safepoint.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -322,7 +322,7 @@
         SpinPause() ;     // MP-Polite spin
       } else
       if (steps < DeferThrSuspendLoopCount) {
-        os::NakedYield() ;
+        os::naked_yield() ;
       } else {
         os::naked_short_sleep(1);
       }
--- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1810,14 +1810,8 @@
 
 
 // Handles the uncommon case in locking, i.e., contention or an inflated lock.
-#ifndef PRODUCT
-int SharedRuntime::_monitor_enter_ctr=0;
-#endif
 JRT_ENTRY_NO_ASYNC(void, SharedRuntime::complete_monitor_locking_C(oopDesc* _obj, BasicLock* lock, JavaThread* thread))
   oop obj(_obj);
-#ifndef PRODUCT
-  _monitor_enter_ctr++;             // monitor enter slow
-#endif
   if (PrintBiasedLockingStatistics) {
     Atomic::inc(BiasedLocking::slow_path_entry_count_addr());
   }
@@ -1831,15 +1825,9 @@
   assert(!HAS_PENDING_EXCEPTION, "Should have no exception here");
 JRT_END
 
-#ifndef PRODUCT
-int SharedRuntime::_monitor_exit_ctr=0;
-#endif
 // Handles the uncommon cases of monitor unlocking in compiled code
 JRT_LEAF(void, SharedRuntime::complete_monitor_unlocking_C(oopDesc* _obj, BasicLock* lock))
    oop obj(_obj);
-#ifndef PRODUCT
-  _monitor_exit_ctr++;              // monitor exit slow
-#endif
   Thread* THREAD = JavaThread::current();
   // I'm not convinced we need the code contained by MIGHT_HAVE_PENDING anymore
   // testing was unable to ever fire the assert that guarded it so I have removed it.
@@ -1879,8 +1867,6 @@
   ttyLocker ttyl;
   if (xtty != NULL)  xtty->head("statistics type='SharedRuntime'");
 
-  if (_monitor_enter_ctr) tty->print_cr("%5d monitor enter slow",  _monitor_enter_ctr);
-  if (_monitor_exit_ctr) tty->print_cr("%5d monitor exit slow",   _monitor_exit_ctr);
   if (_throw_null_ctr) tty->print_cr("%5d implicit null throw", _throw_null_ctr);
 
   SharedRuntime::print_ic_miss_histogram();
@@ -2464,9 +2450,9 @@
     if (PrintAdapterHandlers || PrintStubCode) {
       ttyLocker ttyl;
       entry->print_adapter_on(tty);
-      tty->print_cr("i2c argument handler #%d for: %s %s (%d bytes generated)",
+      tty->print_cr("i2c argument handler #%d for: %s %s %s (%d bytes generated)",
                     _adapters->number_of_entries(), (method->is_static() ? "static" : "receiver"),
-                    method->signature()->as_C_string(), insts_size);
+                    method->signature()->as_C_string(), fingerprint->as_string(), insts_size);
       tty->print_cr("c2i argument handler starts at %p", entry->get_c2i_entry());
       if (Verbose || PrintStubCode) {
         address first_pc = entry->base_address();
--- a/hotspot/src/share/vm/runtime/sharedRuntime.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/sharedRuntime.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -516,8 +516,6 @@
   static void trace_ic_miss(address at);
 
  public:
-  static int _monitor_enter_ctr;                 // monitor enter slow
-  static int _monitor_exit_ctr;                  // monitor exit slow
   static int _throw_null_ctr;                    // throwing a null-pointer exception
   static int _ic_miss_ctr;                       // total # of IC misses
   static int _wrong_method_ctr;
--- a/hotspot/src/share/vm/runtime/synchronizer.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/synchronizer.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -41,24 +41,12 @@
 #include "utilities/dtrace.hpp"
 #include "utilities/events.hpp"
 #include "utilities/preserveException.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 #if defined(__GNUC__) && !defined(PPC64)
   // Need to inhibit inlining for older versions of GCC to avoid build-time failures
-  #define ATTR __attribute__((noinline))
+  #define NOINLINE __attribute__((noinline))
 #else
-  #define ATTR
+  #define NOINLINE
 #endif
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
@@ -218,14 +206,6 @@
     return;
   }
 
-#if 0
-  // The following optimization isn't particularly useful.
-  if (mark->has_monitor() && mark->monitor()->is_entered(THREAD)) {
-    lock->set_displaced_header(NULL);
-    return;
-  }
-#endif
-
   // The object header will never be displaced to this lock,
   // so it does not matter what the value is, except that it
   // must be non-zero to avoid looking like a re-entrant lock,
@@ -469,7 +449,7 @@
     ++its;
     if (its > 10000 || !os::is_MP()) {
        if (its & 1) {
-         os::NakedYield();
+         os::naked_yield();
          TEVENT(Inflate: INFLATING - yield);
        } else {
          // Note that the following code attenuates the livelock problem but is not
@@ -499,7 +479,7 @@
            if ((YieldThenBlock++) >= 16) {
               Thread::current()->_ParkEvent->park(1);
            } else {
-              os::NakedYield();
+              os::naked_yield();
            }
          }
          Thread::muxRelease(InflationLocks + ix);
@@ -585,7 +565,7 @@
     // added check of the bias pattern is to avoid useless calls to
     // thread-local storage.
     if (obj->mark()->has_bias_pattern()) {
-      // Box and unbox the raw reference just in case we cause a STW safepoint.
+      // Handle for oop obj in case of STW safepoint
       Handle hobj(Self, obj);
       // Relaxing assertion for bug 6320749.
       assert(Universe::verify_in_progress() ||
@@ -902,23 +882,23 @@
     }
   }
 }
-/* Too slow for general assert or debug
+
 void ObjectSynchronizer::verifyInUse (Thread *Self) {
    ObjectMonitor* mid;
    int inusetally = 0;
    for (mid = Self->omInUseList; mid != NULL; mid = mid->FreeNext) {
-     inusetally ++;
+     inusetally++;
    }
    assert(inusetally == Self->omInUseCount, "inuse count off");
 
    int freetally = 0;
    for (mid = Self->omFreeList; mid != NULL; mid = mid->FreeNext) {
-     freetally ++;
+     freetally++;
    }
    assert(freetally == Self->omFreeCount, "free count off");
 }
-*/
-ObjectMonitor * ATTR ObjectSynchronizer::omAlloc (Thread * Self) {
+
+ObjectMonitor * NOINLINE ObjectSynchronizer::omAlloc (Thread * Self) {
     // A large MAXPRIVATE value reduces both list lock contention
     // and list coherency traffic, but also tends to increase the
     // number of objectMonitors in circulation as well as the STW
@@ -944,7 +924,9 @@
              m->FreeNext = Self->omInUseList;
              Self->omInUseList = m;
              Self->omInUseCount++;
-             // verifyInUse(Self);
+             if (ObjectMonitor::Knob_VerifyInUse) {
+               verifyInUse(Self);
+             }
            } else {
              m->FreeNext = NULL;
            }
@@ -1064,7 +1046,9 @@
            curmidinuse->FreeNext = mid->FreeNext; // maintain the current thread inuselist
          }
          Self->omInUseCount--;
-         // verifyInUse(Self);
+         if (ObjectMonitor::Knob_VerifyInUse) {
+           verifyInUse(Self);
+         }
          break;
        } else {
          curmidinuse = mid;
@@ -1073,7 +1057,7 @@
     }
   }
 
-  // FreeNext is used for both onInUseList and omFreeList, so clear old before setting new
+  // FreeNext is used for both omInUseList and omFreeList, so clear old before setting new
   m->FreeNext = Self->omFreeList;
   Self->omFreeList = m;
   Self->omFreeCount++;
@@ -1086,7 +1070,7 @@
 // consecutive STW safepoints.  Relatedly, we might decay
 // omFreeProvision at STW safepoints.
 //
-// Also return the monitors of a moribund thread"s omInUseList to
+// Also return the monitors of a moribund thread's omInUseList to
 // a global gOmInUseList under the global list lock so these
 // will continue to be scanned.
 //
@@ -1127,7 +1111,6 @@
         InUseTail = curom;
         InUseTally++;
       }
-// TODO debug
       assert(Self->omInUseCount == InUseTally, "inuse count off");
       Self->omInUseCount = 0;
       guarantee(InUseTail != NULL && InUseList != NULL, "invariant");
@@ -1166,7 +1149,7 @@
 // multiple locks occupy the same $ line.  Padding might be appropriate.
 
 
-ObjectMonitor * ATTR ObjectSynchronizer::inflate (Thread * Self, oop object) {
+ObjectMonitor * NOINLINE ObjectSynchronizer::inflate (Thread * Self, oop object) {
   // Inflate mutates the heap ...
   // Relaxing assertion for bug 6320749.
   assert(Universe::verify_in_progress() ||
@@ -1397,7 +1380,7 @@
 // Deflate a single monitor if not in use
 // Return true if deflated, false if in use
 bool ObjectSynchronizer::deflate_monitor(ObjectMonitor* mid, oop obj,
-                                         ObjectMonitor** FreeHeadp, ObjectMonitor** FreeTailp) {
+                                         ObjectMonitor** freeHeadp, ObjectMonitor** freeTailp) {
   bool deflated;
   // Normal case ... The monitor is associated with obj.
   guarantee(obj->mark() == markOopDesc::encode(mid), "invariant");
@@ -1427,13 +1410,13 @@
      assert(mid->object() == NULL, "invariant");
 
      // Move the object to the working free list defined by FreeHead,FreeTail.
-     if (*FreeHeadp == NULL) *FreeHeadp = mid;
-     if (*FreeTailp != NULL) {
-       ObjectMonitor * prevtail = *FreeTailp;
+     if (*freeHeadp == NULL) *freeHeadp = mid;
+     if (*freeTailp != NULL) {
+       ObjectMonitor * prevtail = *freeTailp;
        assert(prevtail->FreeNext == NULL, "cleaned up deflated?"); // TODO KK
        prevtail->FreeNext = mid;
       }
-     *FreeTailp = mid;
+     *freeTailp = mid;
      deflated = true;
   }
   return deflated;
@@ -1441,7 +1424,7 @@
 
 // Caller acquires ListLock
 int ObjectSynchronizer::walk_monitor_list(ObjectMonitor** listheadp,
-                                          ObjectMonitor** FreeHeadp, ObjectMonitor** FreeTailp) {
+                                          ObjectMonitor** freeHeadp, ObjectMonitor** freeTailp) {
   ObjectMonitor* mid;
   ObjectMonitor* next;
   ObjectMonitor* curmidinuse = NULL;
@@ -1451,7 +1434,7 @@
      oop obj = (oop) mid->object();
      bool deflated = false;
      if (obj != NULL) {
-       deflated = deflate_monitor(mid, obj, FreeHeadp, FreeTailp);
+       deflated = deflate_monitor(mid, obj, freeHeadp, freeTailp);
      }
      if (deflated) {
        // extract from per-thread in-use-list
@@ -1494,7 +1477,9 @@
       nInCirculation+= cur->omInUseCount;
       int deflatedcount = walk_monitor_list(cur->omInUseList_addr(), &FreeHead, &FreeTail);
       cur->omInUseCount-= deflatedcount;
-      // verifyInUse(cur);
+      if (ObjectMonitor::Knob_VerifyInUse) {
+        verifyInUse(cur);
+      }
       nScavenged += deflatedcount;
       nInuse += cur->omInUseCount;
      }
--- a/hotspot/src/share/vm/runtime/synchronizer.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/synchronizer.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -84,7 +84,7 @@
   static void reenter            (Handle obj, intptr_t recursion, TRAPS);
 
   // thread-specific and global objectMonitor free list accessors
-//  static void verifyInUse (Thread * Self) ; too slow for general assert/debug
+  static void verifyInUse(Thread * Self);
   static ObjectMonitor * omAlloc(Thread * Self);
   static void omRelease(Thread * Self, ObjectMonitor * m, bool FromPerThreadAlloc);
   static void omFlush(Thread * Self);
@@ -114,10 +114,10 @@
   // An adaptive profile-based deflation policy could be used if needed
   static void deflate_idle_monitors();
   static int walk_monitor_list(ObjectMonitor** listheadp,
-                               ObjectMonitor** FreeHeadp,
-                               ObjectMonitor** FreeTailp);
-  static bool deflate_monitor(ObjectMonitor* mid, oop obj, ObjectMonitor** FreeHeadp,
-                              ObjectMonitor** FreeTailp);
+                               ObjectMonitor** freeHeadp,
+                               ObjectMonitor** freeTailp);
+  static bool deflate_monitor(ObjectMonitor* mid, oop obj, ObjectMonitor** freeHeadp,
+                              ObjectMonitor** freeTailp);
   static void oops_do(OopClosure* f);
 
   // debugging
@@ -130,7 +130,10 @@
   enum { _BLOCKSIZE = 128 };
   static ObjectMonitor* gBlockList;
   static ObjectMonitor * volatile gFreeList;
-  static ObjectMonitor * volatile gOmInUseList; // for moribund thread, so monitors they inflated still get scanned
+  // global monitor in use list, for moribund threads,
+  // monitors they inflated need to be scanned for deflation
+  static ObjectMonitor * volatile gOmInUseList;
+  // count of entries in gOmInUseList
   static int gOmInUseCount;
 
 };
--- a/hotspot/src/share/vm/runtime/task.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/task.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * 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,18 +28,6 @@
 #include "runtime/task.hpp"
 #include "runtime/thread.inline.hpp"
 #include "runtime/timer.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 int PeriodicTask::_num_tasks = 0;
 PeriodicTask* PeriodicTask::_tasks[PeriodicTask::max_tasks];
--- a/hotspot/src/share/vm/runtime/thread.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -85,18 +85,6 @@
 #include "utilities/events.hpp"
 #include "utilities/preserveException.hpp"
 #include "utilities/macros.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
 #include "gc_implementation/g1/concurrentMarkThread.inline.hpp"
@@ -1358,14 +1346,24 @@
 }
 
 void WatcherThread::stop() {
-  {
-    MutexLockerEx ml(PeriodicTask_lock, Mutex::_no_safepoint_check_flag);
-    _should_terminate = true;
-    OrderAccess::fence();  // ensure WatcherThread sees update in main loop
-
+  // Get the PeriodicTask_lock if we can. If we cannot, then the
+  // WatcherThread is using it and we don't want to block on that lock
+  // here because that might cause a safepoint deadlock depending on
+  // what the current WatcherThread tasks are doing.
+  bool have_lock = PeriodicTask_lock->try_lock();
+
+  _should_terminate = true;
+  OrderAccess::fence();  // ensure WatcherThread sees update in main loop
+
+  if (have_lock) {
     WatcherThread* watcher = watcher_thread();
-    if (watcher != NULL)
+    if (watcher != NULL) {
+      // If we managed to get the lock, then we should unpark the
+      // WatcherThread so that it can see we want it to stop.
       watcher->unpark();
+    }
+
+    PeriodicTask_lock->unlock();
   }
 
   // it is ok to take late safepoints here, if needed
@@ -4376,7 +4374,7 @@
            if (Yields > 5) {
              os::naked_short_sleep(1);
            } else {
-             os::NakedYield();
+             os::naked_yield();
              ++Yields;
            }
         } else {
@@ -4394,6 +4392,12 @@
   // It's safe if subsequent LDs and STs float "up" into the critical section,
   // but prior LDs and STs within the critical section can't be allowed
   // to reorder or float past the ST that releases the lock.
+  // Loads and stores in the critical section - which appear in program
+  // order before the store that releases the lock - must also appear
+  // before the store that releases the lock in memory visibility order.
+  // Conceptually we need a #loadstore|#storestore "release" MEMBAR before
+  // the ST of 0 into the lock-word which releases the lock, so fence
+  // more than covers this on all platforms.
   *adr = 0;
 }
 
@@ -4575,18 +4579,25 @@
 // This implementation pops from the head of the list.  This is unfair,
 // but tends to provide excellent throughput as hot threads remain hot.
 // (We wake recently run threads first).
-
+//
+// All paths through muxRelease() will execute a CAS.
+// Release consistency -- We depend on the CAS in muxRelease() to provide full
+// bidirectional fence/MEMBAR semantics, ensuring that all prior memory operations
+// executed within the critical section are complete and globally visible before the
+// store (CAS) to the lock-word that releases the lock becomes globally visible.
 void Thread::muxRelease (volatile intptr_t * Lock)  {
   for (;;) {
     const intptr_t w = Atomic::cmpxchg_ptr(0, Lock, LOCKBIT);
     assert(w & LOCKBIT, "invariant");
     if (w == LOCKBIT) return;
-    ParkEvent * List = (ParkEvent *)(w & ~LOCKBIT);
+    ParkEvent * const List = (ParkEvent *) (w & ~LOCKBIT);
     assert(List != NULL, "invariant");
     assert(List->OnList == intptr_t(Lock), "invariant");
-    ParkEvent * nxt = List->ListNext;
+    ParkEvent * const nxt = List->ListNext;
+    guarantee((intptr_t(nxt) & LOCKBIT) == 0, "invariant");
 
     // The following CAS() releases the lock and pops the head element.
+    // The CAS() also ratifies the previously fetched lock-word value.
     if (Atomic::cmpxchg_ptr (intptr_t(nxt), Lock, w) != w) {
       continue;
     }
--- a/hotspot/src/share/vm/runtime/thread.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/thread.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1761,34 +1761,6 @@
   return (CompilerThread*)this;
 }
 
-inline bool JavaThread::stack_guard_zone_unused() {
-  return _stack_guard_state == stack_guard_unused;
-}
-
-inline bool JavaThread::stack_yellow_zone_disabled() {
-  return _stack_guard_state == stack_guard_yellow_disabled;
-}
-
-inline bool JavaThread::stack_yellow_zone_enabled() {
-#ifdef ASSERT
-  if (os::uses_stack_guard_pages()) {
-    assert(_stack_guard_state != stack_guard_unused, "guard pages must be in use");
-  }
-#endif
-    return _stack_guard_state == stack_guard_enabled;
-}
-
-inline size_t JavaThread::stack_available(address cur_sp) {
-  // This code assumes java stacks grow down
-  address low_addr; // Limit on the address for deepest stack depth
-  if (_stack_guard_state == stack_guard_unused) {
-    low_addr =  stack_base() - stack_size();
-  } else {
-    low_addr = stack_yellow_zone_base();
-  }
-  return cur_sp > low_addr ? cur_sp - low_addr : 0;
-}
-
 // A thread used for Compilation.
 class CompilerThread : public JavaThread {
   friend class VMStructs;
@@ -1863,7 +1835,6 @@
   return JavaThread::current()->as_CompilerThread();
 }
 
-
 // The active thread queue. It also keeps track of the current used
 // thread priorities.
 class Threads: AllStatic {
--- a/hotspot/src/share/vm/runtime/thread.inline.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/thread.inline.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * 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,6 +28,7 @@
 #define SHARE_VM_RUNTIME_THREAD_INLINE_HPP_SCOPE
 
 #include "runtime/atomic.inline.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/thread.hpp"
 #ifdef TARGET_OS_FAMILY_linux
 # include "thread_linux.inline.hpp"
@@ -136,4 +137,32 @@
   OrderAccess::fence();
 }
 
+inline bool JavaThread::stack_guard_zone_unused() {
+  return _stack_guard_state == stack_guard_unused;
+}
+
+inline bool JavaThread::stack_yellow_zone_disabled() {
+  return _stack_guard_state == stack_guard_yellow_disabled;
+}
+
+inline size_t JavaThread::stack_available(address cur_sp) {
+  // This code assumes java stacks grow down
+  address low_addr; // Limit on the address for deepest stack depth
+  if (_stack_guard_state == stack_guard_unused) {
+    low_addr =  stack_base() - stack_size();
+  } else {
+    low_addr = stack_yellow_zone_base();
+  }
+  return cur_sp > low_addr ? cur_sp - low_addr : 0;
+}
+
+inline bool JavaThread::stack_yellow_zone_enabled() {
+#ifdef ASSERT
+  if (os::uses_stack_guard_pages()) {
+    assert(_stack_guard_state != stack_guard_unused, "guard pages must be in use");
+  }
+#endif
+  return _stack_guard_state == stack_guard_enabled;
+}
+
 #endif // SHARE_VM_RUNTIME_THREAD_INLINE_HPP
--- a/hotspot/src/share/vm/runtime/threadLocalStorage.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/threadLocalStorage.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,20 +23,9 @@
  */
 
 #include "precompiled.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/thread.inline.hpp"
 #include "runtime/threadLocalStorage.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 // static member initialization
 int ThreadLocalStorage::_thread_index = -1;
--- a/hotspot/src/share/vm/runtime/timer.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/timer.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -26,21 +26,6 @@
 #include "oops/oop.inline.hpp"
 #include "runtime/timer.hpp"
 #include "utilities/ostream.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 double TimeHelper::counter_to_seconds(jlong counter) {
   double count = (double) counter;
--- a/hotspot/src/share/vm/runtime/vframe.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/vframe.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -260,66 +260,156 @@
   return fr().interpreter_frame_method();
 }
 
-StackValueCollection* interpretedVFrame::locals() const {
-  int length = method()->max_locals();
+static StackValue* create_stack_value_from_oop_map(const InterpreterOopMap& oop_mask,
+                                                   int index,
+                                                   const intptr_t* const addr) {
+
+  assert(index >= 0 &&
+         index < oop_mask.number_of_entries(), "invariant");
 
-  if (method()->is_native()) {
-    // If the method is native, max_locals is not telling the truth.
-    // maxlocals then equals the size of parameters
-    length = method()->size_of_parameters();
+  // categorize using oop_mask
+  if (oop_mask.is_oop(index)) {
+    // reference (oop) "r"
+    Handle h(addr != NULL ? (*(oop*)addr) : (oop)NULL);
+    return new StackValue(h);
+  }
+  // value (integer) "v"
+  return new StackValue(addr != NULL ? *addr : 0);
+}
+
+static bool is_in_expression_stack(const frame& fr, const intptr_t* const addr) {
+  assert(addr != NULL, "invariant");
+
+  // Ensure to be 'inside' the expresion stack (i.e., addr >= sp for Intel).
+  // In case of exceptions, the expression stack is invalid and the sp
+  // will be reset to express this condition.
+  if (frame::interpreter_frame_expression_stack_direction() > 0) {
+    return addr <= fr.interpreter_frame_tos_address();
   }
 
-  StackValueCollection* result = new StackValueCollection(length);
+  return addr >= fr.interpreter_frame_tos_address();
+}
+
+static void stack_locals(StackValueCollection* result,
+                         int length,
+                         const InterpreterOopMap& oop_mask,
+                         const frame& fr) {
+
+  assert(result != NULL, "invariant");
+
+  for (int i = 0; i < length; ++i) {
+    const intptr_t* const addr = fr.interpreter_frame_local_at(i);
+    assert(addr != NULL, "invariant");
+    assert(addr >= fr.sp(), "must be inside the frame");
+
+    StackValue* const sv = create_stack_value_from_oop_map(oop_mask, i, addr);
+    assert(sv != NULL, "sanity check");
+
+    result->add(sv);
+  }
+}
+
+static void stack_expressions(StackValueCollection* result,
+                              int length,
+                              int max_locals,
+                              const InterpreterOopMap& oop_mask,
+                              const frame& fr) {
+
+  assert(result != NULL, "invariant");
 
-  // Get oopmap describing oops and int for current bci
+  for (int i = 0; i < length; ++i) {
+    const intptr_t* addr = fr.interpreter_frame_expression_stack_at(i);
+    assert(addr != NULL, "invariant");
+    if (!is_in_expression_stack(fr, addr)) {
+      // Need to ensure no bogus escapes.
+      addr = NULL;
+    }
+
+    StackValue* const sv = create_stack_value_from_oop_map(oop_mask,
+                                                           i + max_locals,
+                                                           addr);
+    assert(sv != NULL, "sanity check");
+
+    result->add(sv);
+  }
+}
+
+StackValueCollection* interpretedVFrame::locals() const {
+  return stack_data(false);
+}
+
+StackValueCollection* interpretedVFrame::expressions() const {
+  return stack_data(true);
+}
+
+/*
+ * Worker routine for fetching references and/or values
+ * for a particular bci in the interpretedVFrame.
+ *
+ * Returns data for either "locals" or "expressions",
+ * using bci relative oop_map (oop_mask) information.
+ *
+ * @param expressions  bool switch controlling what data to return
+                       (false == locals / true == expression)
+ *
+ */
+StackValueCollection* interpretedVFrame::stack_data(bool expressions) const {
+
   InterpreterOopMap oop_mask;
+  // oopmap for current bci
   if (TraceDeoptimization && Verbose) {
-    // need the current JavaThread and not thread()
     methodHandle m_h(Thread::current(), method());
     OopMapCache::compute_one_oop_map(m_h, bci(), &oop_mask);
   } else {
     method()->mask_for(bci(), &oop_mask);
   }
-  // handle locals
-  for(int i=0; i < length; i++) {
-    // Find stack location
-    intptr_t *addr = locals_addr_at(i);
+
+  const int mask_len = oop_mask.number_of_entries();
+
+  // If the method is native, method()->max_locals() is not telling the truth.
+  // For our purposes, max locals instead equals the size of parameters.
+  const int max_locals = method()->is_native() ?
+    method()->size_of_parameters() : method()->max_locals();
+
+  assert(mask_len >= max_locals, "invariant");
+
+  const int length = expressions ? mask_len - max_locals : max_locals;
+  assert(length >= 0, "invariant");
 
-    // Depending on oop/int put it in the right package
-    StackValue *sv;
-    if (oop_mask.is_oop(i)) {
-      // oop value
-      Handle h(*(oop *)addr);
-      sv = new StackValue(h);
-    } else {
-      // integer
-      sv = new StackValue(*addr);
-    }
-    assert(sv != NULL, "sanity check");
-    result->add(sv);
+  StackValueCollection* const result = new StackValueCollection(length);
+
+  if (0 == length) {
+    return result;
   }
+
+  if (expressions) {
+    stack_expressions(result, length, max_locals, oop_mask, fr());
+  } else {
+    stack_locals(result, length, oop_mask, fr());
+  }
+
+  assert(length == result->size(), "invariant");
+
   return result;
 }
 
 void interpretedVFrame::set_locals(StackValueCollection* values) const {
   if (values == NULL || values->size() == 0) return;
 
-  int length = method()->max_locals();
-  if (method()->is_native()) {
-    // If the method is native, max_locals is not telling the truth.
-    // maxlocals then equals the size of parameters
-    length = method()->size_of_parameters();
-  }
+  // If the method is native, max_locals is not telling the truth.
+  // maxlocals then equals the size of parameters
+  const int max_locals = method()->is_native() ?
+    method()->size_of_parameters() : method()->max_locals();
 
-  assert(length == values->size(), "Mismatch between actual stack format and supplied data");
+  assert(max_locals == values->size(), "Mismatch between actual stack format and supplied data");
 
   // handle locals
-  for (int i = 0; i < length; i++) {
+  for (int i = 0; i < max_locals; i++) {
     // Find stack location
     intptr_t *addr = locals_addr_at(i);
 
     // Depending on oop/int put it in the right package
-    StackValue *sv = values->at(i);
+    const StackValue* const sv = values->at(i);
     assert(sv != NULL, "sanity check");
     if (sv->type() == T_OBJECT) {
       *(oop *) addr = (sv->get_obj())();
@@ -329,61 +419,6 @@
   }
 }
 
-StackValueCollection* interpretedVFrame::expressions() const {
-
-  InterpreterOopMap oop_mask;
-
-  if (!method()->is_native()) {
-    // Get oopmap describing oops and int for current bci
-    if (TraceDeoptimization && Verbose) {
-      // need the current JavaThread and not thread()
-      methodHandle m_h(Thread::current(), method());
-      OopMapCache::compute_one_oop_map(m_h, bci(), &oop_mask);
-    } else {
-      method()->mask_for(bci(), &oop_mask);
-    }
-  }
-
-  // If the bci is a call instruction, i.e. any of the invoke* instructions,
-  // the InterpreterOopMap does not include expression/operand stack liveness
-  // info in the oop_mask/bit_mask. This can lead to a discrepancy of what
-  // is actually on the expression stack compared to what is given by the
-  // oop_map. We need to use the length reported in the oop_map.
-  int length = oop_mask.expression_stack_size();
-
-  assert(fr().interpreter_frame_expression_stack_size() >= length,
-    "error in expression stack!");
-
-  StackValueCollection* result = new StackValueCollection(length);
-
-  if (0 == length) {
-    return result;
-  }
-
-  int nof_locals = method()->max_locals();
-
-  // handle expressions
-  for(int i=0; i < length; i++) {
-    // Find stack location
-    intptr_t *addr = fr().interpreter_frame_expression_stack_at(i);
-
-    // Depending on oop/int put it in the right package
-    StackValue *sv;
-    if (oop_mask.is_oop(i + nof_locals)) {
-      // oop value
-      Handle h(*(oop *)addr);
-      sv = new StackValue(h);
-    } else {
-      // integer
-      sv = new StackValue(*addr);
-    }
-    assert(sv != NULL, "sanity check");
-    result->add(sv);
-  }
-  return result;
-}
-
-
 // ------------- cChunk --------------
 
 entryVFrame::entryVFrame(const frame* fr, const RegisterMap* reg_map, JavaThread* thread)
--- a/hotspot/src/share/vm/runtime/vframe.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/vframe.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -186,7 +186,7 @@
  private:
   static const int bcp_offset;
   intptr_t* locals_addr_at(int offset) const;
-
+  StackValueCollection* stack_data(bool expressions) const;
   // returns where the parameters starts relative to the frame pointer
   int start_of_parameters() const;
 
--- a/hotspot/src/share/vm/runtime/virtualspace.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/runtime/virtualspace.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -27,21 +27,6 @@
 #include "oops/oop.inline.hpp"
 #include "runtime/virtualspace.hpp"
 #include "services/memTracker.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
--- a/hotspot/src/share/vm/services/heapDumper.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/services/heapDumper.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -33,6 +33,7 @@
 #include "oops/objArrayKlass.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/jniHandles.hpp"
+#include "runtime/os.hpp"
 #include "runtime/reflectionUtils.hpp"
 #include "runtime/vframe.hpp"
 #include "runtime/vmThread.hpp"
--- a/hotspot/src/share/vm/services/memTracker.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/services/memTracker.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -484,7 +484,7 @@
       // as short sleep.
       os::naked_short_sleep(1);
 #else
-      os::NakedYield();
+      os::naked_yield();
 #endif
     }
   }
--- a/hotspot/src/share/vm/trace/tracetypes.xml	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/trace/tracetypes.xml	Fri Jul 11 05:59:08 2014 -0700
@@ -98,6 +98,7 @@
       <value type="SYMBOL" field="name" label="Name"/>
       <value type="SYMBOL" field="signature" label="Signature"/>
       <value type="SHORT" field="modifiers" label="Access modifiers"/>
+      <value type="BOOLEAN" field="hidden" label="Hidden"/>
     </content_type>
 
     <content_type id="UTFConstant" hr_name="UTF constant"
--- a/hotspot/src/share/vm/utilities/accessFlags.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/utilities/accessFlags.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * 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,22 +26,6 @@
 #include "oops/oop.inline.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "utilities/accessFlags.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
-
 
 void AccessFlags::atomic_set_bits(jint bits) {
   // Atomically update the flags with the bits given
--- a/hotspot/src/share/vm/utilities/bitMap.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/utilities/bitMap.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -28,22 +28,6 @@
 #include "runtime/atomic.inline.hpp"
 #include "utilities/bitMap.inline.hpp"
 #include "utilities/copy.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
-
 
 BitMap::BitMap(bm_word_t* map, idx_t size_in_bits) :
   _map(map), _size(size_in_bits), _map_allocator(false)
--- a/hotspot/src/share/vm/utilities/debug.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/utilities/debug.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -42,6 +42,7 @@
 #include "runtime/atomic.inline.hpp"
 #include "runtime/frame.hpp"
 #include "runtime/java.hpp"
+#include "runtime/os.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/stubCodeGenerator.hpp"
 #include "runtime/stubRoutines.hpp"
@@ -52,18 +53,6 @@
 #include "utilities/events.hpp"
 #include "utilities/top.hpp"
 #include "utilities/vmError.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 #ifndef ASSERT
 #  ifdef _DEBUG
--- a/hotspot/src/share/vm/utilities/events.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/utilities/events.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 #include "memory/allocation.inline.hpp"
 #include "runtime/mutexLocker.hpp"
+#include "runtime/os.inline.hpp"
 #include "runtime/osThread.hpp"
 #include "runtime/thread.inline.hpp"
 #include "runtime/threadCritical.hpp"
--- a/hotspot/src/share/vm/utilities/histogram.hpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/utilities/histogram.hpp	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * 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,21 +28,6 @@
 #include "memory/allocation.hpp"
 #include "runtime/os.hpp"
 #include "utilities/growableArray.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 // This class provides a framework for collecting various statistics.
 // The current implementation is oriented towards counting invocations
--- a/hotspot/src/share/vm/utilities/ostream.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/utilities/ostream.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -27,25 +27,11 @@
 #include "gc_implementation/shared/gcId.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/arguments.hpp"
+#include "runtime/os.hpp"
 #include "utilities/defaultStream.hpp"
 #include "utilities/ostream.hpp"
 #include "utilities/top.hpp"
 #include "utilities/xmlstream.hpp"
-#ifdef TARGET_OS_FAMILY_linux
-# include "os_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "os_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "os_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_aix
-# include "os_aix.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "os_bsd.inline.hpp"
-#endif
 
 extern "C" void jio_print(const char* s); // Declarationtion of jvm method
 
--- a/hotspot/src/share/vm/utilities/taskqueue.cpp	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/src/share/vm/utilities/taskqueue.cpp	Fri Jul 11 05:59:08 2014 -0700
@@ -142,7 +142,7 @@
 
 void ParallelTaskTerminator::yield() {
   assert(_offered_termination <= _n_threads, "Invariant");
-  os::yield();
+  os::naked_yield();
 }
 
 void ParallelTaskTerminator::sleep(uint millis) {
--- a/hotspot/test/compiler/6775880/Test.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/test/compiler/6775880/Test.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
  * @test
  * @bug 6775880
  * @summary EA +DeoptimizeALot: assert(mon_info->owner()->is_locked(),"object must be locked now")
- * @compile -source 1.4 -target 1.4 Test.java
  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xbatch -XX:+DoEscapeAnalysis -XX:+DeoptimizeALot -XX:CompileCommand=exclude,java.lang.AbstractStringBuilder::append Test
  */
 
--- a/hotspot/test/compiler/8009761/Test8009761.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/test/compiler/8009761/Test8009761.java	Fri Jul 11 05:59:08 2014 -0700
@@ -21,11 +21,7 @@
  * questions.
  */
 
-import com.sun.management.HotSpotDiagnosticMXBean;
-import com.sun.management.VMOption;
 import sun.hotspot.WhiteBox;
-import sun.management.ManagementFactoryHelper;
-
 import java.lang.reflect.Method;
 
 /*
@@ -40,6 +36,7 @@
 public class Test8009761 {
 
     private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
+    private static int COMP_LEVEL_SIMPLE = 1;
     private static int COMP_LEVEL_FULL_OPTIMIZATION = 4;
     private static Method m3 = null;
 
@@ -236,7 +233,7 @@
 
     static public void main(String[] args) {
         // Make sure background compilation is disabled
-        if (backgroundCompilationEnabled()) {
+        if (WHITE_BOX.getBooleanVMFlag("BackgroundCompilation")) {
             throw new RuntimeException("Background compilation enabled");
         }
 
@@ -256,7 +253,11 @@
         c1 = count;
 
         // Force the compilation of m3() that will inline m1()
-        WHITE_BOX.enqueueMethodForCompilation(m3, COMP_LEVEL_FULL_OPTIMIZATION);
+        if(!WHITE_BOX.enqueueMethodForCompilation(m3, COMP_LEVEL_FULL_OPTIMIZATION)) {
+            // C2 compiler not available, compile with C1
+            WHITE_BOX.enqueueMethodForCompilation(m3, COMP_LEVEL_SIMPLE);
+        }
+
         // Because background compilation is disabled, method should now be compiled
         if(!WHITE_BOX.isMethodCompiled(m3)) {
             throw new RuntimeException(m3 + " not compiled");
@@ -278,19 +279,4 @@
             System.out.println("PASSED " + c1);
         }
     }
-
-    /**
-     * Checks if background compilation (-XX:+BackgroundCompilation) is enabled.
-     * @return True if background compilation is enabled, false otherwise
-     */
-    private static boolean backgroundCompilationEnabled() {
-      HotSpotDiagnosticMXBean diagnostic = ManagementFactoryHelper.getDiagnosticMXBean();
-      VMOption backgroundCompilation;
-      try {
-          backgroundCompilation = diagnostic.getVMOption("BackgroundCompilation");
-      } catch (IllegalArgumentException e) {
-          return false;
-      }
-      return Boolean.valueOf(backgroundCompilation.getValue());
-    }
 }
--- a/hotspot/test/compiler/ciReplay/TestSA.sh	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/test/compiler/ciReplay/TestSA.sh	Fri Jul 11 05:59:08 2014 -0700
@@ -26,6 +26,7 @@
 ##
 ## @test
 ## @bug 8011675
+## @ignore 8032226, 8031978
 ## @summary testing of ciReplay with using generated by SA replay.txt 
 ## @author igor.ignatyev@oracle.com
 ## @run shell TestSA.sh
--- a/hotspot/test/compiler/ciReplay/TestVM.sh	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/test/compiler/ciReplay/TestVM.sh	Fri Jul 11 05:59:08 2014 -0700
@@ -26,6 +26,7 @@
 ##
 ## @test
 ## @bug 8011675
+## @ignore 8031978
 ## @summary testing of ciReplay with using generated by VM replay.txt 
 ## @author igor.ignatyev@oracle.com
 ## @run shell TestVM.sh
--- a/hotspot/test/compiler/ciReplay/TestVM_no_comp_level.sh	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/test/compiler/ciReplay/TestVM_no_comp_level.sh	Fri Jul 11 05:59:08 2014 -0700
@@ -26,6 +26,7 @@
 ##
 ## @test
 ## @bug 8011675
+## @ignore 8031978
 ## @summary testing of ciReplay with using generated by VM replay.txt w/o comp_level
 ## @author igor.ignatyev@oracle.com
 ## @run shell TestVM_no_comp_level.sh
--- a/hotspot/test/compiler/tiered/NonTieredLevelsTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/test/compiler/tiered/NonTieredLevelsTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -25,6 +25,7 @@
 
 /**
  * @test NonTieredLevelsTest
+ * @ignore 8046268
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
  * @build NonTieredLevelsTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/compiler/tiered/TieredLevelsTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/test/compiler/tiered/TieredLevelsTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -23,6 +23,7 @@
 
 /**
  * @test TieredLevelsTest
+ * @ignore 8046268
  * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
  * @build TieredLevelsTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/compiler/whitebox/ClearMethodStateTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/test/compiler/whitebox/ClearMethodStateTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -25,6 +25,7 @@
 
 /*
  * @test ClearMethodStateTest
+ * @ignore 8046268
  * @bug 8006683 8007288 8022832
  * @library /testlibrary /testlibrary/whitebox
  * @build ClearMethodStateTest
--- a/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test DeoptimizeAllTest
+ * @ignore 8046268
  * @bug 8006683 8007288 8022832
  * @library /testlibrary /testlibrary/whitebox
  * @build DeoptimizeAllTest
--- a/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test DeoptimizeMethodTest
+ * @ignore 8046268
  * @bug 8006683 8007288 8022832
  * @library /testlibrary /testlibrary/whitebox
  * @build DeoptimizeMethodTest
--- a/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test EnqueueMethodForCompilationTest
+ * @ignore 8046268
  * @bug 8006683 8007288 8022832
  * @library /testlibrary /testlibrary/whitebox
  * @build EnqueueMethodForCompilationTest
--- a/hotspot/test/compiler/whitebox/GetNMethodTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/test/compiler/whitebox/GetNMethodTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -26,6 +26,7 @@
 
 /*
  * @test GetNMethodTest
+ * @ignore 8046268
  * @bug 8038240
  * @library /testlibrary /testlibrary/whitebox
  * @build GetNMethodTest
--- a/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -23,6 +23,7 @@
 
 /*
  * @test MakeMethodNotCompilableTest
+ * @ignore 8046268
  * @bug 8012322 8006683 8007288 8022832
  * @library /testlibrary /testlibrary/whitebox
  * @build MakeMethodNotCompilableTest
--- a/hotspot/test/runtime/6626217/Test6626217.sh	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/test/runtime/6626217/Test6626217.sh	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 # 
-#  Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+#  Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
 #  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,7 +54,7 @@
 
 # Compile all the usual suspects, including the default 'many_loader'
 ${CP} many_loader1.java.foo many_loader.java
-${JAVAC} ${TESTJAVACOPTS} -source 1.4 -target 1.4 -Xlint *.java
+${JAVAC} ${TESTJAVACOPTS} -Xlint *.java
 
 # Rename the class files, so the custom loader (and not the system loader) will find it
 ${MV} from_loader2.class from_loader2.impl2
@@ -62,7 +62,7 @@
 # Compile the next version of 'many_loader'
 ${MV} many_loader.class many_loader.impl1
 ${CP} many_loader2.java.foo many_loader.java
-${JAVAC} ${TESTJAVACOPTS} -source 1.4 -target 1.4 -Xlint many_loader.java
+${JAVAC} ${TESTJAVACOPTS} -Xlint many_loader.java
 
 # Rename the class file, so the custom loader (and not the system loader) will find it
 ${MV} many_loader.class many_loader.impl2
--- a/hotspot/test/runtime/8003720/Test8003720.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/test/runtime/8003720/Test8003720.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * 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,7 @@
  * @test
  * @bug 8003720
  * @summary Method in interpreter stack frame can be deallocated
- * @compile -XDignore.symbol.file -source 1.7 -target 1.7 Victim.java
+ * @compile -XDignore.symbol.file Victim.java
  * @run main/othervm -Xverify:all -Xint Test8003720
  */
 
--- a/hotspot/test/runtime/Unsafe/RangeCheck.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/hotspot/test/runtime/Unsafe/RangeCheck.java	Fri Jul 11 05:59:08 2014 -0700
@@ -43,6 +43,7 @@
                 true,
                 "-Xmx32m",
                 "-XX:-TransmitErrorReport",
+                "-XX:-InlineUnsafeOps", // The compiler intrinsics doesn't have the assert
                 DummyClassWithMainRangeCheck.class.getName());
 
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/verifier/OverriderMsg.java	Fri Jul 11 05:59:08 2014 -0700
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.io.FileOutputStream;
+import jdk.internal.org.objectweb.asm.ClassWriter;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import static jdk.internal.org.objectweb.asm.Opcodes.*;
+import com.oracle.java.testlibrary.*;
+
+/*
+ * @test OverriderMsg
+ * @bug 8026894
+ * @library /testlibrary
+ * @compile -XDignore.symbol.file OverriderMsg.java
+ * @run main/othervm OverriderMsg
+ */
+
+// This test checks that the super class name is included in the message when
+// a method is detected overriding a final method in its super class.  The
+// asm part of the test creates these two classes:
+//
+//     public class HasFinal {
+//         public final void m(String s) { }
+//     }
+//
+//     public class Overrider extends HasFinal {
+//         public void m(String s) { }
+//         public static void main(String[] args) { }
+//     }
+//
+public class OverriderMsg {
+
+    public static void dump_HasFinal () throws Exception {
+
+        ClassWriter cw = new ClassWriter(0);
+        MethodVisitor mv;
+
+        cw.visit(V1_7, ACC_PUBLIC + ACC_SUPER, "HasFinal", null, "java/lang/Object", null);
+
+        {
+            mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
+            mv.visitCode();
+            mv.visitVarInsn(ALOAD, 0);
+            mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
+            mv.visitInsn(RETURN);
+            mv.visitMaxs(1, 1);
+            mv.visitEnd();
+        }
+        {
+            mv = cw.visitMethod(ACC_PUBLIC + ACC_FINAL, "m", "(Ljava/lang/String;)V", null, null);
+            mv.visitCode();
+            mv.visitInsn(RETURN);
+            mv.visitMaxs(0, 2);
+            mv.visitEnd();
+        }
+        cw.visitEnd();
+        try (FileOutputStream fos = new FileOutputStream(new File("HasFinal.class"))) {
+             fos.write(cw.toByteArray());
+        }
+    }
+
+
+    public static void dump_Overrider () throws Exception {
+
+        ClassWriter cw = new ClassWriter(0);
+        MethodVisitor mv;
+        cw.visit(V1_7, ACC_PUBLIC + ACC_SUPER, "Overrider", null, "HasFinal", null);
+
+        {
+            mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
+            mv.visitCode();
+            mv.visitVarInsn(ALOAD, 0);
+            mv.visitMethodInsn(INVOKESPECIAL, "HasFinal", "<init>", "()V");
+            mv.visitInsn(RETURN);
+            mv.visitMaxs(1, 1);
+            mv.visitEnd();
+        }
+        {
+            mv = cw.visitMethod(ACC_PUBLIC, "m", "(Ljava/lang/String;)V", null, null);
+            mv.visitCode();
+            mv.visitInsn(RETURN);
+            mv.visitMaxs(0, 2);
+            mv.visitEnd();
+        }
+        {
+            mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "main", "([Ljava/lang/String;)V", null, null);
+            mv.visitCode();
+            mv.visitInsn(RETURN);
+            mv.visitMaxs(0, 1);
+            mv.visitEnd();
+        }
+        cw.visitEnd();
+
+        try (FileOutputStream fos = new FileOutputStream(new File("Overrider.class"))) {
+             fos.write(cw.toByteArray());
+        }
+    }
+
+
+    public static void main(String... args) throws Exception {
+        dump_HasFinal();
+        dump_Overrider();
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-cp", ".",  "Overrider");
+        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        output.shouldContain(
+            "java.lang.VerifyError: class Overrider overrides final method HasFinal.m(Ljava/lang/String;)V");
+        output.shouldHaveExitValue(1);
+    }
+
+}
--- a/jaxp/.hgtags	Wed Jul 09 16:44:30 2014 +0200
+++ b/jaxp/.hgtags	Fri Jul 11 05:59:08 2014 -0700
@@ -261,3 +261,5 @@
 a1461221b05d4620e4d7d1907e2a0282aaedf31c jdk9-b16
 6f923fcbe5129eceb9617a9a18dbdd743980e785 jdk9-b17
 5afa90c28742d175431be75f9098745510bd2b30 jdk9-b18
+f9c82769a6bc2b219a8f01c24afe5c91039267d7 jdk9-b19
+94fd4d9d3a75819644b21e18c8a567fd0e973eaf jdk9-b20
--- a/jaxws/.hgtags	Wed Jul 09 16:44:30 2014 +0200
+++ b/jaxws/.hgtags	Fri Jul 11 05:59:08 2014 -0700
@@ -264,3 +264,5 @@
 1e1a3b2215b7551d88e89d1ca8c1e1ebe3d3c0ab jdk9-b16
 6b159e727dac283f424b7d19f5be3ddd9f85acf5 jdk9-b17
 275f2385aed80c84297840638d58656366350c58 jdk9-b18
+7f922a73e8a2c6ce42634238090fce7c6d599541 jdk9-b19
+6a9f8ff45c04a172df446a418c586da6a86564d5 jdk9-b20
--- a/jdk/.hgtags	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/.hgtags	Fri Jul 11 05:59:08 2014 -0700
@@ -261,3 +261,5 @@
 ab7d2c565b0de5bee1361d282d4029371327fc9e jdk9-b16
 fd8e675f141b9bdb2f46d1ae8251f4ee3a895d64 jdk9-b17
 6ad17b31f0d30593392b1e8695b9709dbbd7fb70 jdk9-b18
+27561aede285c25a3e9ed8bf8918234ad3bb81e3 jdk9-b19
+f87c5be90e01a7ffb47947108eb3e0b0b1920880 jdk9-b20
--- a/jdk/THIRD_PARTY_README	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/THIRD_PARTY_README	Fri Jul 11 05:59:08 2014 -0700
@@ -1471,7 +1471,7 @@
 version 2.0.
 
 The NSS libraries are supplied in executable form, built from unmodified
-NSS source code labeled with the "NSS_3.13.1_RTM" release tag.
+NSS source code labeled with the "NSS_3_16_RTM" HG tag.
 
 The NSS source code is available in the OpenJDK source code repository at:
     jdk/test/sun/security/pkcs11/nss/src
--- a/jdk/make/CompileDemos.gmk	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/make/CompileDemos.gmk	Fri Jul 11 05:59:08 2014 -0700
@@ -1,6 +1,5 @@
-
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -320,7 +319,6 @@
 endif
 
 $(eval $(call SetupJVMTIDemo,hprof, java_crw_demo, \
-    -I$(JDK_TOPDIR)/src/share/npt -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt \
     $(BUILD_LIBHPROF_AIX_EXTRA_CFLAGS), C, \
     -ldl, ws2_32.lib winmm.lib, -lsocket -lnsl, -lpthread, $(BUILD_LIBHPROF_AIX_EXTRA_SRC)))
 
--- a/jdk/make/CreateJars.gmk	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/make/CreateJars.gmk	Fri Jul 11 05:59:08 2014 -0700
@@ -676,15 +676,6 @@
 
 ##########################################################################################
 
-#
-# This is an empty jar (only contains manifest) and fits poorly into framework...
-# create simple rule instead
-#
-$(IMAGES_OUTPUTDIR)/lib/management-agent.jar: $(JDK_TOPDIR)/src/share/classes/sun/management/manifest
-	$(JAR) cfm $@ $<
-
-##########################################################################################
-
 # This file is imported from hotspot in Import.gmk. Copying it into images/lib so that
 # all jars can be found in one place when creating images in Images.gmk. It needs to be
 # done here so that clean targets can be simple and accurate.
--- a/jdk/make/lib/CoreLibraries.gmk	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/make/lib/CoreLibraries.gmk	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -526,30 +526,3 @@
   BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/libjli_static.a
 
 endif
-
-##########################################################################################
-
-$(eval $(call SetupNativeCompilation,BUILD_LIBNPT, \
-    LIBRARY := npt, \
-    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
-    SRC := $(JDK_TOPDIR)/src/share/npt $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt, \
-    LANG := C, \
-    OPTIMIZATION := LOW, \
-    CFLAGS := $(CFLAGS_JDKLIB) \
-        -I$(JDK_TOPDIR)/src/share/npt \
-        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt, \
-    MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libnpt/mapfile-vers, \
-    LDFLAGS := $(LDFLAGS_JDKLIB) \
-        $(call SET_SHARED_LIBRARY_ORIGIN), \
-    LDFLAGS_macosx := -liconv, \
-    LDFLAGS_SUFFIX_windows := -export:nptInitialize -export:nptTerminate, \
-    LDFLAGS_SUFFIX_solaris := -lc, \
-    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
-    RC_FLAGS := $(RC_FLAGS) \
-        -D "JDK_FNAME=npt.dll" \
-        -D "JDK_INTERNAL_NAME=npt" \
-        -D "JDK_FTYPE=0x2L", \
-    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libnpt, \
-    DEBUG_SYMBOLS := true))
-
-BUILD_LIBRARIES += $(BUILD_LIBNPT)
--- a/jdk/make/lib/ServiceabilityLibraries.gmk	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/make/lib/ServiceabilityLibraries.gmk	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -147,8 +147,6 @@
     CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) -DJDWP_LOGGING \
         -I$(JDK_TOPDIR)/src/share/transport/export \
         -I$(JDK_TOPDIR)/src/share/back/export \
-        -I$(JDK_TOPDIR)/src/share/npt \
-        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt \
         -I$(JDK_TOPDIR)/src/share/back \
         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/back \
         -I$(JDK_OUTPUTDIR)/gensrc_jdwp_headers, \
@@ -158,6 +156,7 @@
     LDFLAGS_SUFFIX_linux := $(LIBDL), \
     LDFLAGS_SUFFIX_solaris := $(LIBDL) -lc, \
     LDFLAGS_SUFFIX_windows := $(LDFLAGS_JDKLIB_SUFFIX), \
+    LDFLAGS_SUFFIX_macosx := -liconv, \
     VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
     RC_FLAGS := $(RC_FLAGS) \
         -D "JDK_FNAME=jdwp.dll" \
@@ -340,8 +339,6 @@
 
 BUILD_LIBHPROF_SRC := $(JDK_TOPDIR)/src/share/demo/jvmti/hprof $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/demo/jvmti/hprof
 BUILD_LIBHPROF_CFLAGS := -I$(JDK_TOPDIR)/src/share/demo/jvmti/hprof \
-    -I$(JDK_TOPDIR)/src/share/npt \
-    -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt \
     -I$(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo
 
 ifeq ($(OPENJDK_TARGET_OS), aix)
--- a/jdk/make/mapfiles/libnpt/mapfile-vers	Wed Jul 09 16:44:30 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-#
-# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
-# 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.
-#
-
-# Define public interface.
-
-SUNWprivate_1.1 {
-	global:
-	    nptInitialize;
-	    nptTerminate;
-	local:
-	    *;
-};
--- a/jdk/make/profile-includes.txt	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/make/profile-includes.txt	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -127,12 +127,9 @@
     $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsdt.diz \
     $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)management$(SHARED_LIBRARY_SUFFIX) \
     $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)management.diz \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)npt$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)npt.diz \
     $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)prefs$(SHARED_LIBRARY_SUFFIX) \
     $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)sctp$(SHARED_LIBRARY_SUFFIX) \
     jvm.hprof.txt \
-    management-agent.jar \
     management/jmxremote.access \
     management/jmxremote.password.template \
     management/management.properties \
@@ -140,8 +137,7 @@
 
 PROFILE_3_JRE_OTHER_FILES :=
 
-PROFILE_3_JRE_JAR_FILES := \
-    management-agent.jar
+PROFILE_3_JRE_JAR_FILES :=
 
 
 FULL_JRE_BIN_FILES := \
--- a/jdk/make/src/classes/build/tools/buildmetaindex/BuildMetaIndex.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/make/src/classes/build/tools/buildmetaindex/BuildMetaIndex.java	Fri Jul 11 05:59:08 2014 -0700
@@ -53,7 +53,6 @@
 com/sun/net/
 javax/
 com/sun/security/
-# management-agent.jar
 ! rt.jar
 org/w3c/
 com/sun/image/
--- a/jdk/src/share/back/debugInit.c	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/back/debugInit.c	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -202,8 +202,6 @@
     jint              jvmtiCompileTimeMajorVersion;
     jint              jvmtiCompileTimeMinorVersion;
     jint              jvmtiCompileTimeMicroVersion;
-    char              *boot_path = NULL;
-    char              npt_lib[MAXPATHLEN];
 
     /* See if it's already loaded */
     if ( gdata!=NULL && gdata->isLoaded==JNI_TRUE ) {
@@ -268,24 +266,6 @@
         forceExit(1); /* Kill entire process, no core dump wanted */
     }
 
-    JVMTI_FUNC_PTR(gdata->jvmti, GetSystemProperty)
-        (gdata->jvmti, (const char *)"sun.boot.library.path",
-         &boot_path);
-
-    dbgsysBuildLibName(npt_lib, sizeof(npt_lib), boot_path, NPT_LIBNAME);
-    /* Npt and Utf function init */
-    NPT_INITIALIZE(npt_lib, &(gdata->npt), NPT_VERSION, NULL);
-    jvmtiDeallocate(boot_path);
-    if (gdata->npt == NULL) {
-        ERROR_MESSAGE(("JDWP: unable to initialize NPT library"));
-        return JNI_ERR;
-    }
-    gdata->npt->utf = (gdata->npt->utfInitialize)(NULL);
-    if (gdata->npt->utf == NULL) {
-        ERROR_MESSAGE(("JDWP: UTF function initialization failed"));
-        return JNI_ERR;
-    }
-
     /* Parse input options */
     if (!parseOptions(options)) {
         /* No message necessary, should have been printed out already */
@@ -1307,22 +1287,26 @@
     if ( error != JVMTI_ERROR_NONE ) {
         exit_code = 1;
         if ( docoredump ) {
+            LOG_MISC(("Dumping core as requested by command line"));
             finish_logging(exit_code);
             abort();
         }
     }
+
     if ( msg==NULL ) {
         msg = "";
     }
 
     LOG_MISC(("Exiting with error %s(%d): %s", jvmtiErrorText(error), error, msg));
 
-    gdata->vmDead = JNI_TRUE;
+    if (gdata != NULL) {
+        gdata->vmDead = JNI_TRUE;
 
-    /* Let's try and cleanup the JVMTI, if we even have one */
-    if ( gdata->jvmti != NULL ) {
-        /* Dispose of jvmti (gdata->jvmti becomes NULL) */
-        disposeEnvironment(gdata->jvmti);
+        /* Let's try and cleanup the JVMTI, if we even have one */
+        if ( gdata->jvmti != NULL ) {
+            /* Dispose of jvmti (gdata->jvmti becomes NULL) */
+            disposeEnvironment(gdata->jvmti);
+        }
     }
 
     /* Finish up logging. We reach here if JDWP is doing the exiting. */
--- a/jdk/src/share/back/error_messages.c	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/back/error_messages.c	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * 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,7 @@
 #include <errno.h>
 
 #include "util.h"
+#include "utf_util.h"
 #include "proc_md.h"
 
 /* Maximim length of a message */
@@ -70,13 +71,8 @@
     len = (int)strlen((char*)utf8buf);
 
     /* Convert to platform encoding (ignore errors, dangerous area) */
-    if (gdata->npt != NULL) {
-        (void)(gdata->npt->utf8ToPlatform)(gdata->npt->utf,
-               utf8buf, len, pbuf, MAX_MESSAGE_LEN);
-    } else {
-        /* May be called before NPT is initialized so don't fault */
-        strncpy(pbuf, (char*)utf8buf, len);
-    }
+    (void)utf8ToPlatform(utf8buf, len, pbuf, MAX_MESSAGE_LEN);
+
     (void)fprintf(fp, "%s%s%s", prefix, pbuf, suffix);
 }
 
--- a/jdk/src/share/back/inStream.c	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/back/inStream.c	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
  */
 
 #include "util.h"
+#include "utf_util.h"
 #include "stream.h"
 #include "inStream.h"
 #include "transport.h"
@@ -379,15 +380,12 @@
         string[length] = '\0';
 
         /* This is Standard UTF-8, convert to Modified UTF-8 if necessary */
-        new_length = (gdata->npt->utf8sToUtf8mLength)
-                             (gdata->npt->utf, (jbyte*)string, length);
+        new_length = utf8sToUtf8mLength((jbyte*)string, length);
         if ( new_length != length ) {
             char *new_string;
 
             new_string = jvmtiAllocate(new_length+1);
-            (gdata->npt->utf8sToUtf8m)
-                             (gdata->npt->utf, (jbyte*)string, length,
-                              (jbyte*)new_string, new_length);
+            utf8sToUtf8m((jbyte*)string, length, (jbyte*)new_string, new_length);
             jvmtiDeallocate(string);
             return new_string;
         }
--- a/jdk/src/share/back/outStream.c	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/back/outStream.c	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
  */
 
 #include "util.h"
+#include "utf_util.h"
 #include "stream.h"
 #include "outStream.h"
 #include "inStream.h"
@@ -307,8 +308,7 @@
     } else {
         jint      new_length;
 
-        new_length = (gdata->npt->utf8mToUtf8sLength)
-                            (gdata->npt->utf, (jbyte*)string, length);
+        new_length = utf8mToUtf8sLength((jbyte*)string, length);
         if ( new_length == length ) {
             (void)outStream_writeInt(stream, length);
             error = writeBytes(stream, (jbyte *)string, length);
@@ -316,9 +316,7 @@
             char *new_string;
 
             new_string = jvmtiAllocate(new_length+1);
-            (gdata->npt->utf8mToUtf8s)
-                            (gdata->npt->utf, (jbyte*)string, length,
-                             (jbyte*)new_string, new_length);
+            utf8mToUtf8s((jbyte*)string, length, (jbyte*)new_string, new_length);
             (void)outStream_writeInt(stream, new_length);
             error = writeBytes(stream, (jbyte *)new_string, new_length);
             jvmtiDeallocate(new_string);
--- a/jdk/src/share/back/transport.c	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/back/transport.c	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
  */
 
 #include "util.h"
+#include "utf_util.h"
 #include "transport.h"
 #include "debugLoop.h"
 #include "sys.h"
@@ -65,8 +66,7 @@
         len = (int)strlen(msg);
         maxlen = len+len/2+2; /* Should allow for plenty of room */
         utf8msg = (jbyte*)jvmtiAllocate(maxlen+1);
-        (void)(gdata->npt->utf8FromPlatform)(gdata->npt->utf,
-            msg, len, utf8msg, maxlen);
+        (void)utf8FromPlatform(msg, len, utf8msg, maxlen);
         utf8msg[maxlen] = 0;
     }
     if (rv == JDWPTRANSPORT_ERROR_NONE) {
@@ -110,8 +110,7 @@
         int  len;
 
         len = (int)strlen(libdir);
-        (void)(gdata->npt->utf8ToPlatform)(gdata->npt->utf,
-            (jbyte*)libdir, len, buf, (int)sizeof(buf));
+        (void)utf8ToPlatform((jbyte*)libdir, len, buf, (int)sizeof(buf));
         plibdir = buf;
     }
 
@@ -392,8 +391,7 @@
     /* Convert commandLine from UTF-8 to platform encoding */
     len = (int)strlen(commandLine);
     buf = jvmtiAllocate(len*3+3);
-    (void)(gdata->npt->utf8ToPlatform)(gdata->npt->utf,
-        (jbyte*)commandLine, len, buf, len*3+3);
+    (void)utf8ToPlatform((jbyte*)commandLine, len, buf, len*3+3);
 
     /* Exec commandLine */
     rc = dbgsysExec(buf);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/back/utf_util.c	Fri Jul 11 05:59:08 2014 -0700
@@ -0,0 +1,540 @@
+/*
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+#include <stdlib.h>
+#include <ctype.h>
+
+#include "jni.h"
+
+#include "utf_util.h"
+
+
+/* Error and assert macros */
+#define UTF_ERROR(m) utfError(__FILE__, __LINE__,  m)
+#define UTF_ASSERT(x) ( (x)==0 ? UTF_ERROR("ASSERT ERROR " #x) : (void)0 )
+
+// Platform independed part
+
+static void utfError(char *file, int line, char *message) {
+    (void)fprintf(stderr, "UTF ERROR [\"%s\":%d]: %s\n", file, line, message);
+    abort();
+}
+
+/* Determine length of this Standard UTF-8 in Modified UTF-8.
+ *    Validation is done of the basic UTF encoding rules, returns
+ *    length (no change) when errors are detected in the UTF encoding.
+ *
+ *    Note: Accepts Modified UTF-8 also, no verification on the
+ *          correctness of Standard UTF-8 is done. e,g, 0xC080 input is ok.
+ */
+int JNICALL utf8sToUtf8mLength(jbyte *string, int length) {
+  int newLength;
+  int i;
+
+  newLength = 0;
+  for ( i = 0 ; i < length ; i++ ) {
+    unsigned byte;
+
+    byte = (unsigned char)string[i];
+    if ( (byte & 0x80) == 0 ) { /* 1byte encoding */
+      newLength++;
+      if ( byte == 0 ) {
+        newLength++; /* We gain one byte in length on NULL bytes */
+      }
+    } else if ( (byte & 0xE0) == 0xC0 ) { /* 2byte encoding */
+      /* Check encoding of following bytes */
+      if ( (i+1) >= length || (string[i+1] & 0xC0) != 0x80 ) {
+        break; /* Error condition */
+      }
+      i++; /* Skip next byte */
+      newLength += 2;
+    } else if ( (byte & 0xF0) == 0xE0 ) { /* 3byte encoding */
+      /* Check encoding of following bytes */
+      if ( (i+2) >= length || (string[i+1] & 0xC0) != 0x80
+        || (string[i+2] & 0xC0) != 0x80 ) {
+        break; /* Error condition */
+        }
+        i += 2; /* Skip next two bytes */
+        newLength += 3;
+    } else if ( (byte & 0xF8) == 0xF0 ) { /* 4byte encoding */
+      /* Check encoding of following bytes */
+      if ( (i+3) >= length || (string[i+1] & 0xC0) != 0x80
+        || (string[i+2] & 0xC0) != 0x80
+        || (string[i+3] & 0xC0) != 0x80 ) {
+        break; /* Error condition */
+        }
+        i += 3; /* Skip next 3 bytes */
+        newLength += 6; /* 4byte encoding turns into 2 3byte ones */
+    } else {
+      break; /* Error condition */
+    }
+  }
+  if ( i != length ) {
+    /* Error in finding new length, return old length so no conversion */
+    /* FIXUP: ERROR_MESSAGE? */
+    return length;
+  }
+  return newLength;
+}
+
+/* Convert Standard UTF-8 to Modified UTF-8.
+ *    Assumes the UTF-8 encoding was validated by utf8mLength() above.
+ *
+ *    Note: Accepts Modified UTF-8 also, no verification on the
+ *          correctness of Standard UTF-8 is done. e,g, 0xC080 input is ok.
+ */
+void JNICALL utf8sToUtf8m(jbyte *string, int length, jbyte *newString, int newLength) {
+    int i;
+    int j;
+
+    j = 0;
+    for ( i = 0 ; i < length ; i++ ) {
+        unsigned byte1;
+
+        byte1 = (unsigned char)string[i];
+
+        /* NULL bytes and bytes starting with 11110xxx are special */
+        if ( (byte1 & 0x80) == 0 ) { /* 1byte encoding */
+            if ( byte1 == 0 ) {
+                /* Bits out: 11000000 10000000 */
+                newString[j++] = (jbyte)0xC0;
+                newString[j++] = (jbyte)0x80;
+            } else {
+                /* Single byte */
+                newString[j++] = byte1;
+            }
+        } else if ( (byte1 & 0xE0) == 0xC0 ) { /* 2byte encoding */
+            newString[j++] = byte1;
+            newString[j++] = string[++i];
+        } else if ( (byte1 & 0xF0) == 0xE0 ) { /* 3byte encoding */
+            newString[j++] = byte1;
+            newString[j++] = string[++i];
+            newString[j++] = string[++i];
+        } else if ( (byte1 & 0xF8) == 0xF0 ) { /* 4byte encoding */
+            /* Beginning of 4byte encoding, turn into 2 3byte encodings */
+            unsigned byte2, byte3, byte4, u21;
+
+            /* Bits in: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */
+            byte2 = (unsigned char)string[++i];
+            byte3 = (unsigned char)string[++i];
+            byte4 = (unsigned char)string[++i];
+            /* Reconstruct full 21bit value */
+            u21  = (byte1 & 0x07) << 18;
+            u21 += (byte2 & 0x3F) << 12;
+            u21 += (byte3 & 0x3F) << 6;
+            u21 += (byte4 & 0x3F);
+            /* Bits out: 11101101 1010xxxx 10xxxxxx */
+            newString[j++] = (jbyte)0xED;
+            newString[j++] = (jbyte)(0xA0 + (((u21 >> 16) - 1) & 0x0F));
+            newString[j++] = (jbyte)(0x80 + ((u21 >> 10) & 0x3F));
+            /* Bits out: 11101101 1011xxxx 10xxxxxx */
+            newString[j++] = (jbyte)0xED;
+            newString[j++] = (jbyte)(0xB0 + ((u21 >>  6) & 0x0F));
+            newString[j++] = byte4;
+        }
+    }
+    UTF_ASSERT(i==length);
+    UTF_ASSERT(j==newLength);
+    newString[j] = (jbyte)0;
+}
+
+/* Given a Modified UTF-8 string, calculate the Standard UTF-8 length.
+ *   Basic validation of the UTF encoding rules is done, and length is
+ *   returned (no change) when errors are detected.
+ *
+ *   Note: No validation is made that this is indeed Modified UTF-8 coming in.
+ *
+ */
+int JNICALL utf8mToUtf8sLength(jbyte *string, int length) {
+    int newLength;
+    int i;
+
+    newLength = 0;
+    for ( i = 0 ; i < length ; i++ ) {
+        unsigned byte1, byte2, byte3, byte4, byte5, byte6;
+
+        byte1 = (unsigned char)string[i];
+        if ( (byte1 & 0x80) == 0 ) { /* 1byte encoding */
+            newLength++;
+        } else if ( (byte1 & 0xE0) == 0xC0 ) { /* 2byte encoding */
+            /* Check encoding of following bytes */
+            if ( (i+1) >= length || (string[i+1] & 0xC0) != 0x80 ) {
+                break; /* Error condition */
+            }
+            byte2 = (unsigned char)string[++i];
+            if ( byte1 != 0xC0 || byte2 != 0x80 ) {
+                newLength += 2; /* Normal 2byte encoding, not 0xC080 */
+            } else {
+                newLength++;    /* We will turn 0xC080 into 0 */
+            }
+        } else if ( (byte1 & 0xF0) == 0xE0 ) { /* 3byte encoding */
+            /* Check encoding of following bytes */
+            if ( (i+2) >= length || (string[i+1] & 0xC0) != 0x80
+                                 || (string[i+2] & 0xC0) != 0x80 ) {
+                break; /* Error condition */
+            }
+            byte2 = (unsigned char)string[++i];
+            byte3 = (unsigned char)string[++i];
+            newLength += 3;
+            /* Possible process a second 3byte encoding */
+            if ( (i+3) < length && byte1 == 0xED && (byte2 & 0xF0) == 0xA0 ) {
+                /* See if this is a pair of 3byte encodings */
+                byte4 = (unsigned char)string[i+1];
+                byte5 = (unsigned char)string[i+2];
+                byte6 = (unsigned char)string[i+3];
+                if ( byte4 == 0xED && (byte5 & 0xF0) == 0xB0 ) {
+                    /* Check encoding of 3rd byte */
+                    if ( (byte6 & 0xC0) != 0x80 ) {
+                        break; /* Error condition */
+                    }
+                    newLength++; /* New string will have 4byte encoding */
+                    i += 3;       /* Skip next 3 bytes */
+                }
+            }
+        } else {
+            break; /* Error condition */
+        }
+    }
+    if ( i != length ) {
+        /* Error in UTF encoding */
+        /*  FIXUP: ERROR_MESSAGE()? */
+        return length;
+    }
+    return newLength;
+}
+
+/* Convert a Modified UTF-8 string into a Standard UTF-8 string
+ *   It is assumed that this string has been validated in terms of the
+ *   basic UTF encoding rules by utf8Length() above.
+ *
+ *   Note: No validation is made that this is indeed Modified UTF-8 coming in.
+ *
+ */
+void JNICALL utf8mToUtf8s(jbyte *string, int length, jbyte *newString, int newLength) {
+    int i;
+    int j;
+
+    j = 0;
+    for ( i = 0 ; i < length ; i++ ) {
+        unsigned byte1, byte2, byte3, byte4, byte5, byte6;
+
+        byte1 = (unsigned char)string[i];
+        if ( (byte1 & 0x80) == 0 ) { /* 1byte encoding */
+            /* Single byte */
+            newString[j++] = byte1;
+        } else if ( (byte1 & 0xE0) == 0xC0 ) { /* 2byte encoding */
+            byte2 = (unsigned char)string[++i];
+            if ( byte1 != 0xC0 || byte2 != 0x80 ) {
+                newString[j++] = byte1;
+                newString[j++] = byte2;
+            } else {
+                newString[j++] = 0;
+            }
+        } else if ( (byte1 & 0xF0) == 0xE0 ) { /* 3byte encoding */
+            byte2 = (unsigned char)string[++i];
+            byte3 = (unsigned char)string[++i];
+            if ( i+3 < length && byte1 == 0xED && (byte2 & 0xF0) == 0xA0 ) {
+                /* See if this is a pair of 3byte encodings */
+                byte4 = (unsigned char)string[i+1];
+                byte5 = (unsigned char)string[i+2];
+                byte6 = (unsigned char)string[i+3];
+                if ( byte4 == 0xED && (byte5 & 0xF0) == 0xB0 ) {
+                    unsigned u21;
+
+                    /* Bits in: 11101101 1010xxxx 10xxxxxx */
+                    /* Bits in: 11101101 1011xxxx 10xxxxxx */
+                    i += 3;
+
+                    /* Reconstruct 21 bit code */
+                    u21  = ((byte2 & 0x0F) + 1) << 16;
+                    u21 += (byte3 & 0x3F) << 10;
+                    u21 += (byte5 & 0x0F) << 6;
+                    u21 += (byte6 & 0x3F);
+
+                    /* Bits out: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */
+
+                    /* Convert to 4byte encoding */
+                    newString[j++] = 0xF0 + ((u21 >> 18) & 0x07);
+                    newString[j++] = 0x80 + ((u21 >> 12) & 0x3F);
+                    newString[j++] = 0x80 + ((u21 >>  6) & 0x3F);
+                    newString[j++] = 0x80 + (u21 & 0x3F);
+                    continue;
+                }
+            }
+            /* Normal 3byte encoding */
+            newString[j++] = byte1;
+            newString[j++] = byte2;
+            newString[j++] = byte3;
+        }
+    }
+    UTF_ASSERT(i==length);
+    UTF_ASSERT(j==newLength);
+    newString[j] = 0;
+}
+
+#ifdef _WIN32
+// Microsoft Windows specific part
+
+#include <windows.h>
+
+static UINT getCodepage() {
+    LANGID langID;
+    LCID localeID;
+    TCHAR strCodePage[7];       // ANSI code page id
+
+    static UINT intCodePage = -1;
+
+    if (intCodePage == -1) {
+        // Firts call, get codepage from the os
+        langID = LANGIDFROMLCID(GetUserDefaultLCID());
+        localeID = MAKELCID(langID, SORT_DEFAULT);
+        if (GetLocaleInfo(localeID, LOCALE_IDEFAULTANSICODEPAGE,
+                         strCodePage, sizeof(strCodePage)/sizeof(TCHAR)) > 0 ) {
+            intCodePage = atoi(strCodePage);
+        }
+        else {
+            intCodePage = GetACP();
+        }
+    }
+
+    return intCodePage;
+}
+
+/*
+ * Get wide string  (assumes len>0)
+ */
+static WCHAR* getWideString(UINT codePage, char* str, int len, int *pwlen) {
+    int wlen;
+    WCHAR* wstr;
+
+    /* Convert the string to WIDE string */
+    wlen = MultiByteToWideChar(codePage, 0, str, len, NULL, 0);
+    *pwlen = wlen;
+    if (wlen <= 0) {
+        UTF_ERROR(("Can't get WIDE string length"));
+        return NULL;
+    }
+    wstr = (WCHAR*)malloc(wlen * sizeof(WCHAR));
+    if (wstr == NULL) {
+        UTF_ERROR(("Can't malloc() any space"));
+        return NULL;
+    }
+    if (MultiByteToWideChar(codePage, 0, str, len, wstr, wlen) == 0) {
+        UTF_ERROR(("Can't get WIDE string"));
+        return NULL;
+    }
+    return wstr;
+}
+
+/*
+ * Convert UTF-8 to a platform string
+ */
+int JNICALL utf8ToPlatform(jbyte *utf8, int len, char* output, int outputMaxLen) {
+    int wlen;
+    int plen;
+    WCHAR* wstr;
+    UINT codepage;
+
+    UTF_ASSERT(utf8);
+    UTF_ASSERT(output);
+    UTF_ASSERT(outputMaxLen > len);
+
+    /* Zero length is ok, but we don't need to do much */
+    if ( len == 0 ) {
+        output[0] = 0;
+        return 0;
+    }
+
+    /* Get WIDE string version (assumes len>0) */
+    wstr = getWideString(CP_UTF8, (char*)utf8, len, &wlen);
+    if ( wstr == NULL ) {
+        // Can't allocate WIDE string
+        goto just_copy_bytes;
+    }
+
+    /* Convert WIDE string to MultiByte string */
+    codepage = getCodepage();
+    plen = WideCharToMultiByte(codepage, 0, wstr, wlen,
+                               output, outputMaxLen, NULL, NULL);
+    free(wstr);
+    if (plen <= 0) {
+        // Can't convert WIDE string to multi-byte
+        goto just_copy_bytes;
+    }
+    output[plen] = '\0';
+    return plen;
+
+just_copy_bytes:
+    (void)memcpy(output, utf8, len);
+    output[len] = 0;
+    return len;
+}
+
+/*
+ * Convert Platform Encoding to UTF-8.
+ */
+int JNICALL utf8FromPlatform(char *str, int len, jbyte *output, int outputMaxLen) {
+    int wlen;
+    int plen;
+    WCHAR* wstr;
+    UINT codepage;
+
+    UTF_ASSERT(str);
+    UTF_ASSERT(output);
+    UTF_ASSERT(outputMaxLen > len);
+
+    /* Zero length is ok, but we don't need to do much */
+    if ( len == 0 ) {
+        output[0] = 0;
+        return 0;
+    }
+
+    /* Get WIDE string version (assumes len>0) */
+    codepage = getCodepage();
+    wstr = getWideString(codepage, str, len, &wlen);
+    if ( wstr == NULL ) {
+        goto just_copy_bytes;
+    }
+
+    /* Convert WIDE string to UTF-8 string */
+    plen = WideCharToMultiByte(CP_UTF8, 0, wstr, wlen,
+                               (char*)output, outputMaxLen, NULL, NULL);
+    free(wstr);
+    if (plen <= 0) {
+        UTF_ERROR(("Can't convert WIDE string to multi-byte"));
+        goto just_copy_bytes;
+    }
+    output[plen] = '\0';
+    return plen;
+
+just_copy_bytes:
+    (void)memcpy(output, str, len);
+    output[len] = 0;
+    return len;
+}
+
+
+#else
+// *NIX specific part
+
+#include <iconv.h>
+#include <locale.h>
+#include <langinfo.h>
+#include <string.h>
+
+typedef enum {TO_UTF8, FROM_UTF8} conv_direction;
+
+/*
+ * Do iconv() conversion.
+ *    Returns length or -1 if output overflows.
+ */
+static int iconvConvert(conv_direction drn, char *bytes, size_t len, char *output, size_t outputMaxLen) {
+
+    static char *codeset = 0;
+    iconv_t func;
+    size_t bytes_converted;
+    size_t inLeft, outLeft;
+    char *inbuf, *outbuf;
+
+    UTF_ASSERT(bytes);
+    UTF_ASSERT(output);
+    UTF_ASSERT(outputMaxLen > len);
+
+    /* Zero length is ok, but we don't need to do much */
+    if ( len == 0 ) {
+        output[0] = 0;
+        return 0;
+    }
+
+    if (codeset == NULL && codeset != (char *) -1) {
+        // locale is not initialized, do it now
+        if (setlocale(LC_ALL, "") != NULL) {
+            // nl_langinfo returns ANSI_X3.4-1968 by default
+            codeset = (char*)nl_langinfo(CODESET);
+        }
+
+        if (codeset == NULL) {
+           // Not able to intialize process locale from platform one.
+           codeset = (char *) -1;
+        }
+    }
+
+    if (codeset == (char *) -1) {
+      // There was an error during initialization, so just bail out
+      goto just_copy_bytes;
+    }
+
+    func = (drn == TO_UTF8) ? iconv_open(codeset, "UTF-8") : iconv_open("UTF-8", codeset);
+    if (func == (iconv_t) -1) {
+        // Requested charset combination is not supported, conversion couldn't be done.
+        // make sure we will not try it again
+        codeset = (char *) -1;
+        goto just_copy_bytes;
+    }
+
+    // perform conversion
+    inbuf = bytes;
+    outbuf = output;
+    inLeft = len;
+    outLeft = outputMaxLen;
+
+    bytes_converted = iconv(func, (void*)&inbuf, &inLeft, &outbuf, &outLeft);
+    if (bytes_converted == (size_t) -1 || bytes_converted == 0 || inLeft != 0) {
+        // Input string is invalid, not able to convert entire string
+        // or some other iconv error happens.
+        iconv_close(func);
+        goto just_copy_bytes;
+    }
+
+    iconv_close(func);
+    // Overwrite bytes_converted with value of actually stored bytes
+    bytes_converted = outputMaxLen-outLeft;
+    output[bytes_converted] = 0;
+    return bytes_converted;
+
+
+just_copy_bytes:
+    (void)memcpy(output, bytes, len);
+    output[len] = 0;
+    return len;
+ }
+
+/*
+ * Convert UTF-8 to Platform Encoding.
+ *    Returns length or -1 if output overflows.
+ */
+int JNICALL utf8ToPlatform(jbyte *utf8, int len, char *output, int outputMaxLen) {
+    return iconvConvert(FROM_UTF8, (char*)utf8, len, output, outputMaxLen);
+}
+
+/*
+ * Convert Platform Encoding to UTF-8.
+ *    Returns length or -1 if output overflows.
+ */
+int JNICALL utf8FromPlatform(char *str, int len, jbyte *output, int outputMaxLen) {
+    return iconvConvert(TO_UTF8, str, len, (char*) output, outputMaxLen);
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/back/utf_util.h	Fri Jul 11 05:59:08 2014 -0700
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+#ifndef _utf_util_h_
+#define _utf_util_h_
+
+#include "jni.h"
+
+
+int JNICALL utf8sToUtf8mLength(jbyte *string, int length);
+void JNICALL utf8sToUtf8m(jbyte *string, int length, jbyte *newString, int newLength);
+int JNICALL utf8mToUtf8sLength(jbyte *string, int length);
+void JNICALL utf8mToUtf8s(jbyte *string, int length, jbyte *newString, int newLength);
+
+int JNICALL utf8ToPlatform(jbyte *utf8, int len, char* output, int outputMaxLen);
+int JNICALL utf8FromPlatform(char *str, int len, jbyte *output, int outputMaxLen);
+
+#endif
--- a/jdk/src/share/back/util.h	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/back/util.h	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * 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,9 +53,6 @@
 #include "error_messages.h"
 #include "debugInit.h"
 
-/* Get access to Native Platform Toolkit functions */
-#include "npt.h"
-
 /* Definition of a CommonRef tracked by the backend for the frontend */
 typedef struct RefNode {
     jlong        seqNum;        /* ID of reference, also key for hash table */
@@ -123,9 +120,6 @@
 
     unsigned log_flags;
 
-    /* The Native Platform Toolkit access */
-    NptEnv *npt;
-
     /* Common References static data */
     jrawMonitorID refLock;
     jlong         nextSeqNum;
--- a/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java	Fri Jul 11 05:59:08 2014 -0700
@@ -509,7 +509,7 @@
             byte[] signature = new byte[6];
             stream.readFully(signature);
 
-            StringBuffer version = new StringBuffer(3);
+            StringBuilder version = new StringBuilder(3);
             version.append((char)signature[3]);
             version.append((char)signature[4]);
             version.append((char)signature[5]);
--- a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java	Fri Jul 11 05:59:08 2014 -0700
@@ -900,7 +900,7 @@
         if (times == 1) {
             return s;
         }
-        StringBuffer sb = new StringBuffer((s.length() + 1)*times - 1);
+        StringBuilder sb = new StringBuilder((s.length() + 1)*times - 1);
         sb.append(s);
         for (int i = 1; i < times; i++) {
             sb.append(" ");
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java	Fri Jul 11 05:59:08 2014 -0700
@@ -169,23 +169,23 @@
             result.add(typedInName);
         }
 
-        StringBuffer buf = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         len = result.size();
 
         // construct the resulting string
         for (int i=0; i<len; i++) {
             if (i > 0) {
-                buf.append(" ");
+                sb.append(" ");
             }
             if (len > 1) {
-                buf.append("\"");
+                sb.append("\"");
             }
-            buf.append(result.get(i));
+            sb.append(result.get(i));
             if (len > 1) {
-                buf.append("\"");
+                sb.append("\"");
             }
         }
-        return buf.toString();
+        return sb.toString();
     }
 
     public void setFileName(String fileName) {
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java	Fri Jul 11 05:59:08 2014 -0700
@@ -533,13 +533,13 @@
                     // Pending: verify character encoding spec for gconf
                     Reader reader = new InputStreamReader(url.openStream(), "ISO-8859-1");
                     char[] buf = new char[1024];
-                    StringBuffer strBuf = new StringBuffer();
+                    StringBuilder sb = new StringBuilder();
                     int n;
                     while ((n = reader.read(buf)) >= 0) {
-                        strBuf.append(buf, 0, n);
+                        sb.append(buf, 0, n);
                     }
                     reader.close();
-                    String str = strBuf.toString();
+                    String str = sb.toString();
                     if (str != null) {
                         String strLowerCase = str.toLowerCase();
                         int i = strLowerCase.indexOf("<entry name=\"theme\"");
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java	Fri Jul 11 05:59:08 2014 -0700
@@ -121,20 +121,20 @@
     }
 
     private String fileNameString(File[] files) {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         for (int i = 0; files != null && i < files.length; i++) {
             if (i > 0) {
-                buf.append(" ");
+                sb.append(" ");
             }
             if (files.length > 1) {
-                buf.append("\"");
+                sb.append("\"");
             }
-            buf.append(fileNameString(files[i]));
+            sb.append(fileNameString(files[i]));
             if (files.length > 1) {
-                buf.append("\"");
+                sb.append("\"");
             }
         }
-        return buf.toString();
+        return sb.toString();
     }
 
     public MotifFileChooserUI(JFileChooser filechooser) {
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java	Fri Jul 11 05:59:08 2014 -0700
@@ -690,7 +690,7 @@
     }
 
     private String fileNameString(File[] files) {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         for (int i = 0; files != null && i < files.length; i++) {
             if (i > 0) {
                 buf.append(" ");
--- a/jdk/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java	Fri Jul 11 05:59:08 2014 -0700
@@ -628,7 +628,7 @@
             }
             if (metaCoding.length > 0
                 && (verbose > 2 || verbose > 1 && metaCoding.length > 1)) {
-                StringBuffer sb = new StringBuffer();
+                StringBuilder sb = new StringBuilder();
                 for (int i = 0; i < metaCoding.length; i++) {
                     if (i == 1)  sb.append(" /");
                     sb.append(" ").append(metaCoding[i] & 0xFF);
@@ -756,7 +756,7 @@
                          " size="+outputSize()+
                          irr+" coding="+bandCoding);
                 if (metaCoding != noMetaCoding) {
-                    StringBuffer sb = new StringBuffer();
+                    StringBuilder sb = new StringBuilder();
                     for (int i = 0; i < metaCoding.length; i++) {
                         if (i == 1)  sb.append(" /");
                         sb.append(" ").append(metaCoding[i] & 0xFF);
--- a/jdk/src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1026,7 +1026,7 @@
         }
         static
         String stringValueOf(MethodHandleEntry bsmRef, Entry[] argRefs) {
-            StringBuffer sb = new StringBuffer(bsmRef.stringValue());
+            StringBuilder sb = new StringBuilder(bsmRef.stringValue());
             // Arguments are formatted as "<foo;bar;baz>" instead of "[foo,bar,baz]".
             // This ensures there will be no confusion if "[,]" appear inside of names.
             char nextSep = '<';
--- a/jdk/src/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java	Fri Jul 11 05:59:08 2014 -0700
@@ -63,12 +63,12 @@
         if (SNMP_LOGGER.isLoggable(Level.FINEST)) {
             SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(),
                 "extractSubNet", "BINARY ARRAY :");
-            StringBuffer buff = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
             for(int i =0; i < addrLength; i++) {
-                buff.append((b[i] &0xFF) +":");
+                sb.append((b[i] & 0xFF) + ":");
             }
             SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(),
-                "extractSubNet", buff.toString());
+                "extractSubNet", sb.toString());
         }
 
         // 8 is a byte size. Common to any InetAddress (V4 or V6).
--- a/jdk/src/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java	Fri Jul 11 05:59:08 2014 -0700
@@ -170,7 +170,7 @@
    * string literal.
    */
   protected String add_escapes(String str) {
-      StringBuffer retval = new StringBuffer();
+      StringBuilder retval = new StringBuilder();
       char ch;
       for (int i = 0; i < str.length(); i++) {
         switch (str.charAt(i))
--- a/jdk/src/share/classes/com/sun/jmx/snmp/IPAcl/SnmpAcl.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/IPAcl/SnmpAcl.java	Fri Jul 11 05:59:08 2014 -0700
@@ -186,8 +186,8 @@
     public static String getDefaultAclFileName() {
         final String fileSeparator =
             System.getProperty("file.separator");
-        final StringBuffer defaultAclName =
-            new StringBuffer(System.getProperty("java.home")).
+        final StringBuilder defaultAclName =
+            new StringBuilder(System.getProperty("java.home")).
             append(fileSeparator).append("lib").append(fileSeparator).
             append("snmp.acl");
         return defaultAclName.toString();
--- a/jdk/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java	Fri Jul 11 05:59:08 2014 -0700
@@ -65,7 +65,7 @@
     * equivalents in the given string
     */
    protected static final String addEscapes(String str) {
-      StringBuffer retval = new StringBuffer();
+      StringBuilder retval = new StringBuilder();
       char ch;
       for (int i = 0; i < str.length(); i++) {
         switch (str.charAt(i))
--- a/jdk/src/share/classes/com/sun/jmx/snmp/SnmpMessage.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/SnmpMessage.java	Fri Jul 11 05:59:08 2014 -0700
@@ -347,7 +347,7 @@
      * @return The string containing the dump.
      */
     public String printMessage() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         if (community == null) {
             sb.append("Community: null") ;
         }
--- a/jdk/src/share/classes/com/sun/jmx/snmp/SnmpMsg.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/SnmpMsg.java	Fri Jul 11 05:59:08 2014 -0700
@@ -181,22 +181,22 @@
      * @return The string containing the dump.
      */
     public static String dumpHexBuffer(byte [] b, int offset, int len) {
-        StringBuffer buf = new StringBuffer(len << 1) ;
+        StringBuilder sb = new StringBuilder(len << 1) ;
         int k = 1 ;
         int flen = offset + len ;
 
         for (int i = offset; i < flen ; i++) {
             int j = b[i] & 0xFF ;
-            buf.append(Character.forDigit((j >>> 4) , 16)) ;
-            buf.append(Character.forDigit((j & 0x0F), 16)) ;
+            sb.append(Character.forDigit((j >>> 4), 16)) ;
+            sb.append(Character.forDigit((j & 0x0F), 16)) ;
             k++ ;
             if (k%16 == 0) {
-                buf.append('\n') ;
+                sb.append('\n') ;
                 k = 1 ;
             } else
-                buf.append(' ') ;
+                sb.append(' ') ;
         }
-        return buf.toString() ;
+        return sb.toString() ;
     }
 
     /**
@@ -205,7 +205,7 @@
      * @return The string containing the dump.
      */
     public String printMessage() {
-        StringBuffer sb = new StringBuffer() ;
+        StringBuilder sb = new StringBuilder() ;
         sb.append("Version: ") ;
         sb.append(version) ;
         sb.append("\n") ;
--- a/jdk/src/share/classes/com/sun/jmx/snmp/SnmpOpaque.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/SnmpOpaque.java	Fri Jul 11 05:59:08 2014 -0700
@@ -73,7 +73,7 @@
      * @return The <CODE>String</CODE> representation of the value.
      */
     public String toString() {
-        StringBuffer result = new StringBuffer() ;
+        StringBuilder result = new StringBuilder() ;
         for (int i = 0 ; i < value.length ; i++) {
             byte b = value[i] ;
             int n = (b >= 0) ? b : b + 256 ;
--- a/jdk/src/share/classes/com/sun/jmx/snmp/SnmpV3Message.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/SnmpV3Message.java	Fri Jul 11 05:59:08 2014 -0700
@@ -478,7 +478,7 @@
      * @return The string containing the dump.
      */
     public String printMessage() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("msgId : " + msgId + "\n");
         sb.append("msgMaxSize : " + msgMaxSize + "\n");
         sb.append("msgFlags : " + msgFlags + "\n");
--- a/jdk/src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java	Fri Jul 11 05:59:08 2014 -0700
@@ -96,7 +96,7 @@
      * Used by CNCtx.getNameInNamespace(), CNCompoundName.toString().
      */
     static String cosNameToInsString(NameComponent[] cname) {
-      StringBuffer str = new StringBuffer();
+      StringBuilder str = new StringBuilder();
       for ( int i = 0; i < cname.length; i++) {
           if ( i > 0) {
               str.append(compSeparator);
@@ -254,7 +254,7 @@
     }
 
     private static String stringifyComponent(NameComponent comp) {
-        StringBuffer one = new StringBuffer(escape(comp.id));
+        StringBuilder one = new StringBuilder(escape(comp.id));
         if (comp.kind != null && !comp.kind.equals("")) {
             one.append(kindSeparator + escape(comp.kind));
         }
--- a/jdk/src/share/classes/com/sun/jndi/dns/DnsContextFactory.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/dns/DnsContextFactory.java	Fri Jul 11 05:59:08 2014 -0700
@@ -198,14 +198,14 @@
             }
         }
 
-        StringBuffer buf = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         for (int i = 0; i < servers.length; i++) {
             if (i > 0) {
-                buf.append(' ');
+                sb.append(' ');
             }
-            buf.append("dns://").append(servers[i]).append(path);
+            sb.append("dns://").append(servers[i]).append(path);
         }
-        return buf.toString();
+        return sb.toString();
     }
 
     /*
--- a/jdk/src/share/classes/com/sun/jndi/dns/DnsName.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/dns/DnsName.java	Fri Jul 11 05:59:08 2014 -0700
@@ -415,7 +415,7 @@
      */
     private void parse(String name) throws InvalidNameException {
 
-        StringBuffer label = new StringBuffer();        // label being parsed
+        StringBuilder label = new StringBuilder();      // label being parsed
 
         for (int i = 0; i < name.length(); i++) {
             char c = name.charAt(i);
@@ -564,15 +564,15 @@
      * into account.  See compareLabels().
      */
     private static String keyForLabel(String label) {
-        StringBuffer buf = new StringBuffer(label.length());
+        StringBuilder sb = new StringBuilder(label.length());
         for (int i = 0; i < label.length(); i++) {
             char c = label.charAt(i);
             if (c >= 'A' && c <= 'Z') {
                 c += 'a' - 'A';                         // to lower case
             }
-            buf.append(c);
+            sb.append(c);
         }
-        return buf.toString();
+        return sb.toString();
     }
 
 
--- a/jdk/src/share/classes/com/sun/jndi/dns/ResourceRecord.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/dns/ResourceRecord.java	Fri Jul 11 05:59:08 2014 -0700
@@ -596,21 +596,21 @@
         // If bestBase != -1, compress zeros in [bestBase, bestBase+bestLen)
         boolean compress = (bestBase != -1);
 
-        StringBuffer buf = new StringBuffer(40);
+        StringBuilder sb = new StringBuilder(40);
         if (bestBase == 0) {
-            buf.append(':');
+            sb.append(':');
         }
         for (int i = 0; i < 8; i++) {
             if (!compress || (i < bestBase) || (i >= bestBase + bestLen)) {
-                buf.append(Integer.toHexString(addr6[i]));
+                sb.append(Integer.toHexString(addr6[i]));
                 if (i < 7) {
-                    buf.append(':');
+                    sb.append(':');
                 }
             } else if (compress && (i == bestBase)) {  // first compressed zero
-                buf.append(':');
+                sb.append(':');
             }
         }
 
-        return buf.toString();
+        return sb.toString();
     }
 }
--- a/jdk/src/share/classes/com/sun/jndi/ldap/ClientId.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/ClientId.java	Fri Jul 11 05:59:08 2014 -0700
@@ -210,7 +210,7 @@
         if (ctls == null) {
             return "";
         }
-        StringBuffer str = new StringBuffer();
+        StringBuilder str = new StringBuilder();
         for (int i = 0; i < ctls.length; i++) {
             str.append(ctls[i].getID());
             str.append(' ');
--- a/jdk/src/share/classes/com/sun/jndi/ldap/DigestClientId.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/DigestClientId.java	Fri Jul 11 05:59:08 2014 -0700
@@ -103,14 +103,14 @@
 
     public String toString() {
         if (propvals != null) {
-            StringBuffer buf = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
             for (int i = 0; i < propvals.length; i++) {
-                buf.append(':');
+                sb.append(':');
                 if (propvals[i] != null) {
-                    buf.append(propvals[i]);
+                    sb.append(propvals[i]);
                 }
             }
-            return super.toString() + buf.toString();
+            return super.toString() + sb.toString();
         } else {
             return super.toString();
         }
--- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaParser.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaParser.java	Fri Jul 11 05:59:08 2014 -0700
@@ -767,7 +767,7 @@
     final private String classDef2ObjectDesc(Attributes attrs)
         throws NamingException {
 
-        StringBuffer objectDesc = new StringBuffer("( ");
+        StringBuilder objectDesc = new StringBuilder("( ");
 
         Attribute attr = null;
         int count = 0;
@@ -879,7 +879,7 @@
     final private String attrDef2AttrDesc(Attributes attrs)
         throws NamingException {
 
-        StringBuffer attrDesc = new StringBuffer("( "); // opening parens
+        StringBuilder attrDesc = new StringBuilder("( "); // opening parens
 
         Attribute attr = null;
         int count = 0;
@@ -1012,7 +1012,7 @@
     final private String syntaxDef2SyntaxDesc(Attributes attrs)
         throws NamingException {
 
-        StringBuffer syntaxDesc = new StringBuffer("( "); // opening parens
+        StringBuilder syntaxDesc = new StringBuilder("( "); // opening parens
 
         Attribute attr = null;
         int count = 0;
@@ -1068,7 +1068,7 @@
     final private String matchRuleDef2MatchRuleDesc(Attributes attrs)
         throws NamingException {
 
-        StringBuffer matchRuleDesc = new StringBuffer("( "); // opening parens
+        StringBuilder matchRuleDesc = new StringBuilder("( "); // opening parens
 
         Attribute attr = null;
         int count = 0;
@@ -1196,7 +1196,7 @@
 
         // write QDList
 
-        StringBuffer qdList = new StringBuffer(attr.getID());
+        StringBuilder qdList = new StringBuilder(attr.getID());
         qdList.append(WHSP);
         qdList.append(OID_LIST_BEGIN);
 
@@ -1233,7 +1233,7 @@
 
         // write OID List
 
-        StringBuffer oidList = new StringBuffer(oidsAttr.getID());
+        StringBuilder oidList = new StringBuilder(oidsAttr.getID());
         oidList.append(WHSP);
         oidList.append(OID_LIST_BEGIN);
 
--- a/jdk/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java	Fri Jul 11 05:59:08 2014 -0700
@@ -68,7 +68,7 @@
         if (dn == null) {
             return null;
         }
-        StringBuffer domain = new StringBuffer();
+        StringBuilder domain = new StringBuilder();
         LdapName ldapName = new LdapName(dn);
 
         // process RDNs left-to-right
--- a/jdk/src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java	Fri Jul 11 05:59:08 2014 -0700
@@ -88,7 +88,7 @@
                             }
                         }
                         if (selected == -1) {
-                            StringBuffer allChoices = new StringBuffer();
+                            StringBuilder allChoices = new StringBuilder();
                             for (int j = 0; j <  choices.length; j++) {
                                 allChoices.append(choices[j] + ",");
                             }
--- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java	Fri Jul 11 05:59:08 2014 -0700
@@ -520,30 +520,30 @@
             str = (String)obj;
         }
         int len = str.length();
-        StringBuffer buf = new StringBuffer(len);
+        StringBuilder sb = new StringBuilder(len);
         char ch;
         for (int i = 0; i < len; i++) {
             switch (ch=str.charAt(i)) {
             case '*':
-                buf.append("\\2a");
+                sb.append("\\2a");
                 break;
             case '(':
-                buf.append("\\28");
+                sb.append("\\28");
                 break;
             case ')':
-                buf.append("\\29");
+                sb.append("\\29");
                 break;
             case '\\':
-                buf.append("\\5c");
+                sb.append("\\5c");
                 break;
             case 0:
-                buf.append("\\00");
+                sb.append("\\00");
                 break;
             default:
-                buf.append(ch);
+                sb.append(ch);
             }
         }
-        return buf.toString();
+        return sb.toString();
     }
 
 
@@ -585,7 +585,7 @@
 
          int param;
          int where = 0, start = 0;
-         StringBuffer answer = new StringBuffer(expr.length());
+         StringBuilder answer = new StringBuilder(expr.length());
 
          while ((where = findUnescaped('{', expr, start)) >= 0) {
              int pstart = where + 1; // skip '{'
--- a/jdk/src/share/classes/com/sun/media/sound/SoftPerformer.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/media/sound/SoftPerformer.java	Fri Jul 11 05:59:08 2014 -0700
@@ -326,7 +326,7 @@
     private static KeySortComparator keySortComparator = new KeySortComparator();
 
     private String extractKeys(ModelConnectionBlock conn) {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         if (conn.getSources() != null) {
             sb.append("[");
             ModelSource[] srcs = conn.getSources();
--- a/jdk/src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java	Fri Jul 11 05:59:08 2014 -0700
@@ -162,7 +162,7 @@
             0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
 
     private String decodeChannelMask(long channelmask) {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         long m = 1;
         for (int i = 0; i < allchannelnames.length; i++) {
             if ((channelmask & m) != 0L) {
--- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/Base64.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/Base64.java	Fri Jul 11 05:59:08 2014 -0700
@@ -257,7 +257,7 @@
     public static final byte[] decode(Element element) throws Base64DecodingException {
 
         Node sibling = element.getFirstChild();
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
         while (sibling != null) {
             if (sibling.getNodeType() == Node.TEXT_NODE) {
--- a/jdk/src/share/classes/com/sun/security/sasl/CramMD5Base.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/security/sasl/CramMD5Base.java	Fri Jul 11 05:59:08 2014 -0700
@@ -195,7 +195,7 @@
         digest = md5.digest();
 
         // Get character representation of digest
-        StringBuffer digestString = new StringBuffer();
+        StringBuilder digestString = new StringBuilder();
 
         for (i = 0; i < digest.length; i++) {
             if ((digest[i] & 0x000000ff) < 0x10) {
--- a/jdk/src/share/classes/com/sun/security/sasl/CramMD5Server.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/security/sasl/CramMD5Server.java	Fri Jul 11 05:59:08 2014 -0700
@@ -117,15 +117,15 @@
                 long rand = random.nextLong();
                 long timestamp = System.currentTimeMillis();
 
-                StringBuffer buf = new StringBuffer();
-                buf.append('<');
-                buf.append(rand);
-                buf.append('.');
-                buf.append(timestamp);
-                buf.append('@');
-                buf.append(fqdn);
-                buf.append('>');
-                String challengeStr = buf.toString();
+                StringBuilder sb = new StringBuilder();
+                sb.append('<');
+                sb.append(rand);
+                sb.append('.');
+                sb.append(timestamp);
+                sb.append('@');
+                sb.append(fqdn);
+                sb.append('>');
+                String challengeStr = sb.toString();
 
                 logger.log(Level.FINE,
                     "CRAMSRV01:Generated challenge: {0}", challengeStr);
--- a/jdk/src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/security/sasl/digest/DigestMD5Base.java	Fri Jul 11 05:59:08 2014 -0700
@@ -387,7 +387,7 @@
     protected byte[] binaryToHex(byte[] digest) throws
     UnsupportedEncodingException {
 
-        StringBuffer digestString = new StringBuffer();
+        StringBuilder digestString = new StringBuilder();
 
         for (int i = 0; i < digest.length; i ++) {
             if ((digest[i] & 0x000000ff) < 0x10) {
@@ -598,7 +598,7 @@
     protected static String nonceCountToHex(int count) {
 
         String str = Integer.toHexString(count);
-        StringBuffer pad = new StringBuffer();
+        StringBuilder pad = new StringBuilder();
 
         if (str.length() < 8) {
             for (int i = 0; i < 8-str.length(); i ++) {
--- a/jdk/src/share/classes/com/sun/security/sasl/digest/DigestMD5Server.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/security/sasl/digest/DigestMD5Server.java	Fri Jul 11 05:59:08 2014 -0700
@@ -203,19 +203,19 @@
             String supportedCiphers = null;
             if ((allQop&PRIVACY_PROTECTION) != 0) {
                 myCiphers = getPlatformCiphers();
-                StringBuffer buf = new StringBuffer();
+                StringBuilder sb = new StringBuilder();
 
                 // myCipher[i] is a byte that indicates whether CIPHER_TOKENS[i]
                 // is supported
                 for (int i = 0; i < CIPHER_TOKENS.length; i++) {
                     if (myCiphers[i] != 0) {
-                        if (buf.length() > 0) {
-                            buf.append(',');
+                        if (sb.length() > 0) {
+                            sb.append(',');
                         }
-                        buf.append(CIPHER_TOKENS[i]);
+                        sb.append(CIPHER_TOKENS[i]);
                     }
                 }
-                supportedCiphers = buf.toString();
+                supportedCiphers = sb.toString();
             }
 
             try {
--- a/jdk/src/share/classes/com/sun/security/sasl/util/AbstractSaslImpl.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/security/sasl/util/AbstractSaslImpl.java	Fri Jul 11 05:59:08 2014 -0700
@@ -80,13 +80,13 @@
                     "SASLIMPL02:Preferred qop mask: {0}", new Byte(allQop));
 
                 if (qop.length > 0) {
-                    StringBuffer qopbuf = new StringBuffer();
+                    StringBuilder str = new StringBuilder();
                     for (int i = 0; i < qop.length; i++) {
-                        qopbuf.append(Byte.toString(qop[i]));
-                        qopbuf.append(' ');
+                        str.append(Byte.toString(qop[i]));
+                        str.append(' ');
                     }
                     logger.logp(Level.FINE, myClassName, "constructor",
-                        "SASLIMPL03:Preferred qops : {0}", qopbuf.toString());
+                            "SASLIMPL03:Preferred qops : {0}", str.toString());
                 }
             }
 
@@ -95,13 +95,13 @@
             logger.logp(Level.FINE, myClassName, "constructor",
                 "SASLIMPL04:Preferred strength property: {0}", prop);
             if (logger.isLoggable(Level.FINE) && strength.length > 0) {
-                StringBuffer strbuf = new StringBuffer();
+                StringBuilder str = new StringBuilder();
                 for (int i = 0; i < strength.length; i++) {
-                    strbuf.append(Byte.toString(strength[i]));
-                    strbuf.append(' ');
+                    str.append(Byte.toString(strength[i]));
+                    str.append(' ');
                 }
                 logger.logp(Level.FINE, myClassName, "constructor",
-                    "SASLIMPL05:Cipher strengths: {0}", strbuf.toString());
+                        "SASLIMPL05:Cipher strengths: {0}", str.toString());
             }
 
             // Max receive buffer size
--- a/jdk/src/share/classes/com/sun/tools/example/debug/bdi/ExceptionSpec.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/bdi/ExceptionSpec.java	Fri Jul 11 05:59:08 2014 -0700
@@ -102,8 +102,8 @@
 
     @Override
     public String toString() {
-        StringBuffer buffer = new StringBuffer("exception catch ");
-        buffer.append(refSpec.toString());
-        return buffer.toString();
+        StringBuilder sb = new StringBuilder("exception catch ");
+        sb.append(refSpec.toString());
+        return sb.toString();
     }
 }
--- a/jdk/src/share/classes/com/sun/tools/example/debug/bdi/LineBreakpointSpec.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/bdi/LineBreakpointSpec.java	Fri Jul 11 05:59:08 2014 -0700
@@ -118,13 +118,13 @@
 
     @Override
     public String toString() {
-        StringBuffer buffer = new StringBuffer("breakpoint ");
-        buffer.append(refSpec.toString());
-        buffer.append(':');
-        buffer.append(lineNumber);
-        buffer.append(" (");
-        buffer.append(getStatusString());
-        buffer.append(')');
-        return buffer.toString();
+        StringBuilder sb = new StringBuilder("breakpoint ");
+        sb.append(refSpec.toString());
+        sb.append(':');
+        sb.append(lineNumber);
+        sb.append(" (");
+        sb.append(getStatusString());
+        sb.append(')');
+        return sb.toString();
     }
 }
--- a/jdk/src/share/classes/com/sun/tools/example/debug/bdi/MethodBreakpointSpec.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/bdi/MethodBreakpointSpec.java	Fri Jul 11 05:59:08 2014 -0700
@@ -126,26 +126,26 @@
 
     @Override
     public String toString() {
-        StringBuffer buffer = new StringBuffer("breakpoint ");
-        buffer.append(refSpec.toString());
-        buffer.append('.');
-        buffer.append(methodId);
+        StringBuilder sb = new StringBuilder("breakpoint ");
+        sb.append(refSpec.toString());
+        sb.append('.');
+        sb.append(methodId);
         if (methodArgs != null) {
             boolean first = true;
-            buffer.append('(');
+            sb.append('(');
             for (String name : methodArgs) {
                 if (!first) {
-                    buffer.append(',');
+                    sb.append(',');
                 }
-                buffer.append(name);
+                sb.append(name);
                 first = false;
             }
-            buffer.append(")");
+            sb.append(")");
         }
-        buffer.append(" (");
-        buffer.append(getStatusString());
-        buffer.append(')');
-        return buffer.toString();
+        sb.append(" (");
+        sb.append(getStatusString());
+        sb.append(')');
+        return sb.toString();
     }
 
     private boolean isValidMethodName(String s) {
@@ -225,8 +225,8 @@
          * stripping whitespace after the name ends.
          */
         int i = 0;
-        StringBuffer typePart = new StringBuffer();
-        StringBuffer arrayPart = new StringBuffer();
+        StringBuilder typePart = new StringBuilder();
+        StringBuilder arrayPart = new StringBuilder();
         name = name.trim();
         int nameLength = name.length();
         /*
--- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java	Fri Jul 11 05:59:08 2014 -0700
@@ -185,7 +185,7 @@
   }
 
   final public String Name() throws ParseException {
- StringBuffer sb = new StringBuffer();
+    StringBuilder sb = new StringBuilder();
     jj_consume_token(IDENTIFIER);
                  sb.append(token);
     label_2:
--- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java	Fri Jul 11 05:59:08 2014 -0700
@@ -114,7 +114,7 @@
                            int[][] expectedTokenSequences,
                            String[] tokenImage) {
     String eol = System.getProperty("line.separator", "\n");
-    StringBuffer expected = new StringBuffer();
+    StringBuilder expected = new StringBuilder();
     int maxSize = 0;
     for (int i = 0; i < expectedTokenSequences.length; i++) {
       if (maxSize < expectedTokenSequences[i].length) {
@@ -164,7 +164,7 @@
    * string literal.
    */
   static String add_escapes(String str) {
-      StringBuffer retval = new StringBuffer();
+      StringBuilder retval = new StringBuilder();
       char ch;
       for (int i = 0; i < str.length(); i++) {
         switch (str.charAt(i))
--- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java	Fri Jul 11 05:59:08 2014 -0700
@@ -73,7 +73,7 @@
    * equivalents in the given string
    */
   protected static final String addEscapes(String str) {
-    StringBuffer retval = new StringBuffer();
+    StringBuilder retval = new StringBuilder();
     char ch;
     for (int i = 0; i < str.length(); i++) {
       switch (str.charAt(i))
--- a/jdk/src/share/classes/com/sun/tools/example/debug/gui/CommandInterpreter.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/gui/CommandInterpreter.java	Fri Jul 11 05:59:08 2014 -0700
@@ -267,7 +267,7 @@
                 buf[j] = ' ';
             }
             buf[79] = '\0';
-            StringBuffer sbOut = new StringBuffer();
+            StringBuilder sbOut = new StringBuilder();
             sbOut.append(buf);
 
             // Right-justify the thread number at start of output string
@@ -381,16 +381,16 @@
             }
         } else {
             clname = t.nextToken();
-            StringBuffer sbuf = new StringBuffer();
+            StringBuilder str = new StringBuilder();
             // Allow VM arguments to be specified here?
             while (t.hasMoreTokens()) {
                 String tok = t.nextToken();
-                sbuf.append(tok);
+                str.append(tok);
                 if (t.hasMoreTokens()) {
-                    sbuf.append(' ');
+                    str.append(' ');
                 }
             }
-            String args = sbuf.toString();
+            String args = str.toString();
             try {
                 String vmArgs = context.getVmArguments();
                 runtime.run(suspended, vmArgs, clname, args);
--- a/jdk/src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java	Fri Jul 11 05:59:08 2014 -0700
@@ -333,7 +333,7 @@
 
     private String processClasspathDefaults(String javaArgs) {
         if (javaArgs.indexOf("-classpath ") == -1) {
-            StringBuffer munged = new StringBuffer(javaArgs);
+            StringBuilder munged = new StringBuilder(javaArgs);
             SearchPath classpath = classManager.getClassPath();
             if (classpath.isEmpty()) {
                 String envcp = System.getProperty("env.class.path");
--- a/jdk/src/share/classes/com/sun/tools/example/debug/gui/SourceModel.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/gui/SourceModel.java	Fri Jul 11 05:59:08 2014 -0700
@@ -236,7 +236,7 @@
     private String expandTabs(String s) {
         int col = 0;
         int len = s.length();
-        StringBuffer sb = new StringBuffer(132);
+        StringBuilder sb = new StringBuilder(132);
         for (int i = 0; i < len; i++) {
             char c = s.charAt(i);
             sb.append(c);
--- a/jdk/src/share/classes/com/sun/tools/example/debug/tty/BreakpointSpec.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/tty/BreakpointSpec.java	Fri Jul 11 05:59:08 2014 -0700
@@ -154,27 +154,27 @@
 
     @Override
     public String toString() {
-        StringBuffer buffer = new StringBuffer(refSpec.toString());
+        StringBuilder sb = new StringBuilder(refSpec.toString());
         if (isMethodBreakpoint()) {
-            buffer.append('.');
-            buffer.append(methodId);
+            sb.append('.');
+            sb.append(methodId);
             if (methodArgs != null) {
                 boolean first = true;
-                buffer.append('(');
+                sb.append('(');
                 for (String arg : methodArgs) {
                     if (!first) {
-                        buffer.append(',');
+                        sb.append(',');
                     }
-                    buffer.append(arg);
+                    sb.append(arg);
                     first = false;
                 }
-                buffer.append(")");
+                sb.append(")");
             }
         } else {
-            buffer.append(':');
-            buffer.append(lineNumber);
+            sb.append(':');
+            sb.append(lineNumber);
         }
-        return MessageOutput.format("breakpoint", buffer.toString());
+        return MessageOutput.format("breakpoint", sb.toString());
     }
 
     private Location location(ReferenceType refType) throws
@@ -275,8 +275,8 @@
          * stripping whitespace after the name ends
          */
         int i = 0;
-        StringBuffer typePart = new StringBuffer();
-        StringBuffer arrayPart = new StringBuffer();
+        StringBuilder typePart = new StringBuilder();
+        StringBuilder arrayPart = new StringBuilder();
         name = name.trim();
         int nameLength = name.length();
         /*
--- a/jdk/src/share/classes/com/sun/tools/example/debug/tty/Commands.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/tty/Commands.java	Fri Jul 11 05:59:08 2014 -0700
@@ -164,30 +164,30 @@
     }
 
     String typedName(Method method) {
-        StringBuffer buf = new StringBuffer();
-        buf.append(method.name());
-        buf.append("(");
+        StringBuilder sb = new StringBuilder();
+        sb.append(method.name());
+        sb.append("(");
 
         List<String> args = method.argumentTypeNames();
         int lastParam = args.size() - 1;
         // output param types except for the last
         for (int ii = 0; ii < lastParam; ii++) {
-            buf.append(args.get(ii));
-            buf.append(", ");
+            sb.append(args.get(ii));
+            sb.append(", ");
         }
         if (lastParam >= 0) {
             // output the last param
             String lastStr = args.get(lastParam);
             if (method.isVarArgs()) {
                 // lastParam is an array.  Replace the [] with ...
-                buf.append(lastStr.substring(0, lastStr.length() - 2));
-                buf.append("...");
+                sb.append(lastStr.substring(0, lastStr.length() - 2));
+                sb.append("...");
             } else {
-                buf.append(lastStr);
+                sb.append(lastStr);
             }
         }
-        buf.append(")");
-        return buf.toString();
+        sb.append(")");
+        return sb.toString();
     }
 
     void commandConnectors(VirtualMachineManager vmm) {
@@ -226,7 +226,7 @@
     }
 
     void commandClasses() {
-        StringBuffer classList = new StringBuffer();
+        StringBuilder classList = new StringBuilder();
         for (ReferenceType refType : Env.vm().allClasses()) {
             classList.append(refType.name());
             classList.append("\n");
@@ -309,7 +309,7 @@
         String idClass = t.nextToken();
         ReferenceType cls = Env.getReferenceTypeFromToken(idClass);
         if (cls != null) {
-            StringBuffer methodsList = new StringBuffer();
+            StringBuilder methodsList = new StringBuilder();
             for (Method method : cls.allMethods()) {
                 methodsList.append(method.declaringType().name());
                 methodsList.append(" ");
@@ -333,7 +333,7 @@
         if (cls != null) {
             List<Field> fields = cls.allFields();
             List<Field> visible = cls.visibleFields();
-            StringBuffer fieldsList = new StringBuffer();
+            StringBuilder fieldsList = new StringBuilder();
             for (Field field : fields) {
                 String s;
                 if (!visible.contains(field)) {
@@ -391,11 +391,11 @@
              * very long thread names, at the possible cost of lines
              * being wrapped by the display device.
              */
-            StringBuffer idBuffer = new StringBuffer(Env.description(thr));
+            StringBuilder idBuffer = new StringBuilder(Env.description(thr));
             for (int i = idBuffer.length(); i < maxIdLength; i++) {
                 idBuffer.append(" ");
             }
-            StringBuffer nameBuffer = new StringBuffer(thr.name());
+            StringBuilder nameBuffer = new StringBuilder(thr.name());
             for (int i = nameBuffer.length(); i < maxNameLength; i++) {
                 nameBuffer.append(" ");
             }
@@ -1606,16 +1606,16 @@
     private void dump(ObjectReference obj, ReferenceType refType,
                       ReferenceType refTypeBase) {
         for (Field field : refType.fields()) {
-            StringBuffer o = new StringBuffer();
-            o.append("    ");
+            StringBuilder sb = new StringBuilder();
+            sb.append("    ");
             if (!refType.equals(refTypeBase)) {
-                o.append(refType.name());
-                o.append(".");
+                sb.append(refType.name());
+                sb.append(".");
             }
-            o.append(field.name());
-            o.append(MessageOutput.format("colon space"));
-            o.append(obj.getValue(field));
-            MessageOutput.printDirectln(o.toString()); // Special case: use printDirectln()
+            sb.append(field.name());
+            sb.append(MessageOutput.format("colon space"));
+            sb.append(obj.getValue(field));
+            MessageOutput.printDirectln(sb.toString()); // Special case: use printDirectln()
         }
         if (refType instanceof ClassType) {
             ClassType sup = ((ClassType)refType).superclass();
@@ -1954,7 +1954,7 @@
             }
         }
 
-        StringBuffer line = new StringBuffer(80);
+        StringBuilder line = new StringBuilder(80);
         line.append("0000: ");
         for (int i = 0; i < bytecodes.length; i++) {
             if ((i > 0) && (i % 16 == 0)) {
--- a/jdk/src/share/classes/com/sun/tools/example/debug/tty/Env.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/tty/Env.java	Fri Jul 11 05:59:08 2014 -0700
@@ -114,12 +114,12 @@
     }
 
     static String excludesString() {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         for (String pattern : excludes()) {
-            buffer.append(pattern);
-            buffer.append(",");
+            sb.append(pattern);
+            sb.append(",");
         }
-        return buffer.toString();
+        return sb.toString();
     }
 
     static void addExcludes(StepRequest request) {
--- a/jdk/src/share/classes/com/sun/tools/example/debug/tty/TTY.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/tty/TTY.java	Fri Jul 11 05:59:08 2014 -0700
@@ -827,17 +827,17 @@
     private static String addArgument(String string, String argument) {
         if (hasWhitespace(argument) || argument.indexOf(',') != -1) {
             // Quotes were stripped out for this argument, add 'em back.
-            StringBuffer buffer = new StringBuffer(string);
-            buffer.append('"');
+            StringBuilder sb = new StringBuilder(string);
+            sb.append('"');
             for (int i = 0; i < argument.length(); i++) {
                 char c = argument.charAt(i);
                 if (c == '"') {
-                    buffer.append('\\');
+                    sb.append('\\');
                 }
-                buffer.append(c);
+                sb.append(c);
             }
-            buffer.append("\" ");
-            return buffer.toString();
+            sb.append("\" ");
+            return sb.toString();
         } else {
             return string + argument + ' ';
         }
--- a/jdk/src/share/classes/com/sun/tools/example/trace/Trace.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/example/trace/Trace.java	Fri Jul 11 05:59:08 2014 -0700
@@ -121,7 +121,7 @@
             usage();
             System.exit(1);
         }
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append(args[inx]);
         for (++inx; inx < args.length; ++inx) {
             sb.append(' ');
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/util/Misc.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/util/Misc.java	Fri Jul 11 05:59:08 2014 -0700
@@ -83,30 +83,30 @@
 
     public static String encodeHtml(String str) {
         final int len = str.length();
-        StringBuffer buf = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         for (int i = 0; i < len; i++) {
             char ch = str.charAt(i);
             if (ch == '<') {
-                buf.append("&lt;");
+                sb.append("&lt;");
             } else if (ch == '>') {
-                buf.append("&gt;");
+                sb.append("&gt;");
             } else if (ch == '"') {
-                buf.append("&quot;");
+                sb.append("&quot;");
             } else if (ch == '\'') {
-                buf.append("&#039;");
+                sb.append("&#039;");
             } else if (ch == '&') {
-                buf.append("&amp;");
+                sb.append("&amp;");
             } else if (ch < ' ') {
-                buf.append("&#" + Integer.toString(ch) + ";");
+                sb.append("&#" + Integer.toString(ch) + ";");
             } else {
                 int c = (ch & 0xFFFF);
                 if (c > 127) {
-                    buf.append("&#" + Integer.toString(c) + ";");
+                    sb.append("&#" + Integer.toString(c) + ";");
                 } else {
-                    buf.append(ch);
+                    sb.append(ch);
                 }
             }
         }
-        return buf.toString();
+        return sb.toString();
     }
 }
--- a/jdk/src/share/classes/com/sun/tools/jdi/FieldImpl.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/jdi/FieldImpl.java	Fri Jul 11 05:59:08 2014 -0700
@@ -95,12 +95,12 @@
     }
 
     public String toString() {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
-        buf.append(declaringType().name());
-        buf.append('.');
-        buf.append(name());
+        sb.append(declaringType().name());
+        sb.append('.');
+        sb.append(name());
 
-        return buf.toString();
+        return sb.toString();
     }
 }
--- a/jdk/src/share/classes/com/sun/tools/jdi/JNITypeParser.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/jdi/JNITypeParser.java	Fri Jul 11 05:59:08 2014 -0700
@@ -44,11 +44,11 @@
     }
 
     static String typeNameToSignature(String signature) {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         int firstIndex = signature.indexOf('[');
         int index = firstIndex;
         while (index != -1) {
-            buffer.append('[');
+            sb.append('[');
             index = signature.indexOf('[', index + 1);
         }
 
@@ -57,28 +57,28 @@
         }
 
         if (signature.equals("boolean")) {
-            buffer.append('Z');
+            sb.append('Z');
         } else if (signature.equals("byte")) {
-            buffer.append('B');
+            sb.append('B');
         } else if (signature.equals("char")) {
-            buffer.append('C');
+            sb.append('C');
         } else if (signature.equals("short")) {
-            buffer.append('S');
+            sb.append('S');
         } else if (signature.equals("int")) {
-            buffer.append('I');
+            sb.append('I');
         } else if (signature.equals("long")) {
-            buffer.append('J');
+            sb.append('J');
         } else if (signature.equals("float")) {
-            buffer.append('F');
+            sb.append('F');
         } else if (signature.equals("double")) {
-            buffer.append('D');
+            sb.append('D');
         } else {
-            buffer.append('L');
-            buffer.append(signature.replace('.', '/'));
-            buffer.append(';');
+            sb.append('L');
+            sb.append(signature.replace('.', '/'));
+            sb.append(';');
         }
 
-        return buffer.toString();
+        return sb.toString();
     }
 
     String typeName() {
--- a/jdk/src/share/classes/com/sun/tools/jdi/MethodImpl.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/jdi/MethodImpl.java	Fri Jul 11 05:59:08 2014 -0700
@@ -387,7 +387,7 @@
     }
 
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append(declaringType().name());
         sb.append(".");
         sb.append(name());
--- a/jdk/src/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java	Fri Jul 11 05:59:08 2014 -0700
@@ -751,7 +751,7 @@
     String baseSourceDir() {
         if (baseSourceDir == null) {
             String typeName = name();
-            StringBuffer sb = new StringBuffer(typeName.length() + 10);
+            StringBuilder sb = new StringBuilder(typeName.length() + 10);
             int index = 0;
             int nextIndex;
 
--- a/jdk/src/share/classes/com/sun/tools/jdi/SDE.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/jdi/SDE.java	Fri Jul 11 05:59:08 2014 -0700
@@ -56,16 +56,16 @@
                 if (sourcePath == null) {
                     sourcePath = refType.baseSourceDir() + sourceName;
                 } else {
-                    StringBuffer buf = new StringBuffer();
+                    StringBuilder sb = new StringBuilder();
                     for (int i = 0; i < sourcePath.length(); ++i) {
                         char ch = sourcePath.charAt(i);
                         if (ch == '/') {
-                            buf.append(File.separatorChar);
+                            sb.append(File.separatorChar);
                         } else {
-                            buf.append(ch);
+                            sb.append(ch);
                         }
                     }
-                    sourcePath = buf.toString();
+                    sourcePath = sb.toString();
                 }
                 isConverted = true;
             }
@@ -327,7 +327,7 @@
     }
 
     String readLine() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         char ch;
 
         ignoreWhite();
--- a/jdk/src/share/classes/com/sun/tools/jdi/TargetVM.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/jdi/TargetVM.java	Fri Jul 11 05:59:08 2014 -0700
@@ -78,7 +78,7 @@
                           ", errorCode=" + packet.errorCode +
                           ", flags=" + packet.flags);
         }
-        StringBuffer line = new StringBuffer(80);
+        StringBuilder line = new StringBuilder(80);
         line.append("0000: ");
         for (int i = 0; i < packet.data.length; i++) {
             if ((i > 0) && (i % 16 == 0)) {
--- a/jdk/src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java	Fri Jul 11 05:59:08 2014 -0700
@@ -742,7 +742,7 @@
     }
 
     void printReceiveTrace(int depth, String string) {
-        StringBuffer sb = new StringBuffer("Receiving:");
+        StringBuilder sb = new StringBuilder("Receiving:");
         for (int i = depth; i > 0; --i) {
             sb.append("    ");
         }
@@ -872,7 +872,7 @@
     ReferenceTypeImpl referenceType(long id, int tag,
                                                  String signature) {
         if ((vm.traceFlags & VirtualMachine.TRACE_REFTYPES) != 0) {
-            StringBuffer sb = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
             sb.append("Looking up ");
             if (tag == JDWP.TypeTag.CLASS) {
                 sb.append("Class");
--- a/jdk/src/share/classes/java/beans/Introspector.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/beans/Introspector.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1282,7 +1282,7 @@
      * Creates a key for a method in a method cache.
      */
     private static String makeQualifiedMethodName(String name, String[] params) {
-        StringBuffer sb = new StringBuffer(name);
+        StringBuilder sb = new StringBuilder(name);
         sb.append('=');
         for (int i = 0; i < params.length; i++) {
             sb.append(':');
--- a/jdk/src/share/classes/java/beans/Statement.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/beans/Statement.java	Fri Jul 11 05:59:08 2014 -0700
@@ -340,7 +340,7 @@
         if (arguments == null) {
             arguments = emptyArray;
         }
-        StringBuffer result = new StringBuffer(instanceName(target) + "." + methodName + "(");
+        StringBuilder result = new StringBuilder(instanceName(target) + "." + methodName + "(");
         int n = arguments.length;
         for(int i = 0; i < n; i++) {
             result.append(instanceName(arguments[i]));
--- a/jdk/src/share/classes/java/io/RandomAccessFile.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/io/RandomAccessFile.java	Fri Jul 11 05:59:08 2014 -0700
@@ -890,7 +890,7 @@
      */
 
     public final String readLine() throws IOException {
-        StringBuffer input = new StringBuffer();
+        StringBuilder input = new StringBuilder();
         int c = -1;
         boolean eol = false;
 
--- a/jdk/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Fri Jul 11 05:59:08 2014 -0700
@@ -40,6 +40,7 @@
 import static java.lang.invoke.MethodHandleNatives.Constants.*;
 import static java.lang.invoke.LambdaForm.BasicType.*;
 import sun.invoke.util.VerifyType;
+import sun.reflect.misc.ReflectUtil;
 
 /**
  * Code generation backend for LambdaForm.
@@ -594,6 +595,8 @@
             return false;  // inner class of some sort
         if (cls.getClassLoader() != MethodHandle.class.getClassLoader())
             return false;  // not on BCP
+        if (ReflectUtil.isVMAnonymousClass(cls)) // FIXME: switch to supported API once it is added
+            return false;
         MethodType mtype = member.getMethodOrFieldType();
         if (!isStaticallyNameable(mtype.returnType()))
             return false;
@@ -612,6 +615,8 @@
             cls = cls.getComponentType();
         if (cls.isPrimitive())
             return true;  // int[].class, for example
+        if (ReflectUtil.isVMAnonymousClass(cls)) // FIXME: switch to supported API once it is added
+            return false;
         // could use VerifyAccess.isClassAccessible but the following is a safe approximation
         if (cls.getClassLoader() != Object.class.getClassLoader())
             return false;
--- a/jdk/src/share/classes/java/net/IDN.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/net/IDN.java	Fri Jul 11 05:59:08 2014 -0700
@@ -111,7 +111,7 @@
     public static String toASCII(String input, int flag)
     {
         int p = 0, q = 0;
-        StringBuffer out = new StringBuffer();
+        StringBuilder out = new StringBuilder();
 
         if (isRootLabel(input)) {
             return ".";
@@ -172,7 +172,7 @@
      */
     public static String toUnicode(String input, int flag) {
         int p = 0, q = 0;
-        StringBuffer out = new StringBuffer();
+        StringBuilder out = new StringBuilder();
 
         if (isRootLabel(input)) {
             return ".";
--- a/jdk/src/share/classes/java/net/SocketPermission.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/net/SocketPermission.java	Fri Jul 11 05:59:08 2014 -0700
@@ -733,7 +733,7 @@
         InetAddress auth;
 
         try {
-            StringBuffer sb = new StringBuffer(39);
+            StringBuilder sb = new StringBuilder(39);
 
             for (int i = 15; i >= 0; i--) {
                 sb.append(Integer.toHexString(((addr[i]) & 0x0f)));
--- a/jdk/src/share/classes/java/net/URI.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/net/URI.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1957,7 +1957,7 @@
     private void defineString() {
         if (string != null) return;
 
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         if (scheme != null) {
             sb.append(scheme);
             sb.append(':');
@@ -2015,7 +2015,7 @@
             if (i >= 0)
                 path = base.substring(0, i + 1);
         } else {
-            StringBuffer sb = new StringBuffer(base.length() + cn);
+            StringBuilder sb = new StringBuilder(base.length() + cn);
             // 5.2 (6a)
             if (i >= 0)
                 sb.append(base.substring(0, i + 1));
@@ -2778,7 +2778,7 @@
         if (s.indexOf('%') < 0)
             return s;
 
-        StringBuffer sb = new StringBuffer(n);
+        StringBuilder sb = new StringBuilder(n);
         ByteBuffer bb = ByteBuffer.allocate(n);
         CharBuffer cb = CharBuffer.allocate(n);
         CharsetDecoder dec = ThreadLocalCoders.decoderFor("UTF-8")
--- a/jdk/src/share/classes/java/net/URISyntaxException.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/net/URISyntaxException.java	Fri Jul 11 05:59:08 2014 -0700
@@ -121,7 +121,7 @@
      * @return  A string describing the parse error
      */
     public String getMessage() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append(getReason());
         if (index > -1) {
             sb.append(" at index ");
--- a/jdk/src/share/classes/java/net/URLDecoder.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/net/URLDecoder.java	Fri Jul 11 05:59:08 2014 -0700
@@ -134,7 +134,7 @@
 
         boolean needToChange = false;
         int numChars = s.length();
-        StringBuffer sb = new StringBuffer(numChars > 500 ? numChars / 2 : numChars);
+        StringBuilder sb = new StringBuilder(numChars > 500 ? numChars / 2 : numChars);
         int i = 0;
 
         if (enc.length() == 0) {
--- a/jdk/src/share/classes/java/net/URLEncoder.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/net/URLEncoder.java	Fri Jul 11 05:59:08 2014 -0700
@@ -201,7 +201,7 @@
         throws UnsupportedEncodingException {
 
         boolean needToChange = false;
-        StringBuffer out = new StringBuffer(s.length());
+        StringBuilder out = new StringBuilder(s.length());
         Charset charset;
         CharArrayWriter charArrayWriter = new CharArrayWriter();
 
--- a/jdk/src/share/classes/java/net/URLStreamHandler.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/net/URLStreamHandler.java	Fri Jul 11 05:59:08 2014 -0700
@@ -486,7 +486,7 @@
         if (u.getRef() != null)
             len += 1 + u.getRef().length();
 
-        StringBuffer result = new StringBuffer(len);
+        StringBuilder result = new StringBuilder(len);
         result.append(u.getProtocol());
         result.append(":");
         if (u.getAuthority() != null && u.getAuthority().length() > 0) {
--- a/jdk/src/share/classes/java/nio/file/InvalidPathException.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/nio/file/InvalidPathException.java	Fri Jul 11 05:59:08 2014 -0700
@@ -117,7 +117,7 @@
      * @return  a string describing the error
      */
     public String getMessage() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append(getReason());
         if (index > -1) {
             sb.append(" at index ");
--- a/jdk/src/share/classes/java/rmi/dgc/VMID.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/rmi/dgc/VMID.java	Fri Jul 11 05:59:08 2014 -0700
@@ -120,15 +120,15 @@
      * Return string representation of this VMID.
      */
     public String toString() {
-        StringBuffer result = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         if (addr != null)
             for (int i = 0; i < addr.length; ++ i) {
                 int x = addr[i] & 0xFF;
-                result.append((x < 0x10 ? "0" : "") +
-                              Integer.toString(x, 16));
+                sb.append((x < 0x10 ? "0" : "") +
+                          Integer.toString(x, 16));
             }
-        result.append(':');
-        result.append(uid.toString());
-        return result.toString();
+        sb.append(':');
+        sb.append(uid.toString());
+        return sb.toString();
     }
 }
--- a/jdk/src/share/classes/java/security/CodeSigner.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/security/CodeSigner.java	Fri Jul 11 05:59:08 2014 -0700
@@ -154,7 +154,7 @@
      *         if present.
      */
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("(");
         sb.append("Signer: " + signerCertPath.getCertificates().get(0));
         if (timestamp != null) {
--- a/jdk/src/share/classes/java/security/Timestamp.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/security/Timestamp.java	Fri Jul 11 05:59:08 2014 -0700
@@ -141,7 +141,7 @@
      *         its signer's certificate.
      */
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("(");
         sb.append("timestamp: " + timestamp);
         List<? extends Certificate> certs = signerCertPath.getCertificates();
--- a/jdk/src/share/classes/java/security/cert/CertPath.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/security/cert/CertPath.java	Fri Jul 11 05:59:08 2014 -0700
@@ -220,7 +220,7 @@
      * @return a string representation of this certification path
      */
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         Iterator<? extends Certificate> stringIterator =
                                         getCertificates().iterator();
 
--- a/jdk/src/share/classes/java/security/cert/CollectionCertStoreParameters.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/security/cert/CollectionCertStoreParameters.java	Fri Jul 11 05:59:08 2014 -0700
@@ -132,7 +132,7 @@
      * @return a formatted string describing the parameters
      */
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("CollectionCertStoreParameters: [\n");
         sb.append("  collection: " + coll + "\n");
         sb.append("]");
--- a/jdk/src/share/classes/java/security/cert/LDAPCertStoreParameters.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/security/cert/LDAPCertStoreParameters.java	Fri Jul 11 05:59:08 2014 -0700
@@ -138,7 +138,7 @@
      * @return a formatted string describing the parameters
      */
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("LDAPCertStoreParameters: [\n");
 
         sb.append("  serverName: " + serverName + "\n");
--- a/jdk/src/share/classes/java/security/cert/PKIXBuilderParameters.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/security/cert/PKIXBuilderParameters.java	Fri Jul 11 05:59:08 2014 -0700
@@ -189,7 +189,7 @@
      * @return a formatted string describing the parameters
      */
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("[\n");
         sb.append(super.toString());
         sb.append("  Maximum Path Length: " + maxPathLength + "\n");
--- a/jdk/src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java	Fri Jul 11 05:59:08 2014 -0700
@@ -107,7 +107,7 @@
      *         {@code PKIXCertPathBuilderResult}
      */
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("PKIXCertPathBuilderResult: [\n");
         sb.append("  Certification Path: " + certPath + "\n");
         sb.append("  Trust Anchor: " + getTrustAnchor().toString() + "\n");
--- a/jdk/src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java	Fri Jul 11 05:59:08 2014 -0700
@@ -148,7 +148,7 @@
      *         {@code PKIXCertPathValidatorResult}
      */
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("PKIXCertPathValidatorResult: [\n");
         sb.append("  Trust Anchor: " + trustAnchor.toString() + "\n");
         sb.append("  Policy Tree: " + String.valueOf(policyTree) + "\n");
--- a/jdk/src/share/classes/java/security/cert/PKIXParameters.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/security/cert/PKIXParameters.java	Fri Jul 11 05:59:08 2014 -0700
@@ -693,7 +693,7 @@
      * @return a formatted string describing the parameters.
      */
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("[\n");
 
         /* start with trusted anchor info */
--- a/jdk/src/share/classes/java/security/cert/PolicyQualifierInfo.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/security/cert/PolicyQualifierInfo.java	Fri Jul 11 05:59:08 2014 -0700
@@ -161,7 +161,7 @@
         if (pqiString != null)
             return pqiString;
         HexDumpEncoder enc = new HexDumpEncoder();
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("PolicyQualifierInfo: [\n");
         sb.append("  qualifierID: " + mId + "\n");
         sb.append("  qualifier: " +
--- a/jdk/src/share/classes/java/security/cert/TrustAnchor.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/security/cert/TrustAnchor.java	Fri Jul 11 05:59:08 2014 -0700
@@ -317,7 +317,7 @@
      * @return a formatted string describing the {@code TrustAnchor}
      */
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("[\n");
         if (pubKey != null) {
             sb.append("  Trusted CA Public Key: " + pubKey.toString() + "\n");
--- a/jdk/src/share/classes/java/security/cert/X509CRLSelector.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/security/cert/X509CRLSelector.java	Fri Jul 11 05:59:08 2014 -0700
@@ -566,7 +566,7 @@
      *         {@code X509CRLSelector}.
      */
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("X509CRLSelector: [\n");
         if (issuerNames != null) {
             sb.append("  IssuerNames:\n");
--- a/jdk/src/share/classes/java/security/cert/X509CertSelector.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/security/cert/X509CertSelector.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1811,7 +1811,7 @@
      *         {@code CertSelector}
      */
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("X509CertSelector: [\n");
         if (x509Cert != null) {
             sb.append("  Certificate: " + x509Cert.toString() + "\n");
--- a/jdk/src/share/classes/java/text/AttributedString.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/text/AttributedString.java	Fri Jul 11 05:59:08 2014 -0700
@@ -243,11 +243,11 @@
             throw new IllegalArgumentException("Invalid substring range");
 
         // Copy the given string
-        StringBuffer textBuffer = new StringBuffer();
+        StringBuilder textBuilder = new StringBuilder();
         text.setIndex(beginIndex);
         for (char c = text.current(); text.getIndex() < endIndex; c = text.next())
-            textBuffer.append(c);
-        this.text = textBuffer.toString();
+            textBuilder.append(c);
+        this.text = textBuilder.toString();
 
         if (beginIndex == endIndex)
             return;
--- a/jdk/src/share/classes/java/text/ChoiceFormat.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/text/ChoiceFormat.java	Fri Jul 11 05:59:08 2014 -0700
@@ -259,7 +259,7 @@
      * @return the pattern string
      */
     public String toPattern() {
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
         for (int i = 0; i < choiceLimits.length; ++i) {
             if (i != 0) {
                 result.append('|');
--- a/jdk/src/share/classes/java/time/Instant.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/time/Instant.java	Fri Jul 11 05:59:08 2014 -0700
@@ -375,7 +375,7 @@
             return Instant.ofEpochSecond(instantSecs, nanoOfSecond);
         } catch (DateTimeException ex) {
             throw new DateTimeException("Unable to obtain Instant from TemporalAccessor: " +
-                    temporal + " of type " + temporal.getClass().getName());
+                    temporal + " of type " + temporal.getClass().getName(), ex);
         }
     }
 
@@ -1058,7 +1058,8 @@
         }
         // inline TemporalAccessor.super.query(query) as an optimization
         if (query == TemporalQueries.chronology() || query == TemporalQueries.zoneId() ||
-                query == TemporalQueries.zone() || query == TemporalQueries.offset()) {
+                query == TemporalQueries.zone() || query == TemporalQueries.offset() ||
+                query == TemporalQueries.localDate() || query == TemporalQueries.localTime()) {
             return null;
         }
         return query.queryFrom(this);
--- a/jdk/src/share/classes/java/time/OffsetDateTime.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/time/OffsetDateTime.java	Fri Jul 11 05:59:08 2014 -0700
@@ -357,10 +357,11 @@
         }
         try {
             ZoneOffset offset = ZoneOffset.from(temporal);
-            try {
-                LocalDateTime ldt = LocalDateTime.from(temporal);
-                return OffsetDateTime.of(ldt, offset);
-            } catch (DateTimeException ignore) {
+            LocalDate date = temporal.query(TemporalQueries.localDate());
+            LocalTime time = temporal.query(TemporalQueries.localTime());
+            if (date != null && time != null) {
+                return OffsetDateTime.of(date, time, offset);
+            } else {
                 Instant instant = Instant.from(temporal);
                 return OffsetDateTime.ofInstant(instant, offset);
             }
--- a/jdk/src/share/classes/java/time/ZonedDateTime.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/time/ZonedDateTime.java	Fri Jul 11 05:59:08 2014 -0700
@@ -81,6 +81,7 @@
 import java.time.temporal.TemporalAdjuster;
 import java.time.temporal.TemporalAmount;
 import java.time.temporal.TemporalField;
+import java.time.temporal.TemporalQueries;
 import java.time.temporal.TemporalQuery;
 import java.time.temporal.TemporalUnit;
 import java.time.temporal.UnsupportedTemporalTypeException;
@@ -551,14 +552,14 @@
         }
         try {
             ZoneId zone = ZoneId.from(temporal);
-            try {
+            if (temporal.isSupported(INSTANT_SECONDS)) {
                 long epochSecond = temporal.getLong(INSTANT_SECONDS);
                 int nanoOfSecond = temporal.get(NANO_OF_SECOND);
                 return create(epochSecond, nanoOfSecond, zone);
-
-            } catch (DateTimeException ex1) {
-                LocalDateTime ldt = LocalDateTime.from(temporal);
-                return of(ldt, zone);
+            } else {
+                LocalDate date = LocalDate.from(temporal);
+                LocalTime time = LocalTime.from(temporal);
+                return of(date, time, zone);
             }
         } catch (DateTimeException ex) {
             throw new DateTimeException("Unable to obtain ZonedDateTime from TemporalAccessor: " +
@@ -2039,8 +2040,12 @@
      * @throws DateTimeException if unable to query (defined by the query)
      * @throws ArithmeticException if numeric overflow occurs (defined by the query)
      */
+    @SuppressWarnings("unchecked")
     @Override  // override for Javadoc
     public <R> R query(TemporalQuery<R> query) {
+        if (query == TemporalQueries.localDate()) {
+            return (R) toLocalDate();
+        }
         return ChronoZonedDateTime.super.query(query);
     }
 
--- a/jdk/src/share/classes/java/time/format/DateTimeFormatterBuilder.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/time/format/DateTimeFormatterBuilder.java	Fri Jul 11 05:59:08 2014 -0700
@@ -3283,7 +3283,7 @@
             } catch (RuntimeException ex) {
                 return ~position;
             }
-            int successPos = text.length();
+            int successPos = pos;
             successPos = context.setParsedField(INSTANT_SECONDS, instantSecs, position, successPos);
             return context.setParsedField(NANO_OF_SECOND, nano, position, successPos);
         }
--- a/jdk/src/share/classes/java/time/format/Parsed.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/time/format/Parsed.java	Fri Jul 11 05:59:08 2014 -0700
@@ -66,6 +66,7 @@
 import static java.time.temporal.ChronoField.CLOCK_HOUR_OF_DAY;
 import static java.time.temporal.ChronoField.HOUR_OF_AMPM;
 import static java.time.temporal.ChronoField.HOUR_OF_DAY;
+import static java.time.temporal.ChronoField.INSTANT_SECONDS;
 import static java.time.temporal.ChronoField.MICRO_OF_DAY;
 import static java.time.temporal.ChronoField.MICRO_OF_SECOND;
 import static java.time.temporal.ChronoField.MILLI_OF_DAY;
@@ -74,14 +75,17 @@
 import static java.time.temporal.ChronoField.MINUTE_OF_HOUR;
 import static java.time.temporal.ChronoField.NANO_OF_DAY;
 import static java.time.temporal.ChronoField.NANO_OF_SECOND;
+import static java.time.temporal.ChronoField.OFFSET_SECONDS;
 import static java.time.temporal.ChronoField.SECOND_OF_DAY;
 import static java.time.temporal.ChronoField.SECOND_OF_MINUTE;
 
 import java.time.DateTimeException;
+import java.time.Instant;
 import java.time.LocalDate;
 import java.time.LocalTime;
 import java.time.Period;
 import java.time.ZoneId;
+import java.time.ZoneOffset;
 import java.time.chrono.ChronoLocalDate;
 import java.time.chrono.ChronoLocalDateTime;
 import java.time.chrono.ChronoZonedDateTime;
@@ -241,12 +245,15 @@
         resolveTimeLenient();
         crossCheck();
         resolvePeriod();
+        resolveFractional();
+        resolveInstant();
         return this;
     }
 
     //-----------------------------------------------------------------------
     private void resolveFields() {
         // resolve ChronoField
+        resolveInstantFields();
         resolveDateFields();
         resolveTimeFields();
 
@@ -300,6 +307,7 @@
             }
             // if something changed then have to redo ChronoField resolve
             if (changedCount > 0) {
+                resolveInstantFields();
                 resolveDateFields();
                 resolveTimeFields();
             }
@@ -316,6 +324,29 @@
     }
 
     //-----------------------------------------------------------------------
+    private void resolveInstantFields() {
+        // resolve parsed instant seconds to date and time if zone available
+        if (fieldValues.containsKey(INSTANT_SECONDS)) {
+            if (zone != null) {
+                resolveInstantFields0(zone);
+            } else {
+                Long offsetSecs = fieldValues.get(OFFSET_SECONDS);
+                if (offsetSecs != null) {
+                    ZoneOffset offset = ZoneOffset.ofTotalSeconds(offsetSecs.intValue());
+                    resolveInstantFields0(offset);
+                }
+            }
+        }
+    }
+
+    private void resolveInstantFields0(ZoneId selectedZone) {
+        Instant instant = Instant.ofEpochSecond(fieldValues.remove(INSTANT_SECONDS));
+        ChronoZonedDateTime<?> zdt = chrono.zonedDateTime(instant, selectedZone);
+        updateCheckConflict(zdt.toLocalDate());
+        updateCheckConflict(INSTANT_SECONDS, SECOND_OF_DAY, (long) zdt.toLocalTime().toSecondOfDay());
+    }
+
+    //-----------------------------------------------------------------------
     private void resolveDateFields() {
         updateCheckConflict(chrono.resolveDate(fieldValues, resolverStyle));
     }
@@ -533,6 +564,42 @@
         }
     }
 
+    private void resolveFractional() {
+        // ensure fractional seconds available as ChronoField requires
+        // resolveTimeLenient() will have merged MICRO_OF_SECOND/MILLI_OF_SECOND to NANO_OF_SECOND
+        if (time == null &&
+                (fieldValues.containsKey(INSTANT_SECONDS) ||
+                    fieldValues.containsKey(SECOND_OF_DAY) ||
+                    fieldValues.containsKey(SECOND_OF_MINUTE))) {
+            if (fieldValues.containsKey(NANO_OF_SECOND)) {
+                long nos = fieldValues.get(NANO_OF_SECOND);
+                fieldValues.put(MICRO_OF_SECOND, nos / 1000);
+                fieldValues.put(MILLI_OF_SECOND, nos / 1000000);
+            } else {
+                fieldValues.put(NANO_OF_SECOND, 0L);
+                fieldValues.put(MICRO_OF_SECOND, 0L);
+                fieldValues.put(MILLI_OF_SECOND, 0L);
+            }
+        }
+    }
+
+    private void resolveInstant() {
+        // add instant seconds if we have date, time and zone
+        if (date != null && time != null) {
+            if (zone != null) {
+                long instant = date.atTime(time).atZone(zone).getLong(ChronoField.INSTANT_SECONDS);
+                fieldValues.put(INSTANT_SECONDS, instant);
+            } else {
+                Long offsetSecs = fieldValues.get(OFFSET_SECONDS);
+                if (offsetSecs != null) {
+                    ZoneOffset offset = ZoneOffset.ofTotalSeconds(offsetSecs.intValue());
+                    long instant = date.atTime(time).atZone(offset).getLong(ChronoField.INSTANT_SECONDS);
+                    fieldValues.put(INSTANT_SECONDS, instant);
+                }
+            }
+        }
+    }
+
     private void updateCheckConflict(LocalTime timeToSet, Period periodToSet) {
         if (time != null) {
             if (time.equals(timeToSet) == false) {
@@ -568,18 +635,20 @@
         for (Iterator<Entry<TemporalField, Long>> it = fieldValues.entrySet().iterator(); it.hasNext(); ) {
             Entry<TemporalField, Long> entry = it.next();
             TemporalField field = entry.getKey();
-            long val1;
-            try {
-                val1 = target.getLong(field);
-            } catch (RuntimeException ex) {
-                continue;
+            if (target.isSupported(field)) {
+                long val1;
+                try {
+                    val1 = target.getLong(field);
+                } catch (RuntimeException ex) {
+                    continue;
+                }
+                long val2 = entry.getValue();
+                if (val1 != val2) {
+                    throw new DateTimeException("Conflict found: Field " + field + " " + val1 +
+                            " differs from " + field + " " + val2 + " derived from " + target);
+                }
+                it.remove();
             }
-            long val2 = entry.getValue();
-            if (val1 != val2) {
-                throw new DateTimeException("Conflict found: Field " + field + " " + val1 +
-                        " differs from " + field + " " + val2 + " derived from " + target);
-            }
-            it.remove();
         }
     }
 
--- a/jdk/src/share/classes/java/util/Properties.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/util/Properties.java	Fri Jul 11 05:59:08 2014 -0700
@@ -602,7 +602,7 @@
         if (bufLen < 0) {
             bufLen = Integer.MAX_VALUE;
         }
-        StringBuffer outBuffer = new StringBuffer(bufLen);
+        StringBuilder outBuffer = new StringBuilder(bufLen);
 
         for(int x=0; x<len; x++) {
             char aChar = theString.charAt(x);
--- a/jdk/src/share/classes/java/util/concurrent/ConcurrentHashMap.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/util/concurrent/ConcurrentHashMap.java	Fri Jul 11 05:59:08 2014 -0700
@@ -133,12 +133,12 @@
  * mapped values are (perhaps transiently) not used or all take the
  * same mapping value.
  *
- * <p>A ConcurrentHashMap can be used as scalable frequency map (a
+ * <p>A ConcurrentHashMap can be used as a scalable frequency map (a
  * form of histogram or multiset) by using {@link
  * java.util.concurrent.atomic.LongAdder} values and initializing via
  * {@link #computeIfAbsent computeIfAbsent}. For example, to add a count
  * to a {@code ConcurrentHashMap<String,LongAdder> freqs}, you can use
- * {@code freqs.computeIfAbsent(k -> new LongAdder()).increment();}
+ * {@code freqs.computeIfAbsent(key, k -> new LongAdder()).increment();}
  *
  * <p>This class and its views and iterators implement all of the
  * <em>optional</em> methods of the {@link Map} and {@link Iterator}
--- a/jdk/src/share/classes/java/util/concurrent/atomic/LongAdder.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/util/concurrent/atomic/LongAdder.java	Fri Jul 11 05:59:08 2014 -0700
@@ -57,7 +57,7 @@
  * frequency map (a form of histogram or multiset). For example, to
  * add a count to a {@code ConcurrentHashMap<String,LongAdder> freqs},
  * initializing if not already present, you can use {@code
- * freqs.computeIfAbsent(k -> new LongAdder()).increment();}
+ * freqs.computeIfAbsent(key, k -> new LongAdder()).increment();}
  *
  * <p>This class extends {@link Number}, but does <em>not</em> define
  * methods such as {@code equals}, {@code hashCode} and {@code
--- a/jdk/src/share/classes/java/util/prefs/Base64.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/util/prefs/Base64.java	Fri Jul 11 05:59:08 2014 -0700
@@ -57,7 +57,7 @@
         int numFullGroups = aLen/3;
         int numBytesInPartialGroup = aLen - 3*numFullGroups;
         int resultLen = 4*((aLen + 2)/3);
-        StringBuffer result = new StringBuffer(resultLen);
+        StringBuilder result = new StringBuilder(resultLen);
         char[] intToAlpha = (alternate ? intToAltBase64 : intToBase64);
 
         // Translate all full groups from byte array elements to Base64
--- a/jdk/src/share/classes/java/util/regex/PatternSyntaxException.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/java/util/regex/PatternSyntaxException.java	Fri Jul 11 05:59:08 2014 -0700
@@ -105,7 +105,7 @@
      * @return  The full detail message
      */
     public String getMessage() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append(desc);
         if (index >= 0) {
             sb.append(" near index ");
--- a/jdk/src/share/classes/javax/imageio/stream/ImageInputStreamImpl.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/imageio/stream/ImageInputStreamImpl.java	Fri Jul 11 05:59:08 2014 -0700
@@ -289,7 +289,7 @@
     }
 
     public String readLine() throws IOException {
-        StringBuffer input = new StringBuffer();
+        StringBuilder input = new StringBuilder();
         int c = -1;
         boolean eol = false;
 
--- a/jdk/src/share/classes/javax/naming/BinaryRefAddr.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/naming/BinaryRefAddr.java	Fri Jul 11 05:59:08 2014 -0700
@@ -165,7 +165,7 @@
       * @return The non-null string representation of this address.
       */
     public String toString(){
-        StringBuffer str = new StringBuffer("Address Type: " + addrType + "\n");
+        StringBuilder str = new StringBuilder("Address Type: " + addrType + "\n");
 
         str.append("AddressContents: ");
         for (int i = 0; i<buf.length && i < 32; i++) {
--- a/jdk/src/share/classes/javax/naming/NameImpl.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/naming/NameImpl.java	Fri Jul 11 05:59:08 2014 -0700
@@ -104,7 +104,7 @@
         String endQuote;
         boolean start = true;
         boolean one = false;
-        StringBuffer answer = new StringBuffer(len);
+        StringBuilder answer = new StringBuilder(len);
 
         while (i < len) {
             // handle quoted strings
--- a/jdk/src/share/classes/javax/naming/RefAddr.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/naming/RefAddr.java	Fri Jul 11 05:59:08 2014 -0700
@@ -139,7 +139,7 @@
       * @return The non-null string representation of this address.
       */
     public String toString(){
-        StringBuffer str = new StringBuffer("Type: " + addrType + "\n");
+        StringBuilder str = new StringBuilder("Type: " + addrType + "\n");
 
         str.append("Content: " + getContent() + "\n");
         return (str.toString());
--- a/jdk/src/share/classes/javax/naming/Reference.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/naming/Reference.java	Fri Jul 11 05:59:08 2014 -0700
@@ -364,13 +364,13 @@
       * @return The non-null string representation of this reference.
       */
     public String toString() {
-        StringBuffer buf = new StringBuffer("Reference Class Name: " +
-                                            className + "\n");
+        StringBuilder sb = new StringBuilder("Reference Class Name: " +
+                                             className + "\n");
         int len = addrs.size();
         for (int i = 0; i < len; i++)
-            buf.append(get(i).toString());
+            sb.append(get(i).toString());
 
-        return buf.toString();
+        return sb.toString();
     }
 
     /**
--- a/jdk/src/share/classes/javax/naming/directory/BasicAttribute.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/naming/directory/BasicAttribute.java	Fri Jul 11 05:59:08 2014 -0700
@@ -211,7 +211,7 @@
       * @return The non-null string representation of this attribute.
       */
     public String toString() {
-        StringBuffer answer = new StringBuffer(attrID + ": ");
+        StringBuilder answer = new StringBuilder(attrID + ": ");
         if (values.size() == 0) {
             answer.append("No values");
         } else {
--- a/jdk/src/share/classes/javax/print/MimeType.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/print/MimeType.java	Fri Jul 11 05:59:08 2014 -0700
@@ -285,7 +285,7 @@
      */
     private String getStringValue() {
         if (myStringValue == null) {
-            StringBuffer result = new StringBuffer();
+            StringBuilder result = new StringBuilder();
             result.append (myPieces[0]);
             result.append ('/');
             result.append (myPieces[1]);
@@ -510,7 +510,7 @@
         int n = s.length();
         int i;
         char c;
-        StringBuffer result = new StringBuffer (n+2);
+        StringBuilder result = new StringBuilder (n+2);
         result.append ('\"');
         for (i = 0; i < n; ++ i) {
             c = s.charAt (i);
--- a/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java	Fri Jul 11 05:59:08 2014 -0700
@@ -241,7 +241,7 @@
      *     (unchecked exception) Thrown if {@code units < 1}.
      */
     public String toString(int units, String unitsName) {
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
         result.append(getCrossFeedResolution (units));
         result.append('x');
         result.append(getFeedResolution (units));
@@ -326,7 +326,7 @@
      * resolution. The values are reported in the internal units of dphi.
      */
     public String toString() {
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
         result.append(crossFeedResolution);
         result.append('x');
         result.append(feedResolution);
--- a/jdk/src/share/classes/javax/print/attribute/SetOfIntegerSyntax.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/SetOfIntegerSyntax.java	Fri Jul 11 05:59:08 2014 -0700
@@ -540,7 +540,7 @@
      * <CODE>"<I>i</I>-<I>j</I>"</CODE> otherwise.
      */
     public String toString() {
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
         int n = members.length;
         for (int i = 0; i < n; i++) {
             if (i > 0) {
--- a/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java	Fri Jul 11 05:59:08 2014 -0700
@@ -257,7 +257,7 @@
      *     (unchecked exception) Thrown if {@code units < 1}.
      */
     public String toString(int units, String unitsName) {
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
         result.append(getX (units));
         result.append('x');
         result.append(getY (units));
@@ -312,7 +312,7 @@
      * The values are reported in the internal units of micrometers.
      */
     public String toString() {
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
         result.append(x);
         result.append('x');
         result.append(y);
--- a/jdk/src/share/classes/javax/security/auth/kerberos/KerberosTicket.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/security/auth/kerberos/KerberosTicket.java	Fri Jul 11 05:59:08 2014 -0700
@@ -636,11 +636,11 @@
     public String toString() {
         if (destroyed)
             throw new IllegalStateException("This ticket is no longer valid");
-        StringBuffer caddrBuf = new StringBuffer();
+        StringBuilder caddrString = new StringBuilder();
         if (clientAddresses != null) {
             for (int i = 0; i < clientAddresses.length; i++) {
-                caddrBuf.append("clientAddresses[" + i + "] = " +
-                                 clientAddresses[i].toString());
+                caddrString.append("clientAddresses[" + i + "] = " +
+                        clientAddresses[i].toString());
             }
         }
         return ("Ticket (hex) = " + "\n" +
@@ -660,7 +660,7 @@
                 "End Time = " + endTime.toString() + "\n" +
                 "Renew Till = " + String.valueOf(renewTill) + "\n" +
                 "Client Addresses " +
-                (clientAddresses == null ? " Null " : caddrBuf.toString() +
+                (clientAddresses == null ? " Null " : caddrString.toString() +
                 "\n"));
     }
 
--- a/jdk/src/share/classes/javax/sound/sampled/CompoundControl.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sound/sampled/CompoundControl.java	Fri Jul 11 05:59:08 2014 -0700
@@ -94,18 +94,18 @@
      */
     public String toString() {
 
-        StringBuffer buf = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         for (int i = 0; i < controls.length; i++) {
             if (i != 0) {
-                buf.append(", ");
+                sb.append(", ");
                 if ((i + 1) == controls.length) {
-                    buf.append("and ");
+                    sb.append("and ");
                 }
             }
-            buf.append(controls[i].getType());
+            sb.append(controls[i].getType());
         }
 
-        return new String(getType() + " Control containing " + buf + " Controls.");
+        return new String(getType() + " Control containing " + sb + " Controls.");
     }
 
 
--- a/jdk/src/share/classes/javax/sound/sampled/DataLine.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sound/sampled/DataLine.java	Fri Jul 11 05:59:08 2014 -0700
@@ -471,23 +471,23 @@
          */
         public String toString() {
 
-            StringBuffer buf = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
 
             if ( (formats.length == 1) && (formats[0] != null) ) {
-                buf.append(" supporting format " + formats[0]);
+                sb.append(" supporting format " + formats[0]);
             } else if (getFormats().length > 1) {
-                buf.append(" supporting " + getFormats().length + " audio formats");
+                sb.append(" supporting " + getFormats().length + " audio formats");
             }
 
             if ( (minBufferSize != AudioSystem.NOT_SPECIFIED) && (maxBufferSize != AudioSystem.NOT_SPECIFIED) ) {
-                buf.append(", and buffers of " + minBufferSize + " to " + maxBufferSize + " bytes");
+                sb.append(", and buffers of " + minBufferSize + " to " + maxBufferSize + " bytes");
             } else if ( (minBufferSize != AudioSystem.NOT_SPECIFIED) && (minBufferSize > 0) ) {
-                buf.append(", and buffers of at least " + minBufferSize + " bytes");
+                sb.append(", and buffers of at least " + minBufferSize + " bytes");
             } else if (maxBufferSize != AudioSystem.NOT_SPECIFIED) {
-                buf.append(", and buffers of up to " + minBufferSize + " bytes");
+                sb.append(", and buffers of up to " + minBufferSize + " bytes");
             }
 
-            return new String(super.toString() + buf);
+            return new String(super.toString() + sb);
         }
     } // class Info
 
--- a/jdk/src/share/classes/javax/sql/CommonDataSource.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/CommonDataSource.java	Fri Jul 11 05:59:08 2014 -0700
@@ -34,6 +34,7 @@
  * Interface that defines the methods which are common between <code>DataSource</code>,
  * <code>XADataSource</code> and <code>ConnectionPoolDataSource</code>.
  *
+ * @since 1.6
  */
 public interface CommonDataSource {
 
--- a/jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java	Fri Jul 11 05:59:08 2014 -0700
@@ -291,6 +291,8 @@
 * extending class overrides and reimplements any <code>BaseRowSet</code> method and encounters
 * connectivity or underlying data source issues, that method <b>may</b> in addition throw an
 * <code>SQLException</code> object for that reason.
+*
+* @since 1.5
 */
 
 public abstract class BaseRowSet implements Serializable, Cloneable {
--- a/jdk/src/share/classes/javax/sql/rowset/CachedRowSet.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/CachedRowSet.java	Fri Jul 11 05:59:08 2014 -0700
@@ -626,6 +626,7 @@
  * </PRE>
  *
  * @author Jonathan Bruce
+ * @since 1.5
  */
 
 public interface CachedRowSet extends RowSet, Joinable {
--- a/jdk/src/share/classes/javax/sql/rowset/FilteredRowSet.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/FilteredRowSet.java	Fri Jul 11 05:59:08 2014 -0700
@@ -122,6 +122,7 @@
  * synchronized with the data source.
  *
  * @author Jonathan Bruce
+ * @since 1.5
  */
 
 public interface FilteredRowSet extends WebRowSet {
--- a/jdk/src/share/classes/javax/sql/rowset/JdbcRowSet.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/JdbcRowSet.java	Fri Jul 11 05:59:08 2014 -0700
@@ -118,6 +118,7 @@
  * requirements of connected and disconnected <code>RowSet</code> objects.
  *
  * @author Jonathan Bruce
+ * @since 1.5
  */
 
 public interface JdbcRowSet extends RowSet, Joinable {
--- a/jdk/src/share/classes/javax/sql/rowset/JoinRowSet.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/JoinRowSet.java	Fri Jul 11 05:59:08 2014 -0700
@@ -217,6 +217,7 @@
  *       This method creates a copy that can be persisted to the data source.
  * </UL>
  *
+ * @since 1.5
  */
 
 public interface JoinRowSet extends WebRowSet {
--- a/jdk/src/share/classes/javax/sql/rowset/Joinable.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/Joinable.java	Fri Jul 11 05:59:08 2014 -0700
@@ -129,6 +129,7 @@
  *
  * @see JoinRowSet
  * @author  Jonathan Bruce
+ * @since 1.5
  */
 public interface Joinable {
 
--- a/jdk/src/share/classes/javax/sql/rowset/Predicate.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/Predicate.java	Fri Jul 11 05:59:08 2014 -0700
@@ -97,6 +97,7 @@
  * applications that use both column identification conventions.
  *
  * @author Jonathan Bruce, Amit Handa
+ * @since 1.5
  *
  */
 
--- a/jdk/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java	Fri Jul 11 05:59:08 2014 -0700
@@ -48,6 +48,8 @@
  * Therefore, any <code>RowSetMetaDataImpl</code> method that retrieves information
  * is defined as having unspecified behavior when it is called
  * before the <code>RowSet</code> object contains data.
+ *
+ * @since 1.5
  */
 public class RowSetMetaDataImpl implements RowSetMetaData,  Serializable {
 
--- a/jdk/src/share/classes/javax/sql/rowset/RowSetWarning.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/RowSetWarning.java	Fri Jul 11 05:59:08 2014 -0700
@@ -50,6 +50,8 @@
  * The inherited methods <code>getMessage</code>, <code>getSQLState</code>,
  * and <code>getErrorCode</code> retrieve information contained in a
  * <code>RowSetWarning</code> object.
+ *
+ * @since 1.5
  */
 public class RowSetWarning extends SQLException {
 
--- a/jdk/src/share/classes/javax/sql/rowset/WebRowSet.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/WebRowSet.java	Fri Jul 11 05:59:08 2014 -0700
@@ -408,6 +408,7 @@
  * @see javax.sql.rowset.CachedRowSet
  * @see javax.sql.rowset.FilteredRowSet
  * @see javax.sql.rowset.JoinRowSet
+ * @since 1.5
  */
 
 public interface WebRowSet extends CachedRowSet {
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SQLOutputImpl.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SQLOutputImpl.java	Fri Jul 11 05:59:08 2014 -0700
@@ -52,6 +52,8 @@
  * to write data from the <code>SQLData</code> object to
  * the <code>SQLOutputImpl</code> output stream as the
  * representation of an SQL user-defined type.
+ *
+ * @since 1.5
  */
 public class SQLOutputImpl implements SQLOutput {
 
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialArray.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialArray.java	Fri Jul 11 05:59:08 2014 -0700
@@ -56,6 +56,7 @@
  * SerialArray is to be used by more than one thread then access to the
  * SerialArray should be controlled by appropriate synchronization.
  *
+ * @since 1.5
  */
 public class SerialArray implements Array, Serializable, Cloneable {
 
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialBlob.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialBlob.java	Fri Jul 11 05:59:08 2014 -0700
@@ -58,6 +58,7 @@
  * should be controlled by appropriate synchronization.
  *
  * @author Jonathan Bruce
+ * @since 1.5
  */
 public class SerialBlob implements Blob, Serializable, Cloneable {
 
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialClob.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialClob.java	Fri Jul 11 05:59:08 2014 -0700
@@ -49,7 +49,9 @@
  * <p> A SerialClob is not safe for use by multiple concurrent threads.  If a
  * SerialClob is to be used by more than one thread then access to the SerialClob
  * should be controlled by appropriate synchronization.
+ *
  * @author Jonathan Bruce
+ * @since 1.5
  */
 public class SerialClob implements Clob, Serializable, Cloneable {
 
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialDatalink.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialDatalink.java	Fri Jul 11 05:59:08 2014 -0700
@@ -48,6 +48,8 @@
  * A SerialDatalink is not safe for use by multiple concurrent threads.  If a
  * SerialDatalink is to be used by more than one thread then access to the
  * SerialDatalink should be controlled by appropriate synchronization.
+ *
+ * @since 1.5
  */
 public class SerialDatalink implements Serializable, Cloneable {
 
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialException.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialException.java	Fri Jul 11 05:59:08 2014 -0700
@@ -32,6 +32,7 @@
  * SQL types such as <code>BLOB, CLOB, STRUCT or ARRAY</code> in
  * addition to SQL types such as <code>DATALINK and JAVAOBJECT</code>
  *
+ * @since 1.5
  */
 public class SerialException extends java.sql.SQLException {
 
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialJavaObject.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialJavaObject.java	Fri Jul 11 05:59:08 2014 -0700
@@ -54,6 +54,7 @@
  * SerialJavaObject should be controlled by appropriate synchronization.
  *
  * @author Jonathan Bruce
+ * @since 1.5
  */
 public class SerialJavaObject implements Serializable, Cloneable {
 
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialRef.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialRef.java	Fri Jul 11 05:59:08 2014 -0700
@@ -43,6 +43,7 @@
  * SerialRef is to be used by more than one thread then access to the SerialRef
  * should be controlled by appropriate synchronization.
  *
+ * @since 1.5
  */
 public class SerialRef implements Ref, Serializable, Cloneable {
 
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialStruct.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialStruct.java	Fri Jul 11 05:59:08 2014 -0700
@@ -57,6 +57,7 @@
  * SerialStruct is to be used by more than one thread then access to the
  * SerialStruct should be controlled by appropriate synchronization.
  *
+ * @since 1.5
  */
 public class SerialStruct implements Struct, Serializable, Cloneable {
 
--- a/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java	Fri Jul 11 05:59:08 2014 -0700
@@ -200,6 +200,7 @@
  * @author  Jonathan Bruce
  * @see javax.sql.rowset.spi.SyncProvider
  * @see javax.sql.rowset.spi.SyncFactoryException
+ * @since 1.5
  */
 public class SyncFactory {
 
--- a/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactoryException.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactoryException.java	Fri Jul 11 05:59:08 2014 -0700
@@ -35,6 +35,7 @@
  * @author Jonathan Bruce
  * @see javax.sql.rowset.spi.SyncFactory
  * @see javax.sql.rowset.spi.SyncFactoryException
+ * @since 1.5
  */
 public class SyncFactoryException extends java.sql.SQLException {
 
--- a/jdk/src/share/classes/javax/sql/rowset/spi/SyncProvider.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/spi/SyncProvider.java	Fri Jul 11 05:59:08 2014 -0700
@@ -209,6 +209,7 @@
  * @author Jonathan Bruce
  * @see javax.sql.rowset.spi.SyncFactory
  * @see javax.sql.rowset.spi.SyncFactoryException
+ * @since 1.5
  */
 public abstract class SyncProvider {
 
--- a/jdk/src/share/classes/javax/sql/rowset/spi/SyncProviderException.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/spi/SyncProviderException.java	Fri Jul 11 05:59:08 2014 -0700
@@ -61,6 +61,7 @@
  * @see javax.sql.rowset.spi.SyncFactory
  * @see javax.sql.rowset.spi.SyncResolver
  * @see javax.sql.rowset.spi.SyncFactoryException
+ * @since 1.5
  */
 public class SyncProviderException extends java.sql.SQLException {
 
--- a/jdk/src/share/classes/javax/sql/rowset/spi/SyncResolver.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/spi/SyncResolver.java	Fri Jul 11 05:59:08 2014 -0700
@@ -231,7 +231,9 @@
  *          }
  *      }
  * }</PRE>
+ *
  * @author  Jonathan Bruce
+ * @since 1.5
  */
 
 public interface SyncResolver extends RowSet {
--- a/jdk/src/share/classes/javax/sql/rowset/spi/TransactionalWriter.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/spi/TransactionalWriter.java	Fri Jul 11 05:59:08 2014 -0700
@@ -44,6 +44,8 @@
  * the <code>CachedRowSet</code> constant <code>COMMIT_ON_ACCEPT_CHANGES</code>
  * to <code>false</code> and use the <code>commit</code> and <code>rollback</code>
  * methods defined in this interface to manage transaction boundaries.
+ *
+ * @since 1.5
  */
 public interface TransactionalWriter extends RowSetWriter {
 
--- a/jdk/src/share/classes/javax/sql/rowset/spi/XmlReader.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/spi/XmlReader.java	Fri Jul 11 05:59:08 2014 -0700
@@ -46,6 +46,8 @@
  * rowset's <code>xmlReader</code> field. When the <code>WebRowSet</code>
  * object's <code>readXml</code> method is invoked, it in turn invokes
  * its XML reader's <code>readXML</code> method.
+ *
+ * @since 1.5
  */
 public interface XmlReader extends RowSetReader {
 
--- a/jdk/src/share/classes/javax/sql/rowset/spi/XmlWriter.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/sql/rowset/spi/XmlWriter.java	Fri Jul 11 05:59:08 2014 -0700
@@ -44,6 +44,8 @@
  * Writing a <code>WebRowSet</code> object includes printing the
  * rowset's data, metadata, and properties, all with the
  * appropriate XML tags.
+ *
+ * @since 1.5
  */
 public interface XmlWriter extends RowSetWriter {
 
--- a/jdk/src/share/classes/javax/swing/AbstractButton.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/AbstractButton.java	Fri Jul 11 05:59:08 2014 -0700
@@ -947,6 +947,7 @@
      * <p>
      * This is a JavaBeans bound property.
      *
+     * @param iconTextGap the space between icon and text if these properties are set.
      * @since 1.4
      * @see #getIconTextGap
      * @beaninfo
@@ -1337,6 +1338,7 @@
      * that of the <code>Action</code>.
      *
      * @param a the button's action
+     * @return the {@code PropertyChangeListener}
      * @since 1.3
      * @see Action
      * @see #setAction
@@ -2070,12 +2072,20 @@
         }
     }
 
-
+    /**
+     * Returns {@code ActionListener} that is added to model.
+     *
+     * @return the {@code ActionListener}
+     */
     protected ActionListener createActionListener() {
         return getHandler();
     }
 
-
+    /**
+     * Returns {@code ItemListener} that is added to model.
+     *
+     * @return the {@code ItemListener}
+     */
     protected ItemListener createItemListener() {
         return getHandler();
     }
@@ -2148,7 +2158,7 @@
         return listenerList.getListeners(ItemListener.class);
     }
 
-   /**
+    /**
      * Returns an array (length 1) containing the label or
      * <code>null</code> if the button is not selected.
      *
@@ -2164,6 +2174,12 @@
         return selectedObjects;
     }
 
+    /**
+     * Initialization of the {@code AbstractButton}.
+     *
+     * @param text  the text of the button
+     * @param icon  the Icon image to display on the button
+     */
     protected void init(String text, Icon icon) {
         if(text != null) {
             setText(text);
--- a/jdk/src/share/classes/javax/swing/AbstractSpinnerModel.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/AbstractSpinnerModel.java	Fri Jul 11 05:59:08 2014 -0700
@@ -131,6 +131,7 @@
      * myAbstractSpinnerModel.getListeners(ChangeListener.class);
      * </pre>
      *
+     * @param <T> the type of requested listeners
      * @param listenerType the type of listeners to return, e.g. ChangeListener.class
      * @return all of the objects receiving <em>listenerType</em> notifications
      *         from this model
--- a/jdk/src/share/classes/javax/swing/Action.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/Action.java	Fri Jul 11 05:59:08 2014 -0700
@@ -337,6 +337,9 @@
     /**
      * Gets one of this object's properties
      * using the associated key.
+     *
+     * @param key a {@code String} containing the key
+     * @return the {@code Object} value
      * @see #putValue
      */
     public Object getValue(String key);
--- a/jdk/src/share/classes/javax/swing/ActionMap.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/ActionMap.java	Fri Jul 11 05:59:08 2014 -0700
@@ -94,6 +94,9 @@
      * for <code>key</code>.
      * <p>In most instances, <code>key</code> will be
      * <code>action.getValue(NAME)</code>.
+     *
+     * @param key a key
+     * @param action a binding for {@code key}
      */
     public void put(Object key, Action action) {
         if (key == null) {
@@ -113,6 +116,9 @@
     /**
      * Returns the binding for <code>key</code>, messaging the
      * parent <code>ActionMap</code> if the binding is not locally defined.
+     *
+     * @param key a key
+     * @return the binding for {@code key}
      */
     public Action get(Object key) {
         Action value = (arrayTable == null) ? null :
@@ -130,6 +136,8 @@
 
     /**
      * Removes the binding for <code>key</code> from this <code>ActionMap</code>.
+     *
+     * @param key a key
      */
     public void remove(Object key) {
         if (arrayTable != null) {
@@ -148,6 +156,8 @@
 
     /**
      * Returns the <code>Action</code> names that are bound in this <code>ActionMap</code>.
+     *
+     * @return an array of the keys
      */
     public Object[] keys() {
         if (arrayTable == null) {
@@ -172,6 +182,8 @@
      * Returns an array of the keys defined in this <code>ActionMap</code> and
      * its parent. This method differs from <code>keys()</code> in that
      * this method includes the keys defined in the parent.
+     *
+     * @return an array of the keys
      */
     public Object[] allKeys() {
         int           count = size();
--- a/jdk/src/share/classes/javax/swing/ButtonGroup.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/ButtonGroup.java	Fri Jul 11 05:59:08 2014 -0700
@@ -167,9 +167,11 @@
     }
 
     /**
-     * Returns whether a <code>ButtonModel</code> is selected.
-     * @return <code>true</code> if the button is selected,
-     *   otherwise returns <code>false</code>
+     * Returns whether a {@code ButtonModel} is selected.
+     *
+     * @param m an isntance of {@code ButtonModel}
+     * @return {@code true} if the button is selected,
+     *   otherwise returns {@code false}
      */
     public boolean isSelected(ButtonModel m) {
         return (m == selection);
--- a/jdk/src/share/classes/javax/swing/ComboBoxEditor.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/ComboBoxEditor.java	Fri Jul 11 05:59:08 2014 -0700
@@ -34,23 +34,44 @@
  */
 public interface ComboBoxEditor {
 
-  /** Return the component that should be added to the tree hierarchy for
-    * this editor
-    */
+  /**
+   * Returns the component that should be added to the tree hierarchy for
+   * this editor
+   *
+   * @return the component
+   */
   public Component getEditorComponent();
 
-  /** Set the item that should be edited. Cancel any editing if necessary **/
+  /**
+   * Set the item that should be edited. Cancel any editing if necessary
+   *
+   * @param anObject an item
+   */
   public void setItem(Object anObject);
 
-  /** Return the edited item **/
+  /**
+   * Returns the edited item
+   *
+   * @return the edited item
+   */
   public Object getItem();
 
-  /** Ask the editor to start editing and to select everything **/
+  /**
+   * Ask the editor to start editing and to select everything
+   */
   public void selectAll();
 
-  /** Add an ActionListener. An action event is generated when the edited item changes **/
+  /**
+   * Add an ActionListener. An action event is generated when the edited item changes
+   *
+   * @param l an {@code ActionListener}
+   */
   public void addActionListener(ActionListener l);
 
-  /** Remove an ActionListener **/
+  /**
+   * Remove an ActionListener
+   *
+   * @param l an {@code ActionListener}
+   */
   public void removeActionListener(ActionListener l);
 }
--- a/jdk/src/share/classes/javax/swing/ComponentInputMap.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/ComponentInputMap.java	Fri Jul 11 05:59:08 2014 -0700
@@ -78,7 +78,9 @@
     }
 
     /**
-     * Returns the component the <code>InputMap</code> was created for.
+     * Returns the component the {@code InputMap} was created for.
+     *
+     * @return the component the {@code InputMap} was created for.
      */
     public JComponent getComponent() {
         return component;
--- a/jdk/src/share/classes/javax/swing/DefaultButtonModel.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/DefaultButtonModel.java	Fri Jul 11 05:59:08 2014 -0700
@@ -477,6 +477,7 @@
      * If no such listeners exist,
      * this method returns an empty array.
      *
+     * @param <T> the type of requested listeners
      * @param listenerType  the type of listeners requested;
      *          this parameter should specify an interface
      *          that descends from <code>java.util.EventListener</code>
--- a/jdk/src/share/classes/javax/swing/FocusManager.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/FocusManager.java	Fri Jul 11 05:59:08 2014 -0700
@@ -140,6 +140,7 @@
      * Returns whether the application has invoked
      * <code>disableSwingFocusManager()</code>.
      *
+     * @return {@code true} if focus manager is enabled.
      * @see #disableSwingFocusManager
      * @deprecated As of 1.4, replaced by
      *   <code>KeyboardFocusManager.getDefaultFocusTraversalPolicy()</code>
--- a/jdk/src/share/classes/javax/swing/GroupLayout.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/GroupLayout.java	Fri Jul 11 05:59:08 2014 -0700
@@ -670,6 +670,7 @@
      * @param resizable whether the group is resizable
      * @param anchorBaselineToTop whether the baseline is anchored to
      *        the top or bottom of the group
+     * @return the {@code ParallelGroup}
      * @see #createBaselineGroup
      * @see ParallelGroup
      */
--- a/jdk/src/share/classes/javax/swing/JColorChooser.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/JColorChooser.java	Fri Jul 11 05:59:08 2014 -0700
@@ -542,7 +542,7 @@
      * @return  a string representation of this <code>JColorChooser</code>
      */
     protected String paramString() {
-        StringBuffer chooserPanelsString = new StringBuffer("");
+        StringBuilder chooserPanelsString = new StringBuilder("");
         for (int i=0; i<chooserPanels.length; i++) {
             chooserPanelsString.append("[" + chooserPanels[i].toString()
                                        + "]");
--- a/jdk/src/share/classes/javax/swing/JComboBox.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/JComboBox.java	Fri Jul 11 05:59:08 2014 -0700
@@ -232,6 +232,13 @@
         updateUI();
     }
 
+    /**
+     * Registers ancestor listener so that it will receive
+     * {@code AncestorEvents} when it or any of its ancestors
+     * move or are made visible or invisible.
+     * Events are also sent when the component or its ancestors are added
+     * or removed from the containment hierarchy.
+     */
     protected void installAncestorListener() {
         addAncestorListener(new AncestorListener(){
                                 public void ancestorAdded(AncestorEvent event){ hidePopup();}
@@ -812,6 +819,8 @@
 
     /**
      * Sets the visibility of the popup.
+     *
+     * @param v if {@code true} shows the popup, otherwise, hides the popup.
      */
     public void setPopupVisible(boolean v) {
         getUI().setPopupVisible(this, v);
@@ -1144,6 +1153,7 @@
      * that of the <code>Action</code>.
      *
      * @param a the combobox's action
+     * @return the {@code PropertyChangeListener}
      * @since 1.3
      * @see Action
      * @see #setAction
@@ -1357,6 +1367,8 @@
      *
      * @param keyChar a char, typically this is a keyboard key
      *                  typed by the user
+     * @return {@code true} if there is an item corresponding to that character.
+     *         Otherwise, returns {@code false}.
      */
     public boolean selectWithKeyChar(char keyChar) {
         int index;
@@ -1443,6 +1455,7 @@
      * selection. Typically, the first selection with a matching first
      * character becomes the selected item.
      *
+     * @param aManager a key selection manager
      * @beaninfo
      *       expert: true
      *  description: The objects that changes the selection when a key is pressed.
--- a/jdk/src/share/classes/javax/swing/JOptionPane.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/JOptionPane.java	Fri Jul 11 05:59:08 2014 -0700
@@ -435,6 +435,7 @@
      * @exception HeadlessException if
      *   <code>GraphicsEnvironment.isHeadless</code> returns
      *   <code>true</code>
+     * @return user's input
      * @see java.awt.GraphicsEnvironment#isHeadless
      */
     public static String showInputDialog(Object message)
@@ -451,6 +452,7 @@
      * @param message the <code>Object</code> to display
      * @param initialSelectionValue the value used to initialize the input
      *                 field
+     * @return user's input
      * @since 1.4
      */
     public static String showInputDialog(Object message, Object initialSelectionValue) {
@@ -469,6 +471,7 @@
      * @exception HeadlessException if
      *    <code>GraphicsEnvironment.isHeadless</code> returns
      *    <code>true</code>
+     * @return user's input
      * @see java.awt.GraphicsEnvironment#isHeadless
      */
     public static String showInputDialog(Component parentComponent,
@@ -489,6 +492,7 @@
      * @param message the <code>Object</code> to display
      * @param initialSelectionValue the value used to initialize the input
      *                 field
+     * @return user's input
      * @since 1.4
      */
     public static String showInputDialog(Component parentComponent, Object message,
@@ -515,6 +519,7 @@
      *                  <code>WARNING_MESSAGE</code>,
      *                  <code>QUESTION_MESSAGE</code>,
      *                  or <code>PLAIN_MESSAGE</code>
+     * @return user's input
      * @exception HeadlessException if
      *   <code>GraphicsEnvironment.isHeadless</code> returns
      *   <code>true</code>
@@ -1348,6 +1353,7 @@
      * @param parentComponent  the parent <code>Component</code>
      *          for the dialog
      * @param message  the <code>Object</code> to display
+     * @return user's input
      */
     public static String showInternalInputDialog(Component parentComponent,
                                                  Object message) {
@@ -1368,6 +1374,7 @@
      * @param messageType the type of message that is to be displayed:
      *                    ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE,
      *                    QUESTION_MESSAGE, or PLAIN_MESSAGE
+     * @return user's input
      */
     public static String showInternalInputDialog(Component parentComponent,
                              Object message, String title, int messageType) {
@@ -2246,6 +2253,8 @@
      * <p>
      * This is a bound property.
      *
+     * @param newValue if true, an input component whose parent is {@code parentComponent}
+     *                 is provided to allow the user to input a value.
      * @see #setSelectionValues
      * @see #setInputValue
      * @beaninfo
--- a/jdk/src/share/classes/javax/swing/JProgressBar.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/JProgressBar.java	Fri Jul 11 05:59:08 2014 -0700
@@ -665,6 +665,7 @@
      * to the {@code ChangeListener}s that have been added directly to the
      * progress bar.
      *
+     * @return the instance of a custom {@code ChangeListener} implementation.
      * @see #changeListener
      * @see #fireStateChanged
      * @see javax.swing.event.ChangeListener
--- a/jdk/src/share/classes/javax/swing/JRadioButton.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/JRadioButton.java	Fri Jul 11 05:59:08 2014 -0700
@@ -118,6 +118,7 @@
      * Creates a radiobutton where properties are taken from the
      * Action supplied.
      *
+     * @param a an {@code Action}
      * @since 1.3
      */
     public JRadioButton(Action a) {
@@ -175,6 +176,8 @@
      *
      * @param text  the string displayed on the radio button
      * @param icon  the image that the button should display
+     * @param selected if {@code true}, the button is initially selected
+     *                 otherwise, the button is initially unselected
      */
     public JRadioButton (String text, Icon icon, boolean selected) {
         super(text, icon, selected);
--- a/jdk/src/share/classes/javax/swing/JRadioButtonMenuItem.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/JRadioButtonMenuItem.java	Fri Jul 11 05:59:08 2014 -0700
@@ -173,6 +173,8 @@
      *
      * @param text  the string displayed on the radio button
      * @param icon  the image that the button should display
+     * @param selected if {@code true}, the button is initially selected,
+     *                 otherwise, the button is initially unselected
      */
     public JRadioButtonMenuItem(String text, Icon icon, boolean selected) {
         super(text, icon);
--- a/jdk/src/share/classes/javax/swing/JScrollBar.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/JScrollBar.java	Fri Jul 11 05:59:08 2014 -0700
@@ -149,6 +149,12 @@
      * @see #setVisibleAmount
      * @see #setMinimum
      * @see #setMaximum
+     *
+     * @param orientation an orientation of the {@code JScrollBar}
+     * @param value an int giving the current value
+     * @param extent an int giving the amount by which the value can "jump"
+     * @param min an int giving the minimum value
+     * @param max an int giving the maximum value
      */
     public JScrollBar(int orientation, int value, int extent, int min, int max)
     {
@@ -172,6 +178,8 @@
      * value = 0
      * extent = 10
      * </pre>
+     *
+     * @param orientation an orientation of the {@code JScrollBar}
      */
     public JScrollBar(int orientation) {
         this(orientation, 0, 10, 0, 100);
@@ -213,6 +221,7 @@
      * Returns the delegate that implements the look and feel for
      * this component.
      *
+     * @return the scroll bar's current UI.
      * @see JComponent#setUI
      */
     public ScrollBarUI getUI() {
@@ -258,6 +267,7 @@
      * Set the scrollbar's orientation to either VERTICAL or
      * HORIZONTAL.
      *
+     * @param orientation an orientation of the {@code JScrollBar}
      * @exception IllegalArgumentException if orientation is not one of VERTICAL, HORIZONTAL
      * @see #getOrientation
      * @beaninfo
@@ -293,6 +303,8 @@
      * Returns data model that handles the scrollbar's four
      * fundamental properties: minimum, maximum, value, extent.
      *
+     * @return the data model
+     *
      * @see #setModel
      */
     public BoundedRangeModel getModel() {
@@ -304,6 +316,7 @@
      * Sets the model that handles the scrollbar's four
      * fundamental properties: minimum, maximum, value, extent.
      *
+     * @param newModel a new model
      * @see #getModel
      * @beaninfo
      *       bound: true
@@ -583,6 +596,8 @@
      * scrollbar model will not generate ChangeEvents while
      * valueIsAdjusting is true.
      *
+     * @param b {@code true} if the upcoming changes to the value property are part of a series
+     *
      * @see #getValueIsAdjusting
      * @see BoundedRangeModel#setValueIsAdjusting
      * @beaninfo
@@ -610,6 +625,10 @@
      * minimum &le; value &le; value+extent &le; maximum
      * </pre>
      *
+     * @param newValue an int giving the current value
+     * @param newExtent an int giving the amount by which the value can "jump"
+     * @param newMin an int giving the minimum value
+     * @param newMax an int giving the maximum value
      *
      * @see BoundedRangeModel#setRangeProperties
      * @see #setValue
@@ -681,6 +700,10 @@
     /**
      * Notify listeners that the scrollbar's model has changed.
      *
+     * @param id an integer indicating the type of event.
+     * @param type an integer indicating the adjustment type.
+     * @param value the current value of the adjustment
+     *
      * @see #addAdjustmentListener
      * @see EventListenerList
      */
--- a/jdk/src/share/classes/javax/swing/JToggleButton.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/JToggleButton.java	Fri Jul 11 05:59:08 2014 -0700
@@ -140,6 +140,7 @@
      * Creates a toggle button where properties are taken from the
      * Action supplied.
      *
+     * @param a an instance of an {@code Action}
      * @since 1.3
      */
     public JToggleButton(Action a) {
@@ -390,6 +391,9 @@
     protected class AccessibleJToggleButton extends AccessibleAbstractButton
             implements ItemListener {
 
+        /**
+         * Constructs {@code AccessibleJToggleButton}
+         */
         public AccessibleJToggleButton() {
             super();
             JToggleButton.this.addItemListener(this);
--- a/jdk/src/share/classes/javax/swing/JToolBar.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/JToolBar.java	Fri Jul 11 05:59:08 2014 -0700
@@ -161,6 +161,8 @@
 
     /**
      * Returns the tool bar's current UI.
+     *
+     * @return the tool bar's current UI.
      * @see #setUI
      */
     public ToolBarUI getUI() {
@@ -555,7 +557,8 @@
      * or <code>null</code> if the default
      * property change listener for the control is desired.
      *
-     * @return <code>null</code>
+     * @param b a {@code JButton}
+     * @return {@code null}
      */
     protected PropertyChangeListener createActionChangeListener(JButton b) {
         return null;
--- a/jdk/src/share/classes/javax/swing/JTree.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/JTree.java	Fri Jul 11 05:59:08 2014 -0700
@@ -986,6 +986,7 @@
      * or equal to 0 the height for each row is determined by the
      * renderer.
      *
+     * @return the height of each row
      */
     public int getRowHeight()
     {
@@ -1115,6 +1116,7 @@
      * <p>
      * This is a bound property.
      *
+     * @param clickCount the number of mouse clicks to get a node expanded or closed
      * @since 1.3
      * @beaninfo
      *        bound: true
@@ -1508,6 +1510,7 @@
      * is provided as an entry point for subclassers to add filtered
      * editing without having to resort to creating a new editor.
      *
+     * @param path a {@code TreePath} identifying a node
      * @return true if every parent node and the node itself is editable
      * @see #isEditable
      */
@@ -1984,6 +1987,8 @@
     /**
      * Returns true if the node identified by the path has ever been
      * expanded.
+     *
+     * @param path a {@code TreePath} identifying a node
      * @return true if the <code>path</code> has ever been expanded
      */
     public boolean hasBeenExpanded(TreePath path) {
@@ -2079,6 +2084,7 @@
      * which means it is either the root or all of its parents are expanded.
      * Otherwise, this method returns false.
      *
+     * @param path {@code TreePath} identifying a node
      * @return true if the node is viewable, otherwise false
      */
     public boolean isVisible(TreePath path) {
@@ -2472,6 +2478,7 @@
      * set the selection model to <code>null</code>, which forces an empty
      * selection model to be used.
      *
+     * @return the model for selections
      * @see #setSelectionModel
      */
     public TreeSelectionModel getSelectionModel() {
@@ -2817,6 +2824,7 @@
      *
      * @param path the <code>TreePath</code> indicating the node that was
      *          expanded
+     * @throws ExpandVetoException if the expansion is prevented from occurring
      * @see EventListenerList
      */
      public void fireTreeWillExpand(TreePath path) throws ExpandVetoException {
@@ -2843,6 +2851,7 @@
      *
      * @param path the <code>TreePath</code> indicating the node that was
      *          expanded
+     * @throws ExpandVetoException if the collapse is prevented from occurring
      * @see EventListenerList
      */
      public void fireTreeWillCollapse(TreePath path) throws ExpandVetoException {
@@ -3541,6 +3550,11 @@
      * <code>path</code> are marked EXPANDED, but <code>path</code> itself
      * is marked collapsed.<p>
      * This will fail if a <code>TreeWillExpandListener</code> vetos it.
+     *
+     * @param path a {@code TreePath} identifying a node
+     * @param state if {@code true}, all parents of @{code path} and path are marked as expanded.
+     *              Otherwise, all parents of {@code path} are marked EXPANDED,
+     *              but {@code path} itself is marked collapsed.
      */
     protected void setExpandedState(TreePath path, boolean state) {
         if(path != null) {
@@ -3636,9 +3650,12 @@
     }
 
     /**
-     * Returns an <code>Enumeration</code> of <code>TreePaths</code>
+     * Returns an {@code Enumeration} of {@code TreePaths}
      * that have been expanded that
-     * are descendants of <code>parent</code>.
+     * are descendants of {@code parent}.
+     *
+     * @param parent a path
+     * @return the {@code Enumeration} of {@code TreePaths}
      */
     protected Enumeration<TreePath>
         getDescendantToggledPaths(TreePath parent)
@@ -3701,6 +3718,8 @@
       * <p>
       * For more information on what expanded state means, see the
       * <a href=#jtree_description>JTree description</a> above.
+      *
+      * @return the instance of {@code TreeModelHandler}
       */
      protected TreeModelListener createTreeModelListener() {
          return new TreeModelHandler();
@@ -3711,6 +3730,9 @@
      * <code>path</code>. If <code>includePath</code> is true and
      * <code>path</code> is selected, it will be removed from the selection.
      *
+     * @param path a path
+     * @param includePath is {@code true} and {@code path} is selected,
+     *                    it will be removed from the selection.
      * @return true if a descendant was selected
      * @since 1.3
      */
@@ -3891,6 +3913,9 @@
          * elements are added is children, otherwise if <code>children</code>
          * is a hashtable all the key/value pairs are added in the order
          * <code>Enumeration</code> returns them.
+         *
+         * @param parent the parent node
+         * @param children the children
          */
         public static void createChildren(DefaultMutableTreeNode parent,
                                           Object children) {
@@ -4113,6 +4138,9 @@
         TreePath   leadSelectionPath;
         Accessible leadSelectionAccessible;
 
+        /**
+         * Constructs {@code AccessibleJTree}
+         */
         public AccessibleJTree() {
             // Add a tree model listener for JTree
             TreeModel model = JTree.this.getModel();
@@ -4551,7 +4579,11 @@
             private boolean isLeaf = false;
 
             /**
-             *  Constructs an AccessibleJTreeNode
+             * Constructs an AccessibleJTreeNode
+             *
+             * @param t an instance of {@code JTree}
+             * @param p an instance of {@code TreePath}
+             * @param ap an instance of {@code Accessible}
              * @since 1.4
              */
             public AccessibleJTreeNode(JTree t, TreePath p, Accessible ap) {
@@ -5183,6 +5215,11 @@
                 }
             }
 
+            /**
+             * Returns the relative location of the node
+             *
+             * @return the relative location of the node
+             */
             protected Point getLocationInJTree() {
                 Rectangle r = tree.getPathBounds(path);
                 if (r != null) {
--- a/jdk/src/share/classes/javax/swing/ListSelectionModel.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/ListSelectionModel.java	Fri Jul 11 05:59:08 2014 -0700
@@ -134,18 +134,25 @@
 
     /**
      * Returns the first selected index or -1 if the selection is empty.
+     *
+     * @return the first selected index or -1 if the selection is empty.
      */
     int getMinSelectionIndex();
 
 
     /**
      * Returns the last selected index or -1 if the selection is empty.
+     *
+     * @return the last selected index or -1 if the selection is empty.
      */
     int getMaxSelectionIndex();
 
 
     /**
      * Returns true if the specified index is selected.
+     *
+     * @param index an index
+     * @return {@code true} if the specified index is selected
      */
     boolean isSelectedIndex(int index);
 
@@ -158,6 +165,7 @@
      * indices specially, e.g. Windows95 displays the lead index with a
      * dotted yellow outline.
      *
+     * @return the anchor selection index
      * @see #getLeadSelectionIndex
      * @see #setSelectionInterval
      * @see #addSelectionInterval
@@ -168,6 +176,7 @@
     /**
      * Set the anchor selection index.
      *
+     * @param index the anchor selection index
      * @see #getAnchorSelectionIndex
      */
     void setAnchorSelectionIndex(int index);
@@ -177,6 +186,7 @@
      * Return the second index argument from the most recent call to
      * setSelectionInterval(), addSelectionInterval() or removeSelectionInterval().
      *
+     * @return the lead selection index.
      * @see #getAnchorSelectionIndex
      * @see #setSelectionInterval
      * @see #addSelectionInterval
@@ -186,6 +196,7 @@
     /**
      * Set the lead selection index.
      *
+     * @param index the lead selection index
      * @see #getLeadSelectionIndex
      */
     void setLeadSelectionIndex(int index);
@@ -200,20 +211,30 @@
 
     /**
      * Returns true if no indices are selected.
+     *
+     * @return {@code true} if no indices are selected.
      */
     boolean isSelectionEmpty();
 
     /**
-     * Insert length indices beginning before/after index.  This is typically
+     * Insert {@code length} indices beginning before/after {@code index}. This is typically
      * called to sync the selection model with a corresponding change
      * in the data model.
+     *
+     * @param index the beginning of the interval
+     * @param length the length of the interval
+     * @param before if {@code true}, interval inserts before the {@code index},
+     *               otherwise, interval inserts after the {@code index}
      */
     void insertIndexInterval(int index, int length, boolean before);
 
     /**
-     * Remove the indices in the interval index0,index1 (inclusive) from
+     * Remove the indices in the interval {@code index0,index1} (inclusive) from
      * the selection model.  This is typically called to sync the selection
      * model width a corresponding change in the data model.
+     *
+     * @param index0 the beginning of the interval
+     * @param index1 the end of the interval
      */
     void removeIndexInterval(int index0, int index1);
 
@@ -272,6 +293,7 @@
      *   In this mode, there's no restriction on what can be selected.
      * </ul>
      *
+     * @param selectionMode the selection mode
      * @see #getSelectionMode
      * @throws IllegalArgumentException if the selection mode isn't
      *         one of those allowed
--- a/jdk/src/share/classes/javax/swing/MultiUIDefaults.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/MultiUIDefaults.java	Fri Jul 11 05:59:08 2014 -0700
@@ -190,18 +190,18 @@
 
     @Override
     public synchronized String toString() {
-        StringBuffer buf = new StringBuffer();
-        buf.append("{");
+        StringBuilder sb = new StringBuilder();
+        sb.append("{");
         Enumeration keys = keys();
         while (keys.hasMoreElements()) {
             Object key = keys.nextElement();
-            buf.append(key + "=" + get(key) + ", ");
+            sb.append(key + "=" + get(key) + ", ");
         }
-        int length = buf.length();
+        int length = sb.length();
         if (length > 1) {
-            buf.delete(length-2, length);
+            sb.delete(length-2, length);
         }
-        buf.append("}");
-        return buf.toString();
+        sb.append("}");
+        return sb.toString();
     }
 }
--- a/jdk/src/share/classes/javax/swing/RepaintManager.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/RepaintManager.java	Fri Jul 11 05:59:08 2014 -0700
@@ -331,6 +331,7 @@
      * for the event dispatching thread that will validate the components
      * first isValidateRoot() ancestor.
      *
+     * @param invalidComponent a component
      * @see JComponent#isValidateRoot
      * @see #removeInvalidComponent
      */
@@ -374,6 +375,7 @@
     /**
      * Remove a component from the list of invalid components.
      *
+     * @param component a component
      * @see #addInvalidComponent
      */
     public synchronized void removeInvalidComponent(JComponent component) {
@@ -610,9 +612,13 @@
         return false;
     }
 
-    /** Return the current dirty region for a component.
-     *  Return an empty rectangle if the component is not
-     *  dirty.
+    /**
+     * Return the current dirty region for a component.
+     * Return an empty rectangle if the component is not
+     * dirty.
+     *
+     * @param aComponent a component
+     * @return the region
      */
     public Rectangle getDirtyRegion(JComponent aComponent) {
         RepaintManager delegate = getDelegate(aComponent);
@@ -632,6 +638,8 @@
     /**
      * Mark a component completely dirty. <b>aComponent</b> will be
      * completely painted during the next paintDirtyRegions() call.
+     *
+     * @param aComponent a component
      */
     public void markCompletelyDirty(JComponent aComponent) {
         RepaintManager delegate = getDelegate(aComponent);
@@ -645,6 +653,8 @@
     /**
      * Mark a component completely clean. <b>aComponent</b> will not
      * get painted during the next paintDirtyRegions() call.
+     *
+     * @param aComponent a component
      */
     public void markCompletelyClean(JComponent aComponent) {
         RepaintManager delegate = getDelegate(aComponent);
@@ -662,6 +672,10 @@
      * painted during the next paintDirtyRegions(). If computing dirty regions is
      * expensive for your component, use this method and avoid computing dirty region
      * if it return true.
+     *
+     * @param aComponent a component
+     * @return {@code true} if <b>aComponent</b> will be completely
+     *         painted during the next paintDirtyRegions().
      */
     public boolean isCompletelyDirty(JComponent aComponent) {
         RepaintManager delegate = getDelegate(aComponent);
@@ -975,20 +989,26 @@
      * @return a String representation of this object
      */
     public synchronized String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         if(dirtyComponents != null)
             sb.append("" + dirtyComponents);
         return sb.toString();
     }
 
 
-   /**
+    /**
      * Return the offscreen buffer that should be used as a double buffer with
      * the component <code>c</code>.
      * By default there is a double buffer per RepaintManager.
      * The buffer might be smaller than <code>(proposedWidth,proposedHeight)</code>
      * This happens when the maximum double buffer size as been set for the receiving
      * repaint manager.
+     *
+     * @param c the component
+     * @param proposedWidth the width of the buffer
+     * @param proposedHeight the height of the buffer
+     *
+     * @return the image
      */
     public Image getOffscreenBuffer(Component c,int proposedWidth,int proposedHeight) {
         RepaintManager delegate = getDelegate(c);
@@ -998,18 +1018,23 @@
         return _getOffscreenBuffer(c, proposedWidth, proposedHeight);
     }
 
-  /**
-   * Return a volatile offscreen buffer that should be used as a
-   * double buffer with the specified component <code>c</code>.
-   * The image returned will be an instance of VolatileImage, or null
-   * if a VolatileImage object could not be instantiated.
-   * This buffer might be smaller than <code>(proposedWidth,proposedHeight)</code>.
-   * This happens when the maximum double buffer size has been set for this
-   * repaint manager.
-   *
-   * @see java.awt.image.VolatileImage
-   * @since 1.4
-   */
+    /**
+     * Return a volatile offscreen buffer that should be used as a
+     * double buffer with the specified component <code>c</code>.
+     * The image returned will be an instance of VolatileImage, or null
+     * if a VolatileImage object could not be instantiated.
+     * This buffer might be smaller than <code>(proposedWidth,proposedHeight)</code>.
+     * This happens when the maximum double buffer size has been set for this
+     * repaint manager.
+     *
+     * @param c the component
+     * @param proposedWidth the width of the buffer
+     * @param proposedHeight the height of the buffer
+     *
+     * @return the volatile image
+     * @see java.awt.image.VolatileImage
+     * @since 1.4
+     */
     public Image getVolatileOffscreenBuffer(Component c,
                                             int proposedWidth,int proposedHeight) {
         RepaintManager delegate = getDelegate(c);
@@ -1104,7 +1129,11 @@
     }
 
 
-    /** Set the maximum double buffer size. **/
+    /**
+     * Set the maximum double buffer size.
+     *
+     * @param d the dimension
+     */
     public void setDoubleBufferMaximumSize(Dimension d) {
         doubleBufferMaxSize = d;
         if (doubleBufferMaxSize == null) {
--- a/jdk/src/share/classes/javax/swing/RootPaneContainer.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/RootPaneContainer.java	Fri Jul 11 05:59:08 2014 -0700
@@ -132,6 +132,7 @@
      * Generally implemented with<pre>
      *    getRootPane().setLayeredPane(layeredPane);</pre>
      *
+     * @param layeredPane the layered pane
      * @exception java.awt.IllegalComponentStateException (a runtime
      *            exception) if the layered pane parameter is null
      * @see #getLayeredPane
@@ -162,6 +163,7 @@
      * Generally implemented with
      * <code>getRootPane().setGlassPane(glassPane);</code>
      *
+     * @param glassPane the glass pane
      * @see #getGlassPane
      * @see JRootPane#setGlassPane
      */
--- a/jdk/src/share/classes/javax/swing/ScrollPaneLayout.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/ScrollPaneLayout.java	Fri Jul 11 05:59:08 2014 -0700
@@ -168,6 +168,8 @@
      * };
      * scrollpane.setLayout(mySPLayout):
      * </pre>
+     *
+     * @param sp an instance of the {@code JScrollPane}
      */
     public void syncWithScrollPane(JScrollPane sp) {
         viewport = sp.getViewport();
@@ -1106,6 +1108,7 @@
      * Returns the bounds of the border around the specified scroll pane's
      * viewport.
      *
+     * @param scrollpane an instance of the {@code JScrollPane}
      * @return the size and position of the viewport border
      * @deprecated As of JDK version Swing1.1
      *    replaced by <code>JScrollPane.getViewportBorderBounds()</code>.
--- a/jdk/src/share/classes/javax/swing/SwingUtilities.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/SwingUtilities.java	Fri Jul 11 05:59:08 2014 -0700
@@ -103,15 +103,23 @@
     }
 
     /**
-     * Return true if <code>a</code> contains <code>b</code>
+     * Return {@code true} if @{code a} contains {@code b}
+     *
+     * @param a the first rectangle
+     * @param b the second rectangle
+     *
+     * @return {@code true} if @{code a} contains {@code b}
      */
-    public static final boolean isRectangleContainingRectangle(Rectangle a,Rectangle b) {
+    public static boolean isRectangleContainingRectangle(Rectangle a,Rectangle b) {
         return b.x >= a.x && (b.x + b.width) <= (a.x + a.width) &&
                 b.y >= a.y && (b.y + b.height) <= (a.y + a.height);
     }
 
     /**
-     * Return the rectangle (0,0,bounds.width,bounds.height) for the component <code>aComponent</code>
+     * Return the rectangle (0,0,bounds.width,bounds.height) for the component {@code aComponent}
+     *
+     * @param aComponent a component
+     * @return the local bounds for the component {@code aComponent}
      */
     public static Rectangle getLocalBounds(Component aComponent) {
         Rectangle b = new Rectangle(aComponent.getBounds());
@@ -165,6 +173,12 @@
      * root component coordinate system.
      * If both <code>source</code> and <code>destination</code> are {@code null}, return <code>aPoint</code>
      * without any conversion.
+     *
+     * @param source the source component
+     * @param aPoint the point
+     * @param destination the destination component
+     *
+     * @return the converted coordinate
      */
     public static Point convertPoint(Component source,Point aPoint,Component destination) {
         Point p;
@@ -196,6 +210,13 @@
      * root component coordinate system.
      * If both <code>source</code> and <code>destination</code> are {@code null}, return <code>(x,y)</code>
      * without any conversion.
+     *
+     * @param source the source component
+     * @param x the x-coordinate of the point
+     * @param y the y-coordinate of the point
+     * @param destination the destination component
+     *
+     * @return the converted coordinate
      */
     public static Point convertPoint(Component source,int x, int y,Component destination) {
         Point point = new Point(x,y);
@@ -211,6 +232,12 @@
      * root component coordinate system.
      * If both <code>source</code> and <code>destination</code> are {@code null}, return <code>aRectangle</code>
      * without any conversion.
+     *
+     * @param source the source component
+     * @param aRectangle a rectangle
+     * @param destination the destination component
+     *
+     * @return the converted rectangle
      */
     public static Rectangle convertRectangle(Component source,Rectangle aRectangle,Component destination) {
         Point point = new Point(aRectangle.x,aRectangle.y);
@@ -222,6 +249,12 @@
      * Convenience method for searching above <code>comp</code> in the
      * component hierarchy and returns the first object of class <code>c</code> it
      * finds. Can return {@code null}, if a class <code>c</code> cannot be found.
+     *
+     * @param c the class of a component
+     * @param comp the component
+     *
+     * @return the ancestor of the {@code comp},
+     *         or {@code null} if {@code c} cannot be found.
      */
     public static Container getAncestorOfClass(Class<?> c, Component comp)
     {
@@ -238,6 +271,12 @@
      * Convenience method for searching above <code>comp</code> in the
      * component hierarchy and returns the first object of <code>name</code> it
      * finds. Can return {@code null}, if <code>name</code> cannot be found.
+     *
+     * @param name the name of a component
+     * @param comp the component
+     *
+     * @return the ancestor of the {@code comp},
+     *         or {@code null} if {@code name} cannot be found.
      */
     public static Container getAncestorNamed(String name, Component comp) {
         if(comp == null || name == null)
@@ -260,6 +299,8 @@
      * @param parent the root component to begin the search
      * @param x the x target location
      * @param y the y target location
+     *
+     * @return the deepest component
      */
     public static Component getDeepestComponentAt(Component parent, int x, int y) {
         if (!parent.contains(x, y)) {
@@ -297,6 +338,12 @@
      * to <code>destination</code> if destination is non-{@code null}
      * use the translateMouseEvent() method to translate a mouse event from
      * one component to another without changing the source.
+     *
+     * @param source the source component
+     * @param sourceEvent the source mouse event
+     * @param destination the destination component
+     *
+     * @return the new mouse event
      */
     public static MouseEvent convertMouseEvent(Component source,
                                                MouseEvent sourceEvent,
@@ -456,7 +503,11 @@
     }
 
     /**
-     * Return <code>true</code> if a component <code>a</code> descends from a component <code>b</code>
+     * Return {@code true} if a component {@code a} descends from a component {@code b}
+     *
+     * @param a the first component
+     * @param b the second component
+     * @return {@code true} if a component {@code a} descends from a component {@code b}
      */
     public static boolean isDescendingFrom(Component a,Component b) {
         if(a == b)
@@ -531,6 +582,12 @@
      * Convenience returning an array of rect representing the regions within
      * <code>rectA</code> that do not overlap with <code>rectB</code>. If the
      * two Rects do not overlap, returns an empty array
+     *
+     * @param rectA the first rectangle
+     * @param rectB the second rectangle
+     *
+     * @return an array of rectangles representing the regions within {@code rectA}
+     *         that do not overlap with {@code rectB}.
      */
     public static Rectangle[] computeDifference(Rectangle rectA,Rectangle rectB) {
         if (rectB == null || !rectA.intersects(rectB) || isRectangleContainingRectangle(rectB,rectA)) {
@@ -841,6 +898,21 @@
      * relative to the viewR rectangle.
      * The JComponents orientation (LEADING/TRAILING) will also be taken
      * into account and translated into LEFT/RIGHT values accordingly.
+     *
+     * @param c the component
+     * @param fm the instance of {@code FontMetrics}
+     * @param text the text
+     * @param icon the icon
+     * @param verticalAlignment the vertical alignment
+     * @param horizontalAlignment the horizontal alignment
+     * @param verticalTextPosition the vertical text position
+     * @param horizontalTextPosition the horizontal text position
+     * @param viewR the available rectangle
+     * @param iconR the rectangle for the icon
+     * @param textR the rectangle for the text
+     * @param textIconGap the gap between text and icon
+     *
+     * @return the possibly clipped version of the compound labels string
      */
     public static String layoutCompoundLabel(JComponent c,
                                              FontMetrics fm,
@@ -910,6 +982,20 @@
      * values in horizontalTextPosition (they will default to RIGHT) and in
      * horizontalAlignment (they will default to CENTER).
      * Use the other version of layoutCompoundLabel() instead.
+     *
+     * @param fm the instance of {@code FontMetrics}
+     * @param text the text
+     * @param icon the icon
+     * @param verticalAlignment the vertical alignment
+     * @param horizontalAlignment the horizontal alignment
+     * @param verticalTextPosition the vertical text position
+     * @param horizontalTextPosition the horizontal text position
+     * @param viewR the available rectangle
+     * @param iconR the rectangle for the icon
+     * @param textR the rectangle for the text
+     * @param textIconGap the gap between text and icon
+     *
+     * @return the possibly clipped version of the compound labels string
      */
     public static String layoutCompoundLabel(
         FontMetrics fm,
@@ -1219,6 +1305,8 @@
      * A simple minded look and feel change: ask each node in the tree
      * to <code>updateUI()</code> -- that is, to initialize its UI property
      * with the current look and feel.
+     *
+     * @param c the component
      */
     public static void updateComponentTreeUI(Component c) {
         updateComponentTreeUI0(c);
@@ -1284,6 +1372,7 @@
      * <p>
      * Unlike the rest of Swing, this method can be invoked from any thread.
      *
+     * @param doRun the instance of {@code Runnable}
      * @see #invokeAndWait
      */
     public static void invokeLater(Runnable doRun) {
@@ -1334,6 +1423,7 @@
      * As of 1.3 this method is just a cover for
      * <code>java.awt.EventQueue.invokeAndWait()</code>.
      *
+     * @param doRun the instance of {@code Runnable}
      * @exception  InterruptedException if we're interrupted while waiting for
      *             the event dispatching thread to finish executing
      *             <code>doRun.run()</code>
@@ -1374,6 +1464,7 @@
      * Component.AccessibleAWTComponent.getAccessibleIndexInParent() instead
      * of using this method.
      *
+     * @param c the component
      * @return -1 of this object does not have an accessible parent.
      * Otherwise, the index of the child in its accessible parent.
      */
@@ -1386,6 +1477,8 @@
      * local coordinate <code>Point</code>, if one exists.
      * Otherwise returns <code>null</code>.
      *
+     * @param c the component
+     * @param p the local coordinate
      * @return the <code>Accessible</code> at the specified location,
      *    if it exists; otherwise <code>null</code>
      */
@@ -1431,6 +1524,7 @@
      * Component.AccessibleAWTComponent.getAccessibleIndexInParent() instead
      * of using this method.
      *
+     * @param c the component
      * @return an instance of AccessibleStateSet containing the current state
      * set of the object
      * @see AccessibleState
@@ -1448,6 +1542,7 @@
      * Component.AccessibleAWTComponent.getAccessibleIndexInParent() instead
      * of using this method.
      *
+     * @param c the component
      * @return the number of accessible children in the object.
      */
     public static int getAccessibleChildrenCount(Component c) {
@@ -1461,6 +1556,7 @@
      * Component.AccessibleAWTComponent.getAccessibleIndexInParent() instead
      * of using this method.
      *
+     * @param c the component
      * @param i zero-based index of child
      * @return the nth Accessible child of the object
      */
@@ -1502,6 +1598,8 @@
     /**
      * If c is a JRootPane descendant return its JRootPane ancestor.
      * If c is a RootPaneContainer then return its JRootPane.
+     *
+     * @param c the component
      * @return the JRootPane for Component c or {@code null}.
      */
     public static JRootPane getRootPane(Component c) {
@@ -1519,6 +1617,8 @@
 
     /**
      * Returns the root component for the current component tree.
+     *
+     * @param c the component
      * @return the first ancestor of c that's a Window or the last Applet ancestor
      */
     public static Component getRoot(Component c) {
@@ -1616,6 +1716,14 @@
      * This will return true if <code>action</code> is non-{@code null} and
      * actionPerformed is invoked on it.
      *
+     * @param action an action
+     * @param ks a key stroke
+     * @param event a key event
+     * @param sender a sender
+     * @param modifiers action modifiers
+     * @return {@code true} if {@code action} is non-{@code null} and
+     *         actionPerformed is invoked on it.
+     *
      * @since 1.3
      */
     public static boolean notifyAction(Action action, KeyStroke ks,
@@ -1672,6 +1780,9 @@
      * to <code>uiInputMap</code>. If <code>uiInputMap</code> is {@code null},
      * this removes any previously installed UI InputMap.
      *
+     * @param component a component
+     * @param type a type
+     * @param uiInputMap an {@code InputMap}
      * @since 1.3
      */
     public static void replaceUIInputMap(JComponent component, int type,
@@ -1694,6 +1805,8 @@
      * to <code>uiActionMap</code>. If <code>uiActionMap</code> is {@code null},
      * this removes any previously installed UI ActionMap.
      *
+     * @param component a component
+     * @param uiActionMap an {@code ActionMap}
      * @since 1.3
      */
     public static void replaceUIActionMap(JComponent component,
@@ -1714,9 +1827,14 @@
     /**
      * Returns the InputMap provided by the UI for condition
      * <code>condition</code> in component <code>component</code>.
-     * <p>This will return {@code null} if the UI has not installed a InputMap
+     * <p>This will return {@code null} if the UI has not installed an InputMap
      * of the specified type.
      *
+     * @param component a component
+     * @param condition a condition
+     * @return the {@code ActionMap} provided by the UI for {@code condition}
+     *         in the component, or {@code null} if the UI has not installed
+     *         an InputMap of the specified type.
      * @since 1.3
      */
     public static InputMap getUIInputMap(JComponent component, int condition) {
@@ -1736,6 +1854,9 @@
      * in component <code>component</code>.
      * <p>This will return {@code null} if the UI has not installed an ActionMap.
      *
+     * @param component a component
+     * @return the {@code ActionMap} provided by the UI in the component,
+     *         or {@code null} if the UI has not installed an ActionMap.
      * @since 1.3
      */
     public static ActionMap getUIActionMap(JComponent component) {
--- a/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java	Fri Jul 11 05:59:08 2014 -0700
@@ -292,24 +292,24 @@
      * @return a String representation of this object
      */
     public String toString() {
-        StringBuffer   retBuffer = new StringBuffer();
+        StringBuilder   sb = new StringBuilder();
 
-        retBuffer.append(getClass().getName() + " " +
-                         Integer.toString(hashCode()));
+        sb.append(getClass().getName() + " " +
+                  Integer.toString(hashCode()));
         if(path != null)
-            retBuffer.append(" path " + path);
+            sb.append(" path " + path);
         if(childIndices != null) {
-            retBuffer.append(" indices [ ");
+            sb.append(" indices [ ");
             for(int counter = 0; counter < childIndices.length; counter++)
-                retBuffer.append(Integer.toString(childIndices[counter])+ " ");
-            retBuffer.append("]");
+                sb.append(Integer.toString(childIndices[counter])+ " ");
+            sb.append("]");
         }
         if(children != null) {
-            retBuffer.append(" children [ ");
+            sb.append(" children [ ");
             for(int counter = 0; counter < children.length; counter++)
-                retBuffer.append(children[counter] + " ");
-            retBuffer.append("]");
+                sb.append(children[counter] + " ");
+            sb.append("]");
         }
-        return retBuffer.toString();
+        return sb.toString();
     }
 }
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1322,8 +1322,8 @@
                 return null;
             }
 
-            StringBuffer plainBuf = new StringBuffer();
-            StringBuffer htmlBuf = new StringBuffer();
+            StringBuilder plainBuf = new StringBuilder();
+            StringBuilder htmlBuf = new StringBuilder();
 
             htmlBuf.append("<html>\n<body>\n<ul>\n");
 
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java	Fri Jul 11 05:59:08 2014 -0700
@@ -2855,23 +2855,23 @@
                     return null;
                 }
 
-                StringBuffer plainBuf = new StringBuffer();
-                StringBuffer htmlBuf = new StringBuffer();
+                StringBuilder plainStr = new StringBuilder();
+                StringBuilder htmlStr = new StringBuilder();
 
-                htmlBuf.append("<html>\n<body>\n<ul>\n");
+                htmlStr.append("<html>\n<body>\n<ul>\n");
 
                 for (int i = 0; i < values.length; i++) {
                     Object obj = values[i];
                     String val = ((obj == null) ? "" : obj.toString());
-                    plainBuf.append(val + "\n");
-                    htmlBuf.append("  <li>" + val + "\n");
+                    plainStr.append(val + "\n");
+                    htmlStr.append("  <li>" + val + "\n");
                 }
 
                 // remove the last newline
-                plainBuf.deleteCharAt(plainBuf.length() - 1);
-                htmlBuf.append("</ul>\n</body>\n</html>");
+                plainStr.deleteCharAt(plainStr.length() - 1);
+                htmlStr.append("</ul>\n</body>\n</html>");
 
-                return new BasicTransferable(plainBuf.toString(), htmlBuf.toString());
+                return new BasicTransferable(plainStr.toString(), htmlStr.toString());
             }
 
             return null;
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java	Fri Jul 11 05:59:08 2014 -0700
@@ -2182,29 +2182,29 @@
                     return null;
                 }
 
-                StringBuffer plainBuf = new StringBuffer();
-                StringBuffer htmlBuf = new StringBuffer();
+                StringBuilder plainStr = new StringBuilder();
+                StringBuilder htmlStr = new StringBuilder();
 
-                htmlBuf.append("<html>\n<body>\n<table>\n");
+                htmlStr.append("<html>\n<body>\n<table>\n");
 
                 for (int row = 0; row < rows.length; row++) {
-                    htmlBuf.append("<tr>\n");
+                    htmlStr.append("<tr>\n");
                     for (int col = 0; col < cols.length; col++) {
                         Object obj = table.getValueAt(rows[row], cols[col]);
                         String val = ((obj == null) ? "" : obj.toString());
-                        plainBuf.append(val + "\t");
-                        htmlBuf.append("  <td>" + val + "</td>\n");
+                        plainStr.append(val + "\t");
+                        htmlStr.append("  <td>" + val + "</td>\n");
                     }
                     // we want a newline at the end of each line and not a tab
-                    plainBuf.deleteCharAt(plainBuf.length() - 1).append("\n");
-                    htmlBuf.append("</tr>\n");
+                    plainStr.deleteCharAt(plainStr.length() - 1).append("\n");
+                    htmlStr.append("</tr>\n");
                 }
 
                 // remove the last newline
-                plainBuf.deleteCharAt(plainBuf.length() - 1);
-                htmlBuf.append("</table>\n</body>\n</html>");
+                plainStr.deleteCharAt(plainStr.length() - 1);
+                htmlStr.append("</table>\n</body>\n</html>");
 
-                return new BasicTransferable(plainBuf.toString(), htmlBuf.toString());
+                return new BasicTransferable(plainStr.toString(), htmlStr.toString());
             }
 
             return null;
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java	Fri Jul 11 05:59:08 2014 -0700
@@ -3213,10 +3213,10 @@
                     return null;
                 }
 
-                StringBuffer plainBuf = new StringBuffer();
-                StringBuffer htmlBuf = new StringBuffer();
-
-                htmlBuf.append("<html>\n<body>\n<ul>\n");
+                StringBuilder plainStr = new StringBuilder();
+                StringBuilder htmlStr = new StringBuilder();
+
+                htmlStr.append("<html>\n<body>\n<ul>\n");
 
                 TreeModel model = tree.getModel();
                 TreePath lastPath = null;
@@ -3227,17 +3227,17 @@
                     boolean leaf = model.isLeaf(node);
                     String label = getDisplayString(path, true, leaf);
 
-                    plainBuf.append(label + "\n");
-                    htmlBuf.append("  <li>" + label + "\n");
+                    plainStr.append(label + "\n");
+                    htmlStr.append("  <li>" + label + "\n");
                 }
 
                 // remove the last newline
-                plainBuf.deleteCharAt(plainBuf.length() - 1);
-                htmlBuf.append("</ul>\n</body>\n</html>");
+                plainStr.deleteCharAt(plainStr.length() - 1);
+                htmlStr.append("</ul>\n</body>\n</html>");
 
                 tree = null;
 
-                return new BasicTransferable(plainBuf.toString(), htmlBuf.toString());
+                return new BasicTransferable(plainStr.toString(), htmlStr.toString());
             }
 
             return null;
--- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java	Fri Jul 11 05:59:08 2014 -0700
@@ -618,20 +618,20 @@
     }
 
     private String fileNameString(File[] files) {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         for (int i = 0; files != null && i < files.length; i++) {
             if (i > 0) {
-                buf.append(" ");
+                sb.append(" ");
             }
             if (files.length > 1) {
-                buf.append("\"");
+                sb.append("\"");
             }
-            buf.append(fileNameString(files[i]));
+            sb.append(fileNameString(files[i]));
             if (files.length > 1) {
-                buf.append("\"");
+                sb.append("\"");
             }
         }
-        return buf.toString();
+        return sb.toString();
     }
 
     /* The following methods are used by the PropertyChange Listener */
--- a/jdk/src/share/classes/javax/swing/plaf/nimbus/State.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/State.java	Fri Jul 11 05:59:08 2014 -0700
@@ -179,35 +179,35 @@
         }
 
         private static String toString(int state) {
-            StringBuffer buffer = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
             if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
-                buffer.append("Default");
+                sb.append("Default");
             }
             if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
-                if (buffer.length() > 0) buffer.append("+");
-                buffer.append("Disabled");
+                if (sb.length() > 0) sb.append("+");
+                sb.append("Disabled");
             }
             if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
-                if (buffer.length() > 0) buffer.append("+");
-                buffer.append("Enabled");
+                if (sb.length() > 0) sb.append("+");
+                sb.append("Enabled");
             }
             if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
-                if (buffer.length() > 0) buffer.append("+");
-                buffer.append("Focused");
+                if (sb.length() > 0) sb.append("+");
+                sb.append("Focused");
             }
             if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
-                if (buffer.length() > 0) buffer.append("+");
-                buffer.append("MouseOver");
+                if (sb.length() > 0) sb.append("+");
+                sb.append("MouseOver");
             }
             if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
-                if (buffer.length() > 0) buffer.append("+");
-                buffer.append("Pressed");
+                if (sb.length() > 0) sb.append("+");
+                sb.append("Pressed");
             }
             if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
-                if (buffer.length() > 0) buffer.append("+");
-                buffer.append("Selected");
+                if (sb.length() > 0) sb.append("+");
+                sb.append("Selected");
             }
-            return buffer.toString();
+            return sb.toString();
         }
     }
 }
--- a/jdk/src/share/classes/javax/swing/plaf/synth/ParsedSynthStyle.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/ParsedSynthStyle.java	Fri Jul 11 05:59:08 2014 -0700
@@ -156,7 +156,7 @@
     }
 
     public String toString() {
-        StringBuffer text = new StringBuffer(super.toString());
+        StringBuilder text = new StringBuilder(super.toString());
         if (_painters != null) {
             text.append(",painters=[");
             for (int i = 0; i < +_painters.length; i++) {
@@ -208,7 +208,7 @@
         }
 
         public String toString() {
-            StringBuffer text = new StringBuffer(super.toString());
+            StringBuilder text = new StringBuilder(super.toString());
             text.append(",painters=[");
             if (_painterInfo != null) {
                 for (int i = 0; i < +_painterInfo.length; i++) {
--- a/jdk/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1153,23 +1153,23 @@
      */
     public String toString() {
         int                selCount = getSelectionCount();
-        StringBuffer       retBuffer = new StringBuffer();
+        StringBuilder      sb = new StringBuilder();
         int[]              rows;
 
         if(rowMapper != null)
             rows = rowMapper.getRowsForPaths(selection);
         else
             rows = null;
-        retBuffer.append(getClass().getName() + " " + hashCode() + " [ ");
+        sb.append(getClass().getName() + " " + hashCode() + " [ ");
         for(int counter = 0; counter < selCount; counter++) {
             if(rows != null)
-                retBuffer.append(selection[counter].toString() + "@" +
-                                 Integer.toString(rows[counter])+ " ");
+                sb.append(selection[counter].toString() + "@" +
+                          Integer.toString(rows[counter])+ " ");
             else
-                retBuffer.append(selection[counter].toString() + " ");
+                sb.append(selection[counter].toString() + " ");
         }
-        retBuffer.append("]");
-        return retBuffer.toString();
+        sb.append("]");
+        return sb.toString();
     }
 
     /**
--- a/jdk/src/share/classes/javax/swing/tree/TreePath.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/javax/swing/tree/TreePath.java	Fri Jul 11 05:59:08 2014 -0700
@@ -349,7 +349,7 @@
      * @return a String representation of this object
      */
     public String toString() {
-        StringBuffer tempSpot = new StringBuffer("[");
+        StringBuilder tempSpot = new StringBuilder("[");
 
         for(int counter = 0, maxCounter = getPathCount();counter < maxCounter;
             counter++) {
--- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheNodeSetData.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheNodeSetData.java	Fri Jul 11 05:59:08 2014 -0700
@@ -21,7 +21,7 @@
  * under the License.
  */
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * $Id: ApacheNodeSetData.java 1203890 2011-11-18 22:47:56Z mullan $
@@ -47,7 +47,7 @@
         this.xi = xi;
     }
 
-    public Iterator iterator() {
+    public Iterator<Node> iterator() {
         // If nodefilters are set, must execute them first to create node-set
         if (xi.getNodeFilters() != null && !xi.getNodeFilters().isEmpty()) {
             return Collections.unmodifiableSet
--- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMExcC14NMethod.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMExcC14NMethod.java	Fri Jul 11 05:59:08 2014 -0700
@@ -118,7 +118,7 @@
         }
 
         ExcC14NParameterSpec params = (ExcC14NParameterSpec)spec;
-        StringBuffer prefixListAttr = new StringBuffer("");
+        StringBuilder prefixListAttr = new StringBuilder("");
         @SuppressWarnings("unchecked")
         List<String> prefixList = params.getPrefixList();
         for (int i = 0, size = prefixList.size(); i < size; i++) {
--- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyInfo.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyInfo.java	Fri Jul 11 05:59:08 2014 -0700
@@ -21,7 +21,7 @@
  * under the License.
  */
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * $Id: DOMKeyInfo.java 1333869 2012-05-04 10:42:44Z coheigea $
@@ -138,7 +138,7 @@
         return id;
     }
 
-    public List getContent() {
+    public List<XMLStructure> getContent() {
         return keyInfoTypes;
     }
 
--- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyInfoFactory.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyInfoFactory.java	Fri Jul 11 05:59:08 2014 -0700
@@ -21,7 +21,7 @@
  * under the License.
  */
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * $Id: DOMKeyInfoFactory.java 1333869 2012-05-04 10:42:44Z coheigea $
@@ -48,11 +48,12 @@
 
     public DOMKeyInfoFactory() { }
 
+    @SuppressWarnings("rawtypes")
     public KeyInfo newKeyInfo(List content) {
         return newKeyInfo(content, null);
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     public KeyInfo newKeyInfo(List content, String id) {
         return new DOMKeyInfo(content, id);
     }
@@ -78,12 +79,12 @@
         return newPGPData(keyId, null, null);
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     public PGPData newPGPData(byte[] keyId, byte[] keyPacket, List other) {
         return new DOMPGPData(keyId, keyPacket, other);
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     public PGPData newPGPData(byte[] keyPacket, List other) {
         return new DOMPGPData(keyPacket, other);
     }
@@ -92,7 +93,7 @@
         return newRetrievalMethod(uri, null, null);
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     public RetrievalMethod newRetrievalMethod(String uri, String type,
         List transforms) {
         if (uri == null) {
@@ -101,7 +102,7 @@
         return new DOMRetrievalMethod(uri, type, transforms);
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings("rawtypes")
     public X509Data newX509Data(List content) {
         return new DOMX509Data(content);
     }
--- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyValue.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyValue.java	Fri Jul 11 05:59:08 2014 -0700
@@ -21,7 +21,7 @@
  * under the License.
  */
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * $Id: DOMKeyValue.java 1333415 2012-05-03 12:03:51Z coheigea $
@@ -364,15 +364,16 @@
         }
 
         void getMethods() throws ClassNotFoundException, NoSuchMethodException {
-            Class c  = Class.forName("sun.security.ec.ECParameters");
-            Class[] params = new Class[] { ECPoint.class, EllipticCurve.class };
+            Class<?> c  = Class.forName("sun.security.ec.ECParameters");
+            Class<?>[] params = new Class<?>[] { ECPoint.class,
+                                                 EllipticCurve.class };
             encodePoint = c.getMethod("encodePoint", params);
-            params = new Class[] { ECParameterSpec.class };
+            params = new Class<?>[] { ECParameterSpec.class };
             getCurveName = c.getMethod("getCurveName", params);
-            params = new Class[] { byte[].class, EllipticCurve.class };
+            params = new Class<?>[] { byte[].class, EllipticCurve.class };
             decodePoint = c.getMethod("decodePoint", params);
             c  = Class.forName("sun.security.ec.NamedCurve");
-            params = new Class[] { String.class };
+            params = new Class<?>[] { String.class };
             getECParameterSpec = c.getMethod("getECParameterSpec", params);
         }
 
--- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMManifest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMManifest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -21,7 +21,7 @@
  * under the License.
  */
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * $Id: DOMManifest.java 1333415 2012-05-03 12:03:51Z coheigea $
@@ -127,7 +127,12 @@
         return id;
     }
 
-    public List getReferences() {
+    @SuppressWarnings("unchecked")
+    static List<Reference> getManifestReferences(Manifest mf) {
+        return mf.getReferences();
+    }
+
+    public List<Reference> getReferences() {
         return references;
     }
 
--- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMPGPData.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMPGPData.java	Fri Jul 11 05:59:08 2014 -0700
@@ -21,7 +21,7 @@
  * under the License.
  */
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * $Id: DOMPGPData.java 1203846 2011-11-18 21:18:17Z mullan $
@@ -184,7 +184,7 @@
         return (keyPacket == null ? null : keyPacket.clone());
     }
 
-    public List getExternalElements() {
+    public List<XMLStructure> getExternalElements() {
         return externalElements;
     }
 
--- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMReference.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMReference.java	Fri Jul 11 05:59:08 2014 -0700
@@ -21,7 +21,7 @@
  * under the License.
  */
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * ===========================================================================
@@ -293,7 +293,7 @@
         return type;
     }
 
-    public List getTransforms() {
+    public List<Transform> getTransforms() {
         return Collections.unmodifiableList(allTransforms);
     }
 
@@ -643,7 +643,7 @@
                 try {
                     final Set<Node> s = xsi.getNodeSet();
                     return new NodeSetData() {
-                        public Iterator iterator() { return s.iterator(); }
+                        public Iterator<Node> iterator() { return s.iterator(); }
                     };
                 } catch (Exception e) {
                     // log a warning
--- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMRetrievalMethod.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMRetrievalMethod.java	Fri Jul 11 05:59:08 2014 -0700
@@ -21,7 +21,7 @@
  * under the License.
  */
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * ===========================================================================
@@ -177,7 +177,7 @@
         return type;
     }
 
-    public List getTransforms() {
+    public List<Transform> getTransforms() {
         return transforms;
     }
 
@@ -245,7 +245,7 @@
         // guard against RetrievalMethod loops
         if ((data instanceof NodeSetData) && Utils.secureValidation(context)) {
             NodeSetData nsd = (NodeSetData)data;
-            Iterator i = nsd.iterator();
+            Iterator<?> i = nsd.iterator();
             if (i.hasNext()) {
                 Node root = (Node)i.next();
                 if ("RetrievalMethod".equals(root.getLocalName())) {
--- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperties.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperties.java	Fri Jul 11 05:59:08 2014 -0700
@@ -21,7 +21,7 @@
  * under the License.
  */
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * $Id: DOMSignatureProperties.java 1333415 2012-05-03 12:03:51Z coheigea $
@@ -125,7 +125,7 @@
         }
     }
 
-    public List getProperties() {
+    public List<SignatureProperty> getProperties() {
         return properties;
     }
 
--- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperty.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperty.java	Fri Jul 11 05:59:08 2014 -0700
@@ -21,7 +21,7 @@
  * under the License.
  */
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * $Id: DOMSignatureProperty.java 1333415 2012-05-03 12:03:51Z coheigea $
@@ -123,7 +123,7 @@
         }
     }
 
-    public List getContent() {
+    public List<XMLStructure> getContent() {
         return content;
     }
 
--- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignedInfo.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignedInfo.java	Fri Jul 11 05:59:08 2014 -0700
@@ -21,7 +21,7 @@
  * under the License.
  */
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * $Id: DOMSignedInfo.java 1333415 2012-05-03 12:03:51Z coheigea $
@@ -206,7 +206,7 @@
         return id;
     }
 
-    public List getReferences() {
+    public List<Reference> getReferences() {
         return references;
     }
 
--- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSubTreeData.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSubTreeData.java	Fri Jul 11 05:59:08 2014 -0700
@@ -21,7 +21,7 @@
  * under the License.
  */
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * $Id$
@@ -54,7 +54,7 @@
         this.excludeComments = excludeComments;
     }
 
-    public Iterator iterator() {
+    public Iterator<Node> iterator() {
         return new DelayedNodeIterator(root, excludeComments);
     }
 
--- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMURIDereferencer.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMURIDereferencer.java	Fri Jul 11 05:59:08 2014 -0700
@@ -21,7 +21,7 @@
  * under the License.
  */
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * $Id: DOMURIDereferencer.java 1231033 2012-01-13 12:12:12Z coheigea $
@@ -111,7 +111,8 @@
         try {
             ResourceResolver apacheResolver =
                 ResourceResolver.getInstance(uriAttr, baseURI, secVal);
-            XMLSignatureInput in = apacheResolver.resolve(uriAttr, baseURI);
+            XMLSignatureInput in = apacheResolver.resolve(uriAttr,
+                                                          baseURI, secVal);
             if (in.isOctetStream()) {
                 return new ApacheOctetStreamData(in);
             } else {
--- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMX509Data.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMX509Data.java	Fri Jul 11 05:59:08 2014 -0700
@@ -21,7 +21,7 @@
  * under the License.
  */
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * $Id: DOMX509Data.java 1333415 2012-05-03 12:03:51Z coheigea $
@@ -135,7 +135,7 @@
         this.content = Collections.unmodifiableList(content);
     }
 
-    public List getContent() {
+    public List<Object> getContent() {
         return content;
     }
 
--- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLObject.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLObject.java	Fri Jul 11 05:59:08 2014 -0700
@@ -21,7 +21,7 @@
  * under the License.
  */
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * $Id: DOMXMLObject.java 1333415 2012-05-03 12:03:51Z coheigea $
@@ -139,7 +139,7 @@
         this.objectElem = objElem;
     }
 
-    public List getContent() {
+    public List<XMLStructure> getContent() {
         return content;
     }
 
--- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignature.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignature.java	Fri Jul 11 05:59:08 2014 -0700
@@ -21,7 +21,7 @@
  * under the License.
  */
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * ===========================================================================
@@ -188,7 +188,7 @@
         return si;
     }
 
-    public List getObjects() {
+    public List<XMLObject> getObjects() {
         return objects;
     }
 
@@ -471,7 +471,8 @@
                     digestReference((DOMReference)xs, signContext);
                 } else if (xs instanceof Manifest) {
                     Manifest man = (Manifest)xs;
-                    List manRefs = man.getReferences();
+                    List<Reference> manRefs =
+                        DOMManifest.getManifestReferences(man);
                     for (int i = 0, size = manRefs.size(); i < size; i++) {
                         digestReference((DOMReference)manRefs.get(i),
                                         signContext);
--- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignatureFactory.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignatureFactory.java	Fri Jul 11 05:59:08 2014 -0700
@@ -58,7 +58,7 @@
         return new DOMXMLSignature(si, ki, null, null, null);
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     public XMLSignature newXMLSignature(SignedInfo si, KeyInfo ki,
         List objects, String id, String signatureValueId) {
         return new DOMXMLSignature(si, ki, objects, id, signatureValueId);
@@ -68,13 +68,13 @@
         return newReference(uri, dm, null, null, null);
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     public Reference newReference(String uri, DigestMethod dm, List transforms,
         String type, String id) {
         return new DOMReference(uri, type, dm, transforms, id, getProvider());
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     public Reference newReference(String uri, DigestMethod dm,
         List appliedTransforms, Data result, List transforms, String type,
         String id) {
@@ -91,7 +91,7 @@
             (uri, type, dm, appliedTransforms, result, transforms, id, getProvider());
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     public Reference newReference(String uri, DigestMethod dm, List transforms,
         String type, String id, byte[] digestValue) {
         if (digestValue == null) {
@@ -101,41 +101,41 @@
             (uri, type, dm, null, null, transforms, id, digestValue, getProvider());
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings("rawtypes")
     public SignedInfo newSignedInfo(CanonicalizationMethod cm,
         SignatureMethod sm, List references) {
         return newSignedInfo(cm, sm, references, null);
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     public SignedInfo newSignedInfo(CanonicalizationMethod cm,
         SignatureMethod sm, List references, String id) {
         return new DOMSignedInfo(cm, sm, references, id);
     }
 
     // Object factory methods
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     public XMLObject newXMLObject(List content, String id, String mimeType,
         String encoding) {
         return new DOMXMLObject(content, id, mimeType, encoding);
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings("rawtypes")
     public Manifest newManifest(List references) {
         return newManifest(references, null);
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     public Manifest newManifest(List references, String id) {
         return new DOMManifest(references, id);
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     public SignatureProperties newSignatureProperties(List props, String id) {
         return new DOMSignatureProperties(props, id);
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     public SignatureProperty newSignatureProperty
         (List info, String target, String id) {
         return new DOMSignatureProperty(info, target, id);
--- a/jdk/src/share/classes/sun/applet/AppletViewer.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/applet/AppletViewer.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1000,15 +1000,15 @@
      * Scan identifier
      */
     public static String scanIdentifier(Reader in) throws IOException {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         while (true) {
             if (((c >= 'a') && (c <= 'z')) ||
                 ((c >= 'A') && (c <= 'Z')) ||
                 ((c >= '0') && (c <= '9')) || (c == '_')) {
-                buf.append((char)c);
+                sb.append((char) c);
                 c = in.read();
             } else {
-                return buf.toString();
+                return sb.toString();
             }
         }
     }
@@ -1031,19 +1031,19 @@
                     quote = c;
                     c = in.read();
                 }
-                StringBuffer buf = new StringBuffer();
+                StringBuilder sb = new StringBuilder();
                 while ((c > 0) &&
                        (((quote < 0) && (c != ' ') && (c != '\t') &&
                          (c != '\n') && (c != '\r') && (c != '>'))
                         || ((quote >= 0) && (c != quote)))) {
-                    buf.append((char)c);
+                    sb.append((char) c);
                     c = in.read();
                 }
                 if (c == quote) {
                     c = in.read();
                 }
                 skipSpace(in);
-                val = buf.toString();
+                val = sb.toString();
             }
             //statusMsgStream.println("PUT " + att + " = '" + val + "'");
             if (! val.equals("")) {
--- a/jdk/src/share/classes/sun/font/Decoration.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/font/Decoration.java	Fri Jul 11 05:59:08 2014 -0700
@@ -428,17 +428,17 @@
 
 
         public String toString() {
-            StringBuffer buf = new StringBuffer();
-            buf.append(super.toString());
-            buf.append("[");
-            if (fgPaint != null) buf.append("fgPaint: " + fgPaint);
-            if (bgPaint != null) buf.append(" bgPaint: " + bgPaint);
-            if (swapColors) buf.append(" swapColors: true");
-            if (strikethrough) buf.append(" strikethrough: true");
-            if (stdUnderline != null) buf.append(" stdUnderline: " + stdUnderline);
-            if (imUnderline != null) buf.append(" imUnderline: " + imUnderline);
-            buf.append("]");
-            return buf.toString();
+            StringBuilder sb = new StringBuilder();
+            sb.append(super.toString());
+            sb.append("[");
+            if (fgPaint != null) sb.append("fgPaint: " + fgPaint);
+            if (bgPaint != null) sb.append(" bgPaint: " + bgPaint);
+            if (swapColors) sb.append(" swapColors: true");
+            if (strikethrough) sb.append(" strikethrough: true");
+            if (stdUnderline != null) sb.append(" stdUnderline: " + stdUnderline);
+            if (imUnderline != null) sb.append(" imUnderline: " + imUnderline);
+            sb.append("]");
+            return sb.toString();
         }
     }
 }
--- a/jdk/src/share/classes/sun/font/ExtendedTextSourceLabel.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/font/ExtendedTextSourceLabel.java	Fri Jul 11 05:59:08 2014 -0700
@@ -896,31 +896,31 @@
     if (true) {
         return source.toString(TextSource.WITHOUT_CONTEXT);
     }
-    StringBuffer buf = new StringBuffer();
-    buf.append(super.toString());
-    buf.append("[source:");
-    buf.append(source.toString(TextSource.WITHOUT_CONTEXT));
-    buf.append(", lb:");
-    buf.append(lb);
-    buf.append(", ab:");
-    buf.append(ab);
-    buf.append(", vb:");
-    buf.append(vb);
-    buf.append(", gv:");
-    buf.append(gv);
-    buf.append(", ci: ");
+    StringBuilder sb = new StringBuilder();
+    sb.append(super.toString());
+    sb.append("[source:");
+    sb.append(source.toString(TextSource.WITHOUT_CONTEXT));
+    sb.append(", lb:");
+    sb.append(lb);
+    sb.append(", ab:");
+    sb.append(ab);
+    sb.append(", vb:");
+    sb.append(vb);
+    sb.append(", gv:");
+    sb.append(gv);
+    sb.append(", ci: ");
     if (charinfo == null) {
-      buf.append("null");
+      sb.append("null");
     } else {
-      buf.append(charinfo[0]);
+      sb.append(charinfo[0]);
       for (int i = 1; i < charinfo.length;) {
-        buf.append(i % numvals == 0 ? "; " : ", ");
-        buf.append(charinfo[i]);
+        sb.append(i % numvals == 0 ? "; " : ", ");
+        sb.append(charinfo[i]);
       }
     }
-    buf.append("]");
+    sb.append("]");
 
-    return buf.toString();
+    return sb.toString();
   }
 
   //public static ExtendedTextLabel create(TextSource source) {
--- a/jdk/src/share/classes/sun/font/StandardTextSource.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/font/StandardTextSource.java	Fri Jul 11 05:59:08 2014 -0700
@@ -210,16 +210,16 @@
   }
 
   public String toString(boolean withContext) {
-    StringBuffer buf = new StringBuffer(super.toString());
-    buf.append("[start:");
-    buf.append(start);
-    buf.append(", len:" );
-    buf.append(len);
-    buf.append(", cstart:");
-    buf.append(cstart);
-    buf.append(", clen:" );
-    buf.append(clen);
-    buf.append(", chars:\"");
+    StringBuilder sb = new StringBuilder(super.toString());
+    sb.append("[start:");
+    sb.append(start);
+    sb.append(", len:" );
+    sb.append(len);
+    sb.append(", cstart:");
+    sb.append(cstart);
+    sb.append(", clen:" );
+    sb.append(clen);
+    sb.append(", chars:\"");
     int chStart, chLimit;
     if (withContext == WITH_CONTEXT) {
         chStart = cstart;
@@ -231,23 +231,23 @@
     }
     for (int i = chStart; i < chLimit; ++i) {
       if (i > chStart) {
-        buf.append(" ");
+        sb.append(" ");
       }
-      buf.append(Integer.toHexString(chars[i]));
+      sb.append(Integer.toHexString(chars[i]));
     }
-    buf.append("\"");
-    buf.append(", level:");
-    buf.append(level);
-    buf.append(", flags:");
-    buf.append(flags);
-    buf.append(", font:");
-    buf.append(font);
-    buf.append(", frc:");
-    buf.append(frc);
-    buf.append(", cm:");
-    buf.append(cm);
-    buf.append("]");
+    sb.append("\"");
+    sb.append(", level:");
+    sb.append(level);
+    sb.append(", flags:");
+    sb.append(flags);
+    sb.append(", font:");
+    sb.append(font);
+    sb.append(", frc:");
+    sb.append(frc);
+    sb.append(", cm:");
+    sb.append(cm);
+    sb.append("]");
 
-    return buf.toString();
+    return sb.toString();
   }
 }
--- a/jdk/src/share/classes/sun/font/Type1Font.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/font/Type1Font.java	Fri Jul 11 05:59:08 2014 -0700
@@ -529,7 +529,7 @@
     }
 
     private String expandName(String s, boolean tryExpandAbbreviations) {
-        StringBuffer res = new StringBuffer(s.length() + 10);
+        StringBuilder res = new StringBuilder(s.length() + 10);
         int start=0, end;
 
         while(start < s.length()) {
--- a/jdk/src/share/classes/sun/java2d/opengl/OGLContext.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/java2d/opengl/OGLContext.java	Fri Jul 11 05:59:08 2014 -0700
@@ -201,29 +201,29 @@
 
         @Override
         public String toString() {
-            StringBuffer buf = new StringBuffer(super.toString());
+            StringBuilder sb = new StringBuilder(super.toString());
             if ((caps & CAPS_EXT_FBOBJECT) != 0) {
-                buf.append("CAPS_EXT_FBOBJECT|");
+                sb.append("CAPS_EXT_FBOBJECT|");
             }
             if ((caps & CAPS_STORED_ALPHA) != 0) {
-                buf.append("CAPS_STORED_ALPHA|");
+                sb.append("CAPS_STORED_ALPHA|");
             }
             if ((caps & CAPS_DOUBLEBUFFERED) != 0) {
-                buf.append("CAPS_DOUBLEBUFFERED|");
+                sb.append("CAPS_DOUBLEBUFFERED|");
             }
             if ((caps & CAPS_EXT_LCD_SHADER) != 0) {
-                buf.append("CAPS_EXT_LCD_SHADER|");
+                sb.append("CAPS_EXT_LCD_SHADER|");
             }
             if ((caps & CAPS_EXT_BIOP_SHADER) != 0) {
-                buf.append("CAPS_BIOP_SHADER|");
+                sb.append("CAPS_BIOP_SHADER|");
             }
             if ((caps & CAPS_EXT_GRAD_SHADER) != 0) {
-                buf.append("CAPS_EXT_GRAD_SHADER|");
+                sb.append("CAPS_EXT_GRAD_SHADER|");
             }
             if ((caps & CAPS_EXT_TEXRECT) != 0) {
-                buf.append("CAPS_EXT_TEXRECT|");
+                sb.append("CAPS_EXT_TEXRECT|");
             }
-            return buf.toString();
+            return sb.toString();
         }
     }
 }
--- a/jdk/src/share/classes/sun/java2d/pipe/Region.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/java2d/pipe/Region.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1277,7 +1277,7 @@
     }
 
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("Region[[");
         sb.append(lox);
         sb.append(", ");
--- a/jdk/src/share/classes/sun/java2d/pipe/hw/ContextCapabilities.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/java2d/pipe/hw/ContextCapabilities.java	Fri Jul 11 05:59:08 2014 -0700
@@ -93,37 +93,37 @@
 
     @Override
     public String toString() {
-        StringBuffer buf =
-            new StringBuffer("ContextCapabilities: adapter=" +
+        StringBuilder sb =
+            new StringBuilder("ContextCapabilities: adapter=" +
                              adapterId+", caps=");
         if (caps == CAPS_EMPTY) {
-            buf.append("CAPS_EMPTY");
+            sb.append("CAPS_EMPTY");
         } else {
             if ((caps & CAPS_RT_PLAIN_ALPHA) != 0) {
-                buf.append("CAPS_RT_PLAIN_ALPHA|");
+                sb.append("CAPS_RT_PLAIN_ALPHA|");
             }
             if ((caps & CAPS_RT_TEXTURE_ALPHA) != 0) {
-                buf.append("CAPS_RT_TEXTURE_ALPHA|");
+                sb.append("CAPS_RT_TEXTURE_ALPHA|");
             }
             if ((caps & CAPS_RT_TEXTURE_OPAQUE) != 0) {
-                buf.append("CAPS_RT_TEXTURE_OPAQUE|");
+                sb.append("CAPS_RT_TEXTURE_OPAQUE|");
             }
             if ((caps & CAPS_MULTITEXTURE) != 0) {
-                buf.append("CAPS_MULTITEXTURE|");
+                sb.append("CAPS_MULTITEXTURE|");
             }
             if ((caps & CAPS_TEXNONPOW2) != 0) {
-                buf.append("CAPS_TEXNONPOW2|");
+                sb.append("CAPS_TEXNONPOW2|");
             }
             if ((caps & CAPS_TEXNONSQUARE) != 0) {
-                buf.append("CAPS_TEXNONSQUARE|");
+                sb.append("CAPS_TEXNONSQUARE|");
             }
             if ((caps & CAPS_PS20) != 0) {
-                buf.append("CAPS_PS20|");
+                sb.append("CAPS_PS20|");
             }
             if ((caps & CAPS_PS30) != 0) {
-                buf.append("CAPS_PS30|");
+                sb.append("CAPS_PS30|");
             }
         }
-        return buf.toString();
+        return sb.toString();
     }
 }
--- a/jdk/src/share/classes/sun/jvmstat/monitor/HostIdentifier.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/jvmstat/monitor/HostIdentifier.java	Fri Jul 11 05:59:08 2014 -0700
@@ -358,7 +358,7 @@
 
         URI nuri = null;
 
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
         sb.append(scheme).append("://");
 
--- a/jdk/src/share/classes/sun/jvmstat/monitor/MonitoredHost.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/jvmstat/monitor/MonitoredHost.java	Fri Jul 11 05:59:08 2014 -0700
@@ -257,7 +257,7 @@
                      throws MonitorException {
         String hostname = hostId.getHost();
         String scheme = hostId.getScheme();
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
         assert hostname != null;
 
--- a/jdk/src/share/classes/sun/jvmstat/monitor/VmIdentifier.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/jvmstat/monitor/VmIdentifier.java	Fri Jul 11 05:59:08 2014 -0700
@@ -255,7 +255,7 @@
      *                            a MonitorException in a future version.
      */
     public HostIdentifier getHostIdentifier() throws URISyntaxException {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         if (getScheme() != null) {
             sb.append(getScheme()).append(":");
         }
--- a/jdk/src/share/classes/sun/management/Agent.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/management/Agent.java	Fri Jul 11 05:59:08 2014 -0700
@@ -34,7 +34,6 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.net.InetAddress;
-import java.net.Socket;
 import java.net.UnknownHostException;
 import java.text.MessageFormat;
 import java.util.MissingResourceException;
@@ -88,7 +87,7 @@
     // return empty property set
     private static Properties parseString(String args) {
         Properties argProps = new Properties();
-        if (args != null) {
+        if (args != null && !args.trim().equals("")) {
             for (String option : args.split(",")) {
                 String s[] = option.split("=", 2);
                 String name = s[0].trim();
@@ -160,53 +159,59 @@
             throw new RuntimeException(getText(INVALID_STATE, "Agent already started"));
         }
 
-        Properties argProps = parseString(args);
-        Properties configProps = new Properties();
+        try {
+            Properties argProps = parseString(args);
+            Properties configProps = new Properties();
 
-        // Load the management properties from the config file
-        // if config file is not specified readConfiguration implicitly
-        // reads <java.home>/lib/management/management.properties
+            // Load the management properties from the config file
+            // if config file is not specified readConfiguration implicitly
+            // reads <java.home>/lib/management/management.properties
+
+            String fname = System.getProperty(CONFIG_FILE);
+            readConfiguration(fname, configProps);
 
-        String fname = System.getProperty(CONFIG_FILE);
-        readConfiguration(fname, configProps);
+            // management properties can be overridden by system properties
+            // which take precedence
+            Properties sysProps = System.getProperties();
+            synchronized (sysProps) {
+                configProps.putAll(sysProps);
+            }
 
-        // management properties can be overridden by system properties
-        // which take precedence
-        Properties sysProps = System.getProperties();
-        synchronized (sysProps) {
-            configProps.putAll(sysProps);
-        }
+            // if user specifies config file into command line for either
+            // jcmd utilities or attach command it overrides properties set in
+            // command line at the time of VM start
+            String fnameUser = argProps.getProperty(CONFIG_FILE);
+            if (fnameUser != null) {
+                readConfiguration(fnameUser, configProps);
+            }
 
-        // if user specifies config file into command line for either
-        // jcmd utilities or attach command it overrides properties set in
-        // command line at the time of VM start
-        String fnameUser = argProps.getProperty(CONFIG_FILE);
-        if (fnameUser != null) {
-            readConfiguration(fnameUser, configProps);
-        }
+            // arguments specified in command line of jcmd utilities
+            // override both system properties and one set by config file
+            // specified in jcmd command line
+            configProps.putAll(argProps);
 
-        // arguments specified in command line of jcmd utilities
-        // override both system properties and one set by config file
-        // specified in jcmd command line
-        configProps.putAll(argProps);
+            // jcmd doesn't allow to change ThreadContentionMonitoring, but user
+            // can specify this property inside config file, so enable optional
+            // monitoring functionality if this property is set
+            final String enableThreadContentionMonitoring =
+                    configProps.getProperty(ENABLE_THREAD_CONTENTION_MONITORING);
 
-        // jcmd doesn't allow to change ThreadContentionMonitoring, but user
-        // can specify this property inside config file, so enable optional
-        // monitoring functionality if this property is set
-        final String enableThreadContentionMonitoring =
-                configProps.getProperty(ENABLE_THREAD_CONTENTION_MONITORING);
+            if (enableThreadContentionMonitoring != null) {
+                ManagementFactory.getThreadMXBean().
+                        setThreadContentionMonitoringEnabled(true);
+            }
 
-        if (enableThreadContentionMonitoring != null) {
-            ManagementFactory.getThreadMXBean().
-                    setThreadContentionMonitoringEnabled(true);
-        }
+            String jmxremotePort = configProps.getProperty(JMXREMOTE_PORT);
+            if (jmxremotePort != null) {
+                jmxServer = ConnectorBootstrap.
+                        startRemoteConnectorServer(jmxremotePort, configProps);
 
-        String jmxremotePort = configProps.getProperty(JMXREMOTE_PORT);
-        if (jmxremotePort != null) {
-            jmxServer = ConnectorBootstrap.
-                    startRemoteConnectorServer(jmxremotePort, configProps);
-
-            startDiscoveryService(configProps);
+                startDiscoveryService(configProps);
+            } else {
+                throw new AgentConfigurationError(INVALID_JMXREMOTE_PORT, "No port specified");
+            }
+        } catch (AgentConfigurationError err) {
+            error(err.getError(), err.getParams());
         }
     }
 
@@ -401,7 +406,7 @@
             if (home == null) {
                 throw new Error("Can't find java.home ??");
             }
-            StringBuffer defaultFileName = new StringBuffer(home);
+            StringBuilder defaultFileName = new StringBuilder(home);
             defaultFileName.append(File.separator).append("lib");
             defaultFileName.append(File.separator).append("management");
             defaultFileName.append(File.separator).append("management.properties");
@@ -495,7 +500,7 @@
         if (params == null || params.length == 0) {
             error(key);
         } else {
-            StringBuffer message = new StringBuffer(params[0]);
+            StringBuilder message = new StringBuilder(params[0]);
             for (int i = 1; i < params.length; i++) {
                 message.append(" " + params[i]);
             }
@@ -507,7 +512,7 @@
         String keyText = getText(key);
         System.err.print(getText("agent.err.error") + ": " + keyText);
         System.err.println(": " + message);
-        throw new RuntimeException(keyText);
+        throw new RuntimeException(keyText + ": " + message);
     }
 
     public static void error(Exception e) {
--- a/jdk/src/share/classes/sun/management/manifest	Wed Jul 09 16:44:30 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-Premain-Class: sun.management.Agent
-Agent-Class: sun.management.Agent
-
--- a/jdk/src/share/classes/sun/management/resources/agent.properties	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/management/resources/agent.properties	Fri Jul 11 05:59:08 2014 -0700
@@ -43,7 +43,7 @@
 agent.err.premain.notfound         = premain(String) does not exist in agent class
 agent.err.agentclass.access.denied = Access to premain(String) is denied
 agent.err.invalid.agentclass       = Invalid com.sun.management.agent.class property value
-agent.err.invalid.state            = Invalid agent state
+agent.err.invalid.state            = Invalid agent state: {0}
 agent.err.invalid.jmxremote.port   = Invalid com.sun.management.jmxremote.port number
 agent.err.invalid.jmxremote.rmi.port = Invalid com.sun.management.jmxremote.rmi.port number
 
--- a/jdk/src/share/classes/sun/management/snmp/jvminstr/JvmThreadInstanceEntryImpl.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/management/snmp/jvminstr/JvmThreadInstanceEntryImpl.java	Fri Jul 11 05:59:08 2014 -0700
@@ -311,19 +311,19 @@
         StackTraceElement[] stackTrace = info.getStackTrace();
         //We append the stack trace in a buffer
         // XXX Revisit: should check isDebugOn()
-        StringBuffer b = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         final int stackSize = stackTrace.length;
         log.debug("getJvmThreadInstStackTrace", "Stack size : " + stackSize);
         for(int i = 0; i < stackSize; i++) {
             log.debug("getJvmThreadInstStackTrace", "Append " +
                       stackTrace[i].toString());
-            b.append(stackTrace[i].toString());
+            sb.append(stackTrace[i].toString());
             //Append \n at the end of each line except the last one
             if(i < stackSize)
-                b.append("\n");
+                sb.append("\n");
         }
         //The stack trace is truncated if its size exceeds 255.
-        return validPathElementTC(b.toString());
+        return validPathElementTC(sb.toString());
     }
     static final MibLogger log =
         new MibLogger(JvmThreadInstanceEntryImpl.class);
--- a/jdk/src/share/classes/sun/misc/MessageUtils.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/misc/MessageUtils.java	Fri Jul 11 05:59:08 2014 -0700
@@ -55,7 +55,7 @@
     }
 
     public static String subst(String patt, String args[]) {
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
         int len = patt.length();
         for (int i = 0; i >= 0 && i < len; i++) {
             char ch = patt.charAt(i);
--- a/jdk/src/share/classes/sun/misc/Timeable.java	Wed Jul 09 16:44:30 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 1995, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.misc;
-
-/**
- * This interface is used by the Timer class.  A class that uses
- * Timer objects must implement this interface.
- *
- * @see Timer
- * @author Patrick Chan
- */
-public interface Timeable {
-    /**
-     * This method is executed every time a timer owned by this
-     * object ticks.  An object can own more than one timer but
-     * all timers call this method when they tick;
-     * you can use the supplied timer parameter to determine
-     * which timer has ticked.
-     * @param timer a handle to the timer that has just ticked.
-     */
-    public void tick(Timer timer);
-}
--- a/jdk/src/share/classes/sun/misc/Timer.java	Wed Jul 09 16:44:30 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,647 +0,0 @@
-/*
- * Copyright (c) 1995, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.misc;
-
-/**
-    A Timer object is used by algorithms that require timed events.
-    For example, in an animation loop, a timer would help in
-    determining when to change frames.
-
-    A timer has an interval which determines when it "ticks";
-    that is, a timer delays for the specified interval and then
-    it calls the owner's tick() method.
-
-    Here's an example of creating a timer with a 5 sec interval:
-
-    <pre>
-    class Main implements Timeable {
-        public void tick(Timer timer) {
-            System.out.println("tick");
-        }
-        public static void main(String args[]) {
-            (new Timer(this, 5000)).cont();
-        }
-    }
-    </pre>
-
-    A timer can be stopped, continued, or reset at any time.
-    A timer's state is not stopped while it's calling the
-    owner's tick() method.
-
-    A timer can be regular or irregular.  If in regular mode,
-    a timer ticks at the specified interval, regardless of
-    how long the owner's tick() method takes.  While the timer
-    is running, no ticks are ever discarded.  That means that if
-    the owner's tick() method takes longer than the interval,
-    the ticks that would have occurred are delivered immediately.
-
-    In irregular mode, a timer starts delaying for exactly
-    the specified interval only after the tick() method returns.
-
-    Synchronization issues: do not hold the timer's monitor
-    while calling any of the Timer operations below otherwise
-    the Timer class will deadlock.
-
-    @author     Patrick Chan
-*/
-
-/*
-    Synchronization issues:  there are two data structures that
-    require locking.  A Timer object and the Timer queue
-    (described in the TimerThread class).  To avoid deadlock,
-    the timer queue monitor is always acquired before the timer
-    object's monitor.  However, the timer queue monitor is acquired
-    only if the timer operation will make use of the timer
-    queue, e.g. stop().
-
-    The class monitor on the class TimerThread severs as the monitor
-    to the timer queue.
-
-    Possible feature: perhaps a timer should have an associated
-    thread priority.  The thread that makes the callback temporarily
-    takes on that priority before calling the owner's tick() method.
-*/
-
-public class Timer {
-    /**
-     * This is the owner of the timer.  Its tick method is
-     * called when the timer ticks.
-     */
-    public Timeable owner;
-
-    /*
-     * This is the interval of time in ms.
-     */
-    long interval;
-
-    /*
-     * This variable is used for two different purposes.
-     * This is done in order to save space.
-     * If 'stopped' is true, this variable holds the time
-     * that the timer was stopped; otherwise, this variable
-     * is used by the TimerThread to determine when the timer
-     * should tick.
-     */
-    long sleepUntil;
-
-    /*
-     * This is the time remaining before the timer ticks.  It
-     * is only valid if 'stopped' is true.  If the timer is
-     * continued, the next tick will happen remaingTime
-     * milliseconds later.
-     */
-    long remainingTime;
-
-    /*
-     * True iff the timer is in regular mode.
-     */
-    boolean regular;
-
-    /*
-     * True iff the timer has been stopped.
-     */
-    boolean stopped;
-
-    /* **************************************************************
-     * Timer queue-related variables
-     * ************************************************************** */
-
-    /*
-     * A link to another timer object.  This is used while the
-     * timer object is enqueued in the timer queue.
-     */
-    Timer next;
-
-    /* **************************************************************
-     * Timer methods
-     * ************************************************************** */
-
-    /*
-     * This variable holds a handle to the TimerThread class for
-     * the purpose of getting at the class monitor.  The reason
-     * why Class.forName("TimerThread") is not used is because it
-     * doesn't appear to work when loaded via a net class loader.
-     */
-    static TimerThread timerThread = null;
-
-    /**
-     * Creates a timer object that is owned by 'owner' and
-     * with the interval 'interval' milliseconds.  The new timer
-     * object is stopped and is regular.  getRemainingTime()
-     * return 'interval' at this point.  getStopTime() returns
-     * the time this object was created.
-     * @param owner    owner of the timer object
-     * @param interval interval of the timer in milliseconds
-     */
-    public Timer(Timeable owner, long interval) {
-        this.owner = owner;
-        this.interval = interval;
-        remainingTime = interval;
-        regular = true;
-        sleepUntil = System.currentTimeMillis();
-        stopped = true;
-        synchronized (getClass()) {
-            if (timerThread == null) {
-                timerThread = new TimerThread();
-            }
-        }
-    }
-
-    /**
-     * Returns true if this timer is stopped.
-     */
-    public synchronized boolean isStopped() {
-        return stopped;
-    }
-
-    /**
-     * Stops the timer.  The amount of time the timer has already
-     * delayed is saved so if the timer is continued, it will only
-     * delay for the amount of time remaining.
-     * Note that even after stopping a timer, one more tick may
-     * still occur.
-     * This method is MT-safe; i.e. it is synchronized but for
-     * implementation reasons, the synchronized modifier cannot
-     * be included in the method declaration.
-     */
-    public void stop() {
-        long now = System.currentTimeMillis();
-
-        synchronized (timerThread) {
-            synchronized (this) {
-                if (!stopped) {
-                    TimerThread.dequeue(this);
-                    remainingTime = Math.max(0, sleepUntil - now);
-                    sleepUntil = now;        // stop time
-                    stopped = true;
-                }
-            }
-        }
-    }
-
-    /**
-     * Continue the timer.  The next tick will come at getRemainingTime()
-     * milliseconds later.  If the timer is not stopped, this
-     * call will be a no-op.
-     * This method is MT-safe; i.e. it is synchronized but for
-     * implementation reasons, the synchronized modifier cannot
-     * be included in the method declaration.
-     */
-    public void cont() {
-        synchronized (timerThread) {
-            synchronized (this) {
-                if (stopped) {
-                    // The TimerTickThread avoids requeuing the
-                    // timer only if the sleepUntil value has changed.
-                    // The following guarantees that the sleepUntil
-                    // value will be different; without this guarantee,
-                    // it's theoretically possible for the timer to be
-                    // inserted twice.
-                    sleepUntil = Math.max(sleepUntil + 1,
-                        System.currentTimeMillis() + remainingTime);
-                    TimerThread.enqueue(this);
-                    stopped = false;
-                }
-            }
-        }
-    }
-
-    /**
-     * Resets the timer's remaining time to the timer's interval.
-     * If the timer's running state is not altered.
-     */
-    public void reset() {
-        synchronized (timerThread) {
-            synchronized (this) {
-                setRemainingTime(interval);
-            }
-        }
-    }
-
-    /**
-     * Returns the time at which the timer was last stopped.  The
-     * return value is valid only if the timer is stopped.
-     */
-    public synchronized long getStopTime() {
-        return sleepUntil;
-    }
-
-    /**
-     * Returns the timer's interval.
-     */
-    public synchronized long getInterval() {
-        return interval;
-    }
-
-    /**
-     * Changes the timer's interval.  The new interval setting
-     * does not take effect until after the next tick.
-     * This method does not alter the remaining time or the
-     * running state of the timer.
-     * @param interval new interval of the timer in milliseconds
-     */
-    public synchronized void setInterval(long interval) {
-        this.interval = interval;
-    }
-
-    /**
-     * Returns the remaining time before the timer's next tick.
-     * The return value is valid only if timer is stopped.
-     */
-    public synchronized long getRemainingTime() {
-        return remainingTime;
-    }
-
-    /**
-     * Sets the remaining time before the timer's next tick.
-     * This method does not alter the timer's running state.
-     * This method is MT-safe; i.e. it is synchronized but for
-     * implementation reasons, the synchronized modifier cannot
-     * be included in the method declaration.
-     * @param time new remaining time in milliseconds.
-     */
-    public void setRemainingTime(long time) {
-        synchronized (timerThread) {
-            synchronized (this) {
-                if (stopped) {
-                    remainingTime = time;
-                } else {
-                    stop();
-                    remainingTime = time;
-                    cont();
-                }
-            }
-        }
-    }
-
-    /**
-     * In regular mode, a timer ticks at the specified interval,
-     * regardless of how long the owner's tick() method takes.
-     * While the timer is running, no ticks are ever discarded.
-     * That means that if the owner's tick() method takes longer
-     * than the interval, the ticks that would have occurred are
-     * delivered immediately.
-     *
-     * In irregular mode, a timer starts delaying for exactly
-     * the specified interval only after the tick() method returns.
-     */
-    public synchronized void setRegular(boolean regular) {
-        this.regular = regular;
-    }
-
-    /*
-     * This method is used only for testing purposes.
-     */
-    protected Thread getTimerThread() {
-        return TimerThread.timerThread;
-    }
-}
-
-
-/*
-
-This class implements the timer queue and is exclusively used by the
-Timer class.  There are only two methods exported to the Timer class -
-enqueue, for inserting a timer into queue and dequeue, for removing
-a timer from the queue.
-
-A timer in the timer queue is awaiting a tick.  When a timer is to be
-ticked, it is removed from the timer queue before the owner's tick()
-method is called.
-
-A single timer thread manages the timer queue.  This timer thread
-looks at the head of the timer queue and delays until it's time for
-the timer to tick.  When the time comes, the timer thread creates a
-callback thread to call the timer owner's tick() method.  The timer
-thread then processes the next timer in the queue.
-
-When a timer is inserted at the head of the queue, the timer thread is
-notified.  This causes the timer thread to prematurely wake up and
-process the new head of the queue.
-
-*/
-
-class TimerThread extends Thread {
-    /*
-     * Set to true to get debugging output.
-     */
-    public static boolean debug = false;
-
-    /*
-     * This is a handle to the thread managing the thread queue.
-     */
-    static TimerThread timerThread;
-
-    /*
-     * This flag is set if the timer thread has been notified
-     * while it was in the timed wait.  This flag allows the
-     * timer thread to tell whether or not the wait completed.
-     */
-    static boolean notified = false;
-
-    protected TimerThread() {
-        super("TimerThread");
-        timerThread = this;
-        start();
-    }
-
-    public synchronized void run() {
-        while (true) {
-            long delay;
-
-            while (timerQueue == null) {
-                try {
-                    wait();
-                } catch (InterruptedException ex) {
-                   // Just drop through and check timerQueue.
-                }
-            }
-            notified = false;
-            delay = timerQueue.sleepUntil - System.currentTimeMillis();
-            if (delay > 0) {
-                try {
-                    wait(delay);
-                } catch (InterruptedException ex) {
-                    // Just drop through.
-                }
-            }
-            // remove from timer queue.
-            if (!notified) {
-                Timer timer = timerQueue;
-                timerQueue = timerQueue.next;
-                TimerTickThread thr = TimerTickThread.call(
-                    timer, timer.sleepUntil);
-                if (debug) {
-                    long delta = (System.currentTimeMillis() - timer.sleepUntil);
-                    System.out.println("tick(" + thr.getName() + ","
-                        + timer.interval + ","+delta+ ")");
-                    if (delta > 250) {
-                        System.out.println("*** BIG DELAY ***");
-                    }
-                }
-            }
-        }
-    }
-
-    /* *******************************************************
-       Timer Queue
-       ******************************************************* */
-
-    /*
-     * The timer queue is a queue of timers waiting to tick.
-     */
-    static Timer timerQueue = null;
-
-    /*
-     * Uses timer.sleepUntil to determine where in the queue
-     * to insert the timer object.
-     * A new ticker thread is created only if the timer
-     * is inserted at the beginning of the queue.
-     * The timer must not already be in the queue.
-     * Assumes the caller has the TimerThread monitor.
-     */
-    static protected void enqueue(Timer timer) {
-        Timer prev = null;
-        Timer cur = timerQueue;
-
-        if (cur == null || timer.sleepUntil <= cur.sleepUntil) {
-            // insert at front of queue
-            timer.next = timerQueue;
-            timerQueue = timer;
-            notified = true;
-            timerThread.notify();
-        } else {
-            do {
-                prev = cur;
-                cur = cur.next;
-            } while (cur != null && timer.sleepUntil > cur.sleepUntil);
-            // insert or append to the timer queue
-            timer.next = cur;
-            prev.next = timer;
-        }
-        if (debug) {
-            long now = System.currentTimeMillis();
-
-            System.out.print(Thread.currentThread().getName()
-                + ": enqueue " + timer.interval + ": ");
-            cur = timerQueue;
-            while(cur != null) {
-                long delta = cur.sleepUntil - now;
-                System.out.print(cur.interval + "(" + delta + ") ");
-                cur = cur.next;
-            }
-            System.out.println();
-        }
-    }
-
-    /*
-     * If the timer is not in the queue, returns false;
-     * otherwise removes the timer from the timer queue and returns true.
-     * Assumes the caller has the TimerThread monitor.
-     */
-    static protected boolean dequeue(Timer timer) {
-        Timer prev = null;
-        Timer cur = timerQueue;
-
-        while (cur != null && cur != timer) {
-            prev = cur;
-            cur = cur.next;
-        }
-        if (cur == null) {
-            if (debug) {
-                System.out.println(Thread.currentThread().getName()
-                    + ": dequeue " + timer.interval + ": no-op");
-            }
-            return false;
-        }       if (prev == null) {
-            timerQueue = timer.next;
-            notified = true;
-            timerThread.notify();
-        } else {
-            prev.next = timer.next;
-        }
-        timer.next = null;
-        if (debug) {
-            long now = System.currentTimeMillis();
-
-            System.out.print(Thread.currentThread().getName()
-                + ": dequeue " + timer.interval + ": ");
-            cur = timerQueue;
-            while(cur != null) {
-                long delta = cur.sleepUntil - now;
-                System.out.print(cur.interval + "(" + delta + ") ");
-                cur = cur.next;
-            }
-            System.out.println();
-        }
-        return true;
-    }
-
-    /*
-     * Inserts the timer back into the queue.  This method
-     * is used by a callback thread after it has called the
-     * timer owner's tick() method.  This method recomputes
-     * the sleepUntil field.
-     * Assumes the caller has the TimerThread and Timer monitor.
-     */
-    protected static void requeue(Timer timer) {
-        if (!timer.stopped) {
-            long now = System.currentTimeMillis();
-            if (timer.regular) {
-                timer.sleepUntil += timer.interval;
-            } else {
-                timer.sleepUntil = now + timer.interval;
-            }
-            enqueue(timer);
-        } else if (debug) {
-            System.out.println(Thread.currentThread().getName()
-                + ": requeue " + timer.interval + ": no-op");
-        }
-    }
-}
-
-/*
-
-This class implements a simple thread whose only purpose is to call a
-timer owner's tick() method.  A small fixed-sized pool of threads is
-maintained and is protected by the class monitor.  If the pool is
-exhausted, a new thread is temporarily created and destroyed when
-done.
-
-A thread that's in the pool waits on it's own monitor.  When the
-thread is retrieved from the pool, the retriever notifies the thread's
-monitor.
-
-*/
-
-class TimerTickThread extends Thread {
-    /*
-     * Maximum size of the thread pool.
-     */
-    static final int MAX_POOL_SIZE = 3;
-
-    /*
-     * Number of threads in the pool.
-     */
-    static int curPoolSize = 0;
-
-    /*
-     * The pool of timer threads.
-     */
-    static TimerTickThread pool = null;
-
-    /*
-     * Is used when linked into the thread pool.
-     */
-    TimerTickThread next = null;
-
-    /*
-     * This is the handle to the timer whose owner's
-     * tick() method will be called.
-     */
-    Timer timer;
-
-    /*
-     * The value of a timer's sleepUntil value is captured here.
-     * This is used to determine whether or not the timer should
-     * be reinserted into the queue.  If the timer's sleepUntil
-     * value has changed, the timer is not reinserted.
-     */
-    long lastSleepUntil;
-
-    /*
-     * Creates a new callback thread to call the timer owner's
-     * tick() method.  A thread is taken from the pool if one
-     * is available, otherwise, a new thread is created.
-     * The thread handle is returned.
-     */
-    protected static synchronized TimerTickThread call(
-            Timer timer, long sleepUntil) {
-        TimerTickThread thread = pool;
-
-        if (thread == null) {
-            // create one.
-            thread = new TimerTickThread();
-            thread.timer = timer;
-            thread.lastSleepUntil = sleepUntil;
-            thread.start();
-        } else {
-            pool = pool.next;
-            thread.timer = timer;
-            thread.lastSleepUntil = sleepUntil;
-            synchronized (thread) {
-                thread.notify();
-            }
-        }
-        return thread;
-    }
-
-    /*
-     * Returns false if the thread should simply exit;
-     * otherwise the thread is returned the pool, where
-     * it waits to be notified.  (I did try to use the
-     * class monitor but the time between the notify
-     * and breaking out of the wait seemed to take
-     * significantly longer; need to look into this later.)
-     */
-    private boolean returnToPool() {
-        synchronized (getClass()) {
-            if (curPoolSize >= MAX_POOL_SIZE) {
-                return false;
-            }
-            next = pool;
-            pool = this;
-            curPoolSize++;
-            timer = null;
-        }
-        while (timer == null) {
-            synchronized (this) {
-                try {
-                    wait();
-                } catch (InterruptedException ex) {
-                   // Just drop through and retest timer.
-                }
-            }
-        }
-        synchronized (getClass()) {
-            curPoolSize--;
-        }
-        return true;
-    }
-
-    public void run() {
-        do {
-            timer.owner.tick(timer);
-            synchronized (TimerThread.timerThread) {
-                synchronized (timer) {
-                    if (lastSleepUntil == timer.sleepUntil) {
-                        TimerThread.requeue(timer);
-                    }
-                }
-            }
-        } while (returnToPool());
-    }
-}
--- a/jdk/src/share/classes/sun/misc/UUDecoder.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/misc/UUDecoder.java	Fri Jul 11 05:59:08 2014 -0700
@@ -123,7 +123,7 @@
         throws IOException {
         int i, c1, c2, c3, c4;
         int a, b, c;
-        StringBuffer x = new StringBuffer();
+        StringBuilder x = new StringBuilder();
 
         for (i = 0; i < 4; i++) {
             c1 = inStream.read();
@@ -152,7 +152,7 @@
      */
     protected void decodeBufferPrefix(PushbackInputStream inStream, OutputStream outStream) throws IOException {
         int     c;
-        StringBuffer q = new StringBuffer(32);
+        StringBuilder q = new StringBuilder(32);
         String r;
         boolean sawNewLine;
 
--- a/jdk/src/share/classes/sun/net/TransferProtocolClient.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/net/TransferProtocolClient.java	Fri Jul 11 05:59:08 2014 -0700
@@ -53,7 +53,7 @@
      * number. Returns -1 on failure.
      */
     public int readServerResponse() throws IOException {
-        StringBuffer    replyBuf = new StringBuffer(32);
+        StringBuilder   replyBuf = new StringBuilder(32);
         int             c;
         int             continuingCode = -1;
         int             code;
--- a/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java	Fri Jul 11 05:59:08 2014 -0700
@@ -408,7 +408,7 @@
      * number. Returns -1 on failure.
      */
     private int readServerResponse() throws IOException {
-        StringBuffer replyBuf = new StringBuffer(32);
+        StringBuilder replyBuf = new StringBuilder(32);
         int c;
         int continuingCode = -1;
         int code;
@@ -1050,7 +1050,7 @@
         // keep the welcome message around so we can
         // put it in the resulting HTML page.
         String l;
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         for (int i = 0; i < serverResponse.size(); i++) {
             l = serverResponse.elementAt(i);
             if (l != null) {
@@ -1095,7 +1095,7 @@
 
         // keep the welcome message around so we can
         // put it in the resulting HTML page.
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         if (serverResponse != null) {
             for (String l : serverResponse) {
                 if (l != null) {
@@ -1493,7 +1493,7 @@
          * So we need to remove the 1st and last line
          */
         Vector<String> resp = getResponseStrings();
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         for (int i = 1; i < resp.size() - 1; i++) {
             sb.append(resp.get(i));
         }
@@ -1985,7 +1985,7 @@
      *         by the server.
      */
     public String getLastResponseString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         if (serverResponse != null) {
             for (String l : serverResponse) {
                 if (l != null) {
@@ -2188,7 +2188,7 @@
         }
         // on multiple lines answers, like the ones above, remove 1st and last
         // line, concat the the others.
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         for (int i = 1; i < resp.size() - 1; i++) {
             sb.append(resp.get(i).substring(3));
         }
--- a/jdk/src/share/classes/sun/net/www/MimeEntry.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/net/www/MimeEntry.java	Fri Jul 11 05:59:08 2014 -0700
@@ -281,52 +281,52 @@
     }
 
     public synchronized String toProperty() {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
         String separator = "; ";
         boolean needSeparator = false;
 
         int action = getAction();
         if (action != MimeEntry.UNKNOWN) {
-            buf.append("action=" + actionKeywords[action]);
+            sb.append("action=" + actionKeywords[action]);
             needSeparator = true;
         }
 
         String command = getLaunchString();
         if (command != null && command.length() > 0) {
             if (needSeparator) {
-                buf.append(separator);
+                sb.append(separator);
             }
-            buf.append("application=" + command);
+            sb.append("application=" + command);
             needSeparator = true;
         }
 
         if (getImageFileName() != null) {
             if (needSeparator) {
-                buf.append(separator);
+                sb.append(separator);
             }
-            buf.append("icon=" + getImageFileName());
+            sb.append("icon=" + getImageFileName());
             needSeparator = true;
         }
 
         String extensions = getExtensionsAsList();
         if (extensions.length() > 0) {
             if (needSeparator) {
-                buf.append(separator);
+                sb.append(separator);
             }
-            buf.append("file_extensions=" + extensions);
+            sb.append("file_extensions=" + extensions);
             needSeparator = true;
         }
 
         String description = getDescription();
         if (description != null && !description.equals(getType())) {
             if (needSeparator) {
-                buf.append(separator);
+                sb.append(separator);
             }
-            buf.append("description=" + description);
+            sb.append("description=" + description);
         }
 
-        return buf.toString();
+        return sb.toString();
     }
 
     public String toString() {
--- a/jdk/src/share/classes/sun/net/www/http/HttpClient.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/net/www/http/HttpClient.java	Fri Jul 11 05:59:08 2014 -0700
@@ -558,7 +558,7 @@
             // Do not use URLStreamHandler.toExternalForm as the fragment
             // should not be part of the RequestURI. It should be an
             // absolute URI which does not have a fragment part.
-            StringBuffer result = new StringBuffer(128);
+            StringBuilder result = new StringBuilder(128);
             result.append(url.getProtocol());
             result.append(":");
             if (url.getAuthority() != null && url.getAuthority().length() > 0) {
--- a/jdk/src/share/classes/sun/net/www/protocol/file/FileURLConnection.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/net/www/protocol/file/FileURLConnection.java	Fri Jul 11 05:59:08 2014 -0700
@@ -191,7 +191,7 @@
             if (isDirectory) {
                 FileNameMap map = java.net.URLConnection.getFileNameMap();
 
-                StringBuffer buf = new StringBuffer();
+                StringBuilder sb = new StringBuilder();
 
                 if (files == null) {
                     throw new FileNotFoundException(filename);
@@ -201,11 +201,11 @@
 
                 for (int i = 0 ; i < files.size() ; i++) {
                     String fileName = files.get(i);
-                    buf.append(fileName);
-                    buf.append("\n");
+                    sb.append(fileName);
+                    sb.append("\n");
                 }
                 // Put it into a (default) locale-specific byte-stream.
-                is = new ByteArrayInputStream(buf.toString().getBytes());
+                is = new ByteArrayInputStream(sb.toString().getBytes());
             } else {
                 throw new FileNotFoundException(filename);
             }
--- a/jdk/src/share/classes/sun/net/www/protocol/http/DigestAuthentication.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/net/www/protocol/http/DigestAuthentication.java	Fri Jul 11 05:59:08 2014 -0700
@@ -532,7 +532,7 @@
         }
         byte[] digest = md.digest();
 
-        StringBuffer res = new StringBuffer(digest.length * 2);
+        StringBuilder res = new StringBuilder(digest.length * 2);
         for (int i = 0; i < digest.length; i++) {
             int hashchar = ((digest[i] >>> 4) & 0xf);
             res.append(charArray[hashchar]);
--- a/jdk/src/share/classes/sun/nio/ch/ServerSocketChannelImpl.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/nio/ch/ServerSocketChannelImpl.java	Fri Jul 11 05:59:08 2014 -0700
@@ -382,7 +382,7 @@
     }
 
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append(this.getClass().getName());
         sb.append('[');
         if (!isOpen()) {
--- a/jdk/src/share/classes/sun/nio/ch/SocketChannelImpl.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/nio/ch/SocketChannelImpl.java	Fri Jul 11 05:59:08 2014 -0700
@@ -983,7 +983,7 @@
 
     @Override
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append(this.getClass().getSuperclass().getName());
         sb.append('[');
         if (!isOpen())
--- a/jdk/src/share/classes/sun/print/PSPrinterJob.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/print/PSPrinterJob.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1269,7 +1269,7 @@
                     CharsetString cs = acs[i];
                     CharsetEncoder fontCS = cs.fontDescriptor.encoder;
 
-                    StringBuffer nativeStr = new StringBuffer();
+                    StringBuilder nativeStr = new StringBuilder();
                     byte[] strSeg = new byte[cs.length * 2];
                     int len = 0;
                     try {
--- a/jdk/src/share/classes/sun/reflect/MethodAccessorGenerator.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/reflect/MethodAccessorGenerator.java	Fri Jul 11 05:59:08 2014 -0700
@@ -751,14 +751,14 @@
     }
 
     private String buildInternalSignature() {
-        StringBuffer buf = new StringBuffer();
-        buf.append("(");
+        StringBuilder sb = new StringBuilder();
+        sb.append("(");
         for (int i = 0; i < parameterTypes.length; i++) {
-            buf.append(getClassName(parameterTypes[i], true));
+            sb.append(getClassName(parameterTypes[i], true));
         }
-        buf.append(")");
-        buf.append(getClassName(returnType, true));
-        return buf.toString();
+        sb.append(")");
+        sb.append(getClassName(returnType, true));
+        return sb.toString();
     }
 
     private static synchronized String generateName(boolean isConstructor,
--- a/jdk/src/share/classes/sun/rmi/server/Activation.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/rmi/server/Activation.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1239,7 +1239,7 @@
                 checkArgs(desc, argv);
 
                 if (debugExec) {
-                    StringBuffer sb = new StringBuffer(argv[0]);
+                    StringBuilder sb = new StringBuilder(argv[0]);
                     int j;
                     for (j = 1; j < argv.length; j++) {
                         sb.append(' ');
--- a/jdk/src/share/classes/sun/rmi/server/LoaderHandler.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/rmi/server/LoaderHandler.java	Fri Jul 11 05:59:08 2014 -0700
@@ -793,7 +793,7 @@
         } else if (urls.length == 1) {
             return urls[0].toExternalForm();
         } else {
-            StringBuffer path = new StringBuffer(urls[0].toExternalForm());
+            StringBuilder path = new StringBuilder(urls[0].toExternalForm());
             for (int i = 1; i < urls.length; i++) {
                 path.append(' ');
                 path.append(urls[i].toExternalForm());
--- a/jdk/src/share/classes/sun/rmi/server/Util.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/rmi/server/Util.java	Fri Jul 11 05:59:08 2014 -0700
@@ -391,7 +391,7 @@
      * the definition of a "method descriptor".
      */
     private static String getMethodNameAndDescriptor(Method m) {
-        StringBuffer desc = new StringBuffer(m.getName());
+        StringBuilder desc = new StringBuilder(m.getName());
         desc.append('(');
         Class<?>[] paramTypes = m.getParameterTypes();
         for (int i = 0; i < paramTypes.length; i++) {
--- a/jdk/src/share/classes/sun/security/acl/AclImpl.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/acl/AclImpl.java	Fri Jul 11 05:59:08 2014 -0700
@@ -253,7 +253,7 @@
      * ACL.
      */
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         Enumeration<AclEntry> entries = entries();
         while (entries.hasMoreElements()) {
             AclEntry entry = entries.nextElement();
--- a/jdk/src/share/classes/sun/security/jgss/GSSCredentialImpl.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/jgss/GSSCredentialImpl.java	Fri Jul 11 05:59:08 2014 -0700
@@ -636,29 +636,29 @@
         }
 
         GSSCredentialSpi element = null;
-        StringBuffer buffer = new StringBuffer("[GSSCredential: ");
+        StringBuilder sb = new StringBuilder("[GSSCredential: ");
         Object[] elements = hashtable.entrySet().toArray();
         for (int i = 0; i < elements.length; i++) {
             try {
-                buffer.append('\n');
+                sb.append('\n');
                 element = (GSSCredentialSpi)
                     ((Map.Entry)elements[i]).getValue();
-                buffer.append(element.getName());
-                buffer.append(' ');
-                buffer.append(element.getMechanism());
-                buffer.append(element.isInitiatorCredential() ?
-                              " Initiate" : "");
-                buffer.append(element.isAcceptorCredential() ?
-                              " Accept" : "");
-                buffer.append(" [");
-                buffer.append(element.getClass());
-                buffer.append(']');
+                sb.append(element.getName());
+                sb.append(' ');
+                sb.append(element.getMechanism());
+                sb.append(element.isInitiatorCredential() ?
+                          " Initiate" : "");
+                sb.append(element.isAcceptorCredential() ?
+                          " Accept" : "");
+                sb.append(" [");
+                sb.append(element.getClass());
+                sb.append(']');
             } catch (GSSException e) {
                 // skip to next element
             }
         }
-        buffer.append(']');
-        return buffer.toString();
+        sb.append(']');
+        return sb.toString();
     }
 
     static class SearchKey {
--- a/jdk/src/share/classes/sun/security/jgss/GSSHeader.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/jgss/GSSHeader.java	Fri Jul 11 05:59:08 2014 -0700
@@ -327,7 +327,7 @@
     private  String getHexBytes(byte[] bytes, int len)
         throws IOException {
 
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         for (int i = 0; i < len; i++) {
 
             int b1 = (bytes[i]>>4) & 0x0f;
--- a/jdk/src/share/classes/sun/security/jgss/GSSToken.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/jgss/GSSToken.java	Fri Jul 11 05:59:08 2014 -0700
@@ -216,7 +216,7 @@
     }
 
     public static final String getHexBytes(byte[] bytes, int pos, int len) {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         for (int i = pos; i < (pos+len); i++) {
             int b1 = (bytes[i]>>4) & 0x0f;
             int b2 = bytes[i] & 0x0f;
--- a/jdk/src/share/classes/sun/security/jgss/ProviderList.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/jgss/ProviderList.java	Fri Jul 11 05:59:08 2014 -0700
@@ -536,12 +536,12 @@
 
         // For debugging
         public String toString() {
-            StringBuffer buf = new StringBuffer("<");
-            buf.append(p.getName());
-            buf.append(", ");
-            buf.append(oid);
-            buf.append(">");
-            return buf.toString();
+            StringBuilder sb = new StringBuilder("<");
+            sb.append(p.getName());
+            sb.append(", ");
+            sb.append(oid);
+            sb.append(">");
+            return sb.toString();
         }
     }
 }
--- a/jdk/src/share/classes/sun/security/jgss/TokenTracker.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/jgss/TokenTracker.java	Fri Jul 11 05:59:08 2014 -0700
@@ -336,19 +336,19 @@
     }
 
     public String toString() {
-        StringBuffer buf = new StringBuffer("TokenTracker: ");
-        buf.append(" initNumber=").append(initNumber);
-        buf.append(" windowStart=").append(windowStart);
-        buf.append(" expectedNumber=").append(expectedNumber);
-        buf.append(" windowStartIndex=").append(windowStartIndex);
-        buf.append("\n\tIntervals are: {");
+        StringBuilder sb = new StringBuilder("TokenTracker: ");
+        sb.append(" initNumber=").append(initNumber);
+        sb.append(" windowStart=").append(windowStart);
+        sb.append(" expectedNumber=").append(expectedNumber);
+        sb.append(" windowStartIndex=").append(windowStartIndex);
+        sb.append("\n\tIntervals are: {");
         for (int i = 0; i < list.size(); i++) {
             if (i != 0)
-                buf.append(", ");
-            buf.append(list.get(i).toString());
+                sb.append(", ");
+            sb.append(list.get(i).toString());
         }
-        buf.append('}');
-        return buf.toString();
+        sb.append('}');
+        return sb.toString();
     }
 
     /**
--- a/jdk/src/share/classes/sun/security/jgss/krb5/InitialToken.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/jgss/krb5/InitialToken.java	Fri Jul 11 05:59:08 2014 -0700
@@ -164,15 +164,15 @@
                     serviceTicket.getServer();
                 // Cannot use '\"' instead of "\"" in constructor because
                 // it is interpreted as suggested length!
-                StringBuffer buf = new StringBuffer("\"");
-                buf.append(delegateTo.getName()).append('\"');
+                StringBuilder sb = new StringBuilder("\"");
+                sb.append(delegateTo.getName()).append('\"');
                 String realm = delegateTo.getRealmAsString();
-                buf.append(" \"krbtgt/").append(realm).append('@');
-                buf.append(realm).append('\"');
+                sb.append(" \"krbtgt/").append(realm).append('@');
+                sb.append(realm).append('\"');
                 SecurityManager sm = System.getSecurityManager();
                 if (sm != null) {
                     DelegationPermission perm =
-                        new DelegationPermission(buf.toString());
+                        new DelegationPermission(sb.toString());
                     sm.checkPermission(perm);
                 }
 
--- a/jdk/src/share/classes/sun/security/jgss/krb5/Krb5Context.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/jgss/krb5/Krb5Context.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1345,7 +1345,7 @@
 
     private static String getHexBytes(byte[] bytes, int pos, int len) {
 
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         for (int i = 0; i < len; i++) {
 
             int b1 = (bytes[i]>>4) & 0x0f;
--- a/jdk/src/share/classes/sun/security/jgss/wrapper/Krb5Util.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/jgss/wrapper/Krb5Util.java	Fri Jul 11 05:59:08 2014 -0700
@@ -41,9 +41,9 @@
         String krbPrinc = name.getKrbName();
         int atIndex = krbPrinc.indexOf('@');
         String realm = krbPrinc.substring(atIndex + 1);
-        StringBuffer buf = new StringBuffer("krbtgt/");
-        buf.append(realm).append('@').append(realm);
-        return buf.toString();
+        StringBuilder sb = new StringBuilder("krbtgt/");
+        sb.append(realm).append('@').append(realm);
+        return sb.toString();
     }
 
     // Perform the Service Permission check using the specified
--- a/jdk/src/share/classes/sun/security/jgss/wrapper/NativeGSSContext.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/jgss/wrapper/NativeGSSContext.java	Fri Jul 11 05:59:08 2014 -0700
@@ -139,10 +139,10 @@
         if (sm != null) {
             String targetStr = targetName.getKrbName();
             String tgsStr = Krb5Util.getTGSName(targetName);
-            StringBuffer buf = new StringBuffer("\"");
-            buf.append(targetStr).append("\" \"");
-            buf.append(tgsStr).append('\"');
-            String krbPrincPair = buf.toString();
+            StringBuilder sb = new StringBuilder("\"");
+            sb.append(targetStr).append("\" \"");
+            sb.append(tgsStr).append('\"');
+            String krbPrincPair = sb.toString();
             SunNativeProvider.debug("Checking DelegationPermission (" +
                                     krbPrincPair + ")");
             DelegationPermission perm =
--- a/jdk/src/share/classes/sun/security/krb5/Credentials.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/krb5/Credentials.java	Fri Jul 11 05:59:08 2014 -0700
@@ -510,21 +510,21 @@
     }
 
     public String toString() {
-        StringBuffer buffer = new StringBuffer("Credentials:");
-        buffer.append(    "\n      client=").append(client);
-        buffer.append(    "\n      server=").append(server);
+        StringBuilder sb = new StringBuilder("Credentials:");
+        sb.append(    "\n      client=").append(client);
+        sb.append(    "\n      server=").append(server);
         if (authTime != null) {
-            buffer.append("\n    authTime=").append(authTime);
+            sb.append("\n    authTime=").append(authTime);
         }
         if (startTime != null) {
-            buffer.append("\n   startTime=").append(startTime);
+            sb.append("\n   startTime=").append(startTime);
         }
-        buffer.append(    "\n     endTime=").append(endTime);
-        buffer.append(    "\n   renewTill=").append(renewTill);
-        buffer.append(    "\n       flags=").append(flags);
-        buffer.append(    "\nEType (skey)=").append(key.getEType());
-        buffer.append(    "\n   (tkt key)=").append(ticket.encPart.eType);
-        return buffer.toString();
+        sb.append(    "\n     endTime=").append(endTime);
+        sb.append(    "\n   renewTill=").append(renewTill);
+        sb.append(    "\n       flags=").append(flags);
+        sb.append(    "\nEType (skey)=").append(key.getEType());
+        sb.append(    "\n   (tkt key)=").append(ticket.encPart.eType);
+        return sb.toString();
     }
 
 }
--- a/jdk/src/share/classes/sun/security/krb5/KrbException.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/krb5/KrbException.java	Fri Jul 11 05:59:08 2014 -0700
@@ -96,7 +96,7 @@
 
 
     public String krbErrorMessage() {
-        StringBuffer strbuf = new StringBuffer("krb_error " + returnCode);
+        StringBuilder strbuf = new StringBuilder("krb_error " + returnCode);
         String msg =  getMessage();
         if (msg != null) {
             strbuf.append(" ");
@@ -112,7 +112,7 @@
      * If the error code is 0 then the first half is skipped.
      */
     public String getMessage() {
-        StringBuffer message = new StringBuffer();
+        StringBuilder message = new StringBuilder();
         int returnCode = returnCode();
         if (returnCode != 0) {
             message.append(returnCodeMessage());
--- a/jdk/src/share/classes/sun/security/krb5/PrincipalName.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/krb5/PrincipalName.java	Fri Jul 11 05:59:08 2014 -0700
@@ -480,7 +480,7 @@
     }
 
     public String getPrincipalNameAsString() {
-        StringBuffer temp = new StringBuffer(nameStrings[0]);
+        StringBuilder temp = new StringBuilder(nameStrings[0]);
         for (int i = 1; i < nameStrings.length; i++)
             temp.append(nameStrings[i]);
         return temp.toString();
@@ -521,7 +521,7 @@
 
     public String getSalt() {
         if (salt == null) {
-            StringBuffer salt = new StringBuffer();
+            StringBuilder salt = new StringBuilder();
             salt.append(nameRealm.toString());
             for (int i = 0; i < nameStrings.length; i++) {
                 salt.append(nameStrings[i]);
@@ -532,7 +532,7 @@
     }
 
     public String toString() {
-        StringBuffer str = new StringBuffer();
+        StringBuilder str = new StringBuilder();
         for (int i = 0; i < nameStrings.length; i++) {
             if (i > 0)
                 str.append("/");
@@ -544,7 +544,7 @@
     }
 
     public String getNameString() {
-        StringBuffer str = new StringBuffer();
+        StringBuilder str = new StringBuilder();
         for (int i = 0; i < nameStrings.length; i++) {
             if (i > 0)
                 str.append("/");
--- a/jdk/src/share/classes/sun/security/krb5/internal/EncTicketPart.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/krb5/internal/EncTicketPart.java	Fri Jul 11 05:59:08 2014 -0700
@@ -117,7 +117,7 @@
     private static String getHexBytes(byte[] bytes, int len)
             throws IOException {
 
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         for (int i = 0; i < len; i++) {
 
             int b1 = (bytes[i] >> 4) & 0x0f;
--- a/jdk/src/share/classes/sun/security/krb5/internal/TicketFlags.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/krb5/internal/TicketFlags.java	Fri Jul 11 05:59:08 2014 -0700
@@ -137,7 +137,7 @@
      * Returns the string representative of ticket flags.
      */
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         boolean[] flags = toBooleanArray();
         for (int i = 0; i < flags.length; i++) {
             if (flags[i] == true) {
--- a/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java	Fri Jul 11 05:59:08 2014 -0700
@@ -269,7 +269,7 @@
         }
         int len = list.size();
         if (len <= 0) {
-            StringBuffer keystr = new StringBuffer();
+            StringBuilder keystr = new StringBuilder();
             for (int i = 0; i < keys.length; i++) {
                 keystr.append(toString(keys[i].getEType()));
                 keystr.append(" ");
--- a/jdk/src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java	Fri Jul 11 05:59:08 2014 -0700
@@ -636,7 +636,7 @@
     // Routines used for debugging
     static String bytesToString(byte[] digest) {
         // Get character representation of digest
-        StringBuffer digestString = new StringBuffer();
+        StringBuilder digestString = new StringBuilder();
 
         for (int i = 0; i < digest.length; i++) {
             if ((digest[i] & 0x000000ff) < 0x10) {
--- a/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTabEntry.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTabEntry.java	Fri Jul 11 05:59:08 2014 -0700
@@ -73,7 +73,7 @@
     }
 
     public String getKeyString() {
-        StringBuffer sb = new StringBuffer("0x");
+        StringBuilder sb = new StringBuilder("0x");
         for (int i = 0; i < keyblock.length; i++) {
             sb.append(String.format("%02x", keyblock[i]&0xff));
         }
--- a/jdk/src/share/classes/sun/security/pkcs/PKCS9Attribute.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/pkcs/PKCS9Attribute.java	Fri Jul 11 05:59:08 2014 -0700
@@ -790,26 +790,26 @@
      * Returns a string representation of this attribute.
      */
     public String toString() {
-        StringBuffer buf = new StringBuffer(100);
+        StringBuilder sb = new StringBuilder(100);
 
-        buf.append("[");
+        sb.append("[");
 
         if (index == -1) {
-            buf.append(oid.toString());
+            sb.append(oid.toString());
         } else {
-            buf.append(OID_NAME_TABLE.get(PKCS9_OIDS[index]));
+            sb.append(OID_NAME_TABLE.get(PKCS9_OIDS[index]));
         }
-        buf.append(": ");
+        sb.append(": ");
 
         if (index == -1 || SINGLE_VALUED[index]) {
             if (value instanceof byte[]) { // special case for octet string
                 HexDumpEncoder hexDump = new HexDumpEncoder();
-                buf.append(hexDump.encodeBuffer((byte[]) value));
+                sb.append(hexDump.encodeBuffer((byte[]) value));
             } else {
-                buf.append(value.toString());
+                sb.append(value.toString());
             }
-            buf.append("]");
-            return buf.toString();
+            sb.append("]");
+            return sb.toString();
         } else { // multi-valued
             boolean first = true;
             Object[] values = (Object[]) value;
@@ -818,11 +818,11 @@
                 if (first)
                     first = false;
                 else
-                    buf.append(", ");
+                    sb.append(", ");
 
-                buf.append(values[j].toString());
+                sb.append(values[j].toString());
             }
-            return buf.toString();
+            return sb.toString();
         }
     }
 
@@ -857,7 +857,7 @@
     private void throwTagException(Byte tag)
     throws IOException {
         Byte[] expectedTags = PKCS9_VALUE_TAGS[index];
-        StringBuffer msg = new StringBuffer(100);
+        StringBuilder msg = new StringBuilder(100);
         msg.append("Value of attribute ");
         msg.append(oid.toString());
         msg.append(" (");
--- a/jdk/src/share/classes/sun/security/pkcs/PKCS9Attributes.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/pkcs/PKCS9Attributes.java	Fri Jul 11 05:59:08 2014 -0700
@@ -323,8 +323,8 @@
      * Returns the PKCS9 block in a printable string form.
      */
     public String toString() {
-        StringBuffer buf = new StringBuffer(200);
-        buf.append("PKCS9 Attributes: [\n\t");
+        StringBuilder sb = new StringBuilder(200);
+        sb.append("PKCS9 Attributes: [\n\t");
 
         ObjectIdentifier oid;
         PKCS9Attribute value;
@@ -339,14 +339,14 @@
             if (first)
                 first = false;
             else
-                buf.append(";\n\t");
+                sb.append(";\n\t");
 
-            buf.append(value.toString());
+            sb.append(value.toString());
         }
 
-        buf.append("\n\t] (end PKCS9 Attributes)");
+        sb.append("\n\t] (end PKCS9 Attributes)");
 
-        return buf.toString();
+        return sb.toString();
     }
 
     /**
--- a/jdk/src/share/classes/sun/security/pkcs/SigningCertificateInfo.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/pkcs/SigningCertificateInfo.java	Fri Jul 11 05:59:08 2014 -0700
@@ -92,15 +92,15 @@
     }
 
     public String toString() {
-        StringBuffer buffer = new StringBuffer();
-        buffer.append("[\n");
+        StringBuilder sb = new StringBuilder();
+        sb.append("[\n");
         for (int i = 0; i < certId.length; i++) {
-            buffer.append(certId[i].toString());
+            sb.append(certId[i].toString());
         }
         // format policies as a string
-        buffer.append("\n]");
+        sb.append("\n]");
 
-        return buffer.toString();
+        return sb.toString();
     }
 
     public void parse(byte[] bytes) throws IOException {
@@ -151,17 +151,17 @@
     }
 
     public String toString() {
-        StringBuffer buffer = new StringBuffer();
-        buffer.append("[\n\tCertificate hash (SHA-1):\n");
+        StringBuilder sb = new StringBuilder();
+        sb.append("[\n\tCertificate hash (SHA-1):\n");
         if (hexDumper == null) {
             hexDumper = new HexDumpEncoder();
         }
-        buffer.append(hexDumper.encode(certHash));
+        sb.append(hexDumper.encode(certHash));
         if (issuer != null && serialNumber != null) {
-            buffer.append("\n\tIssuer: " + issuer + "\n");
-            buffer.append("\t" + serialNumber);
+            sb.append("\n\tIssuer: " + issuer + "\n");
+            sb.append("\t" + serialNumber);
         }
-        buffer.append("\n]");
-        return buffer.toString();
+        sb.append("\n]");
+        return sb.toString();
     }
 }
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_AES_CTR_PARAMS.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_AES_CTR_PARAMS.java	Fri Jul 11 05:59:08 2014 -0700
@@ -50,17 +50,17 @@
     }
 
     public String toString() {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
-        buffer.append(Constants.INDENT);
-        buffer.append("ulCounterBits: ");
-        buffer.append(ulCounterBits);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("ulCounterBits: ");
+        sb.append(ulCounterBits);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("cb: ");
-        buffer.append(Functions.toHexString(cb));
+        sb.append(Constants.INDENT);
+        sb.append("cb: ");
+        sb.append(Functions.toHexString(cb));
 
-        return buffer.toString();
+        return sb.toString();
     }
 }
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_DATE.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_DATE.java	Fri Jul 11 05:59:08 2014 -0700
@@ -122,16 +122,16 @@
      * @return the string representation of CK_DATE
      */
     public String toString() {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
-        buffer.append(new String(day));
-        buffer.append('.');
-        buffer.append(new String(month));
-        buffer.append('.');
-        buffer.append(new String(year));
-        buffer.append(" (DD.MM.YYYY)");
+        sb.append(new String(day));
+        sb.append('.');
+        sb.append(new String(month));
+        sb.append('.');
+        sb.append(new String(year));
+        sb.append(" (DD.MM.YYYY)");
 
-        return buffer.toString();
+        return sb.toString();
     }
 
 }
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_ECDH1_DERIVE_PARAMS.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_ECDH1_DERIVE_PARAMS.java	Fri Jul 11 05:59:08 2014 -0700
@@ -105,34 +105,34 @@
      * @return the string representation of CK_PKCS5_PBKD2_PARAMS
      */
     public String toString() {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
-        buffer.append(Constants.INDENT);
-        buffer.append("kdf: 0x");
-        buffer.append(Functions.toFullHexString(kdf));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("kdf: 0x");
+        sb.append(Functions.toFullHexString(kdf));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pSharedDataLen: ");
-        buffer.append(pSharedData.length);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("pSharedDataLen: ");
+        sb.append(pSharedData.length);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pSharedData: ");
-        buffer.append(Functions.toHexString(pSharedData));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("pSharedData: ");
+        sb.append(Functions.toHexString(pSharedData));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pPublicDataLen: ");
-        buffer.append(pPublicData.length);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("pPublicDataLen: ");
+        sb.append(pPublicData.length);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pPublicData: ");
-        buffer.append(Functions.toHexString(pPublicData));
+        sb.append(Constants.INDENT);
+        sb.append("pPublicData: ");
+        sb.append(Functions.toHexString(pPublicData));
         //buffer.append(Constants.NEWLINE);
 
-        return buffer.toString();
+        return sb.toString();
     }
 
 }
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_ECDH2_DERIVE_PARAMS.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_ECDH2_DERIVE_PARAMS.java	Fri Jul 11 05:59:08 2014 -0700
@@ -128,54 +128,54 @@
      * @return the string representation of CK_PKCS5_PBKD2_PARAMS
      */
     public String toString() {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
-        buffer.append(Constants.INDENT);
-        buffer.append("kdf: 0x");
-        buffer.append(Functions.toFullHexString(kdf));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("kdf: 0x");
+        sb.append(Functions.toFullHexString(kdf));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pSharedDataLen: ");
-        buffer.append(pSharedData.length);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("pSharedDataLen: ");
+        sb.append(pSharedData.length);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pSharedData: ");
-        buffer.append(Functions.toHexString(pSharedData));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("pSharedData: ");
+        sb.append(Functions.toHexString(pSharedData));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pPublicDataLen: ");
-        buffer.append(pPublicData.length);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("pPublicDataLen: ");
+        sb.append(pPublicData.length);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pPublicData: ");
-        buffer.append(Functions.toHexString(pPublicData));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("pPublicData: ");
+        sb.append(Functions.toHexString(pPublicData));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("ulPrivateDataLen: ");
-        buffer.append(ulPrivateDataLen);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("ulPrivateDataLen: ");
+        sb.append(ulPrivateDataLen);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("hPrivateData: ");
-        buffer.append(hPrivateData);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("hPrivateData: ");
+        sb.append(hPrivateData);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pPublicDataLen2: ");
-        buffer.append(pPublicData2.length);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("pPublicDataLen2: ");
+        sb.append(pPublicData2.length);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pPublicData2: ");
-        buffer.append(Functions.toHexString(pPublicData2));
+        sb.append(Constants.INDENT);
+        sb.append("pPublicData2: ");
+        sb.append(Functions.toHexString(pPublicData2));
         //buffer.append(Constants.NEWLINE);
 
-        return buffer.toString();
+        return sb.toString();
     }
 
 }
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_INFO.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_INFO.java	Fri Jul 11 05:59:08 2014 -0700
@@ -131,34 +131,34 @@
      * @return the string representation of CK_INFO
      */
     public String toString() {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
-        buffer.append(Constants.INDENT);
-        buffer.append("cryptokiVersion: ");
-        buffer.append(cryptokiVersion.toString());
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("cryptokiVersion: ");
+        sb.append(cryptokiVersion.toString());
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("manufacturerID: ");
-        buffer.append(new String(manufacturerID));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("manufacturerID: ");
+        sb.append(new String(manufacturerID));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("flags: ");
-        buffer.append(Functions.toBinaryString(flags));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("flags: ");
+        sb.append(Functions.toBinaryString(flags));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("libraryDescription: ");
-        buffer.append(new String(libraryDescription));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("libraryDescription: ");
+        sb.append(new String(libraryDescription));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("libraryVersion: ");
-        buffer.append(libraryVersion.toString());
+        sb.append(Constants.INDENT);
+        sb.append("libraryVersion: ");
+        sb.append(libraryVersion.toString());
         //buffer.append(Constants.NEWLINE);
 
-        return buffer.toString() ;
+        return sb.toString() ;
     }
 
 }
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_MECHANISM.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_MECHANISM.java	Fri Jul 11 05:59:08 2014 -0700
@@ -143,24 +143,24 @@
      * @return the string representation of CK_MECHANISM
      */
     public String toString() {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
-        buffer.append(Constants.INDENT);
-        buffer.append("mechanism: ");
-        buffer.append(mechanism);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("mechanism: ");
+        sb.append(mechanism);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pParameter: ");
-        buffer.append(pParameter.toString());
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("pParameter: ");
+        sb.append(pParameter.toString());
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("ulParameterLen: ??");
+        sb.append(Constants.INDENT);
+        sb.append("ulParameterLen: ??");
         //buffer.append(pParameter.length);
         //buffer.append(Constants.NEWLINE);
 
-        return buffer.toString() ;
+        return sb.toString() ;
     }
 
 }
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_MECHANISM_INFO.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_MECHANISM_INFO.java	Fri Jul 11 05:59:08 2014 -0700
@@ -103,25 +103,25 @@
      * @return the string representation of CK_MECHANISM_INFO
      */
     public String toString() {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
-        buffer.append(Constants.INDENT);
-        buffer.append("ulMinKeySize: ");
-        buffer.append(String.valueOf(ulMinKeySize));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("ulMinKeySize: ");
+        sb.append(String.valueOf(ulMinKeySize));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("ulMaxKeySize: ");
-        buffer.append(String.valueOf(ulMaxKeySize));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("ulMaxKeySize: ");
+        sb.append(String.valueOf(ulMaxKeySize));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("flags: ");
-        buffer.append(String.valueOf(flags));
-        buffer.append(" = ");
-        buffer.append(Functions.mechanismInfoFlagsToString(flags));
+        sb.append(Constants.INDENT);
+        sb.append("flags: ");
+        sb.append(String.valueOf(flags));
+        sb.append(" = ");
+        sb.append(Functions.mechanismInfoFlagsToString(flags));
         //buffer.append(Constants.NEWLINE);
 
-        return buffer.toString() ;
+        return sb.toString() ;
     }
 }
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_PBE_PARAMS.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_PBE_PARAMS.java	Fri Jul 11 05:59:08 2014 -0700
@@ -109,39 +109,39 @@
      * @return the string representation of CK_PBE_PARAMS
      */
     public String toString() {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pInitVector: ");
-        buffer.append(pInitVector);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("pInitVector: ");
+        sb.append(pInitVector);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("ulPasswordLen: ");
-        buffer.append(pPassword.length);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("ulPasswordLen: ");
+        sb.append(pPassword.length);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pPassword: ");
-        buffer.append(pPassword);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("pPassword: ");
+        sb.append(pPassword);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("ulSaltLen: ");
-        buffer.append(pSalt.length);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("ulSaltLen: ");
+        sb.append(pSalt.length);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pSalt: ");
-        buffer.append(pSalt);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("pSalt: ");
+        sb.append(pSalt);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("ulIteration: ");
-        buffer.append(ulIteration);
+        sb.append(Constants.INDENT);
+        sb.append("ulIteration: ");
+        sb.append(ulIteration);
         //buffer.append(Constants.NEWLINE);
 
-        return buffer.toString();
+        return sb.toString();
     }
 
 }
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_PKCS5_PBKD2_PARAMS.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_PKCS5_PBKD2_PARAMS.java	Fri Jul 11 05:59:08 2014 -0700
@@ -118,44 +118,44 @@
      * @return the string representation of CK_PKCS5_PBKD2_PARAMS
      */
     public String toString() {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
-        buffer.append(Constants.INDENT);
-        buffer.append("saltSource: ");
-        buffer.append(saltSource);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("saltSource: ");
+        sb.append(saltSource);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pSaltSourceData: ");
-        buffer.append(Functions.toHexString(pSaltSourceData));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("pSaltSourceData: ");
+        sb.append(Functions.toHexString(pSaltSourceData));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("ulSaltSourceDataLen: ");
-        buffer.append(pSaltSourceData.length);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("ulSaltSourceDataLen: ");
+        sb.append(pSaltSourceData.length);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("iterations: ");
-        buffer.append(iterations);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("iterations: ");
+        sb.append(iterations);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("prf: ");
-        buffer.append(prf);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("prf: ");
+        sb.append(prf);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pPrfData: ");
-        buffer.append(Functions.toHexString(pPrfData));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("pPrfData: ");
+        sb.append(Functions.toHexString(pPrfData));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("ulPrfDataLen: ");
-        buffer.append(pPrfData.length);
+        sb.append(Constants.INDENT);
+        sb.append("ulPrfDataLen: ");
+        sb.append(pPrfData.length);
         //buffer.append(Constants.NEWLINE);
 
-        return buffer.toString();
+        return sb.toString();
     }
 
 }
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_RSA_PKCS_OAEP_PARAMS.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_RSA_PKCS_OAEP_PARAMS.java	Fri Jul 11 05:59:08 2014 -0700
@@ -110,34 +110,34 @@
      * @return the string representation of CK_RSA_PKCS_OAEP_PARAMS
      */
     public String toString() {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
-        buffer.append(Constants.INDENT);
-        buffer.append("hashAlg: ");
-        buffer.append(hashAlg);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("hashAlg: ");
+        sb.append(hashAlg);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("mgf: ");
-        buffer.append(mgf);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("mgf: ");
+        sb.append(mgf);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("source: ");
-        buffer.append(source);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("source: ");
+        sb.append(source);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pSourceData: ");
-        buffer.append(pSourceData.toString());
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("pSourceData: ");
+        sb.append(pSourceData.toString());
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pSourceDataLen: ");
-        buffer.append(Functions.toHexString(pSourceData));
+        sb.append(Constants.INDENT);
+        sb.append("pSourceDataLen: ");
+        sb.append(Functions.toHexString(pSourceData));
         //buffer.append(Constants.NEWLINE);
 
-        return buffer.toString() ;
+        return sb.toString() ;
     }
 
 }
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_RSA_PKCS_PSS_PARAMS.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_RSA_PKCS_PSS_PARAMS.java	Fri Jul 11 05:59:08 2014 -0700
@@ -95,24 +95,24 @@
      * @return the string representation of CK_PKCS5_PBKD2_PARAMS
      */
     public String toString() {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
-        buffer.append(Constants.INDENT);
-        buffer.append("hashAlg: 0x");
-        buffer.append(Functions.toFullHexString(hashAlg));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("hashAlg: 0x");
+        sb.append(Functions.toFullHexString(hashAlg));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("mgf: 0x");
-        buffer.append(Functions.toFullHexString(mgf));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("mgf: 0x");
+        sb.append(Functions.toFullHexString(mgf));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("sLen: ");
-        buffer.append(sLen);
+        sb.append(Constants.INDENT);
+        sb.append("sLen: ");
+        sb.append(sLen);
         //buffer.append(Constants.NEWLINE);
 
-        return buffer.toString();
+        return sb.toString();
     }
 
 }
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_SESSION_INFO.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_SESSION_INFO.java	Fri Jul 11 05:59:08 2014 -0700
@@ -114,29 +114,29 @@
      * @return the string representation of CK_SESSION_INFO
      */
     public String toString() {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
-        buffer.append(Constants.INDENT);
-        buffer.append("slotID: ");
-        buffer.append(String.valueOf(slotID));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("slotID: ");
+        sb.append(String.valueOf(slotID));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("state: ");
-        buffer.append(Functions.sessionStateToString(state));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("state: ");
+        sb.append(Functions.sessionStateToString(state));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("flags: ");
-        buffer.append(Functions.sessionInfoFlagsToString(flags));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("flags: ");
+        sb.append(Functions.sessionInfoFlagsToString(flags));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("ulDeviceError: ");
-        buffer.append(Functions.toHexString(ulDeviceError));
+        sb.append(Constants.INDENT);
+        sb.append("ulDeviceError: ");
+        sb.append(Functions.toHexString(ulDeviceError));
         //buffer.append(Constants.NEWLINE);
 
-        return buffer.toString() ;
+        return sb.toString() ;
     }
 
 }
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_SLOT_INFO.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_SLOT_INFO.java	Fri Jul 11 05:59:08 2014 -0700
@@ -130,34 +130,34 @@
      * @return the string representation of CK_SLOT_INFO
      */
     public String toString() {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
-        buffer.append(Constants.INDENT);
-        buffer.append("slotDescription: ");
-        buffer.append(new String(slotDescription));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("slotDescription: ");
+        sb.append(new String(slotDescription));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("manufacturerID: ");
-        buffer.append(new String(manufacturerID));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("manufacturerID: ");
+        sb.append(new String(manufacturerID));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("flags: ");
-        buffer.append(Functions.slotInfoFlagsToString(flags));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("flags: ");
+        sb.append(Functions.slotInfoFlagsToString(flags));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("hardwareVersion: ");
-        buffer.append(hardwareVersion.toString());
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("hardwareVersion: ");
+        sb.append(hardwareVersion.toString());
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("firmwareVersion: ");
-        buffer.append(firmwareVersion.toString());
+        sb.append(Constants.INDENT);
+        sb.append("firmwareVersion: ");
+        sb.append(firmwareVersion.toString());
         //buffer.append(Constants.NEWLINE);
 
-        return buffer.toString() ;
+        return sb.toString() ;
     }
 
 }
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_TOKEN_INFO.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_TOKEN_INFO.java	Fri Jul 11 05:59:08 2014 -0700
@@ -271,119 +271,119 @@
      * @return the string representation of CK_TOKEN_INFO
      */
     public String toString() {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
-        buffer.append(Constants.INDENT);
-        buffer.append("label: ");
-        buffer.append(new String(label));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("label: ");
+        sb.append(new String(label));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("manufacturerID: ");
-        buffer.append(new String(manufacturerID));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("manufacturerID: ");
+        sb.append(new String(manufacturerID));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("model: ");
-        buffer.append(new String(model));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("model: ");
+        sb.append(new String(model));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("serialNumber: ");
-        buffer.append(new String(serialNumber));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("serialNumber: ");
+        sb.append(new String(serialNumber));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("flags: ");
-        buffer.append(Functions.tokenInfoFlagsToString(flags));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("flags: ");
+        sb.append(Functions.tokenInfoFlagsToString(flags));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("ulMaxSessionCount: ");
-        buffer.append((ulMaxSessionCount == PKCS11Constants.CK_EFFECTIVELY_INFINITE)
+        sb.append(Constants.INDENT);
+        sb.append("ulMaxSessionCount: ");
+        sb.append((ulMaxSessionCount == PKCS11Constants.CK_EFFECTIVELY_INFINITE)
                   ? "CK_EFFECTIVELY_INFINITE"
                   : (ulMaxSessionCount == PKCS11Constants.CK_UNAVAILABLE_INFORMATION)
                     ? "CK_UNAVAILABLE_INFORMATION"
                     : String.valueOf(ulMaxSessionCount));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("ulSessionCount: ");
-        buffer.append((ulSessionCount == PKCS11Constants.CK_UNAVAILABLE_INFORMATION)
+        sb.append(Constants.INDENT);
+        sb.append("ulSessionCount: ");
+        sb.append((ulSessionCount == PKCS11Constants.CK_UNAVAILABLE_INFORMATION)
                   ? "CK_UNAVAILABLE_INFORMATION"
                   : String.valueOf(ulSessionCount));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("ulMaxRwSessionCount: ");
-        buffer.append((ulMaxRwSessionCount == PKCS11Constants.CK_EFFECTIVELY_INFINITE)
+        sb.append(Constants.INDENT);
+        sb.append("ulMaxRwSessionCount: ");
+        sb.append((ulMaxRwSessionCount == PKCS11Constants.CK_EFFECTIVELY_INFINITE)
                   ? "CK_EFFECTIVELY_INFINITE"
                   : (ulMaxRwSessionCount == PKCS11Constants.CK_UNAVAILABLE_INFORMATION)
                     ? "CK_UNAVAILABLE_INFORMATION"
                     : String.valueOf(ulMaxRwSessionCount));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("ulRwSessionCount: ");
-        buffer.append((ulRwSessionCount == PKCS11Constants.CK_UNAVAILABLE_INFORMATION)
+        sb.append(Constants.INDENT);
+        sb.append("ulRwSessionCount: ");
+        sb.append((ulRwSessionCount == PKCS11Constants.CK_UNAVAILABLE_INFORMATION)
                   ? "CK_UNAVAILABLE_INFORMATION"
                   : String.valueOf(ulRwSessionCount));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("ulMaxPinLen: ");
-        buffer.append(String.valueOf(ulMaxPinLen));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("ulMaxPinLen: ");
+        sb.append(String.valueOf(ulMaxPinLen));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("ulMinPinLen: ");
-        buffer.append(String.valueOf(ulMinPinLen));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("ulMinPinLen: ");
+        sb.append(String.valueOf(ulMinPinLen));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("ulTotalPublicMemory: ");
-        buffer.append((ulTotalPublicMemory == PKCS11Constants.CK_UNAVAILABLE_INFORMATION)
+        sb.append(Constants.INDENT);
+        sb.append("ulTotalPublicMemory: ");
+        sb.append((ulTotalPublicMemory == PKCS11Constants.CK_UNAVAILABLE_INFORMATION)
                   ? "CK_UNAVAILABLE_INFORMATION"
                   : String.valueOf(ulTotalPublicMemory));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("ulFreePublicMemory: ");
-        buffer.append((ulFreePublicMemory == PKCS11Constants.CK_UNAVAILABLE_INFORMATION)
+        sb.append(Constants.INDENT);
+        sb.append("ulFreePublicMemory: ");
+        sb.append((ulFreePublicMemory == PKCS11Constants.CK_UNAVAILABLE_INFORMATION)
                   ? "CK_UNAVAILABLE_INFORMATION"
                   : String.valueOf(ulFreePublicMemory));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("ulTotalPrivateMemory: ");
-        buffer.append((ulTotalPrivateMemory == PKCS11Constants.CK_UNAVAILABLE_INFORMATION)
+        sb.append(Constants.INDENT);
+        sb.append("ulTotalPrivateMemory: ");
+        sb.append((ulTotalPrivateMemory == PKCS11Constants.CK_UNAVAILABLE_INFORMATION)
                   ? "CK_UNAVAILABLE_INFORMATION"
                   : String.valueOf(ulTotalPrivateMemory));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("ulFreePrivateMemory: ");
-        buffer.append((ulFreePrivateMemory == PKCS11Constants.CK_UNAVAILABLE_INFORMATION)
+        sb.append(Constants.INDENT);
+        sb.append("ulFreePrivateMemory: ");
+        sb.append((ulFreePrivateMemory == PKCS11Constants.CK_UNAVAILABLE_INFORMATION)
                   ? "CK_UNAVAILABLE_INFORMATION"
                   : String.valueOf(ulFreePrivateMemory));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("hardwareVersion: ");
-        buffer.append(hardwareVersion.toString());
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("hardwareVersion: ");
+        sb.append(hardwareVersion.toString());
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("firmwareVersion: ");
-        buffer.append(firmwareVersion.toString());
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("firmwareVersion: ");
+        sb.append(firmwareVersion.toString());
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("utcTime: ");
-        buffer.append(new String(utcTime));
+        sb.append(Constants.INDENT);
+        sb.append("utcTime: ");
+        sb.append(new String(utcTime));
         //buffer.append(Constants.NEWLINE);
 
-        return buffer.toString() ;
+        return sb.toString() ;
     }
 
 }
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_X9_42_DH1_DERIVE_PARAMS.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_X9_42_DH1_DERIVE_PARAMS.java	Fri Jul 11 05:59:08 2014 -0700
@@ -99,34 +99,34 @@
      * @return the string representation of CK_PKCS5_PBKD2_PARAMS
      */
     public String toString() {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
-        buffer.append(Constants.INDENT);
-        buffer.append("kdf: 0x");
-        buffer.append(Functions.toFullHexString(kdf));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("kdf: 0x");
+        sb.append(Functions.toFullHexString(kdf));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pOtherInfoLen: ");
-        buffer.append(pOtherInfo.length);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("pOtherInfoLen: ");
+        sb.append(pOtherInfo.length);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pOtherInfo: ");
-        buffer.append(Functions.toHexString(pOtherInfo));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("pOtherInfo: ");
+        sb.append(Functions.toHexString(pOtherInfo));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pPublicDataLen: ");
-        buffer.append(pPublicData.length);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("pPublicDataLen: ");
+        sb.append(pPublicData.length);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pPublicData: ");
-        buffer.append(Functions.toHexString(pPublicData));
+        sb.append(Constants.INDENT);
+        sb.append("pPublicData: ");
+        sb.append(Functions.toHexString(pPublicData));
         //buffer.append(Constants.NEWLINE);
 
-        return buffer.toString();
+        return sb.toString();
     }
 
 }
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_X9_42_DH2_DERIVE_PARAMS.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/CK_X9_42_DH2_DERIVE_PARAMS.java	Fri Jul 11 05:59:08 2014 -0700
@@ -128,54 +128,54 @@
      * @return the string representation of CK_PKCS5_PBKD2_PARAMS
      */
     public String toString() {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
-        buffer.append(Constants.INDENT);
-        buffer.append("kdf: 0x");
-        buffer.append(Functions.toFullHexString(kdf));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("kdf: 0x");
+        sb.append(Functions.toFullHexString(kdf));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pOtherInfoLen: ");
-        buffer.append(pOtherInfo.length);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("pOtherInfoLen: ");
+        sb.append(pOtherInfo.length);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pOtherInfo: ");
-        buffer.append(Functions.toHexString(pOtherInfo));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("pOtherInfo: ");
+        sb.append(Functions.toHexString(pOtherInfo));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pPublicDataLen: ");
-        buffer.append(pPublicData.length);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("pPublicDataLen: ");
+        sb.append(pPublicData.length);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pPublicData: ");
-        buffer.append(Functions.toHexString(pPublicData));
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("pPublicData: ");
+        sb.append(Functions.toHexString(pPublicData));
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("ulPrivateDataLen: ");
-        buffer.append(ulPrivateDataLen);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("ulPrivateDataLen: ");
+        sb.append(ulPrivateDataLen);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("hPrivateData: ");
-        buffer.append(hPrivateData);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("hPrivateData: ");
+        sb.append(hPrivateData);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pPublicDataLen2: ");
-        buffer.append(pPublicData2.length);
-        buffer.append(Constants.NEWLINE);
+        sb.append(Constants.INDENT);
+        sb.append("pPublicDataLen2: ");
+        sb.append(pPublicData2.length);
+        sb.append(Constants.NEWLINE);
 
-        buffer.append(Constants.INDENT);
-        buffer.append("pPublicData2: ");
-        buffer.append(Functions.toHexString(pPublicData2));
+        sb.append(Constants.INDENT);
+        sb.append("pPublicData2: ");
+        sb.append(Functions.toHexString(pPublicData2));
         //buffer.append(Constants.NEWLINE);
 
-        return buffer.toString();
+        return sb.toString();
     }
 
 }
--- a/jdk/src/share/classes/sun/security/pkcs11/wrapper/Functions.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/pkcs11/wrapper/Functions.java	Fri Jul 11 05:59:08 2014 -0700
@@ -109,14 +109,14 @@
      */
     public static String toFullHexString(long value) {
         long currentValue = value;
-        StringBuffer stringBuffer = new StringBuffer(16);
+        StringBuilder sb = new StringBuilder(16);
         for(int j = 0; j < 16; j++) {
             int currentDigit = (int) currentValue & 0xf;
-            stringBuffer.append(HEX_DIGITS[currentDigit]);
+            sb.append(HEX_DIGITS[currentDigit]);
             currentValue >>>= 4;
         }
 
-        return stringBuffer.reverse().toString();
+        return sb.reverse().toString();
     }
 
     /**
@@ -128,14 +128,14 @@
      */
     public static String toFullHexString(int value) {
         int currentValue = value;
-        StringBuffer stringBuffer = new StringBuffer(8);
+        StringBuilder sb = new StringBuilder(8);
         for(int i = 0; i < 8; i++) {
             int currentDigit = currentValue & 0xf;
-            stringBuffer.append(HEX_DIGITS[currentDigit]);
+            sb.append(HEX_DIGITS[currentDigit]);
             currentValue >>>= 4;
         }
 
-        return stringBuffer.reverse().toString();
+        return sb.reverse().toString();
     }
 
     /**
@@ -161,20 +161,20 @@
             return null;
         }
 
-        StringBuffer buffer = new StringBuffer(2 * value.length);
+        StringBuilder sb = new StringBuilder(2 * value.length);
         int          single;
 
         for (int i = 0; i < value.length; i++) {
             single = value[i] & 0xFF;
 
             if (single < 0x10) {
-                buffer.append('0');
+                sb.append('0');
             }
 
-            buffer.append(Integer.toString(single, 16));
+            sb.append(Integer.toString(single, 16));
         }
 
-        return buffer.toString();
+        return sb.toString();
     }
 
     /**
--- a/jdk/src/share/classes/sun/security/provider/AuthPolicyFile.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/provider/AuthPolicyFile.java	Fri Jul 11 05:59:08 2014 -0700
@@ -944,7 +944,7 @@
                     }
                     File f = new File(path);
                     path = f.getCanonicalPath();
-                    StringBuffer sb = new StringBuffer(path);
+                    StringBuilder sb = new StringBuilder(path);
                     // reappend '*' to canonicalized filename (note that
                     // canonicalization may have removed trailing file
                     // separator, so we have to check for that, too)
@@ -1095,7 +1095,7 @@
 
         @Override
         public String toString(){
-            StringBuffer sb = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
             sb.append(rb.getString("LPARAM"));
             sb.append(getCodeSource());
             sb.append("\n");
--- a/jdk/src/share/classes/sun/security/provider/X509Factory.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/provider/X509Factory.java	Fri Jul 11 05:59:08 2014 -0700
@@ -519,7 +519,7 @@
 
             // Step 2: Read the rest of header, determine the line end
             int end;
-            StringBuffer header = new StringBuffer("-----");
+            StringBuilder header = new StringBuilder("-----");
             while (true) {
                 int next = is.read();
                 if (next == -1) {
@@ -562,7 +562,7 @@
             }
 
             // Step 4: Consume the footer
-            StringBuffer footer = new StringBuffer("-");
+            StringBuilder footer = new StringBuilder("-");
             while (true) {
                 int next = is.read();
                 // Add next == '\n' for maximum safety, in case endline
--- a/jdk/src/share/classes/sun/security/smartcardio/PCSC.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/smartcardio/PCSC.java	Fri Jul 11 05:59:08 2014 -0700
@@ -172,7 +172,7 @@
     private final static char[] hexDigits = "0123456789abcdef".toCharArray();
 
     public static String toString(byte[] b) {
-        StringBuffer sb = new StringBuffer(b.length * 3);
+        StringBuilder sb = new StringBuilder(b.length * 3);
         for (int i = 0; i < b.length; i++) {
             int k = b[i] & 0xff;
             if (i != 0) {
--- a/jdk/src/share/classes/sun/security/ssl/HandshakeMessage.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/ssl/HandshakeMessage.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1474,17 +1474,17 @@
             s.println();
 
             if (protocolVersion.v >= ProtocolVersion.TLS12.v) {
-                StringBuffer buffer = new StringBuffer();
+                StringBuilder sb = new StringBuilder();
                 boolean opened = false;
                 for (SignatureAndHashAlgorithm signAlg : algorithms) {
                     if (opened) {
-                        buffer.append(", " + signAlg.getAlgorithmName());
+                        sb.append(", " + signAlg.getAlgorithmName());
                     } else {
-                        buffer.append(signAlg.getAlgorithmName());
+                        sb.append(signAlg.getAlgorithmName());
                         opened = true;
                     }
                 }
-                s.println("Supported Signature Algorithms: " + buffer);
+                s.println("Supported Signature Algorithms: " + sb);
             }
 
             s.println("Cert Authorities:");
--- a/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java	Fri Jul 11 05:59:08 2014 -0700
@@ -2594,7 +2594,7 @@
      */
     @Override
     public String toString() {
-        StringBuffer retval = new StringBuffer(80);
+        StringBuilder retval = new StringBuilder(80);
 
         retval.append(Integer.toHexString(hashCode()));
         retval.append("[");
--- a/jdk/src/share/classes/sun/security/ssl/ServerNameExtension.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/ssl/ServerNameExtension.java	Fri Jul 11 05:59:08 2014 -0700
@@ -266,12 +266,12 @@
 
     @Override
     public String toString() {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         for (SNIServerName sniName : sniMap.values()) {
-            buffer.append("[" + sniName + "]");
+            sb.append("[" + sniName + "]");
         }
 
-        return "Extension " + type + ", server_name: " + buffer;
+        return "Extension " + type + ", server_name: " + sb;
     }
 
     private static class UnknownServerName extends SNIServerName {
--- a/jdk/src/share/classes/sun/security/ssl/SessionId.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/ssl/SessionId.java	Fri Jul 11 05:59:08 2014 -0700
@@ -72,16 +72,16 @@
     public String toString ()
     {
         int             len = sessionId.length;
-        StringBuffer    s = new StringBuffer (10 + 2 * len);
+        StringBuilder    sb = new StringBuilder (10 + 2 * len);
 
-        s.append ("{");
+        sb.append("{");
         for (int i = 0; i < len; i++) {
-            s.append (0x0ff & sessionId [i]);
+            sb.append(0x0ff & sessionId[i]);
             if (i != (len - 1))
-                s.append (", ");
+                sb.append (", ");
         }
-        s.append ("}");
-        return s.toString ();
+        sb.append("}");
+        return sb.toString ();
     }
 
 
--- a/jdk/src/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java	Fri Jul 11 05:59:08 2014 -0700
@@ -118,18 +118,18 @@
 
     @Override
     public String toString() {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         boolean opened = false;
         for (SignatureAndHashAlgorithm signAlg : algorithms) {
             if (opened) {
-                buffer.append(", " + signAlg.getAlgorithmName());
+                sb.append(", " + signAlg.getAlgorithmName());
             } else {
-                buffer.append(signAlg.getAlgorithmName());
+                sb.append(signAlg.getAlgorithmName());
                 opened = true;
             }
         }
 
-        return "Extension " + type + ", signature_algorithms: " + buffer;
+        return "Extension " + type + ", signature_algorithms: " + sb;
     }
 }
 
--- a/jdk/src/share/classes/sun/security/tools/jarsigner/Main.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/tools/jarsigner/Main.java	Fri Jul 11 05:59:08 2014 -0700
@@ -728,7 +728,7 @@
                             output.put(label, new ArrayList<String>());
                         }
 
-                        StringBuffer fb = new StringBuffer();
+                        StringBuilder fb = new StringBuilder();
                         String s = Long.toString(je.getSize());
                         for (int i = 6 - s.length(); i > 0; --i) {
                             fb.append(' ');
@@ -1572,25 +1572,25 @@
         if (cacheForSignerInfo.containsKey(signer)) {
             return cacheForSignerInfo.get(signer);
         }
-        StringBuffer s = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         List<? extends Certificate> certs = signer.getSignerCertPath().getCertificates();
         // display the signature timestamp, if present
         Date timestamp;
         Timestamp ts = signer.getTimestamp();
         if (ts != null) {
-            s.append(printTimestamp(tab, ts));
-            s.append('\n');
+            sb.append(printTimestamp(tab, ts));
+            sb.append('\n');
             timestamp = ts.getTimestamp();
         } else {
             timestamp = null;
             noTimestamp = true;
         }
-        // display the certificate(s). The first one is end-entity cert and
+        // display the certificate(sb). The first one is end-entity cert and
         // its KeyUsage should be checked.
         boolean first = true;
         for (Certificate c : certs) {
-            s.append(printCert(tab, c, true, timestamp, first));
-            s.append('\n');
+            sb.append(printCert(tab, c, true, timestamp, first));
+            sb.append('\n');
             first = false;
         }
         try {
@@ -1605,11 +1605,11 @@
                 // No more warning, we alreay have hasExpiredCert or notYetValidCert
             } else {
                 chainNotValidated = true;
-                s.append(tab + rb.getString(".CertPath.not.validated.") +
+                sb.append(tab + rb.getString(".CertPath.not.validated.") +
                         e.getLocalizedMessage() + "]\n");   // TODO
             }
         }
-        String result = s.toString();
+        String result = sb.toString();
         cacheForSignerInfo.put(signer, result);
         return result;
     }
--- a/jdk/src/share/classes/sun/security/tools/keytool/Main.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/tools/keytool/Main.java	Fri Jul 11 05:59:08 2014 -0700
@@ -3664,7 +3664,7 @@
                     .startsWith(s.toLowerCase(Locale.ENGLISH))) {
                 match[nmatch++] = i;
             } else {
-                StringBuffer sb = new StringBuffer();
+                StringBuilder sb = new StringBuilder();
                 boolean first = true;
                 for (char c: one.toCharArray()) {
                     if (first) {
@@ -3690,7 +3690,7 @@
             if (match[1] > experiment) {
                 return match[0];
             }
-            StringBuffer sb = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
             MessageFormat form = new MessageFormat(rb.getString
                 ("command.{0}.is.ambiguous."));
             Object[] source = {s};
--- a/jdk/src/share/classes/sun/security/tools/policytool/PolicyTool.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/tools/policytool/PolicyTool.java	Fri Jul 11 05:59:08 2014 -0700
@@ -975,16 +975,16 @@
         String result = "";
         if ((grantEntry.principals != null) &&
             (!grantEntry.principals.isEmpty())) {
-            StringBuffer buffer = new StringBuffer(200);
+            StringBuilder sb = new StringBuilder(200);
             ListIterator<PolicyParser.PrincipalEntry> list =
                                 grantEntry.principals.listIterator();
             while (list.hasNext()) {
                 PolicyParser.PrincipalEntry pppe = list.next();
-                buffer.append(" Principal " + pppe.getDisplayClass() + " " +
+                sb.append(" Principal " + pppe.getDisplayClass() + " " +
                     pppe.getDisplayName(true));
-                if (list.hasNext()) buffer.append(", ");
+                if (list.hasNext()) sb.append(", ");
             }
-            result = buffer.toString();
+            result = sb.toString();
         }
         return result;
     }
--- a/jdk/src/share/classes/sun/security/util/Debug.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/util/Debug.java	Fri Jul 11 05:59:08 2014 -0700
@@ -188,13 +188,13 @@
      */
     public static String toHexString(BigInteger b) {
         String hexValue = b.toString(16);
-        StringBuffer buf = new StringBuffer(hexValue.length()*2);
+        StringBuilder sb = new StringBuilder(hexValue.length()*2);
 
         if (hexValue.startsWith("-")) {
-            buf.append("   -");
+            sb.append("   -");
             hexValue = hexValue.substring(1);
         } else {
-            buf.append("    ");     // four spaces
+            sb.append("    ");     // four spaces
         }
         if ((hexValue.length()%2) != 0) {
             // add back the leading 0
@@ -203,17 +203,17 @@
         int i=0;
         while (i < hexValue.length()) {
             // one byte at a time
-            buf.append(hexValue.substring(i, i+2));
+            sb.append(hexValue.substring(i, i + 2));
             i+=2;
             if (i!= hexValue.length()) {
                 if ((i%64) == 0) {
-                    buf.append("\n    ");     // line after eight words
+                    sb.append("\n    ");     // line after eight words
                 } else if (i%8 == 0) {
-                    buf.append(" ");     // space between words
+                    sb.append(" ");     // space between words
                 }
             }
         }
-        return buf.toString();
+        return sb.toString();
     }
 
     /**
@@ -221,7 +221,7 @@
      */
     private static String marshal(String args) {
         if (args != null) {
-            StringBuffer target = new StringBuffer();
+            StringBuilder target = new StringBuilder();
             StringBuffer source = new StringBuffer(args);
 
             // obtain the "permission=<classname>" options
--- a/jdk/src/share/classes/sun/security/util/ManifestEntryVerifier.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/util/ManifestEntryVerifier.java	Fri Jul 11 05:59:08 2014 -0700
@@ -238,7 +238,7 @@
 
     static String toHex(byte[] data) {
 
-        StringBuffer sb = new StringBuffer(data.length*2);
+        StringBuilder sb = new StringBuilder(data.length*2);
 
         for (int i=0; i<data.length; i++) {
             sb.append(hexc[(data[i] >>4) & 0x0f]);
--- a/jdk/src/share/classes/sun/security/util/ObjectIdentifier.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/util/ObjectIdentifier.java	Fri Jul 11 05:59:08 2014 -0700
@@ -418,7 +418,7 @@
         String s = stringForm;
         if (s == null) {
             int length = encoding.length;
-            StringBuffer sb = new StringBuffer(length * 4);
+            StringBuilder sb = new StringBuilder(length * 4);
 
             int fromPos = 0;
             for (int i = 0; i < length; i++) {
--- a/jdk/src/share/classes/sun/security/util/PropertyExpander.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/util/PropertyExpander.java	Fri Jul 11 05:59:08 2014 -0700
@@ -67,7 +67,7 @@
         // no special characters
         if (p == -1) return value;
 
-        StringBuffer sb = new StringBuffer(value.length());
+        StringBuilder sb = new StringBuilder(value.length());
         int max = value.length();
         int i = 0;  // index of last character we copied
 
--- a/jdk/src/share/classes/sun/security/util/SignatureFileVerifier.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/util/SignatureFileVerifier.java	Fri Jul 11 05:59:08 2014 -0700
@@ -552,7 +552,7 @@
 
     static String toHex(byte[] data) {
 
-        StringBuffer sb = new StringBuffer(data.length*2);
+        StringBuilder sb = new StringBuilder(data.length*2);
 
         for (int i=0; i<data.length; i++) {
             sb.append(hexc[(data[i] >>4) & 0x0f]);
--- a/jdk/src/share/classes/sun/security/x509/X509CRLImpl.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/security/x509/X509CRLImpl.java	Fri Jul 11 05:59:08 2014 -0700
@@ -536,7 +536,7 @@
      * @return value of this CRL in a printable form.
      */
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("X.509 CRL v" + (version+1) + "\n");
         if (sigAlgId != null)
             sb.append("Signature Algorithm: " + sigAlgId.toString() +
--- a/jdk/src/share/classes/sun/swing/SwingUtilities2.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/swing/SwingUtilities2.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1431,7 +1431,7 @@
     }
 
     public static String displayPropertiesToCSS(Font font, Color fg) {
-        StringBuffer rule = new StringBuffer("body {");
+        StringBuilder rule = new StringBuilder("body {");
         if (font != null) {
             rule.append(" font-family: ");
             rule.append(font.getFamily());
--- a/jdk/src/share/classes/sun/swing/plaf/synth/DefaultSynthStyle.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/swing/plaf/synth/DefaultSynthStyle.java	Fri Jul 11 05:59:08 2014 -0700
@@ -673,33 +673,33 @@
 
 
     public String toString() {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
-        buf.append(super.toString()).append(',');
+        sb.append(super.toString()).append(',');
 
-        buf.append("data=").append(data).append(',');
+        sb.append("data=").append(data).append(',');
 
-        buf.append("font=").append(font).append(',');
+        sb.append("font=").append(font).append(',');
 
-        buf.append("insets=").append(insets).append(',');
+        sb.append("insets=").append(insets).append(',');
 
-        buf.append("synthGraphics=").append(synthGraphics).append(',');
+        sb.append("synthGraphics=").append(synthGraphics).append(',');
 
-        buf.append("painter=").append(painter).append(',');
+        sb.append("painter=").append(painter).append(',');
 
         StateInfo[] states = getStateInfo();
         if (states != null) {
-            buf.append("states[");
+            sb.append("states[");
             for (StateInfo state : states) {
-                buf.append(state.toString()).append(',');
+                sb.append(state.toString()).append(',');
             }
-            buf.append(']').append(',');
+            sb.append(']').append(',');
         }
 
         // remove last newline
-        buf.deleteCharAt(buf.length() - 1);
+        sb.deleteCharAt(sb.length() - 1);
 
-        return buf.toString();
+        return sb.toString();
     }
 
 
@@ -909,19 +909,19 @@
         }
 
         public String toString() {
-            StringBuffer buf = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
 
-            buf.append(super.toString()).append(',');
+            sb.append(super.toString()).append(',');
 
-            buf.append("state=").append(Integer.toString(state)).append(',');
+            sb.append("state=").append(Integer.toString(state)).append(',');
 
-            buf.append("font=").append(font).append(',');
+            sb.append("font=").append(font).append(',');
 
             if (colors != null) {
-                buf.append("colors=").append(Arrays.asList(colors)).
+                sb.append("colors=").append(Arrays.asList(colors)).
                     append(',');
             }
-            return buf.toString();
+            return sb.toString();
         }
     }
 }
--- a/jdk/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java	Fri Jul 11 05:59:08 2014 -0700
@@ -439,20 +439,20 @@
     }
 
     private String fileNameString(File[] files) {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         for (int i = 0; files != null && i < files.length; i++) {
             if (i > 0) {
-                buf.append(" ");
+                sb.append(" ");
             }
             if (files.length > 1) {
-                buf.append("\"");
+                sb.append("\"");
             }
-            buf.append(fileNameString(files[i]));
+            sb.append(fileNameString(files[i]));
             if (files.length > 1) {
-                buf.append("\"");
+                sb.append("\"");
             }
         }
-        return buf.toString();
+        return sb.toString();
     }
 
     public void uninstallUI(JComponent c) {
--- a/jdk/src/share/classes/sun/text/normalizer/UTF16.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/text/normalizer/UTF16.java	Fri Jul 11 05:59:08 2014 -0700
@@ -530,7 +530,7 @@
             return String.valueOf((char)ch);
         }
 
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
         result.append(getLeadSurrogate(ch));
         result.append(getTrailSurrogate(ch));
         return result.toString();
--- a/jdk/src/share/classes/sun/tools/java/MemberDefinition.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/tools/java/MemberDefinition.java	Fri Jul 11 05:59:08 2014 -0700
@@ -919,18 +919,18 @@
         if (isInitializer()) {
             return isStatic() ? "static {}" : "instance {}";
         } else if (isConstructor()) {
-            StringBuffer buf = new StringBuffer();
-            buf.append(name);
-            buf.append('(');
+            StringBuilder sb = new StringBuilder();
+            sb.append(name);
+            sb.append('(');
             Type argTypes[] = getType().getArgumentTypes();
             for (int i = 0 ; i < argTypes.length ; i++) {
                 if (i > 0) {
-                    buf.append(',');
+                    sb.append(',');
                 }
-                buf.append(argTypes[i].toString());
+                sb.append(argTypes[i].toString());
             }
-            buf.append(')');
-            return buf.toString();
+            sb.append(')');
+            return sb.toString();
         } else if (isInnerClass()) {
             return getInnerClass().toString();
         }
--- a/jdk/src/share/classes/sun/tools/java/MethodSet.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/tools/java/MethodSet.java	Fri Jul 11 05:59:08 2014 -0700
@@ -261,18 +261,18 @@
      */
     public String toString() {
         int len = size();
-        StringBuffer buf = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         Iterator all = iterator();
-        buf.append("{");
+        sb.append("{");
 
         while (all.hasNext()) {
-            buf.append(all.next().toString());
+            sb.append(all.next().toString());
             len--;
             if (len > 0) {
-                buf.append(", ");
+                sb.append(", ");
             }
         }
-        buf.append("}");
-        return buf.toString();
+        sb.append("}");
+        return sb.toString();
     }
 }
--- a/jdk/src/share/classes/sun/tools/java/MethodType.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/tools/java/MethodType.java	Fri Jul 11 05:59:08 2014 -0700
@@ -91,17 +91,17 @@
     }
 
     public String typeString(String id, boolean abbrev, boolean ret) {
-        StringBuffer buf = new StringBuffer();
-        buf.append(id);
-        buf.append('(');
+        StringBuilder sb = new StringBuilder();
+        sb.append(id);
+        sb.append('(');
         for (int i = 0 ; i < argTypes.length ; i++) {
             if (i > 0) {
-                buf.append(", ");
+                sb.append(", ");
             }
-            buf.append(argTypes[i].typeString("", abbrev, ret));
+            sb.append(argTypes[i].typeString("", abbrev, ret));
         }
-        buf.append(')');
+        sb.append(')');
 
-        return ret ? getReturnType().typeString(buf.toString(), abbrev, ret) : buf.toString();
+        return ret ? getReturnType().typeString(sb.toString(), abbrev, ret) : sb.toString();
     }
 }
--- a/jdk/src/share/classes/sun/tools/java/Parser.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/tools/java/Parser.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1395,24 +1395,24 @@
             return res;
         }
 
-        StringBuffer buf = new StringBuffer(res.id.toString());
+        StringBuilder sb = new StringBuilder(res.id.toString());
 
         while (token == FIELD) {
             scan();
             if ((token == MUL) && star) {
                 scan();
-                buf.append(".*");
+                sb.append(".*");
                 break;
             }
 
-            buf.append('.');
+            sb.append('.');
             if (token == IDENT) {
-                buf.append(scanner.idValue);
+                sb.append(scanner.idValue);
             }
             expect(IDENT);
         }
 
-        res.id = Identifier.lookup(buf.toString());
+        res.id = Identifier.lookup(sb.toString());
         return res;
     }
     /**
--- a/jdk/src/share/classes/sun/tools/java/Type.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/tools/java/Type.java	Fri Jul 11 05:59:08 2014 -0700
@@ -274,15 +274,15 @@
      * Create a method type with arguments.
      */
     public static synchronized Type tMethod(Type returnType, Type argTypes[]) {
-        StringBuffer buf = new StringBuffer();
-        buf.append(SIG_METHOD);
+        StringBuilder sb = new StringBuilder();
+        sb.append(SIG_METHOD);
         for (int i = 0 ; i < argTypes.length ; i++) {
-            buf.append(argTypes[i].getTypeSignature());
+            sb.append(argTypes[i].getTypeSignature());
         }
-        buf.append(SIG_ENDMETHOD);
-        buf.append(returnType.getTypeSignature());
+        sb.append(SIG_ENDMETHOD);
+        sb.append(returnType.getTypeSignature());
 
-        String sig = buf.toString();
+        String sig = sb.toString();
         Type t = (Type)typeHash.get(sig);
         if (t == null) {
             t = new MethodType(sig, returnType, argTypes);
--- a/jdk/src/share/classes/sun/tools/jconsole/Formatter.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/tools/jconsole/Formatter.java	Fri Jul 11 05:59:08 2014 -0700
@@ -232,15 +232,15 @@
     }
 
     static String justify(String str, int size) {
-        StringBuffer buf = new StringBuffer();
-        buf.append("<TT>");
+        StringBuilder sb = new StringBuilder();
+        sb.append("<TT>");
         int n = size - str.length();
         for (int i = 0; i < n; i++) {
-            buf.append("&nbsp;");
+            sb.append("&nbsp;");
         }
-        buf.append(str);
-        buf.append("</TT>");
-        return buf.toString();
+        sb.append(str);
+        sb.append("</TT>");
+        return sb.toString();
     }
 
     static String newRow(String label, String value) {
--- a/jdk/src/share/classes/sun/tools/jstatd/RemoteHostImpl.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/tools/jstatd/RemoteHostImpl.java	Fri Jul 11 05:59:08 2014 -0700
@@ -64,7 +64,7 @@
                     throws RemoteException, MonitorException {
         Integer v = new Integer(lvmid);
         RemoteVm stub = null;
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
         sb.append("local://").append(lvmid).append("@localhost");
         if (mode != null) {
--- a/jdk/src/share/classes/sun/tools/native2ascii/N2AFilter.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/tools/native2ascii/N2AFilter.java	Fri Jul 11 05:59:08 2014 -0700
@@ -58,7 +58,7 @@
                 out.write('u');
                 String hex =
                     Integer.toHexString(buf[i]);
-                StringBuffer hex4 = new StringBuffer(hex);
+                StringBuilder hex4 = new StringBuilder(hex);
                 hex4.reverse();
                 int length = 4 - hex4.length();
                 for (int j = 0; j < length; j++) {
--- a/jdk/src/share/classes/sun/tools/serialver/SerialVer.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/tools/serialver/SerialVer.java	Fri Jul 11 05:59:08 2014 -0700
@@ -85,7 +85,7 @@
                 /* Class not found so far */
             }
             if (!classFound) {
-                StringBuffer workBuffer = new StringBuffer(classname);
+                StringBuilder workBuffer = new StringBuilder(classname);
                 String workName = workBuffer.toString();
                 int i;
                 while ((i = workName.lastIndexOf('.')) != -1 && !classFound) {
--- a/jdk/src/share/classes/sun/tools/tree/FieldExpression.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/FieldExpression.java	Fri Jul 11 05:59:08 2014 -0700
@@ -79,21 +79,21 @@
      * Convert an '.' expression to a qualified identifier
      */
     static public Identifier toIdentifier(Expression e) {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         while (e.op == FIELD) {
             FieldExpression fe = (FieldExpression)e;
             if (fe.id == idThis || fe.id == idClass) {
                 return null;
             }
-            buf.insert(0, fe.id);
-            buf.insert(0, '.');
+            sb.insert(0, fe.id);
+            sb.insert(0, '.');
             e = fe.right;
         }
         if (e.op != IDENT) {
             return null;
         }
-        buf.insert(0, ((IdentifierExpression)e).id);
-        return Identifier.lookup(buf.toString());
+        sb.insert(0, ((IdentifierExpression) e).id);
+        return Identifier.lookup(sb.toString());
     }
 
     /**
--- a/jdk/src/share/classes/sun/tools/tree/Vset.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/tools/tree/Vset.java	Fri Jul 11 05:59:08 2014 -0700
@@ -495,7 +495,7 @@
     public String toString() {
         if (this == DEAD_END)
             return "{DEAD_END}";
-        StringBuffer sb = new StringBuffer("{");
+        StringBuilder sb = new StringBuilder("{");
         int maxVar = VBITS * (1 + (x.length+1)/2);
         for (int i = 0; i < maxVar; i++) {
             if (!testVarUnassigned(i)) {
--- a/jdk/src/share/classes/sun/tracing/PrintStreamProviderFactory.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/classes/sun/tracing/PrintStreamProviderFactory.java	Fri Jul 11 05:59:08 2014 -0700
@@ -99,7 +99,7 @@
     }
 
     public void uncheckedTrigger(Object[] args) {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append(provider.getName());
         sb.append(".");
         sb.append(name);
--- a/jdk/src/share/demo/jvmti/hprof/hprof.h	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/demo/jvmti/hprof/hprof.h	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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
@@ -67,10 +67,6 @@
 #include "classfile_constants.h"
 #include "jvm_md.h"
 
-#ifndef SKIP_NPT
-#include "npt.h"   /* To get NptEnv for doing character conversions */
-#endif
-
 /* Macros to extract the upper and lower 32 bits of a jlong */
 
 #define jlong_high(a)    ((jint)((a)>>32))
@@ -207,9 +203,6 @@
 
     jvmtiEnv            *jvmti; /* JVMTI env for this session */
     JavaVM              *jvm;   /* JavaVM* for this session */
-#ifndef SKIP_NPT
-    NptEnv              *npt;   /* NptEnv* for this session, see npt.h */
-#endif
     jint                cachedJvmtiVersion; /* JVMTI version number */
 
     char               *header; /* "JAVA PROFILE 1.0.[12]" */
--- a/jdk/src/share/demo/jvmti/hprof/hprof_init.c	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/share/demo/jvmti/hprof/hprof_init.c	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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
@@ -740,16 +740,11 @@
     }
 
     if ( gdata->utf8_output_filename != NULL ) {
-        /* UTF-8 to platform encoding (fill in gdata->output_filename) */
+        // Don't attempt to convert output filename.
+        // If fileystem uses the same encoding as the rest of the OS it will work as is.
         ulen = (int)strlen(gdata->utf8_output_filename);
         gdata->output_filename = (char*)HPROF_MALLOC(ulen*3+3);
-#ifdef SKIP_NPT
         (void)strcpy(gdata->output_filename, gdata->utf8_output_filename);
-#else
-        (void)(gdata->npt->utf8ToPlatform)
-              (gdata->npt->utf, (jbyte*)gdata->utf8_output_filename, ulen,
-               gdata->output_filename, ulen*3+3);
-#endif
     }
 
     /* By default we turn on gdata->alloc_sites and gdata->heap_dump */
@@ -1949,7 +1944,6 @@
 Agent_OnLoad(JavaVM *vm, char *options, void *reserved)
 {
     char *boot_path = NULL;
-    char npt_lib[JVM_MAXPATHLEN];
 
     /* See if it's already loaded */
     if ( gdata!=NULL && gdata->isLoaded==JNI_TRUE ) {
@@ -1970,24 +1964,6 @@
     /* Get the JVMTI environment */
     getJvmti();
 
-#ifndef SKIP_NPT
-    getSystemProperty("sun.boot.library.path", &boot_path);
-    /* Load in NPT library for character conversions */
-    md_build_library_name(npt_lib, sizeof(npt_lib), boot_path, NPT_LIBNAME);
-    if ( strlen(npt_lib) == 0 ) {
-        HPROF_ERROR(JNI_TRUE, "Could not find npt library");
-    }
-    jvmtiDeallocate(boot_path);
-    NPT_INITIALIZE(npt_lib, &(gdata->npt), NPT_VERSION, NULL);
-    if ( gdata->npt == NULL ) {
-        HPROF_ERROR(JNI_TRUE, "Cannot load npt library");
-    }
-    gdata->npt->utf = (gdata->npt->utfInitialize)(NULL);
-    if ( gdata->npt->utf == NULL ) {
-        HPROF_ERROR(JNI_TRUE, "Cannot initialize npt utf functions");
-    }
-#endif
-
     /* Lock needed to protect debug_malloc() code, which is not MT safe */
     #ifdef DEBUG
         gdata->debug_malloc_lock = createRawMonitor("HPROF debug_malloc lock");
--- a/jdk/src/share/npt/README.txt	Wed Jul 09 16:44:30 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-
-README: For NPT Library.
-------------------------
-
-To use this Native Platform Toolkit library, you need to add 
--Isrc/share/npt and -I/src/${platform}/npt (platform is solaris or windows)
-to your compilation lines.
-
-To initialize/use the library:
-
-    #include "npt.h"
-    
-    NptEnv *npt;
-    
-    NPT_INITIALIZE(&npt, NPT_VERSION, NULL);
-    if (npt == NULL) {
-        FATAL_ERROR_MESSAGE(("Unable to gain access to Npt library"));
-    }
-
-    /* To use the npt utf functions, they require initialization */
-    npt->utf = (npt->utfInitialize)(NULL);
-    if (npt->utf == NULL) {
-        FATAL_ERROR_MESSAGE(("Unable to gain access to Npt utf functions"));
-    }
-
-    ...
-
-
-    /* After all uses is done, it can be terminated, however, if the
-     *   process will be exiting anyway it isn't necessary, and if
-     *   you have other threads running that might use these handles
-     *   you will need to wait here until all those threads have terminated.
-     *   So in general, termination can be a pain and slow your process
-     *   termination down.
-     */
-    (npt->utfTerminate)(npt->utf,NULL);
-    NPT_TERMINATE(&npt, NULL);
-
-
--- a/jdk/src/share/npt/npt.c	Wed Jul 09 16:44:30 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "jni.h"
-
-#include "npt.h"
-
-#include "utf.h"
-
-static int
-version_check(char *version)
-{
-    if ( version==NULL || strcmp(version, NPT_VERSION)!=0 ) {
-        return 1;
-    }
-    return 0;
-}
-
-JNIEXPORT void JNICALL
-nptInitialize(NptEnv **pnpt, char *nptVersion, char *options)
-{
-    NptEnv *npt;
-
-    (*pnpt) = NULL;
-
-    if ( version_check(nptVersion) ) {
-        NPT_ERROR("NPT version doesn't match");
-        return;
-    }
-
-    npt = (NptEnv*)calloc(sizeof(NptEnv), 1);
-    if ( npt == NULL ) {
-        NPT_ERROR("Cannot allocate calloc space for NptEnv*");
-        return;
-    }
-
-    if ( options != NULL ) {
-        npt->options = strdup(options);
-    }
-    npt->utfInitialize          = &utfInitialize;
-    npt->utfTerminate           = &utfTerminate;
-    npt->utf8ToPlatform         = &utf8ToPlatform;
-    npt->utf8FromPlatform       = &utf8FromPlatform;
-    npt->utf8ToUtf16            = &utf8ToUtf16;
-    npt->utf16ToUtf8m           = &utf16ToUtf8m;
-    npt->utf16ToUtf8s           = &utf16ToUtf8s;
-    npt->utf8sToUtf8mLength     = &utf8sToUtf8mLength;
-    npt->utf8sToUtf8m           = &utf8sToUtf8m;
-    npt->utf8mToUtf8sLength     = &utf8mToUtf8sLength;
-    npt->utf8mToUtf8s           = &utf8mToUtf8s;
-
-    (*pnpt) = npt;
-}
-
-JNIEXPORT void JNICALL
-nptTerminate(NptEnv* npt, char *options)
-{
-
-    /* FIXUP: options? Check memory or something? */
-    if ( npt->options != NULL ) {
-        (void)free(npt->options);
-    }
-    (void)free(npt);
-}
--- a/jdk/src/share/npt/npt.h	Wed Jul 09 16:44:30 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
- * 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.
- */
-
-/* Native Platform Toolkit */
-
-#ifndef  _NPT_H
-#define _NPT_H
-
-#define NPT_VERSION "0.0.0"
-
-#include <stdio.h>
-
-#include "jni.h"
-
-#include "npt_md.h"
-#include "utf.h"
-
-#define NPT_ERROR(s) { (void)fprintf(stderr, "NPT ERROR: %s\n", s); exit(1); }
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct {
-
-    /* Used to save handle to our own dynamicly loaded library */
-    void *libhandle;
-
-    /* Copy of the options sent in at initialization */
-    char *options;
-
-    /* Can be used to save the UtfInst handle */
-    struct UtfInst *utf;
-
-    /* UTF interfaces, see utf.c */
-    struct UtfInst* (JNICALL *utfInitialize)
-                         (char *options);
-    void     (JNICALL *utfTerminate)
-                         (struct UtfInst *utf, char *options);
-    int      (JNICALL *utf8ToPlatform)
-                         (struct UtfInst *utf, jbyte *utf8, int len,
-                          char *output, int outputMaxLen);
-    int      (JNICALL *utf8FromPlatform)
-                         (struct UtfInst *utf, char *str, int len,
-                          jbyte *output, int outputMaxLen);
-    int      (JNICALL *utf8ToUtf16)
-                         (struct UtfInst *utf, jbyte *utf8, int len,
-                          jchar *output, int outputMaxLen);
-    int      (JNICALL *utf16ToUtf8m)
-                         (struct UtfInst *utf, jchar *utf16, int len,
-                          jbyte *output, int outputMaxLen);
-    int      (JNICALL *utf16ToUtf8s)
-                         (struct UtfInst *utf, jchar *utf16, int len,
-                          jbyte *output, int outputMaxLen);
-    int      (JNICALL *utf8sToUtf8mLength)
-                         (struct UtfInst *utf, jbyte *string, int length);
-    void     (JNICALL *utf8sToUtf8m)
-                         (struct UtfInst *utf, jbyte *string, int length,
-                          jbyte *newString, int newLength);
-    int      (JNICALL *utf8mToUtf8sLength)
-                         (struct UtfInst *utf, jbyte *string, int length);
-    void     (JNICALL *utf8mToUtf8s)
-                         (struct UtfInst *utf, jbyte *string, int length,
-                          jbyte *newString, int newLength);
-
-} NptEnv;
-
-/* Typedefs for the only 2 'extern' functions in npt library:
- *    nptInitialize and nptTerminate
- *    See NPT_INITIALIZE() and NPT_TERMINATE() in npt_md.h.
- */
-
-JNIEXPORT void JNICALL nptInitialize
-                       (NptEnv **pnpt, char *nptVersion, char *options);
-typedef void (JNICALL *NptInitialize)
-             (NptEnv **pnpt, char *nptVersion, char *options);
-
-JNIEXPORT void JNICALL nptTerminate
-                       (NptEnv* npt, char *options);
-typedef void (JNICALL *NptTerminate)
-             (NptEnv* npt, char *options);
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif /* __cplusplus */
-
-#endif
--- a/jdk/src/share/npt/utf.c	Wed Jul 09 16:44:30 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,500 +0,0 @@
-/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
- * 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.
- */
-
-/* Misc functions for conversion of Unicode and UTF-8 and platform encoding */
-
-#include <stdio.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <ctype.h>
-
-#include "jni.h"
-
-#include "utf.h"
-
-/*
- * Error handler
- */
-void
-utfError(char *file, int line, char *message)
-{
-    (void)fprintf(stderr, "UTF ERROR [\"%s\":%d]: %s\n", file, line, message);
-    abort();
-}
-
-/*
- * Convert UTF-8 to UTF-16
- *    Returns length or -1 if output overflows.
- */
-int JNICALL
-utf8ToUtf16(struct UtfInst *ui, jbyte *utf8, int len, unsigned short *output, int outputMaxLen)
-{
-    int outputLen;
-    int i;
-
-    UTF_ASSERT(utf8);
-    UTF_ASSERT(len>=0);
-    UTF_ASSERT(output);
-    UTF_ASSERT(outputMaxLen>0);
-
-    i = 0;
-    outputLen = 0;
-    while ( i<len ) {
-        unsigned code, x, y, z;
-
-        if ( outputLen >= outputMaxLen ) {
-            return -1;
-        }
-        x = (unsigned char)utf8[i++];
-        code = x;
-        if ( (x & 0xE0)==0xE0 ) {
-            y = (unsigned char)utf8[i++];
-            z = (unsigned char)utf8[i++];
-            code = ((x & 0xF)<<12) + ((y & 0x3F)<<6) + (z & 0x3F);
-        } else if ( (x & 0xC0)==0xC0 ) {
-            y = (unsigned char)utf8[i++];
-            code = ((x & 0x1F)<<6) + (y & 0x3F);
-        }
-        output[outputLen++] = code;
-    }
-    return outputLen;
-}
-
-/*
- * Convert UTF-16 to UTF-8 Modified
- *    Returns length or -1 if output overflows.
- */
-int JNICALL
-utf16ToUtf8m(struct UtfInst *ui, unsigned short *utf16, int len, jbyte *output, int outputMaxLen)
-{
-    int i;
-    int outputLen;
-
-    UTF_ASSERT(utf16);
-    UTF_ASSERT(len>=0);
-    UTF_ASSERT(output);
-    UTF_ASSERT(outputMaxLen>0);
-
-    outputLen = 0;
-    for (i = 0; i < len; i++) {
-        unsigned code;
-
-        code = utf16[i];
-        if ( code >= 0x0001 && code <= 0x007F ) {
-            if ( outputLen + 1 >= outputMaxLen ) {
-                return -1;
-            }
-            output[outputLen++] = code;
-        } else if ( code == 0 || ( code >= 0x0080 && code <= 0x07FF ) ) {
-            if ( outputLen + 2 >= outputMaxLen ) {
-                return -1;
-            }
-            output[outputLen++] = ((code>>6) & 0x1F) | 0xC0;
-            output[outputLen++] = (code & 0x3F) | 0x80;
-        } else if ( code >= 0x0800 && code <= 0xFFFF ) {
-            if ( outputLen + 3 >= outputMaxLen ) {
-                return -1;
-            }
-            output[outputLen++] = ((code>>12) & 0x0F) | 0xE0;
-            output[outputLen++] = ((code>>6) & 0x3F) | 0x80;
-            output[outputLen++] = (code & 0x3F) | 0x80;
-        }
-    }
-    output[outputLen] = 0;
-    return outputLen;
-}
-
-int JNICALL
-utf16ToUtf8s(struct UtfInst *ui, unsigned short *utf16, int len, jbyte *output, int outputMaxLen)
-{
-    return -1; /* FIXUP */
-}
-
-/* Determine length of this Standard UTF-8 in Modified UTF-8.
- *    Validation is done of the basic UTF encoding rules, returns
- *    length (no change) when errors are detected in the UTF encoding.
- *
- *    Note: Accepts Modified UTF-8 also, no verification on the
- *          correctness of Standard UTF-8 is done. e,g, 0xC080 input is ok.
- */
-int JNICALL
-utf8sToUtf8mLength(struct UtfInst *ui, jbyte *string, int length)
-{
-    int newLength;
-    int i;
-
-    newLength = 0;
-    for ( i = 0 ; i < length ; i++ ) {
-        unsigned byte;
-
-        byte = (unsigned char)string[i];
-        if ( (byte & 0x80) == 0 ) { /* 1byte encoding */
-            newLength++;
-            if ( byte == 0 ) {
-                newLength++; /* We gain one byte in length on NULL bytes */
-            }
-        } else if ( (byte & 0xE0) == 0xC0 ) { /* 2byte encoding */
-            /* Check encoding of following bytes */
-            if ( (i+1) >= length || (string[i+1] & 0xC0) != 0x80 ) {
-                break; /* Error condition */
-            }
-            i++; /* Skip next byte */
-            newLength += 2;
-        } else if ( (byte & 0xF0) == 0xE0 ) { /* 3byte encoding */
-            /* Check encoding of following bytes */
-            if ( (i+2) >= length || (string[i+1] & 0xC0) != 0x80
-                                 || (string[i+2] & 0xC0) != 0x80 ) {
-                break; /* Error condition */
-            }
-            i += 2; /* Skip next two bytes */
-            newLength += 3;
-        } else if ( (byte & 0xF8) == 0xF0 ) { /* 4byte encoding */
-            /* Check encoding of following bytes */
-            if ( (i+3) >= length || (string[i+1] & 0xC0) != 0x80
-                                 || (string[i+2] & 0xC0) != 0x80
-                                 || (string[i+3] & 0xC0) != 0x80 ) {
-                break; /* Error condition */
-            }
-            i += 3; /* Skip next 3 bytes */
-            newLength += 6; /* 4byte encoding turns into 2 3byte ones */
-        } else {
-            break; /* Error condition */
-        }
-    }
-    if ( i != length ) {
-        /* Error in finding new length, return old length so no conversion */
-        /* FIXUP: ERROR_MESSAGE? */
-        return length;
-    }
-    return newLength;
-}
-
-/* Convert Standard UTF-8 to Modified UTF-8.
- *    Assumes the UTF-8 encoding was validated by utf8mLength() above.
- *
- *    Note: Accepts Modified UTF-8 also, no verification on the
- *          correctness of Standard UTF-8 is done. e,g, 0xC080 input is ok.
- */
-void JNICALL
-utf8sToUtf8m(struct UtfInst *ui, jbyte *string, int length, jbyte *newString, int newLength)
-{
-    int i;
-    int j;
-
-    j = 0;
-    for ( i = 0 ; i < length ; i++ ) {
-        unsigned byte1;
-
-        byte1 = (unsigned char)string[i];
-
-        /* NULL bytes and bytes starting with 11110xxx are special */
-        if ( (byte1 & 0x80) == 0 ) { /* 1byte encoding */
-            if ( byte1 == 0 ) {
-                /* Bits out: 11000000 10000000 */
-                newString[j++] = (jbyte)0xC0;
-                newString[j++] = (jbyte)0x80;
-            } else {
-                /* Single byte */
-                newString[j++] = byte1;
-            }
-        } else if ( (byte1 & 0xE0) == 0xC0 ) { /* 2byte encoding */
-            newString[j++] = byte1;
-            newString[j++] = string[++i];
-        } else if ( (byte1 & 0xF0) == 0xE0 ) { /* 3byte encoding */
-            newString[j++] = byte1;
-            newString[j++] = string[++i];
-            newString[j++] = string[++i];
-        } else if ( (byte1 & 0xF8) == 0xF0 ) { /* 4byte encoding */
-            /* Beginning of 4byte encoding, turn into 2 3byte encodings */
-            unsigned byte2, byte3, byte4, u21;
-
-            /* Bits in: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */
-            byte2 = (unsigned char)string[++i];
-            byte3 = (unsigned char)string[++i];
-            byte4 = (unsigned char)string[++i];
-            /* Reconstruct full 21bit value */
-            u21  = (byte1 & 0x07) << 18;
-            u21 += (byte2 & 0x3F) << 12;
-            u21 += (byte3 & 0x3F) << 6;
-            u21 += (byte4 & 0x3F);
-            /* Bits out: 11101101 1010xxxx 10xxxxxx */
-            newString[j++] = (jbyte)0xED;
-            newString[j++] = (jbyte)(0xA0 + (((u21 >> 16) - 1) & 0x0F));
-            newString[j++] = (jbyte)(0x80 + ((u21 >> 10) & 0x3F));
-            /* Bits out: 11101101 1011xxxx 10xxxxxx */
-            newString[j++] = (jbyte)0xED;
-            newString[j++] = (jbyte)(0xB0 + ((u21 >>  6) & 0x0F));
-            newString[j++] = byte4;
-        }
-    }
-    UTF_ASSERT(i==length);
-    UTF_ASSERT(j==newLength);
-    newString[j] = (jbyte)0;
-}
-
-/* Given a Modified UTF-8 string, calculate the Standard UTF-8 length.
- *   Basic validation of the UTF encoding rules is done, and length is
- *   returned (no change) when errors are detected.
- *
- *   Note: No validation is made that this is indeed Modified UTF-8 coming in.
- *
- */
-int JNICALL
-utf8mToUtf8sLength(struct UtfInst *ui, jbyte *string, int length)
-{
-    int newLength;
-    int i;
-
-    newLength = 0;
-    for ( i = 0 ; i < length ; i++ ) {
-        unsigned byte1, byte2, byte3, byte4, byte5, byte6;
-
-        byte1 = (unsigned char)string[i];
-        if ( (byte1 & 0x80) == 0 ) { /* 1byte encoding */
-            newLength++;
-        } else if ( (byte1 & 0xE0) == 0xC0 ) { /* 2byte encoding */
-            /* Check encoding of following bytes */
-            if ( (i+1) >= length || (string[i+1] & 0xC0) != 0x80 ) {
-                break; /* Error condition */
-            }
-            byte2 = (unsigned char)string[++i];
-            if ( byte1 != 0xC0 || byte2 != 0x80 ) {
-                newLength += 2; /* Normal 2byte encoding, not 0xC080 */
-            } else {
-                newLength++;    /* We will turn 0xC080 into 0 */
-            }
-        } else if ( (byte1 & 0xF0) == 0xE0 ) { /* 3byte encoding */
-            /* Check encoding of following bytes */
-            if ( (i+2) >= length || (string[i+1] & 0xC0) != 0x80
-                                 || (string[i+2] & 0xC0) != 0x80 ) {
-                break; /* Error condition */
-            }
-            byte2 = (unsigned char)string[++i];
-            byte3 = (unsigned char)string[++i];
-            newLength += 3;
-            /* Possible process a second 3byte encoding */
-            if ( (i+3) < length && byte1 == 0xED && (byte2 & 0xF0) == 0xA0 ) {
-                /* See if this is a pair of 3byte encodings */
-                byte4 = (unsigned char)string[i+1];
-                byte5 = (unsigned char)string[i+2];
-                byte6 = (unsigned char)string[i+3];
-                if ( byte4 == 0xED && (byte5 & 0xF0) == 0xB0 ) {
-                    /* Check encoding of 3rd byte */
-                    if ( (byte6 & 0xC0) != 0x80 ) {
-                        break; /* Error condition */
-                    }
-                    newLength++; /* New string will have 4byte encoding */
-                    i += 3;       /* Skip next 3 bytes */
-                }
-            }
-        } else {
-            break; /* Error condition */
-        }
-    }
-    if ( i != length ) {
-        /* Error in UTF encoding */
-        /*  FIXUP: ERROR_MESSAGE()? */
-        return length;
-    }
-    return newLength;
-}
-
-/* Convert a Modified UTF-8 string into a Standard UTF-8 string
- *   It is assumed that this string has been validated in terms of the
- *   basic UTF encoding rules by utf8Length() above.
- *
- *   Note: No validation is made that this is indeed Modified UTF-8 coming in.
- *
- */
-void JNICALL
-utf8mToUtf8s(struct UtfInst *ui, jbyte *string, int length, jbyte *newString, int newLength)
-{
-    int i;
-    int j;
-
-    j = 0;
-    for ( i = 0 ; i < length ; i++ ) {
-        unsigned byte1, byte2, byte3, byte4, byte5, byte6;
-
-        byte1 = (unsigned char)string[i];
-        if ( (byte1 & 0x80) == 0 ) { /* 1byte encoding */
-            /* Single byte */
-            newString[j++] = byte1;
-        } else if ( (byte1 & 0xE0) == 0xC0 ) { /* 2byte encoding */
-            byte2 = (unsigned char)string[++i];
-            if ( byte1 != 0xC0 || byte2 != 0x80 ) {
-                newString[j++] = byte1;
-                newString[j++] = byte2;
-            } else {
-                newString[j++] = 0;
-            }
-        } else if ( (byte1 & 0xF0) == 0xE0 ) { /* 3byte encoding */
-            byte2 = (unsigned char)string[++i];
-            byte3 = (unsigned char)string[++i];
-            if ( i+3 < length && byte1 == 0xED && (byte2 & 0xF0) == 0xA0 ) {
-                /* See if this is a pair of 3byte encodings */
-                byte4 = (unsigned char)string[i+1];
-                byte5 = (unsigned char)string[i+2];
-                byte6 = (unsigned char)string[i+3];
-                if ( byte4 == 0xED && (byte5 & 0xF0) == 0xB0 ) {
-                    unsigned u21;
-
-                    /* Bits in: 11101101 1010xxxx 10xxxxxx */
-                    /* Bits in: 11101101 1011xxxx 10xxxxxx */
-                    i += 3;
-
-                    /* Reconstruct 21 bit code */
-                    u21  = ((byte2 & 0x0F) + 1) << 16;
-                    u21 += (byte3 & 0x3F) << 10;
-                    u21 += (byte5 & 0x0F) << 6;
-                    u21 += (byte6 & 0x3F);
-
-                    /* Bits out: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */
-
-                    /* Convert to 4byte encoding */
-                    newString[j++] = 0xF0 + ((u21 >> 18) & 0x07);
-                    newString[j++] = 0x80 + ((u21 >> 12) & 0x3F);
-                    newString[j++] = 0x80 + ((u21 >>  6) & 0x3F);
-                    newString[j++] = 0x80 + (u21 & 0x3F);
-                    continue;
-                }
-            }
-            /* Normal 3byte encoding */
-            newString[j++] = byte1;
-            newString[j++] = byte2;
-            newString[j++] = byte3;
-        }
-    }
-    UTF_ASSERT(i==length);
-    UTF_ASSERT(j==newLength);
-    newString[j] = 0;
-}
-
-/* ================================================================= */
-
-#ifdef COMPILE_WITH_UTF_TEST  /* Test program */
-
-/*
- * Convert any byte array into a printable string.
- *    Returns length or -1 if output overflows.
- */
-static int
-bytesToPrintable(struct UtfInst *ui, char *bytes, int len, char *output, int outputMaxLen)
-{
-    int outputLen;
-    int i;
-
-    UTF_ASSERT(bytes);
-    UTF_ASSERT(len>=0);
-    UTF_ASSERT(output);
-    UTF_ASSERT(outputMaxLen>=0);
-
-    outputLen = 0;
-    for ( i=0; i<len ; i++ ) {
-        unsigned byte;
-
-        byte = bytes[i];
-        if ( byte <= 0x7f && isprint(byte) && !iscntrl(byte) ) {
-            if ( outputLen + 1 >= outputMaxLen ) {
-                return -1;
-            }
-            output[outputLen++] = (char)byte;
-        } else {
-            if ( outputLen + 4 >= outputMaxLen ) {
-                return -1;
-            }
-            (void)sprintf(output+outputLen,"\\x%02x",byte);
-            outputLen += 4;
-        }
-    }
-    output[outputLen] = 0;
-    return outputLen;
-}
-
-static void
-test(void)
-{
-    static char *strings[] = {
-                "characters",
-                "abcdefghijklmnopqrstuvwxyz",
-                "0123456789",
-                "!@#$%^&*()_+=-{}[]:;",
-                NULL };
-    int i;
-    struct UtfInst *ui;
-
-    ui = utfInitialize(NULL);
-
-    i = 0;
-    while ( strings[i] != NULL ) {
-        char *str;
-        #define MAX 1024
-        char buf0[MAX];
-        char buf1[MAX];
-        char buf2[MAX];
-        unsigned short buf3[MAX];
-        int len1;
-        int len2;
-        int len3;
-
-        str = strings[i];
-
-        (void)bytesToPrintable(ui, str, (int)strlen(str), buf0, 1024);
-
-        len1 = utf8FromPlatform(ui, str, (int)strlen(str), (jbyte*)buf1, 1024);
-
-        UTF_ASSERT(len1==(int)strlen(str));
-
-        len3 = utf8ToUtf16(ui, (jbyte*)buf1, len1, (jchar*)buf3, 1024);
-
-        UTF_ASSERT(len3==len1);
-
-        len1 = utf16ToUtf8m(ui, (jchar*)buf3, len3, (jbyte*)buf1, 1024);
-
-        UTF_ASSERT(len1==len3);
-        UTF_ASSERT(strcmp(str, buf1) == 0);
-
-        len2 = utf8ToPlatform(ui, (jbyte*)buf1, len1, buf2, 1024);
-
-        UTF_ASSERT(len2==len1);
-        UTF_ASSERT(strcmp(str, buf2) == 0);
-
-        i++;
-    }
-
-    utfTerminate(ui, NULL);
-
-}
-
-int
-main(int argc, char **argv)
-{
-    test();
-    return 0;
-}
-
-#endif
--- a/jdk/src/share/npt/utf.h	Wed Jul 09 16:44:30 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* Routines for various UTF conversions */
-
-#ifndef  _UTF_H
-#define _UTF_H
-
-#include <stdio.h>
-
-#include "jni.h"
-#include "utf_md.h"
-
-/* Use THIS_FILE when it is available. */
-#ifndef THIS_FILE
-    #define THIS_FILE __FILE__
-#endif
-
-/* Error and assert macros */
-#define UTF_ERROR(m) utfError(THIS_FILE, __LINE__,  m)
-#define UTF_ASSERT(x) ( (x)==0 ? UTF_ERROR("ASSERT ERROR " #x) : (void)0 )
-
-void utfError(char *file, int line, char *message);
-
-struct UtfInst* JNICALL utfInitialize
-                            (char *options);
-void            JNICALL utfTerminate
-                            (struct UtfInst *ui, char *options);
-int             JNICALL utf8ToPlatform
-                            (struct UtfInst *ui, jbyte *utf8,
-                             int len, char *output, int outputMaxLen);
-int             JNICALL utf8FromPlatform
-                            (struct UtfInst *ui, char *str, int len,
-                             jbyte *output, int outputMaxLen);
-int             JNICALL utf8ToUtf16
-                            (struct UtfInst *ui, jbyte *utf8, int len,
-                             jchar *output, int outputMaxLen);
-int             JNICALL utf16ToUtf8m
-                            (struct UtfInst *ui, jchar *utf16, int len,
-                             jbyte *output, int outputMaxLen);
-int             JNICALL utf16ToUtf8s
-                            (struct UtfInst *ui, jchar *utf16, int len,
-                             jbyte *output, int outputMaxLen);
-int             JNICALL utf8sToUtf8mLength
-                            (struct UtfInst *ui, jbyte *string, int length);
-void            JNICALL utf8sToUtf8m
-                            (struct UtfInst *ui, jbyte *string, int length,
-                             jbyte *new_string, int new_length);
-int             JNICALL utf8mToUtf8sLength
-                            (struct UtfInst *ui, jbyte *string, int length);
-void            JNICALL utf8mToUtf8s
-                            (struct UtfInst *ui, jbyte *string, int length,
-                             jbyte *new_string, int new_length);
-
-#endif
--- a/jdk/src/solaris/native/java/net/ExtendedOptionsImpl.c	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/solaris/native/java/net/ExtendedOptionsImpl.c	Fri Jul 11 05:59:08 2014 -0700
@@ -218,6 +218,9 @@
             if (errno == ENOPROTOOPT) {
                 JNU_ThrowByName(env, "java/lang/UnsupportedOperationException",
                         "unsupported socket option");
+            } else if (errno == EACCES || errno == EPERM) {
+                NET_ERROR(env, JNU_JAVANETPKG "SocketException",
+                                "Permission denied");
             } else {
                 NET_ERROR(env, JNU_JAVANETPKG "SocketException",
                                 "set option SO_FLOW_SLA failed");
@@ -251,6 +254,9 @@
             if (errno == ENOPROTOOPT) {
                 JNU_ThrowByName(env, "java/lang/UnsupportedOperationException",
                         "unsupported socket option");
+            } else if (errno == EACCES || errno == EPERM) {
+                NET_ERROR(env, JNU_JAVANETPKG "SocketException",
+                                "Permission denied");
             } else {
                 NET_ERROR(env, JNU_JAVANETPKG "SocketException",
                                 "set option SO_FLOW_SLA failed");
--- a/jdk/src/solaris/npt/npt_md.h	Wed Jul 09 16:44:30 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* Native Platform Toolkit */
-
-#ifndef  _NPT_MD_H
-#define _NPT_MD_H
-
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <dlfcn.h>
-#include <jvm_md.h>
-
-#define NPT_LIBNAME "npt"
-
-#define NPT_INITIALIZE(path,pnpt,version,options)                       \
-    {                                                                   \
-        void   *_handle;                                                \
-        void   *_sym;                                                   \
-                                                                        \
-        if ( (pnpt) == NULL ) NPT_ERROR("NptEnv* is NULL");             \
-        *(pnpt) = NULL;                                                 \
-        _handle =  dlopen(path, RTLD_LAZY);                             \
-        if ( _handle == NULL ) NPT_ERROR("Cannot open library");        \
-        _sym = dlsym(_handle, "nptInitialize");                         \
-        if ( _sym == NULL ) NPT_ERROR("Cannot find nptInitialize");     \
-        ((NptInitialize)_sym)((pnpt), version, (options));              \
-        if ( (*(pnpt)) == NULL ) NPT_ERROR("Cannot initialize NptEnv"); \
-        (*(pnpt))->libhandle = _handle;                                 \
-    }
-
-#define NPT_TERMINATE(npt,options)                                      \
-    {                                                                   \
-        void *_handle;                                                  \
-        void *_sym;                                                     \
-                                                                        \
-        if ( (npt) == NULL ) NPT_ERROR("NptEnv* is NULL");              \
-        _handle = (npt)->libhandle;                                     \
-        _sym = dlsym(_handle, "nptTerminate");                          \
-        if ( _sym == NULL ) NPT_ERROR("Cannot find nptTerminate");      \
-        ((NptTerminate)_sym)((npt), (options));                         \
-        if ( _handle != NULL ) (void)dlclose(_handle);                  \
-    }
-
-
-#endif
--- a/jdk/src/solaris/npt/utf_md.c	Wed Jul 09 16:44:30 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,179 +0,0 @@
-/*
- * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <locale.h>
-#include <langinfo.h>
-#include <iconv.h>
-
-#include "utf.h"
-
-/* Global variables */
-
-/*
- * Initialize all utf processing.
- */
-struct UtfInst *JNICALL
-utfInitialize(char *options)
-{
-    struct UtfInst *ui;
-    char           *codeset;
-
-    ui = (struct UtfInst*)calloc(sizeof(struct UtfInst), 1);
-    ui->iconvToPlatform         = (void *)-1;
-    ui->iconvFromPlatform       = (void *)-1;
-
-    /* Set the locale from the environment */
-    (void)setlocale(LC_ALL, "");
-
-    /* Get the codeset name */
-    codeset = (char*)nl_langinfo(CODESET);
-    if ( codeset == NULL || codeset[0] == 0 ) {
-        return ui;
-    }
-
-    /* If we don't need this, skip it */
-    if (strcmp(codeset, "UTF-8") == 0 || strcmp(codeset, "utf8") == 0 ) {
-        return ui;
-    }
-
-    /* Open conversion descriptors */
-    ui->iconvToPlatform   = iconv_open(codeset, "UTF-8");
-    if ( ui->iconvToPlatform == (void *)-1 ) {
-        UTF_ERROR("Failed to complete iconv_open() setup");
-    }
-    ui->iconvFromPlatform = iconv_open("UTF-8", codeset);
-    if ( ui->iconvFromPlatform == (void *)-1 ) {
-        UTF_ERROR("Failed to complete iconv_open() setup");
-    }
-    return ui;
-}
-
-/*
- * Terminate all utf processing
- */
-void  JNICALL
-utfTerminate(struct UtfInst *ui, char *options)
-{
-    if ( ui->iconvFromPlatform != (void *)-1 ) {
-        (void)iconv_close(ui->iconvFromPlatform);
-    }
-    if ( ui->iconvToPlatform != (void *)-1 ) {
-        (void)iconv_close(ui->iconvToPlatform);
-    }
-    ui->iconvToPlatform   = (void *)-1;
-    ui->iconvFromPlatform = (void *)-1;
-    (void)free(ui);
-}
-
-/*
- * Do iconv() conversion.
- *    Returns length or -1 if output overflows.
- */
-static int
-iconvConvert(iconv_t ic, char *bytes, int len, char *output, int outputMaxLen)
-{
-    int outputLen = 0;
-
-    UTF_ASSERT(bytes);
-    UTF_ASSERT(len>=0);
-    UTF_ASSERT(output);
-    UTF_ASSERT(outputMaxLen>len);
-
-    output[0] = 0;
-    outputLen = 0;
-
-    if ( ic != (iconv_t)(void *)-1 ) {
-        int          returnValue;
-        size_t       inLeft;
-        size_t       outLeft;
-        char        *inbuf;
-        char        *outbuf;
-
-        inbuf        = bytes;
-        outbuf       = output;
-        inLeft       = len;
-        outLeft      = outputMaxLen;
-        returnValue  = iconv(ic, (void*)&inbuf, &inLeft, &outbuf, &outLeft);
-        if ( returnValue >= 0 && inLeft==0 ) {
-            outputLen = outputMaxLen-outLeft;
-            output[outputLen] = 0;
-            return outputLen;
-        }
-
-        /* Failed to do the conversion */
-        return -1;
-    }
-
-    /* Just copy bytes */
-    outputLen = len;
-    (void)memcpy(output, bytes, len);
-    output[len] = 0;
-    return outputLen;
-}
-
-/*
- * Convert UTF-8 to Platform Encoding.
- *    Returns length or -1 if output overflows.
- */
-int  JNICALL
-utf8ToPlatform(struct UtfInst*ui, jbyte *utf8, int len, char *output, int outputMaxLen)
-{
-    /* Negative length is an error */
-    if ( len < 0 ) {
-        return -1;
-    }
-
-    /* Zero length is ok, but we don't need to do much */
-    if ( len == 0 ) {
-        output[0] = 0;
-        return 0;
-    }
-
-    return iconvConvert(ui->iconvToPlatform, (char*)utf8, len, output, outputMaxLen);
-}
-
-/*
- * Convert Platform Encoding to UTF-8.
- *    Returns length or -1 if output overflows.
- */
-int  JNICALL
-utf8FromPlatform(struct UtfInst*ui, char *str, int len, jbyte *output, int outputMaxLen)
-{
-    /* Negative length is an error */
-    if ( len < 0 ) {
-        return -1;
-    }
-
-    /* Zero length is ok, but we don't need to do much */
-    if ( len == 0 ) {
-        output[0] = 0;
-        return 0;
-    }
-
-    return iconvConvert(ui->iconvFromPlatform, str, len, (char*)output, outputMaxLen);
-}
--- a/jdk/src/solaris/npt/utf_md.h	Wed Jul 09 16:44:30 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#ifndef  _UTF_MD_H
-#define _UTF_MD_H
-
-struct UtfInst {
-    void *iconvToPlatform;
-    void *iconvFromPlatform;
-};
-
-#endif
--- a/jdk/src/windows/native/sun/security/provider/WinCAPISeedGenerator.c	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/src/windows/native/sun/security/provider/WinCAPISeedGenerator.c	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
  * 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,16 @@
 
     numBytes = (*env)->GetArrayLength(env, randArray);
     randBytes = (*env)->GetByteArrayElements(env, randArray, NULL);
+    if (randBytes == NULL) {
+        goto cleanup;
+    }
+
     if (CryptGenRandom(hCryptProv, numBytes, randBytes)) {
         result = JNI_TRUE;
     }
     (*env)->ReleaseByteArrayElements(env, randArray, randBytes, 0);
 
+cleanup:
     CryptReleaseContext(hCryptProv, 0);
 
     return result;
--- a/jdk/src/windows/npt/npt_md.h	Wed Jul 09 16:44:30 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/* Native Platform Toolkit */
-
-#ifndef  _NPT_MD_H
-#define _NPT_MD_H
-
-#include <windows.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-
-#define NPT_LIBNAME "npt"
-
-#define NPT_INITIALIZE(path,pnpt,version,options)                       \
-    {                                                                   \
-        void   *_handle;                                                \
-        void   *_sym;                                                   \
-                                                                        \
-        if ( (pnpt) == NULL ) NPT_ERROR("NptEnv* is NULL");             \
-        *(pnpt) = NULL;                                                 \
-        _handle =  LoadLibrary(path);                                   \
-        if ( _handle == NULL ) NPT_ERROR("Cannot open library");        \
-        _sym = GetProcAddress(_handle, "nptInitialize");                \
-        if ( _sym == NULL ) NPT_ERROR("Cannot find nptInitialize");     \
-        ((NptInitialize)_sym)((pnpt), version, (options));              \
-        if ( *(pnpt) == NULL ) NPT_ERROR("Cannot initialize NptEnv");   \
-        (*(pnpt))->libhandle = _handle;                                 \
-    }
-
-#define NPT_TERMINATE(npt,options)                                      \
-    {                                                                   \
-        void *_handle;                                                  \
-        void *_sym;                                                     \
-                                                                        \
-        if ( (npt) == NULL ) NPT_ERROR("NptEnv* is NULL");              \
-        _handle = (npt)->libhandle;                                     \
-        if ( _handle == NULL ) NPT_ERROR("npt->libhandle is NULL");     \
-        _sym = GetProcAddress(_handle, "nptTerminate");                 \
-        if ( _sym == NULL ) NPT_ERROR("Cannot find nptTerminate");      \
-        ((NptTerminate)_sym)((npt), (options));                         \
-        (void)FreeLibrary(_handle);                                     \
-    }
-
-#endif
--- a/jdk/src/windows/npt/utf_md.c	Wed Jul 09 16:44:30 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,172 +0,0 @@
-/*
- * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "utf.h"
-
-#include <windows.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-/*
- * Initialize all utf processing.
- */
-struct UtfInst * JNICALL
-utfInitialize(char *options)
-{
-    struct UtfInst *ui;
-    LANGID langID;
-    LCID localeID;
-    TCHAR strCodePage[7];       // ANSI code page id
-
-    ui = (struct UtfInst*)calloc(sizeof(struct UtfInst), 1);
-
-    /*
-     * Get the code page for this locale
-     */
-    langID = LANGIDFROMLCID(GetUserDefaultLCID());
-    localeID = MAKELCID(langID, SORT_DEFAULT);
-    if (GetLocaleInfo(localeID, LOCALE_IDEFAULTANSICODEPAGE,
-                      strCodePage, sizeof(strCodePage)/sizeof(TCHAR)) > 0 ) {
-        ui->platformCodePage = atoi(strCodePage);
-    } else {
-        ui->platformCodePage = GetACP();
-    }
-    return ui;
-}
-
-/*
- * Terminate all utf processing
- */
-void JNICALL
-utfTerminate(struct UtfInst *ui, char *options)
-{
-    (void)free(ui);
-}
-
-/*
- * Get wide string  (assumes len>0)
- */
-static WCHAR*
-getWideString(UINT codePage, char* str, int len, int *pwlen)
-{
-    int wlen;
-    WCHAR* wstr;
-
-    /* Convert the string to WIDE string */
-    wlen = MultiByteToWideChar(codePage, 0, str, len, NULL, 0);
-    *pwlen = wlen;
-    if (wlen <= 0) {
-        UTF_ERROR(("Can't get WIDE string length"));
-        return NULL;
-    }
-    wstr = (WCHAR*)malloc(wlen * sizeof(WCHAR));
-    if (wstr == NULL) {
-        UTF_ERROR(("Can't malloc() any space"));
-        return NULL;
-    }
-    if (MultiByteToWideChar(codePage, 0, str, len, wstr, wlen) == 0) {
-        UTF_ERROR(("Can't get WIDE string"));
-        return NULL;
-    }
-    return wstr;
-}
-
-/*
- * Convert UTF-8 to a platform string
- */
-int JNICALL
-utf8ToPlatform(struct UtfInst *ui, jbyte *utf8, int len, char* output, int outputMaxLen)
-{
-    int wlen;
-    int plen;
-    WCHAR* wstr;
-
-    /* Negative length is an error */
-    if ( len < 0 ) {
-        return -1;
-    }
-
-    /* Zero length is ok, but we don't need to do much */
-    if ( len == 0 ) {
-        output[0] = 0;
-        return 0;
-    }
-
-    /* Get WIDE string version (assumes len>0) */
-    wstr = getWideString(CP_UTF8, (char*)utf8, len, &wlen);
-    if ( wstr == NULL ) {
-        return -1;
-    }
-
-    /* Convert WIDE string to MultiByte string */
-    plen = WideCharToMultiByte(ui->platformCodePage, 0, wstr, wlen,
-                               output, outputMaxLen, NULL, NULL);
-    free(wstr);
-    if (plen <= 0) {
-        UTF_ERROR(("Can't convert WIDE string to multi-byte"));
-        return -1;
-    }
-    output[plen] = '\0';
-    return plen;
-}
-
-/*
- * Convert Platform Encoding to UTF-8.
- */
-int JNICALL
-utf8FromPlatform(struct UtfInst *ui, char *str, int len, jbyte *output, int outputMaxLen)
-{
-    int wlen;
-    int plen;
-    WCHAR* wstr;
-
-    /* Negative length is an error */
-    if ( len < 0 ) {
-        return -1;
-    }
-
-    /* Zero length is ok, but we don't need to do much */
-    if ( len == 0 ) {
-        output[0] = 0;
-        return 0;
-    }
-
-    /* Get WIDE string version (assumes len>0) */
-    wstr = getWideString(ui->platformCodePage, str, len, &wlen);
-    if ( wstr == NULL ) {
-        return -1;
-    }
-
-    /* Convert WIDE string to UTF-8 string */
-    plen = WideCharToMultiByte(CP_UTF8, 0, wstr, wlen,
-                               (char*)output, outputMaxLen, NULL, NULL);
-    free(wstr);
-    if (plen <= 0) {
-        UTF_ERROR(("Can't convert WIDE string to multi-byte"));
-        return -1;
-    }
-    output[plen] = '\0';
-    return plen;
-}
--- a/jdk/src/windows/npt/utf_md.h	Wed Jul 09 16:44:30 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#ifndef  _UTF_MD_H
-#define _UTF_MD_H
-
-struct UtfInst {
-    unsigned int platformCodePage;
-};
-
-#endif
--- a/jdk/test/ProblemList.txt	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/ProblemList.txt	Fri Jul 11 05:59:08 2014 -0700
@@ -124,6 +124,10 @@
 
 # jdk_management
 
+# 8046351
+com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationContentTest.java   generic-all
+com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationTest.java          generic-all
+
 ############################################################################
 
 # jdk_jmx
@@ -264,7 +268,6 @@
 # 8044419
 com/sun/jdi/JdbReadTwiceTest.sh                                 generic-all
 
-
 ############################################################################
 
 # jdk_util
@@ -292,4 +295,10 @@
 # 8037285
 sun/tools/jstatd/TestJstatdServer.java                          generic-all
 
+# 8046355
+sun/tools/jstatd/TestJstatdExternalRegistry.java                generic-all
+
+# 8046352
+com/sun/tools/attach/TempDirTest.java                           generic-all
+
 ############################################################################
--- a/jdk/test/com/sun/jdi/AccessSpecifierTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/AccessSpecifierTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g AccessSpecifierTest.java
- *  @run main AccessSpecifierTest
+ *  @run driver AccessSpecifierTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/AfterThreadDeathTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/AfterThreadDeathTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g AfterThreadDeathTest.java
- *  @run main AfterThreadDeathTest
+ *  @run driver AfterThreadDeathTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/AllLineLocations.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/AllLineLocations.java	Fri Jul 11 05:59:08 2014 -0700
@@ -32,7 +32,7 @@
  *  @run compile -g RefTypes.java
  *  @run build AllLineLocations
  *
- *  @run main AllLineLocations RefTypes
+ *  @run driver AllLineLocations RefTypes
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/AnyDebuggeeTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/AnyDebuggeeTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -29,7 +29,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g AnyDebuggeeTest.java
- *  @run main AnyDebuggeeeTest
+ *  @run driver AnyDebuggeeeTest
  *
  *  This test is intended to be run manually to investigate behaviors;
  *  it is not an actual test of any specific functionality, it just
--- a/jdk/test/com/sun/jdi/ArgumentValuesTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/ArgumentValuesTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -7,7 +7,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile ArgumentValuesTest.java
- *  @run main ArgumentValuesTest
+ *  @run driver ArgumentValuesTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/ArrayRangeTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/ArrayRangeTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -32,7 +32,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g ArrayRangeTest.java
- *  @run main ArrayRangeTest
+ *  @run driver ArrayRangeTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/BacktraceFieldTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/BacktraceFieldTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g BacktraceFieldTest.java
- *  @run main BacktraceFieldTest
+ *  @run driver BacktraceFieldTest
  */
 
 /*
--- a/jdk/test/com/sun/jdi/BadHandshakeTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/BadHandshakeTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -27,7 +27,7 @@
  * @library /lib/testlibrary
  *
  * @build jdk.testlibrary.* VMConnection BadHandshakeTest Exit0
- * @run main BadHandshakeTest
+ * @run driver BadHandshakeTest
  *
  */
 import java.net.Socket;
--- a/jdk/test/com/sun/jdi/BreakpointTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/BreakpointTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g BreakpointTest.java
- *  @run main BreakpointTest
+ *  @run driver BreakpointTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/ClassLoaderClassesTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/ClassLoaderClassesTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -32,7 +32,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g ClassLoaderClassesTest.java
- *  @run main ClassLoaderClassesTest
+ *  @run driver ClassLoaderClassesTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/ClassesByName.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/ClassesByName.java	Fri Jul 11 05:59:08 2014 -0700
@@ -34,7 +34,7 @@
  *  @summary ClassesByName verifies that all the classes in the
  *  loaded class list can be found with classesByName..
  *
- *  @run main ClassesByName HelloWorld
+ *  @run driver ClassesByName HelloWorld
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/ClassesByName2Test.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/ClassesByName2Test.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g ClassesByName2Test.java
- *  @run main ClassesByName2Test
+ *  @run driver ClassesByName2Test
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/ConnectedVMs.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/ConnectedVMs.java	Fri Jul 11 05:59:08 2014 -0700
@@ -28,10 +28,10 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g InstTarg.java
- *  @run main ConnectedVMs Kill
- *  @run main ConnectedVMs Resume-to-exit
- *  @run main ConnectedVMs dispose()
- *  @run main ConnectedVMs exit()
+ *  @run driver ConnectedVMs Kill
+ *  @run driver ConnectedVMs Resume-to-exit
+ *  @run driver ConnectedVMs dispose()
+ *  @run driver ConnectedVMs exit()
  *
  * @summary ConnectedVMs checks the method
  * VirtualMachineManager.connectedVirtualMachines()
--- a/jdk/test/com/sun/jdi/ConstantPoolInfo.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/ConstantPoolInfo.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection
  *  @run compile -g ConstantPoolInfo.java
- *  @run main ConstantPoolInfo
+ *  @run driver ConstantPoolInfo
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/CountEvent.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/CountEvent.java	Fri Jul 11 05:59:08 2014 -0700
@@ -31,7 +31,7 @@
  *
  *  @run build TestScaffold VMConnection TargetAdapter TargetListener
  *  @run compile -g CountEvent.java
- *  @run main CountEvent
+ *  @run driver CountEvent
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/CountFilterTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/CountFilterTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g CountFilterTest.java
- *  @run main CountFilterTest
+ *  @run driver CountFilterTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/DataModelTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/DataModelTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -34,7 +34,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g DataModelTest.java
- *  @run main DataModelTest
+ *  @run driver DataModelTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/DebuggerThreadTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/DebuggerThreadTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g DebuggerThreadTest.java
- *  @run main DebuggerThreadTest
+ *  @run driver DebuggerThreadTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/DeleteAllBkptsTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/DeleteAllBkptsTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -31,7 +31,7 @@
  *  @library ..
  *  @run build  TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g DeleteAllBkptsTest.java
- *  @run main DeleteAllBkptsTest
+ *  @run driver DeleteAllBkptsTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/DeleteEventRequestsTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/DeleteEventRequestsTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g DeleteEventRequestsTest.java
- *  @run main DeleteEventRequestsTest
+ *  @run driver DeleteEventRequestsTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/DoubleAgentTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/DoubleAgentTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -26,14 +26,13 @@
  * @summary Check that a double agent request fails
  *
  * @build VMConnection DoubleAgentTest Exit0
- * @run main DoubleAgentTest
+ * @run driver DoubleAgentTest
  *
  */
 import java.io.InputStream;
 import java.io.IOException;
 import java.io.File;
 import java.net.ServerSocket;
-import java.net.Socket;
 
 public class DoubleAgentTest {
 
--- a/jdk/test/com/sun/jdi/EarlyReturnNegativeTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/EarlyReturnNegativeTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -29,7 +29,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g EarlyReturnNegativeTest.java
- *  @run main EarlyReturnNegativeTest
+ *  @run driver EarlyReturnNegativeTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/EarlyReturnTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/EarlyReturnTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -36,7 +36,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g EarlyReturnTest.java
- *  @run main EarlyReturnTest
+ *  @run driver EarlyReturnTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/EnumTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/EnumTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g EnumTest.java
- *  @run main EnumTest
+ *  @run driver EnumTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/EventQueueDisconnectTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/EventQueueDisconnectTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -28,7 +28,7 @@
  *
  *  @run build VMConnection
  *  @run compile -g EventQueueDisconnectTest.java
- *  @run main EventQueueDisconnectTest
+ *  @run driver EventQueueDisconnectTest
  *
  *  @summary EventQueueDisconnectTest checks to see that
  *  VMDisconnectedException is never thrown before VMDisconnectEvent.
@@ -64,7 +64,7 @@
                                        "com.sun.jdi.CommandLineLaunch:",
                                        VirtualMachine.TRACE_NONE);
         connection.setConnectorArg("main", "EventQueueDisconnectTarg");
-        String debuggeeVMOptions = connection.getDebuggeeVMOptions();
+        String debuggeeVMOptions = VMConnection.getDebuggeeVMOptions();
         if (!debuggeeVMOptions.equals("")) {
             if (connection.connectorArg("options").length() > 0) {
                 throw new IllegalArgumentException("VM options in two places");
--- a/jdk/test/com/sun/jdi/ExceptionEvents.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/ExceptionEvents.java	Fri Jul 11 05:59:08 2014 -0700
@@ -32,32 +32,32 @@
  *  @run build TestScaffold VMConnection
  *  @run compile -g ExceptionEvents.java
  *
- *  @run main/othervm ExceptionEvents N A StackOverflowCaughtTarg java.lang.Exception
- *  @run main/othervm ExceptionEvents C A StackOverflowCaughtTarg null
- *  @run main/othervm ExceptionEvents C A StackOverflowCaughtTarg java.lang.Error
- *  @run main/othervm ExceptionEvents C A StackOverflowCaughtTarg java.lang.StackOverflowError
- *  @run main/othervm ExceptionEvents N A StackOverflowCaughtTarg java.lang.NullPointerException
+ *  @run driver ExceptionEvents N A StackOverflowCaughtTarg java.lang.Exception
+ *  @run driver ExceptionEvents C A StackOverflowCaughtTarg null
+ *  @run driver ExceptionEvents C A StackOverflowCaughtTarg java.lang.Error
+ *  @run driver ExceptionEvents C A StackOverflowCaughtTarg java.lang.StackOverflowError
+ *  @run driver ExceptionEvents N A StackOverflowCaughtTarg java.lang.NullPointerException
 
- *  @run main/othervm ExceptionEvents N T StackOverflowCaughtTarg java.lang.Exception
- *  @run main/othervm ExceptionEvents C T StackOverflowCaughtTarg null
- *  @run main/othervm ExceptionEvents C T StackOverflowCaughtTarg java.lang.Error
- *  @run main/othervm ExceptionEvents C T StackOverflowCaughtTarg java.lang.StackOverflowError
- *  @run main/othervm ExceptionEvents N T StackOverflowCaughtTarg java.lang.NullPointerException
+ *  @run driver ExceptionEvents N T StackOverflowCaughtTarg java.lang.Exception
+ *  @run driver ExceptionEvents C T StackOverflowCaughtTarg null
+ *  @run driver ExceptionEvents C T StackOverflowCaughtTarg java.lang.Error
+ *  @run driver ExceptionEvents C T StackOverflowCaughtTarg java.lang.StackOverflowError
+ *  @run driver ExceptionEvents N T StackOverflowCaughtTarg java.lang.NullPointerException
 
- *  @run main/othervm ExceptionEvents N N StackOverflowCaughtTarg java.lang.Exception
- *  @run main/othervm ExceptionEvents C N StackOverflowCaughtTarg null
- *  @run main/othervm ExceptionEvents C N StackOverflowCaughtTarg java.lang.Error
- *  @run main/othervm ExceptionEvents C N StackOverflowCaughtTarg java.lang.StackOverflowError
- *  @run main/othervm ExceptionEvents N N StackOverflowCaughtTarg java.lang.NullPointerException
+ *  @run driver ExceptionEvents N N StackOverflowCaughtTarg java.lang.Exception
+ *  @run driver ExceptionEvents C N StackOverflowCaughtTarg null
+ *  @run driver ExceptionEvents C N StackOverflowCaughtTarg java.lang.Error
+ *  @run driver ExceptionEvents C N StackOverflowCaughtTarg java.lang.StackOverflowError
+ *  @run driver ExceptionEvents N N StackOverflowCaughtTarg java.lang.NullPointerException
 
- *  @run main/othervm ExceptionEvents N A StackOverflowUncaughtTarg java.lang.Exception
- *  @run main/othervm ExceptionEvents U A StackOverflowUncaughtTarg null
- *  @run main/othervm ExceptionEvents U A StackOverflowUncaughtTarg java.lang.Error
- *  @run main/othervm ExceptionEvents U A StackOverflowUncaughtTarg java.lang.StackOverflowError
- *  @run main/othervm ExceptionEvents N A StackOverflowUncaughtTarg java.lang.NullPointerException
+ *  @run driver ExceptionEvents N A StackOverflowUncaughtTarg java.lang.Exception
+ *  @run driver ExceptionEvents U A StackOverflowUncaughtTarg null
+ *  @run driver ExceptionEvents U A StackOverflowUncaughtTarg java.lang.Error
+ *  @run driver ExceptionEvents U A StackOverflowUncaughtTarg java.lang.StackOverflowError
+ *  @run driver ExceptionEvents N A StackOverflowUncaughtTarg java.lang.NullPointerException
 
- *  @run main/othervm ExceptionEvents N T StackOverflowUncaughtTarg java.lang.NullPointerException
- *  @run main/othervm ExceptionEvents N N StackOverflowUncaughtTarg java.lang.NullPointerException
+ *  @run driver ExceptionEvents N T StackOverflowUncaughtTarg java.lang.NullPointerException
+ *  @run driver ExceptionEvents N N StackOverflowUncaughtTarg java.lang.NullPointerException
 
  */
 import com.sun.jdi.*;
--- a/jdk/test/com/sun/jdi/ExclusiveBind.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/ExclusiveBind.java	Fri Jul 11 05:59:08 2014 -0700
@@ -28,7 +28,7 @@
  * @library /lib/testlibrary
  *
  * @build jdk.testlibrary.* VMConnection ExclusiveBind HelloWorld
- * @run main ExclusiveBind
+ * @run driver ExclusiveBind
  */
 import java.net.ServerSocket;
 import com.sun.jdi.Bootstrap;
--- a/jdk/test/com/sun/jdi/ExpiredRequestDeletionTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/ExpiredRequestDeletionTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -31,7 +31,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g ExpiredRequestDeletionTest.java
- *  @run main ExpiredRequestDeletionTest
+ *  @run driver ExpiredRequestDeletionTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/FetchLocals.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/FetchLocals.java	Fri Jul 11 05:59:08 2014 -0700
@@ -7,7 +7,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g FetchLocals.java
- *  @run main FetchLocals
+ *  @run driver FetchLocals
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/FieldWatchpoints.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/FieldWatchpoints.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g FieldWatchpoints.java
- *  @run main/othervm FieldWatchpoints
+ *  @run driver FieldWatchpoints
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/FilterMatch.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/FilterMatch.java	Fri Jul 11 05:59:08 2014 -0700
@@ -31,7 +31,7 @@
  *  @library scaffold
  *  @run build JDIScaffold VMConnection
  *  @run compile -g HelloWorld.java
- *  @run main/othervm FilterMatch
+ *  @run driver FilterMatch
  */
 
 /* Look at patternMatch in JDK file:
--- a/jdk/test/com/sun/jdi/FilterNoMatch.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/FilterNoMatch.java	Fri Jul 11 05:59:08 2014 -0700
@@ -31,7 +31,7 @@
  *  @library scaffold
  *  @run build JDIScaffold VMConnection
  *  @run compile -g HelloWorld.java
- *  @run main/othervm FilterNoMatch
+ *  @run driver FilterNoMatch
  */
 
 /* This tests the patternMatch function in JDK file:
--- a/jdk/test/com/sun/jdi/FinalLocalsTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/FinalLocalsTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -32,7 +32,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g FinalLocalsTest.java
- *  @run main FinalLocalsTest
+ *  @run driver FinalLocalsTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/FinalizerTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/FinalizerTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g FinalizerTest.java
  *
- *  @run main FinalizerTest
+ *  @run driver FinalizerTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/FramesTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/FramesTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g FramesTest.java
- *  @run main FramesTest
+ *  @run driver FramesTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/GenericsTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/GenericsTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g GenericsTest.java
- *  @run main GenericsTest
+ *  @run driver GenericsTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/GetLocalVariables.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/GetLocalVariables.java	Fri Jul 11 05:59:08 2014 -0700
@@ -7,7 +7,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g GetLocalVariables.java
- *  @run main GetLocalVariables
+ *  @run driver GetLocalVariables
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/GetLocalVariables2Test.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/GetLocalVariables2Test.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g GetLocalVariables2Test.java
- *  @run main GetLocalVariables2Test
+ *  @run driver GetLocalVariables2Test
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/GetSetLocalTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/GetSetLocalTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -7,7 +7,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g GetSetLocalTest.java
- *  @run main GetSetLocalTest
+ *  @run driver GetSetLocalTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/GetUninitializedStringValue.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/GetUninitializedStringValue.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g GetUninitializedStringValue.java
- *  @run main GetUninitializedStringValue
+ *  @run driver GetUninitializedStringValue
  */
 import com.sun.jdi.ReferenceType;
 import com.sun.jdi.StackFrame;
--- a/jdk/test/com/sun/jdi/HomeTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/HomeTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g HomeTest.java
- *  @run main HomeTest
+ *  @run driver HomeTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.connect.*;
--- a/jdk/test/com/sun/jdi/InstanceFilter.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/InstanceFilter.java	Fri Jul 11 05:59:08 2014 -0700
@@ -31,7 +31,7 @@
  *
  *  @run build TestScaffold VMConnection TargetAdapter TargetListener
  *  @run compile -g InstanceFilter.java
- *  @run main/othervm InstanceFilter
+ *  @run driver InstanceFilter
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/InstancesTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/InstancesTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -29,7 +29,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g InstancesTest.java
- *  @run main InstancesTest
+ *  @run driver InstancesTest
  */
 
 /*
--- a/jdk/test/com/sun/jdi/InterfaceMethodsTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/InterfaceMethodsTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -28,7 +28,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run build InterfaceMethodsTest
- *  @run main InterfaceMethodsTest
+ *  @run driver InterfaceMethodsTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/InterruptHangTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/InterruptHangTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -7,7 +7,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g InterruptHangTest.java
- *  @run main InterruptHangTest
+ *  @run driver InterruptHangTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/InvokeHangTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/InvokeHangTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g InvokeHangTest.java
- *  @run main InvokeHangTest
+ *  @run driver InvokeHangTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/InvokeTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/InvokeTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -31,7 +31,7 @@
  *  @library ..
  *  @run build  TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g InvokeTest.java
- *  @run main InvokeTest
+ *  @run driver InvokeTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/JITDebug.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/JITDebug.java	Fri Jul 11 05:59:08 2014 -0700
@@ -46,7 +46,7 @@
  *  assure that launching on uncaught exception works
  *
  *  @author Robert Field
- *  @run main/othervm JITDebug
+ *  @run driver JITDebug
  */
 
 import com.sun.jdi.*;
--- a/jdk/test/com/sun/jdi/Java_gTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/Java_gTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g Java_gTest.java
- *  @run main Java_gTest
+ *  @run driver Java_gTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/LambdaBreakpointTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/LambdaBreakpointTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -31,7 +31,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g LambdaBreakpointTest.java
- *  @run main LambdaBreakpointTest
+ *  @run driver LambdaBreakpointTest
  */
 import java.util.List;
 
--- a/jdk/test/com/sun/jdi/LambdaStepTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/LambdaStepTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -29,7 +29,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g LambdaStepTest.java
- *  @run main LambdaStepTest
+ *  @run driver LambdaStepTest
  */
 import com.sun.jdi.LocalVariable;
 import com.sun.jdi.ObjectReference;
--- a/jdk/test/com/sun/jdi/LaunchCommandLine.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/LaunchCommandLine.java	Fri Jul 11 05:59:08 2014 -0700
@@ -32,7 +32,7 @@
  *  @run compile -g HelloWorld.java
  *  @run build LaunchCommandLine
  *
- *  @run main LaunchCommandLine
+ *  @run driver LaunchCommandLine
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/LineNumberInfo.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/LineNumberInfo.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g LineNumberInfo.java ControlFlow.java
  *
- *  @run main LineNumberInfo
+ *  @run driver LineNumberInfo
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/LineNumberOnBraceTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/LineNumberOnBraceTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -7,7 +7,7 @@
  *
  *  @run build VMConnection TargetListener TargetAdapter
  *  @run compile -g LineNumberOnBraceTest.java
- *  @run main LineNumberOnBraceTest
+ *  @run driver LineNumberOnBraceTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/LocalVariableEqual.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/LocalVariableEqual.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g LocalVariableEqual.java
- *  @run main LocalVariableEqual
+ *  @run driver LocalVariableEqual
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/LocationTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/LocationTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g LocationTest.java
- *  @run main LocationTest
+ *  @run driver LocationTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/MethodEntryExitEvents.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/MethodEntryExitEvents.java	Fri Jul 11 05:59:08 2014 -0700
@@ -29,9 +29,9 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g MethodEntryExitEvents.java
- *  @run main MethodEntryExitEvents SUSPEND_EVENT_THREAD MethodEntryExitEventsDebugee
- *  @run main MethodEntryExitEvents SUSPEND_NONE MethodEntryExitEventsDebugee
- *  @run main MethodEntryExitEvents SUSPEND_ALL MethodEntryExitEventsDebugee
+ *  @run driver MethodEntryExitEvents SUSPEND_EVENT_THREAD MethodEntryExitEventsDebugee
+ *  @run driver MethodEntryExitEvents SUSPEND_NONE MethodEntryExitEventsDebugee
+ *  @run driver MethodEntryExitEvents SUSPEND_ALL MethodEntryExitEventsDebugee
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/MethodExitReturnValuesTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/MethodExitReturnValuesTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -29,7 +29,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g MethodExitReturnValuesTest.java
- *  @run main MethodExitReturnValuesTest
+ *  @run driver MethodExitReturnValuesTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/ModificationWatchpoints.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/ModificationWatchpoints.java	Fri Jul 11 05:59:08 2014 -0700
@@ -32,7 +32,7 @@
  *  @library scaffold
  *  @run build JDIScaffold VMConnection
  *  @run compile -g ModificationWatchpoints.java
- *  @run main/othervm ModificationWatchpoints
+ *  @run driver ModificationWatchpoints
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/MonitorEventTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/MonitorEventTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g MonitorEventTest.java
- *  @run main MonitorEventTest
+ *  @run driver MonitorEventTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/MonitorFrameInfo.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/MonitorFrameInfo.java	Fri Jul 11 05:59:08 2014 -0700
@@ -31,7 +31,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g MonitorFrameInfo.java
- *  @run main MonitorFrameInfo
+ *  @run driver MonitorFrameInfo
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/MultiBreakpointsTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/MultiBreakpointsTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -31,7 +31,7 @@
  *
  *  @build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g MultiBreakpointsTest.java
- *  @run main MultiBreakpointsTest
+ *  @run driver MultiBreakpointsTest
  */
 
 /*
--- a/jdk/test/com/sun/jdi/NativeInstanceFilter.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/NativeInstanceFilter.java	Fri Jul 11 05:59:08 2014 -0700
@@ -31,7 +31,7 @@
  *  @library scaffold
  *  @run build JDIScaffold VMConnection
  *  @compile -XDignore.symbol.file NativeInstanceFilterTarg.java
- *  @run main/othervm NativeInstanceFilter
+ *  @run driver NativeInstanceFilter
  */
 
 /*
--- a/jdk/test/com/sun/jdi/NewInstanceTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/NewInstanceTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -31,7 +31,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g NewInstanceTest.java
- *  @run main NewInstanceTest
+ *  @run driver NewInstanceTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/NoLaunchOptionTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/NoLaunchOptionTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -29,7 +29,7 @@
  *
  *  @run compile -g NoLaunchOptionTest.java
  *  @build VMConnection
- *  @run main/othervm NoLaunchOptionTest
+ *  @run driver NoLaunchOptionTest
  */
 
 import java.net.ServerSocket;
--- a/jdk/test/com/sun/jdi/NoLocInfoTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/NoLocInfoTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -31,7 +31,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g:none NoLocInfoTest.java
- *  @run main NoLocInfoTest
+ *  @run driver NoLocInfoTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/NullThreadGroupNameTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/NullThreadGroupNameTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -27,7 +27,7 @@
  *  @summary Ensure that JDWP doesn't crash with a null thread group name
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
- *  @run main NullThreadGroupNameTest
+ *  @run driver NullThreadGroupNameTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.connect.*;
--- a/jdk/test/com/sun/jdi/OnThrowTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/OnThrowTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *  @run compile -g OnThrowTest.java
  *  @run compile -g OnThrowTarget.java
  *  @run compile -g VMConnection.java
- *  @run main/othervm OnThrowTest
+ *  @run driver OnThrowTest
  */
 
 import java.io.File;
--- a/jdk/test/com/sun/jdi/OptionTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/OptionTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *  @run compile -g OptionTest.java
  *  @run compile -g HelloWorld.java
  *  @run compile -g VMConnection.java
- *  @run main/othervm OptionTest
+ *  @run driver OptionTest
  */
 
 import java.net.ServerSocket;
--- a/jdk/test/com/sun/jdi/PopAndInvokeTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/PopAndInvokeTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -31,7 +31,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g PopAndInvokeTest.java
- *  @run main PopAndInvokeTest
+ *  @run driver PopAndInvokeTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/PopAndStepTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/PopAndStepTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -10,7 +10,7 @@
  *  @library ..
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g PopAndStepTest.java
- *  @run main PopAndStepTest
+ *  @run driver PopAndStepTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/PopAsynchronousTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/PopAsynchronousTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -31,7 +31,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g PopAsynchronousTest.java
- *  @run main PopAsynchronousTest
+ *  @run driver PopAsynchronousTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/PopSynchronousTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/PopSynchronousTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -31,7 +31,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g PopSynchronousTest.java
- *  @run main PopSynchronousTest
+ *  @run driver PopSynchronousTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/RedefineCrossEvent.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/RedefineCrossEvent.java	Fri Jul 11 05:59:08 2014 -0700
@@ -46,26 +46,26 @@
  *  @run compile -g RepStepTarg.java
  *  @run compile -g RequestReflectionTest.java
  *
- *  @run main AccessSpecifierTest -redefstart -redefevent
- *  @run main AfterThreadDeathTest -redefstart -redefevent
- *  @run main ArrayRangeTest -redefstart -redefevent
- *  @run main BacktraceFieldTest -redefstart -redefevent
- *  @run main ClassesByName2Test -redefstart -redefevent
- *  @run main DebuggerThreadTest -redefstart -redefevent
- *  @run main DeleteEventRequestsTest -redefstart -redefevent
- *  @run main/othervm ExceptionEvents -redefstart -redefevent N A StackOverflowCaughtTarg java.lang.Exception
- *  @run main/othervm ExceptionEvents -redefstart -redefevent C A StackOverflowCaughtTarg null
- *  @run main/othervm ExceptionEvents -redefstart -redefevent C A StackOverflowCaughtTarg java.lang.StackOverflowError
- *  @run main/othervm ExceptionEvents -redefstart -redefevent N A StackOverflowCaughtTarg java.lang.NullPointerException
- *  @run main/othervm ExceptionEvents -redefstart -redefevent C T StackOverflowCaughtTarg java.lang.Error
- *  @run main/othervm ExceptionEvents -redefstart -redefevent N T StackOverflowCaughtTarg java.lang.NullPointerException
- *  @run main/othervm ExceptionEvents -redefstart -redefevent N N StackOverflowCaughtTarg java.lang.Exception
- *  @run main/othervm ExceptionEvents -redefstart -redefevent C N StackOverflowCaughtTarg java.lang.Error
- *  @run main/othervm ExceptionEvents -redefstart -redefevent N A StackOverflowUncaughtTarg java.lang.Exception
- *  @run main ExpiredRequestDeletionTest -redefstart -redefevent
- *  @run main/othervm FieldWatchpoints -redefstart -redefevent
- *  @run main/othervm InstanceFilter -redefstart -redefevent
- *  @run main LocationTest -redefstart -redefevent
- *  @run main NewInstanceTest -redefstart -redefevent
- *  @run main RequestReflectionTest -redefstart -redefevent
+ *  @run driver AccessSpecifierTest -redefstart -redefevent
+ *  @run driver AfterThreadDeathTest -redefstart -redefevent
+ *  @run driver ArrayRangeTest -redefstart -redefevent
+ *  @run driver BacktraceFieldTest -redefstart -redefevent
+ *  @run driver ClassesByName2Test -redefstart -redefevent
+ *  @run driver DebuggerThreadTest -redefstart -redefevent
+ *  @run driver DeleteEventRequestsTest -redefstart -redefevent
+ *  @run driver ExceptionEvents -redefstart -redefevent N A StackOverflowCaughtTarg java.lang.Exception
+ *  @run driver ExceptionEvents -redefstart -redefevent C A StackOverflowCaughtTarg null
+ *  @run driver ExceptionEvents -redefstart -redefevent C A StackOverflowCaughtTarg java.lang.StackOverflowError
+ *  @run driver ExceptionEvents -redefstart -redefevent N A StackOverflowCaughtTarg java.lang.NullPointerException
+ *  @run driver ExceptionEvents -redefstart -redefevent C T StackOverflowCaughtTarg java.lang.Error
+ *  @run driver ExceptionEvents -redefstart -redefevent N T StackOverflowCaughtTarg java.lang.NullPointerException
+ *  @run driver ExceptionEvents -redefstart -redefevent N N StackOverflowCaughtTarg java.lang.Exception
+ *  @run driver ExceptionEvents -redefstart -redefevent C N StackOverflowCaughtTarg java.lang.Error
+ *  @run driver ExceptionEvents -redefstart -redefevent N A StackOverflowUncaughtTarg java.lang.Exception
+ *  @run driver ExpiredRequestDeletionTest -redefstart -redefevent
+ *  @run driver FieldWatchpoints -redefstart -redefevent
+ *  @run driver InstanceFilter -redefstart -redefevent
+ *  @run driver LocationTest -redefstart -redefevent
+ *  @run driver NewInstanceTest -redefstart -redefevent
+ *  @run driver RequestReflectionTest -redefstart -redefevent
  */
--- a/jdk/test/com/sun/jdi/RedefineCrossStart.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/RedefineCrossStart.java	Fri Jul 11 05:59:08 2014 -0700
@@ -37,13 +37,13 @@
  *  @run compile -g FramesTest.java
  *  @run compile -g InvokeTest.java
  *
- *  @run main CountEvent -redefstart
- *  @run main CountFilterTest -redefstart
- *  @run main FramesTest -redefstart
- *  @run main InvokeTest -redefstart
+ *  @run driver CountEvent -redefstart
+ *  @run driver CountFilterTest -redefstart
+ *  @run driver FramesTest -redefstart
+ *  @run driver InvokeTest -redefstart
  *
- *  @run main/othervm ExceptionEvents -redefstart U A StackOverflowUncaughtTarg null
- *  @run main/othervm ExceptionEvents -redefstart U A StackOverflowUncaughtTarg java.lang.Error
- *  @run main/othervm ExceptionEvents -redefstart U A StackOverflowUncaughtTarg java.lang.StackOverflowError
- *  @run main PopSynchronousTest -redefstart
+ *  @run driver ExceptionEvents -redefstart U A StackOverflowUncaughtTarg null
+ *  @run driver ExceptionEvents -redefstart U A StackOverflowUncaughtTarg java.lang.Error
+ *  @run driver ExceptionEvents -redefstart U A StackOverflowUncaughtTarg java.lang.StackOverflowError
+ *  @run driver PopSynchronousTest -redefstart
  */
--- a/jdk/test/com/sun/jdi/ReferrersTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/ReferrersTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -29,7 +29,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g ReferrersTest.java
- *  @run main ReferrersTest
+ *  @run driver ReferrersTest
  */
 
 /*
--- a/jdk/test/com/sun/jdi/RepStep.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/RepStep.java	Fri Jul 11 05:59:08 2014 -0700
@@ -29,7 +29,7 @@
  *  @run compile -g RepStepTarg.java
  *  @run build VMConnection RepStep
  *
- *  @run main/othervm RepStep
+ *  @run driver RepStep
  *
  * @summary RepStep detects missed step events due to lack of
  * frame pop events (in back-end).
--- a/jdk/test/com/sun/jdi/RequestReflectionTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/RequestReflectionTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -28,7 +28,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g RequestReflectionTest.java
- *  @run main RequestReflectionTest
+ *  @run driver RequestReflectionTest
  *
  *  @summary RequestReflectionTest checks to see that reflective
  *  accessors on EventRequests return what they are given.
--- a/jdk/test/com/sun/jdi/ResumeOneThreadTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/ResumeOneThreadTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g ResumeOneThreadTest.java
- *  @run main ResumeOneThreadTest
+ *  @run driver ResumeOneThreadTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/RunToExit.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/RunToExit.java	Fri Jul 11 05:59:08 2014 -0700
@@ -26,7 +26,7 @@
  * @summary Test that with server=y, when VM runs to System.exit() no error happens
  *
  * @build VMConnection RunToExit Exit0
- * @run main/othervm RunToExit
+ * @run driver RunToExit
  */
 import java.io.InputStream;
 import java.io.IOException;
--- a/jdk/test/com/sun/jdi/SDENullTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/SDENullTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build  TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g SDENullTest.java
- *  @run main SDENullTest
+ *  @run driver SDENullTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/SimulResumerTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/SimulResumerTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g SimulResumerTest.java
- *  @run main/othervm SimulResumerTest
+ *  @run driver SimulResumerTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/SourceNameFilterTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/SourceNameFilterTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,9 +30,9 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g SourceNameFilterTest.java
- *  @run main SourceNameFilterTest
+ *  @run driver SourceNameFilterTest
  *  @run compile -g:none SourceNameFilterTest.java
- *  @run main SourceNameFilterTest
+ *  @run driver SourceNameFilterTest
  */
 // The compile -g:none suppresses the lineNumber table to trigger bug 6646613.
 
--- a/jdk/test/com/sun/jdi/StepTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/StepTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -51,15 +51,15 @@
  *                     |  |    |  +--- Debuggee command Line
  *                     V  V    V  V      Workaround-----+
  *                                                      V
- *  @run main StepTest 2 line  2 MethodCalls
- *  @run main StepTest 3 line 14 MethodCalls
+ *  @run driver StepTest 2 line  2 MethodCalls
+ *  @run driver StepTest 3 line 14 MethodCalls
  *
- *  @run main StepTest 2 line 18 MethodCallsReflection  12
+ *  @run driver StepTest 2 line 18 MethodCallsReflection  12
  *
- *  @run main StepTest 2 min   4 MethodCalls
- *  @run main StepTest 3 min  43 MethodCalls
+ *  @run driver StepTest 2 min   4 MethodCalls
+ *  @run driver StepTest 3 min  43 MethodCalls
  *
- *  @run main StepTest 2 line 65 ControlFlow            64
+ *  @run driver StepTest 2 line 65 ControlFlow            64
  */
 
 /*
--- a/jdk/test/com/sun/jdi/SuspendThreadTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/SuspendThreadTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g SuspendThreadTest.java
- *  @run main SuspendThreadTest
+ *  @run driver SuspendThreadTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/TemplateTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/TemplateTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -33,7 +33,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g TemplateTest.java
- *  @run main TemplateTest
+ *  @run driver TemplateTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/ThreadGroupTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/ThreadGroupTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile ThreadGroupTest.java
- *  @run main ThreadGroupTest
+ *  @run driver ThreadGroupTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.connect.*;
--- a/jdk/test/com/sun/jdi/TwoThreadsTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/TwoThreadsTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g TwoThreadsTest.java
- *  @run main TwoThreadsTest
+ *  @run driver TwoThreadsTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/UTF8Test.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/UTF8Test.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g UTF8Test.java
- *  @run main UTF8Test
+ *  @run driver UTF8Test
  */
 
 /*
--- a/jdk/test/com/sun/jdi/UnpreparedByName.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/UnpreparedByName.java	Fri Jul 11 05:59:08 2014 -0700
@@ -33,7 +33,7 @@
  *  @run compile -g InnerTarg.java
  *  @run build UnpreparedByName
  *
- *  @run main UnpreparedByName InnerTarg
+ *  @run driver UnpreparedByName InnerTarg
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/UnpreparedClasses.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/UnpreparedClasses.java	Fri Jul 11 05:59:08 2014 -0700
@@ -33,7 +33,7 @@
  *  @run compile -g InnerTarg.java
  *  @run build UnpreparedClasses
  *
- *  @run main UnpreparedClasses InnerTarg
+ *  @run driver UnpreparedClasses InnerTarg
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/VMConnection.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/VMConnection.java	Fri Jul 11 05:59:08 2014 -0700
@@ -52,61 +52,23 @@
 
         // When we run under jtreg, test.classes contains the pathname of
         // the dir in which the .class files will be placed.
-        BufferedReader reader;
         String testClasses = System.getProperty("test.classes");
         if (testClasses == null) {
             return retVal;
         }
-        retVal += "-classpath " + testClasses + " ";
-        File myFile = new File(testClasses, "@debuggeeVMOptions");
+        retVal += "-classpath " + testClasses;
 
-        if (!myFile.canRead()) {
-            // Not there - look in parent (in case we are in a subdir)
-            myFile = new File(testClasses);
-            String parentDir = myFile.getParent();
-            if (parentDir != null) {
-                myFile = new File(parentDir, "@debuggeeVMOptions");
-                if (!myFile.canRead()) {
-                    return retVal;
-                }
-            }
+        String vmOpts = System.getProperty("test.vm.opts");
+        System.out.println("vmOpts: "+vmOpts);
+        if (vmOpts != null) {
+            retVal += " " + vmOpts;
         }
-        String wholePath = myFile.getPath();
-        try {
-            reader = new BufferedReader(new FileReader(myFile));
-        } catch (FileNotFoundException ee) {
-            System.out.println("-- Error 2 trying to access file " +
-                               wholePath + ": " + ee);
-            return retVal;
+        String javaOpts = System.getProperty("test.java.opts");
+        System.out.println("javaOpts: "+javaOpts);
+        if (javaOpts != null) {
+            retVal += " " + javaOpts;
         }
 
-        String line;
-        while (true) {
-            try {
-                line = reader.readLine();
-            } catch (IOException ee) {
-                System.out.println("-- Error reading options from file " +
-                                   wholePath + ": " + ee);
-                break;
-            }
-            if (line == null) {
-                System.out.println("-- No debuggee VM options found in file " +
-                                   wholePath);
-                break;
-            }
-            line = line.trim();
-            if (line.length() != 0 && !line.startsWith("#")) {
-                System.out.println("-- Added debuggeeVM options from file " +
-                                   wholePath + ": " + line);
-                retVal += line;
-                break;
-            }
-            // Else, read he next line.
-        }
-        try {
-            reader.close();
-        } catch (IOException ee) {
-        }
         return retVal;
     }
 
--- a/jdk/test/com/sun/jdi/VMDeathLastTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/VMDeathLastTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -31,7 +31,7 @@
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g HelloWorld.java
  *  @run build VMDeathLastTest
- *  @run main VMDeathLastTest
+ *  @run driver VMDeathLastTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/VMDeathRequestTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/VMDeathRequestTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -29,7 +29,7 @@
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g HelloWorld.java
  *  @run build VMDeathRequestTest
- *  @run main VMDeathRequestTest
+ *  @run driver VMDeathRequestTest
  *
  * @summary VMDeathRequestTest checks to see that
  * VMDisconnectedException is never thrown before VMDisconnectEvent.
--- a/jdk/test/com/sun/jdi/VarargsTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/VarargsTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g VarargsTest.java
- *  @run main VarargsTest
+ *  @run driver VarargsTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/Vars.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/Vars.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *  @library scaffold
  *  @run build JDIScaffold VMConnection
  *  @run compile -g Vars.java
- *  @run main/othervm Vars
+ *  @run driver Vars
  */
 
 import com.sun.jdi.*;
--- a/jdk/test/com/sun/jdi/VisibleMethods.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/VisibleMethods.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,7 +30,7 @@
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g VisibleMethods.java
- *  @run main VisibleMethods
+ *  @run driver VisibleMethods
  */
 import com.sun.jdi.Method;
 import com.sun.jdi.ReferenceType;
--- a/jdk/test/com/sun/jdi/redefine/RedefineTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/redefine/RedefineTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -34,7 +34,7 @@
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g RedefineTest.java
  *  @run shell RedefineSetUp.sh
- *  @run main/othervm RedefineTest
+ *  @run driver RedefineTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/redefineMethod/RedefineTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/redefineMethod/RedefineTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -32,8 +32,8 @@
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  *  @run compile -g RedefineTest.java
  *  @run shell RedefineSetUp.sh
- *  @run main RedefineTest -repeat 3
- *  @run main RedefineTest
+ *  @run driver RedefineTest -repeat 3
+ *  @run driver RedefineTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/sde/FilterMangleTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/sde/FilterMangleTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -9,21 +9,21 @@
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE
  *  @run compile FilterMangleTest.java
  *  @run compile -g onion/pickle/Mangle.java
- *  @run main FilterMangleTest
- *  @run main FilterMangleTest SDE-pMangle.java*
- *  @run main FilterMangleTest SDE-pMangle.jav*
- *  @run main FilterMangleTest SDE-pMangle.j*
- *  @run main FilterMangleTest SDE-p*Mangle.java
- *  @run main FilterMangleTest SDE-p*angle.java
- *  @run main FilterMangleTest SDE-p*java
- *  @run main FilterMangleTest SDE-pMangle.xyz
- *  @run main FilterMangleTest SDE-pIncl.rats*
- *  @run main FilterMangleTest SDE-pIncl.rat*
- *  @run main FilterMangleTest SDE-p*angle.rats
- *  @run main FilterMangleTest SDE-f*Incl.rat
- *  @run main FilterMangleTest SDE-ffred
- *  @run main FilterMangleTest SDE-f*ratsx
- *  @run main FilterMangleTest SDE-fMangle.javax*
+ *  @run driver FilterMangleTest
+ *  @run driver FilterMangleTest SDE-pMangle.java*
+ *  @run driver FilterMangleTest SDE-pMangle.jav*
+ *  @run driver FilterMangleTest SDE-pMangle.j*
+ *  @run driver FilterMangleTest SDE-p*Mangle.java
+ *  @run driver FilterMangleTest SDE-p*angle.java
+ *  @run driver FilterMangleTest SDE-p*java
+ *  @run driver FilterMangleTest SDE-pMangle.xyz
+ *  @run driver FilterMangleTest SDE-pIncl.rats*
+ *  @run driver FilterMangleTest SDE-pIncl.rat*
+ *  @run driver FilterMangleTest SDE-p*angle.rats
+ *  @run driver FilterMangleTest SDE-f*Incl.rat
+ *  @run driver FilterMangleTest SDE-ffred
+ *  @run driver FilterMangleTest SDE-f*ratsx
+ *  @run driver FilterMangleTest SDE-fMangle.javax*
  */
 
 /*
--- a/jdk/test/com/sun/jdi/sde/MangleStepTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/sde/MangleStepTest.java	Fri Jul 11 05:59:08 2014 -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/othervm MangleStepTest unset
- *  @run main/othervm MangleStepTest Java
- *  @run main/othervm MangleStepTest XYZ
- *  @run main/othervm MangleStepTest Rats
- *  @run main/othervm MangleStepTest bogus
+ *  @run driver MangleStepTest unset
+ *  @run driver MangleStepTest Java
+ *  @run driver MangleStepTest XYZ
+ *  @run driver MangleStepTest Rats
+ *  @run driver MangleStepTest bogus
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
@@ -82,7 +82,6 @@
         }
         BreakpointEvent bpe = resumeTo(targetName, "main",
                                        "([Ljava/lang/String;)V");
-        waitForInput();
 
         ThreadReference thread = bpe.thread();
 
--- a/jdk/test/com/sun/jdi/sde/MangleTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/sde/MangleTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -10,7 +10,7 @@
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE
  *  @run compile MangleTest.java
  *  @run compile -g onion/pickle/Mangle.java
- *  @run main MangleTest
+ *  @run driver MangleTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/sde/SourceDebugExtensionTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/sde/SourceDebugExtensionTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -10,7 +10,7 @@
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE
  *  @run compile SourceDebugExtensionTest.java
  *  @run compile -g SourceDebugExtensionTarg.java
- *  @run main SourceDebugExtensionTest
+ *  @run driver SourceDebugExtensionTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/jdi/sde/TemperatureTableTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/jdi/sde/TemperatureTableTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -10,7 +10,7 @@
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE HelloWorld
  *  @run compile TemperatureTableTest.java
  *  @run compile -g TemperatureTableServlet.java
- *  @run main TemperatureTableTest
+ *  @run driver TemperatureTableTest
  */
 import com.sun.jdi.*;
 import com.sun.jdi.event.*;
--- a/jdk/test/com/sun/tools/attach/StartManagementAgent.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/com/sun/tools/attach/StartManagementAgent.java	Fri Jul 11 05:59:08 2014 -0700
@@ -93,7 +93,7 @@
         } catch(AttachOperationFailedException ex) {
             // We expect parsing of "apa" above to fail, but if the file path
             // can't be read we get a different exception message
-            if (!ex.getMessage().contains("java.lang.NumberFormatException")) {
+            if (!ex.getMessage().contains("Invalid com.sun.management.jmxremote.port number")) {
                 throw ex;
             }
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/invoke/VMAnonymousClass.java	Fri Jul 11 05:59:08 2014 -0700
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * 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 8046903
+ * @summary VM anonymous class members can't be statically invocable
+ * @run junit test.java.lang.invoke.VMAnonymousClass
+ */
+package test.java.lang.invoke;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import java.lang.reflect.Field;
+import org.junit.Test;
+import sun.misc.Unsafe;
+import jdk.internal.org.objectweb.asm.*;
+import static jdk.internal.org.objectweb.asm.Opcodes.*;
+
+public class VMAnonymousClass {
+    public static void main(String[] args) throws Throwable {
+        VMAnonymousClass test = new VMAnonymousClass();
+        test.testJavaLang();
+        test.testJavaUtil();
+        test.testSunMisc();
+        test.testJavaLangInvoke();
+        System.out.println("TEST PASSED");
+    }
+
+    // Test VM anonymous classes from different packages
+    // (see j.l.i.InvokerBytecodeGenerator::isStaticallyInvocable).
+    @Test public void testJavaLang()       throws Throwable { test("java/lang");        }
+    @Test public void testJavaUtil()       throws Throwable { test("java/util");        }
+    @Test public void testSunMisc()        throws Throwable { test("sun/misc");         }
+    @Test public void testJavaLangInvoke() throws Throwable { test("java/lang/invoke"); }
+
+    private static Unsafe unsafe = getUnsafe();
+
+    private static void test(String pkg) throws Throwable {
+        byte[] bytes = dumpClass(pkg);
+        // Define VM anonymous class in privileged context (on BCP).
+        Class anonClass = unsafe.defineAnonymousClass(Object.class, bytes, null);
+
+        MethodType t = MethodType.methodType(Object.class, int.class);
+        MethodHandle target = MethodHandles.lookup().findStatic(anonClass, "get", t);
+
+        // Wrap target into LF (convert) to get "target" referenced from LF
+        MethodHandle wrappedMH = target.asType(MethodType.methodType(Object.class, Integer.class));
+
+        // Invoke enough times to provoke LF compilation to bytecode.
+        for (int i = 0; i<100; i++) {
+            Object r = wrappedMH.invokeExact((Integer)1);
+        }
+    }
+
+    /*
+     * Constructs bytecode for the following class:
+     * public class pkg.MyClass {
+     *     MyClass() {}
+     *     public Object get(int i) { return null; }
+     * }
+     */
+    public static byte[] dumpClass(String pkg) {
+        ClassWriter cw = new ClassWriter(0);
+        MethodVisitor mv;
+
+        cw.visit(52, ACC_SUPER | ACC_PUBLIC, pkg+"/MyClass", null, "java/lang/Object", null);
+        {
+            mv = cw.visitMethod(0, "<init>", "()V", null, null);
+            mv.visitCode();
+            mv.visitVarInsn(ALOAD, 0);
+            mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
+            mv.visitInsn(RETURN);
+            mv.visitMaxs(1, 1);
+            mv.visitEnd();
+        }
+        {
+            mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "get", "(I)Ljava/lang/Object;", null, null);
+            mv.visitCode();
+            mv.visitInsn(ACONST_NULL);
+            mv.visitInsn(ARETURN);
+            mv.visitMaxs(1, 1);
+            mv.visitEnd();
+        }
+        cw.visitEnd();
+        return cw.toByteArray();
+    }
+
+    private static synchronized Unsafe getUnsafe() {
+        try {
+            Field f = Unsafe.class.getDeclaredField("theUnsafe");
+            f.setAccessible(true);
+            return (Unsafe) f.get(null);
+        } catch (NoSuchFieldException | IllegalAccessException e) {
+            throw new RuntimeException("Unable to get Unsafe instance.", e);
+        }
+    }
+}
--- a/jdk/test/java/time/tck/java/time/format/TCKDateTimeParseResolver.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/java/time/tck/java/time/format/TCKDateTimeParseResolver.java	Fri Jul 11 05:59:08 2014 -0700
@@ -76,6 +76,7 @@
 import static java.time.temporal.ChronoField.ERA;
 import static java.time.temporal.ChronoField.HOUR_OF_AMPM;
 import static java.time.temporal.ChronoField.HOUR_OF_DAY;
+import static java.time.temporal.ChronoField.INSTANT_SECONDS;
 import static java.time.temporal.ChronoField.MICRO_OF_DAY;
 import static java.time.temporal.ChronoField.MICRO_OF_SECOND;
 import static java.time.temporal.ChronoField.MILLI_OF_DAY;
@@ -93,11 +94,13 @@
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.fail;
 
+import java.time.Instant;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalTime;
 import java.time.Period;
 import java.time.ZoneId;
+import java.time.ZoneOffset;
 import java.time.ZonedDateTime;
 import java.time.chrono.ChronoLocalDate;
 import java.time.chrono.ChronoLocalDateTime;
@@ -1159,4 +1162,102 @@
         }
     };
 
+    //-------------------------------------------------------------------------
+    // SPEC: ChronoField.INSTANT_SECONDS
+    @Test
+    public void test_parse_fromField_InstantSeconds() {
+        DateTimeFormatter fmt = new DateTimeFormatterBuilder()
+            .appendValue(INSTANT_SECONDS).toFormatter();
+        TemporalAccessor acc = fmt.parse("86402");
+        Instant expected = Instant.ofEpochSecond(86402);
+        assertEquals(acc.isSupported(INSTANT_SECONDS), true);
+        assertEquals(acc.isSupported(NANO_OF_SECOND), true);
+        assertEquals(acc.isSupported(MICRO_OF_SECOND), true);
+        assertEquals(acc.isSupported(MILLI_OF_SECOND), true);
+        assertEquals(acc.getLong(INSTANT_SECONDS), 86402L);
+        assertEquals(acc.getLong(NANO_OF_SECOND), 0L);
+        assertEquals(acc.getLong(MICRO_OF_SECOND), 0L);
+        assertEquals(acc.getLong(MILLI_OF_SECOND), 0L);
+        assertEquals(Instant.from(acc), expected);
+    }
+
+    @Test
+    public void test_parse_fromField_InstantSeconds_NanoOfSecond() {
+        DateTimeFormatter fmt = new DateTimeFormatterBuilder()
+            .appendValue(INSTANT_SECONDS).appendLiteral('.').appendValue(NANO_OF_SECOND).toFormatter();
+        TemporalAccessor acc = fmt.parse("86402.123456789");
+        Instant expected = Instant.ofEpochSecond(86402, 123456789);
+        assertEquals(acc.isSupported(INSTANT_SECONDS), true);
+        assertEquals(acc.isSupported(NANO_OF_SECOND), true);
+        assertEquals(acc.isSupported(MICRO_OF_SECOND), true);
+        assertEquals(acc.isSupported(MILLI_OF_SECOND), true);
+        assertEquals(acc.getLong(INSTANT_SECONDS), 86402L);
+        assertEquals(acc.getLong(NANO_OF_SECOND), 123456789L);
+        assertEquals(acc.getLong(MICRO_OF_SECOND), 123456L);
+        assertEquals(acc.getLong(MILLI_OF_SECOND), 123L);
+        assertEquals(Instant.from(acc), expected);
+    }
+
+    // SPEC: ChronoField.SECOND_OF_DAY
+    @Test
+    public void test_parse_fromField_SecondOfDay() {
+        DateTimeFormatter fmt = new DateTimeFormatterBuilder()
+            .appendValue(SECOND_OF_DAY).toFormatter();
+        TemporalAccessor acc = fmt.parse("864");
+        assertEquals(acc.isSupported(SECOND_OF_DAY), true);
+        assertEquals(acc.isSupported(NANO_OF_SECOND), true);
+        assertEquals(acc.isSupported(MICRO_OF_SECOND), true);
+        assertEquals(acc.isSupported(MILLI_OF_SECOND), true);
+        assertEquals(acc.getLong(SECOND_OF_DAY), 864L);
+        assertEquals(acc.getLong(NANO_OF_SECOND), 0L);
+        assertEquals(acc.getLong(MICRO_OF_SECOND), 0L);
+        assertEquals(acc.getLong(MILLI_OF_SECOND), 0L);
+    }
+
+    @Test
+    public void test_parse_fromField_SecondOfDay_NanoOfSecond() {
+        DateTimeFormatter fmt = new DateTimeFormatterBuilder()
+            .appendValue(SECOND_OF_DAY).appendLiteral('.').appendValue(NANO_OF_SECOND).toFormatter();
+        TemporalAccessor acc = fmt.parse("864.123456789");
+        assertEquals(acc.isSupported(SECOND_OF_DAY), true);
+        assertEquals(acc.isSupported(NANO_OF_SECOND), true);
+        assertEquals(acc.isSupported(MICRO_OF_SECOND), true);
+        assertEquals(acc.isSupported(MILLI_OF_SECOND), true);
+        assertEquals(acc.getLong(SECOND_OF_DAY), 864L);
+        assertEquals(acc.getLong(NANO_OF_SECOND), 123456789L);
+        assertEquals(acc.getLong(MICRO_OF_SECOND), 123456L);
+        assertEquals(acc.getLong(MILLI_OF_SECOND), 123L);
+    }
+
+    // SPEC: ChronoField.SECOND_OF_MINUTE
+    @Test
+    public void test_parse_fromField_SecondOfMinute() {
+        DateTimeFormatter fmt = new DateTimeFormatterBuilder()
+            .appendValue(SECOND_OF_MINUTE).toFormatter();
+        TemporalAccessor acc = fmt.parse("32");
+        assertEquals(acc.isSupported(SECOND_OF_MINUTE), true);
+        assertEquals(acc.isSupported(NANO_OF_SECOND), true);
+        assertEquals(acc.isSupported(MICRO_OF_SECOND), true);
+        assertEquals(acc.isSupported(MILLI_OF_SECOND), true);
+        assertEquals(acc.getLong(SECOND_OF_MINUTE), 32L);
+        assertEquals(acc.getLong(NANO_OF_SECOND), 0L);
+        assertEquals(acc.getLong(MICRO_OF_SECOND), 0L);
+        assertEquals(acc.getLong(MILLI_OF_SECOND), 0L);
+    }
+
+    @Test
+    public void test_parse_fromField_SecondOfMinute_NanoOfSecond() {
+        DateTimeFormatter fmt = new DateTimeFormatterBuilder()
+            .appendValue(SECOND_OF_MINUTE).appendLiteral('.').appendValue(NANO_OF_SECOND).toFormatter();
+        TemporalAccessor acc = fmt.parse("32.123456789");
+        assertEquals(acc.isSupported(SECOND_OF_MINUTE), true);
+        assertEquals(acc.isSupported(NANO_OF_SECOND), true);
+        assertEquals(acc.isSupported(MICRO_OF_SECOND), true);
+        assertEquals(acc.isSupported(MILLI_OF_SECOND), true);
+        assertEquals(acc.getLong(SECOND_OF_MINUTE), 32L);
+        assertEquals(acc.getLong(NANO_OF_SECOND), 123456789L);
+        assertEquals(acc.getLong(MICRO_OF_SECOND), 123456L);
+        assertEquals(acc.getLong(MILLI_OF_SECOND), 123L);
+    }
+
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/time/test/java/time/format/TestDateTimeParsing.java	Fri Jul 11 05:59:08 2014 -0700
@@ -0,0 +1,204 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * Copyright (c) 2014, Stephen Colebourne & Michael Nascimento Santos
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *  * Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ *  * Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ *  * Neither the name of JSR-310 nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package test.java.time.format;
+
+import static java.time.temporal.ChronoField.EPOCH_DAY;
+import static java.time.temporal.ChronoField.INSTANT_SECONDS;
+import static java.time.temporal.ChronoField.MICRO_OF_SECOND;
+import static java.time.temporal.ChronoField.MILLI_OF_SECOND;
+import static java.time.temporal.ChronoField.NANO_OF_SECOND;
+import static java.time.temporal.ChronoField.OFFSET_SECONDS;
+import static java.time.temporal.ChronoField.SECOND_OF_DAY;
+import static org.testng.Assert.assertEquals;
+
+import java.time.DateTimeException;
+import java.time.Instant;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
+import java.time.format.DateTimeFormatterBuilder;
+import java.time.temporal.TemporalAccessor;
+
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+/**
+ * Test parsing of edge cases.
+ */
+@Test
+public class TestDateTimeParsing {
+
+    private static final ZoneId PARIS = ZoneId.of("Europe/Paris");
+    private static final ZoneOffset OFFSET_0230 = ZoneOffset.ofHoursMinutes(2, 30);
+
+    private static final DateTimeFormatter LOCALFIELDS = new DateTimeFormatterBuilder()
+        .appendPattern("yyyy-MM-dd HH:mm:ss").toFormatter();
+    private static final DateTimeFormatter LOCALFIELDS_ZONEID = new DateTimeFormatterBuilder()
+        .appendPattern("yyyy-MM-dd HH:mm:ss ").appendZoneId().toFormatter();
+    private static final DateTimeFormatter LOCALFIELDS_OFFSETID = new DateTimeFormatterBuilder()
+        .appendPattern("yyyy-MM-dd HH:mm:ss ").appendOffsetId().toFormatter();
+    private static final DateTimeFormatter LOCALFIELDS_WITH_PARIS = LOCALFIELDS.withZone(PARIS);
+    private static final DateTimeFormatter LOCALFIELDS_WITH_0230 = LOCALFIELDS.withZone(OFFSET_0230);
+    private static final DateTimeFormatter INSTANT = new DateTimeFormatterBuilder()
+        .appendInstant().toFormatter();
+    private static final DateTimeFormatter INSTANT_WITH_PARIS = INSTANT.withZone(PARIS);
+    private static final DateTimeFormatter INSTANT_WITH_0230 = INSTANT.withZone(OFFSET_0230);
+    private static final DateTimeFormatter INSTANT_OFFSETID = new DateTimeFormatterBuilder()
+        .appendInstant().appendLiteral(' ').appendOffsetId().toFormatter();
+    private static final DateTimeFormatter INSTANT_OFFSETSECONDS = new DateTimeFormatterBuilder()
+        .appendInstant().appendLiteral(' ').appendValue(OFFSET_SECONDS).toFormatter();
+    private static final DateTimeFormatter INSTANTSECONDS = new DateTimeFormatterBuilder()
+        .appendValue(INSTANT_SECONDS).toFormatter();
+    private static final DateTimeFormatter INSTANTSECONDS_WITH_PARIS = INSTANTSECONDS.withZone(PARIS);
+    private static final DateTimeFormatter INSTANTSECONDS_NOS = new DateTimeFormatterBuilder()
+        .appendValue(INSTANT_SECONDS).appendLiteral('.').appendValue(NANO_OF_SECOND).toFormatter();
+    private static final DateTimeFormatter INSTANTSECONDS_NOS_WITH_PARIS = INSTANTSECONDS_NOS.withZone(PARIS);
+    private static final DateTimeFormatter INSTANTSECONDS_OFFSETSECONDS = new DateTimeFormatterBuilder()
+        .appendValue(INSTANT_SECONDS).appendLiteral(' ').appendValue(OFFSET_SECONDS).toFormatter();
+
+    @DataProvider(name = "instantZones")
+    Object[][] data_instantZones() {
+        return new Object[][] {
+            {LOCALFIELDS_ZONEID, "2014-06-30 01:02:03 Europe/Paris", ZonedDateTime.of(2014, 6, 30, 1, 2, 3, 0, PARIS)},
+            {LOCALFIELDS_ZONEID, "2014-06-30 01:02:03 +02:30", ZonedDateTime.of(2014, 6, 30, 1, 2, 3, 0, OFFSET_0230)},
+            {LOCALFIELDS_OFFSETID, "2014-06-30 01:02:03 +02:30", ZonedDateTime.of(2014, 6, 30, 1, 2, 3, 0, OFFSET_0230)},
+            {LOCALFIELDS_WITH_PARIS, "2014-06-30 01:02:03", ZonedDateTime.of(2014, 6, 30, 1, 2, 3, 0, PARIS)},
+            {LOCALFIELDS_WITH_0230, "2014-06-30 01:02:03", ZonedDateTime.of(2014, 6, 30, 1, 2, 3, 0, OFFSET_0230)},
+            {INSTANT_WITH_PARIS, "2014-06-30T01:02:03Z", ZonedDateTime.of(2014, 6, 30, 1, 2, 3, 0, ZoneOffset.UTC).withZoneSameInstant(PARIS)},
+            {INSTANT_WITH_0230, "2014-06-30T01:02:03Z", ZonedDateTime.of(2014, 6, 30, 1, 2, 3, 0, ZoneOffset.UTC).withZoneSameInstant(OFFSET_0230)},
+            {INSTANT_OFFSETID, "2014-06-30T01:02:03Z +02:30", ZonedDateTime.of(2014, 6, 30, 1, 2, 3, 0, ZoneOffset.UTC).withZoneSameInstant(OFFSET_0230)},
+            {INSTANT_OFFSETSECONDS, "2014-06-30T01:02:03Z 9000", ZonedDateTime.of(2014, 6, 30, 1, 2, 3, 0, ZoneOffset.UTC).withZoneSameInstant(OFFSET_0230)},
+            {INSTANTSECONDS_WITH_PARIS, "86402", Instant.ofEpochSecond(86402).atZone(PARIS)},
+            {INSTANTSECONDS_NOS_WITH_PARIS, "86402.123456789", Instant.ofEpochSecond(86402, 123456789).atZone(PARIS)},
+            {INSTANTSECONDS_OFFSETSECONDS, "86402 9000", Instant.ofEpochSecond(86402).atZone(OFFSET_0230)},
+        };
+    }
+
+    @Test(dataProvider = "instantZones")
+    public void test_parse_instantZones_ZDT(DateTimeFormatter formatter, String text, ZonedDateTime expected) {
+        TemporalAccessor actual = formatter.parse(text);
+        assertEquals(ZonedDateTime.from(actual), expected);
+    }
+
+    @Test(dataProvider = "instantZones")
+    public void test_parse_instantZones_LDT(DateTimeFormatter formatter, String text, ZonedDateTime expected) {
+        TemporalAccessor actual = formatter.parse(text);
+        assertEquals(LocalDateTime.from(actual), expected.toLocalDateTime());
+    }
+
+    @Test(dataProvider = "instantZones")
+    public void test_parse_instantZones_Instant(DateTimeFormatter formatter, String text, ZonedDateTime expected) {
+        TemporalAccessor actual = formatter.parse(text);
+        assertEquals(Instant.from(actual), expected.toInstant());
+    }
+
+    @Test(dataProvider = "instantZones")
+    public void test_parse_instantZones_supported(DateTimeFormatter formatter, String text, ZonedDateTime expected) {
+        TemporalAccessor actual = formatter.parse(text);
+        assertEquals(actual.isSupported(INSTANT_SECONDS), true);
+        assertEquals(actual.isSupported(EPOCH_DAY), true);
+        assertEquals(actual.isSupported(SECOND_OF_DAY), true);
+        assertEquals(actual.isSupported(NANO_OF_SECOND), true);
+        assertEquals(actual.isSupported(MICRO_OF_SECOND), true);
+        assertEquals(actual.isSupported(MILLI_OF_SECOND), true);
+    }
+
+    //-----------------------------------------------------------------------
+    @DataProvider(name = "instantNoZone")
+    Object[][] data_instantNoZone() {
+        return new Object[][] {
+            {INSTANT, "2014-06-30T01:02:03Z", ZonedDateTime.of(2014, 6, 30, 1, 2, 3, 0, ZoneOffset.UTC).toInstant()},
+            {INSTANTSECONDS, "86402", Instant.ofEpochSecond(86402)},
+            {INSTANTSECONDS_NOS, "86402.123456789", Instant.ofEpochSecond(86402, 123456789)},
+        };
+    }
+
+    @Test(dataProvider = "instantNoZone", expectedExceptions = DateTimeException.class)
+    public void test_parse_instantNoZone_ZDT(DateTimeFormatter formatter, String text, Instant expected) {
+        TemporalAccessor actual = formatter.parse(text);
+        ZonedDateTime.from(actual);
+    }
+
+    @Test(dataProvider = "instantNoZone", expectedExceptions = DateTimeException.class)
+    public void test_parse_instantNoZone_LDT(DateTimeFormatter formatter, String text, Instant expected) {
+        TemporalAccessor actual = formatter.parse(text);
+        LocalDateTime.from(actual);
+    }
+
+    @Test(dataProvider = "instantNoZone")
+    public void test_parse_instantNoZone_Instant(DateTimeFormatter formatter, String text, Instant expected) {
+        TemporalAccessor actual = formatter.parse(text);
+        assertEquals(Instant.from(actual), expected);
+    }
+
+    @Test(dataProvider = "instantNoZone")
+    public void test_parse_instantNoZone_supported(DateTimeFormatter formatter, String text, Instant expected) {
+        TemporalAccessor actual = formatter.parse(text);
+        assertEquals(actual.isSupported(INSTANT_SECONDS), true);
+        assertEquals(actual.isSupported(EPOCH_DAY), false);
+        assertEquals(actual.isSupported(SECOND_OF_DAY), false);
+        assertEquals(actual.isSupported(NANO_OF_SECOND), true);
+        assertEquals(actual.isSupported(MICRO_OF_SECOND), true);
+        assertEquals(actual.isSupported(MILLI_OF_SECOND), true);
+    }
+
+}
--- a/jdk/test/jdk/net/Sockets/Test.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/jdk/net/Sockets/Test.java	Fri Jul 11 05:59:08 2014 -0700
@@ -30,8 +30,10 @@
  */
 
 import java.net.*;
+import java.io.IOException;
 import java.nio.channels.*;
 import java.util.concurrent.*;
+import java.util.Set;
 import jdk.net.*;
 
 public class Test {
@@ -75,6 +77,13 @@
         DatagramSocket dg = new DatagramSocket(0);
         final int udp_port = dg.getLocalPort();
 
+        // If option not available, end test
+        Set<SocketOption<?>> options = dg.supportedOptions();
+        if (!options.contains(ExtendedSocketOptions.SO_FLOW_SLA)) {
+            System.out.println("SO_FLOW_SLA not supported");
+            return;
+        }
+
         final Socket s = new Socket("127.0.0.1", tcp_port);
         final SocketChannel sc = SocketChannel.open();
         sc.connect (new InetSocketAddress("127.0.0.1", tcp_port));
@@ -125,6 +134,13 @@
             if (success) {
                 throw new RuntimeException("Test failed");
             }
-        } catch (UnsupportedOperationException e) {}
+        } catch (UnsupportedOperationException e) {
+            System.out.println (e);
+        } catch (IOException e) {
+            // Probably a permission error, but we're not
+            // going to check unless a specific permission exception
+            // is defined.
+            System.out.println (e);
+        }
     }
 }
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-amd64/freebl3.chk has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-amd64/freebl3.dll has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-amd64/libnspr4.dll has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-amd64/libnspr4.lib has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-amd64/libplc4.dll has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-amd64/libplc4.lib has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-amd64/libplds4.dll has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-amd64/libplds4.lib has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-amd64/nss3.dll has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-amd64/nss3.lib has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-amd64/nssckbi.dll has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-amd64/nssdbm3.chk has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-amd64/nssdbm3.dll has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-amd64/nssutil3.dll has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-amd64/nssutil3.lib has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-amd64/softokn3.chk has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-amd64/softokn3.dll has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-amd64/sqlite3.dll has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-amd64/ssl3.dll has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-amd64/ssl3.lib has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-i586/freebl3.chk has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-i586/freebl3.dll has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-i586/libnspr4.dll has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-i586/libnspr4.lib has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-i586/libplc4.dll has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-i586/libplc4.lib has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-i586/libplds4.dll has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-i586/libplds4.lib has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-i586/nss3.dll has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-i586/nss3.lib has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-i586/nssckbi.dll has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-i586/nssdbm3.chk has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-i586/nssdbm3.dll has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-i586/nssutil3.dll has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-i586/nssutil3.lib has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-i586/softokn3.chk has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-i586/softokn3.dll has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-i586/sqlite3.dll has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-i586/ssl3.dll has changed
Binary file jdk/test/sun/security/pkcs11/nss/lib/windows-i586/ssl3.lib has changed
--- a/jdk/test/sun/security/pkcs11/nss/src/MD5SUMS	Wed Jul 09 16:44:30 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-1390c8a35c667e05e542  nss-3.13.1.tar.gz
--- a/jdk/test/sun/security/pkcs11/nss/src/SHA1SUMS	Wed Jul 09 16:44:30 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-d8e7ee9f9f1e0bfa2ea8b72d25727634fea130a6  nss-3.13.1.tar.gz
Binary file jdk/test/sun/security/pkcs11/nss/src/nss-3.13.1.tar.gz has changed
Binary file jdk/test/sun/security/pkcs11/nss/src/nss-3.16_nspr-4.10_src.tar.gz has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/pkcs11/nss/src/nss-3.16_nspr-4.10_src.tar.gz.sha256	Fri Jul 11 05:59:08 2014 -0700
@@ -0,0 +1,1 @@
+d2374795528f9cf36de07bf7c77d8c8414bb5b4da12ee7c78a57ec90d68e3706  nss-3.16_nspr-4.10_src.tar.gz
--- a/jdk/test/sun/tools/jhat/HatHeapDump1Test.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/jdk/test/sun/tools/jhat/HatHeapDump1Test.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,31 +21,68 @@
  * questions.
  */
 
+import java.io.File;
+import java.util.Arrays;
 
-/* @test HatHeapDump1Test.java
+import jdk.testlibrary.Asserts;
+import jdk.testlibrary.JDKToolLauncher;
+import jdk.testlibrary.OutputAnalyzer;
+import jdk.testlibrary.ProcessTools;
+
+/* @test
  * @bug 5102009
- * @summary Test jhat
- *
- * @compile -g HelloWorld.java HatRun.java
- * @build HatHeapDump1Test
- * @run main HatHeapDump1Test HelloWorld
+ * @summary Sanity test of jhat functionality
+ * @library /lib/testlibrary
+ * @build jdk.testlibarary.*
+ * @compile -g HelloWorld.java
+ * @run main HatHeapDump1Test
  */
+public class HatHeapDump1Test {
 
-public class HatHeapDump1Test {
+    private static final String TEST_CLASSES = System.getProperty("test.classes", ".");
 
     public static void main(String args[]) throws Exception {
-        HatRun run;
+        String className = "HelloWorld";
+        File dumpFile = new File(className + ".hdump");
+
+        // Generate a heap dump
+        ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder("-cp",
+                TEST_CLASSES,
+                "-Xcheck:jni",
+                "-Xverify:all",
+                "-agentlib:hprof=heap=dump,format=b,file=" + dumpFile.getAbsolutePath(),
+                className);
+        OutputAnalyzer output = new OutputAnalyzer(processBuilder.start());
+        System.out.println(output.getOutput());
+        output.shouldHaveExitValue(0);
+        output.shouldContain("Dumping Java heap ... done");
+        Asserts.assertTrue(dumpFile.exists() && dumpFile.isFile(), "Invalid dump file " + dumpFile.getAbsolutePath());
 
-        /* Run hprof and jhat */
-        run = new HatRun("heap=dump", "");
-        run.runit(args[0]);
+        // Run jhat to analyze the heap dump
+        output = jhat("-debug", "2", dumpFile.getAbsolutePath());
+        output.shouldHaveExitValue(0);
+        output.shouldContain("Snapshot resolved");
+        output.shouldContain("-debug 2 was used");
+        output.shouldNotContain("ERROR");
 
-        /* Make sure patterns in output look ok */
-        if (run.output_contains("ERROR")) {
-            throw new RuntimeException("Test failed - ERROR seen in output");
+        dumpFile.delete();
+    }
+
+    private static OutputAnalyzer jhat(String... toolArgs) throws Exception {
+        JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jhat");
+        if (toolArgs != null) {
+            for (String toolArg : toolArgs) {
+                launcher.addToolArg(toolArg);
+            }
         }
 
-        /* Must be a pass. */
-        System.out.println("Test passed - cleanly terminated");
+        ProcessBuilder processBuilder = new ProcessBuilder();
+        processBuilder.command(launcher.getCommand());
+        System.out.println(Arrays.toString(processBuilder.command().toArray()).replace(",", ""));
+        OutputAnalyzer output = new OutputAnalyzer(processBuilder.start());
+        System.out.println(output.getOutput());
+
+        return output;
     }
+
 }
--- a/jdk/test/sun/tools/jhat/HatRun.java	Wed Jul 09 16:44:30 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,226 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * 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.
- */
-
-
-/*
- *
- * Support classes for running jhat tests
- *
- */
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.File;
-import java.io.BufferedInputStream;
-import java.io.PrintStream;
-
-/*
- * Helper class to direct process output to a StringBuffer
- */
-class MyInputStream implements Runnable {
-    private String              name;
-    private BufferedInputStream in;
-    private StringBuffer        buffer;
-
-    /* Create MyInputStream that saves all output to a StringBuffer */
-    MyInputStream(String name, InputStream in) {
-        this.name = name;
-        this.in = new BufferedInputStream(in);
-        buffer = new StringBuffer(4096);
-        Thread thr = new Thread(this);
-        thr.setDaemon(true);
-        thr.start();
-    }
-
-    /* Dump the buffer */
-    void dump(PrintStream x) {
-        String str = buffer.toString();
-        x.println("<beginning of " + name + " buffer>");
-        x.println(str);
-        x.println("<end of buffer>");
-    }
-
-    /* Check to see if a pattern is inside the output. */
-    boolean contains(String pattern) {
-        String str = buffer.toString();
-        return str.contains(pattern);
-    }
-
-    /* Runs as a separate thread capturing all output in a StringBuffer */
-    public void run() {
-        try {
-            byte b[] = new byte[100];
-            for (;;) {
-                int n = in.read(b);
-                String str;
-                if (n < 0) {
-                    break;
-                }
-                str = new String(b, 0, n);
-                buffer.append(str);
-                System.out.print(str);
-            }
-        } catch (IOException ioe) { /* skip */ }
-    }
-}
-
-/*
- * Main jhat run
- */
-public class HatRun {
-
-    private String        all_hprof_options;
-    private String        all_hat_options;
-    private String        dumpfile;
-    private MyInputStream output;
-    private MyInputStream error;
-
-    /* Create a Hat run process */
-    public HatRun(String hprof_options, String hat_options)
-    {
-        all_hprof_options = hprof_options;
-        all_hat_options   = hat_options;
-    }
-
-    /*
-     * Execute a process with an -agentpath or -agentlib command option
-     */
-    public void runit(String class_name)
-    {
-        runit(class_name, null);
-    }
-
-    /*
-     * Execute a command.
-     */
-    private void execute(String cmd[])
-    {
-        /* Begin process */
-        Process p;
-        String cmdLine = "";
-        int i;
-
-        for ( i = 0 ; i < cmd.length; i++ ) {
-          cmdLine += cmd[i];
-          cmdLine += " ";
-        }
-        System.out.println("Starting: " + cmdLine);
-
-        try {
-            p = Runtime.getRuntime().exec(cmd);
-        } catch ( IOException e ) {
-            throw new RuntimeException("Test failed - exec got IO exception");
-        }
-
-        /* Save process output in StringBuffers */
-        output = new MyInputStream("Input Stream", p.getInputStream());
-        error  = new MyInputStream("Error Stream", p.getErrorStream());
-
-        /* Wait for process to complete, and if exit code is non-zero we fail */
-        try {
-            int exitStatus;
-            exitStatus = p.waitFor();
-            if ( exitStatus != 0) {
-                System.out.println("Exit code is " + exitStatus);
-                error.dump(System.out);
-                output.dump(System.out);
-                throw new RuntimeException("Test failed - " +
-                                    "exit return code non-zero " +
-                                    "(exitStatus==" + exitStatus + ")");
-            }
-        } catch ( InterruptedException e ) {
-            throw new RuntimeException("Test failed - process interrupted");
-        }
-        System.out.println("Completed: " + cmdLine);
-    }
-
-    /*
-     * Execute a process with an -agentpath or -agentlib command option
-     *    plus any set of other java options.
-     */
-    public void runit(String class_name, String vm_options[])
-    {
-        String jre_home  = System.getProperty("java.home");
-        String sdk_home  = (jre_home.endsWith("jre") ?
-                            (jre_home + File.separator + "..") :
-                            jre_home );
-        String cdir      = System.getProperty("test.classes", ".");
-        String os_arch   = System.getProperty("os.arch");
-        String os_name   = System.getProperty("os.name");
-        String java      = jre_home
-                             + File.separator + "bin"
-                             + File.separator + "java";
-        String jhat      = sdk_home + File.separator + "bin"
-                           + File.separator + "jhat";
-        /* Array of strings to be passed in for exec:
-         *   1. java
-         *   2. -Dtest.classes=.
-         *   3. -Xcheck:jni          (Just because it finds bugs)
-         *   4. -Xverify:all         (Make sure verification is on full blast)
-         *   5. -agent
-         *       vm_options
-         *   6+i. classname
-         */
-        int nvm_options = 0;
-        if ( vm_options != null ) nvm_options = vm_options.length;
-        String cmd[]     = new String[1 + 7 + nvm_options];
-        int i,j;
-
-        i = 0;
-        cmd[i++] = java;
-        cmd[i++] = "-cp";
-        cmd[i++] = cdir;
-        cmd[i++] = "-Dtest.classes=" + cdir;
-        cmd[i++] = "-Xcheck:jni";
-        cmd[i++] = "-Xverify:all";
-        dumpfile= cdir + File.separator + class_name + ".hdump";
-        cmd[i++] = "-agentlib:hprof=" + all_hprof_options
-                    + ",format=b,file=" + dumpfile;
-        /* Add any special VM options */
-        for ( j = 0; j < nvm_options; j++ ) {
-            cmd[i++] = vm_options[j];
-        }
-        /* Add classname */
-        cmd[i++] = class_name;
-
-        /* Execute process */
-        execute(cmd);
-
-        /* Run jhat */
-        String jhat_cmd[] = new String[4];
-        jhat_cmd[0] = jhat;
-        jhat_cmd[1] = "-debug";
-        jhat_cmd[2] = "2";
-        jhat_cmd[3] = dumpfile;
-
-        /* Execute process */
-        execute(jhat_cmd);
-
-    }
-
-    /* Does the pattern appear in the output of this process */
-    public boolean output_contains(String pattern)
-    {
-        return output.contains(pattern) || error.contains(pattern);
-    }
-}
--- a/langtools/.hgtags	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/.hgtags	Fri Jul 11 05:59:08 2014 -0700
@@ -261,3 +261,5 @@
 7d67ebd3e35c3c36ad2caee482a84f8310d2f838 jdk9-b16
 b64f8d5b97faa29e4d629bf4e56ebe0e26c40ecc jdk9-b17
 fd8da51c5df4546995c360fc49f0b985cbf8fbd3 jdk9-b18
+a9accd7c44159f191ad09740d54493e563c39f95 jdk9-b19
+31acbc476a5251824f919df0b82bca9cbb19cf7c jdk9-b20
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java	Fri Jul 11 05:59:08 2014 -0700
@@ -31,6 +31,7 @@
 import java.lang.annotation.Target;
 import java.text.Collator;
 import java.util.*;
+
 import javax.tools.StandardLocation;
 
 import com.sun.javadoc.*;
@@ -783,9 +784,8 @@
     }
 
     /**
-     * A general purpose String comparator, which compares two Strings using a Collator
-     * strength of "SECONDARY", thus providing  optimum case insensitive comparisons in
-     * most Locales.
+     * A general purpose case insensitive String comparator, which compares two Strings using a Collator
+     * strength of "TERTIARY".
      *
      * @param s1 first String to compare.
      * @param s2 second String to compare.
@@ -793,14 +793,32 @@
      *         argument is less than, equal to, or greater than the second.
      */
     public static int compareStrings(String s1, String s2) {
+        return compareStrings(true, s1, s2);
+    }
+    /**
+     * A general purpose case sensitive String comparator, which compares two Strings using a Collator
+     * strength of "SECONDARY".
+     *
+     * @param s1 first String to compare.
+     * @param s2 second String to compare.
+     * @return a negative integer, zero, or a positive integer as the first
+     *         argument is less than, equal to, or greater than the second.
+     */
+    public static int compareCaseCompare(String s1, String s2) {
+        return compareStrings(false, s1, s2);
+    }
+    private static int compareStrings(boolean caseSensitive, String s1, String s2) {
         Collator collator = Collator.getInstance();
-        collator.setStrength(Collator.SECONDARY);
+        collator.setStrength(caseSensitive ? Collator.TERTIARY : Collator.SECONDARY);
         return collator.compare(s1, s2);
     }
-
     /**
-     * A comparator for index file uses, this sorts first on names, then on
-     * parameter types and finally on the fully qualified name.
+     * A comparator for index file uses,
+     *  1. this sorts first on simple names
+     *  2. if equal, case insensitive comparison of Parameter types
+     *  3. if equal, case sensitive comparison of Parameter types
+     *  4. if equal, compare the FQNs of the entities
+     *  5. if equal, then compare the DocKinds ex: Package, Interface etc.
      * @return a comparator for index file use
      */
     public static Comparator<Doc> makeComparatorForIndexUse() {
@@ -816,29 +834,35 @@
              *         argument is less than, equal to, or greater than the second.
              */
             public int compare(Doc d1, Doc d2) {
-                int result = compareStrings(d1.name(), d2.name());
+                int result = compareNames(d1, d2);
                 if (result != 0) {
                     return result;
                 }
                 if (d1 instanceof ExecutableMemberDoc && d2 instanceof ExecutableMemberDoc) {
-                    result = compareExecutableMembers(
-                            (ExecutableMemberDoc) d1,
-                            (ExecutableMemberDoc) d2);
+                    Parameter[] param1 = ((ExecutableMemberDoc) d1).parameters();
+                    Parameter[] param2 = ((ExecutableMemberDoc) d2).parameters();
+                    result = compareParameters(false, param1, param2);
                     if (result != 0) {
                         return result;
                     }
+                    result = compareParameters(true, param1, param2);
                 }
-                if (d1 instanceof ProgramElementDoc && d2 instanceof ProgramElementDoc) {
-                    return compareProgramElementDoc((ProgramElementDoc)d1, (ProgramElementDoc)d2);
+                if (result != 0) {
+                    return result;
                 }
-                return 0;
+                result = compareFullyQualifiedNames(d1, d2);
+                if (result != 0) {
+                    return result;
+                }
+                return compareDocKinds(d1, d2);
             }
         };
     }
 
     /**
      * Comparator for ClassUse representations, this sorts on member names,
-     * fully qualified member names and then the parameter types if applicable.
+     * fully qualified member names and then the parameter types if applicable,
+     * and finally the Doc kinds ie. package, class, interface etc.
      * @return a comparator to sort classes and members for class use
      */
     public static Comparator<Doc> makeComparatorForClassUse() {
@@ -853,46 +877,88 @@
              *         argument is less than, equal to, or greater than the second.
              */
             public int compare(Doc d1, Doc d2) {
-                int result = compareStrings(d1.name(), d2.name());
+                int result = compareNames(d1, d2);
                 if (result != 0) {
                     return result;
                 }
-                if (d1 instanceof ProgramElementDoc && d2 instanceof ProgramElementDoc) {
-                    result = compareProgramElementDoc((ProgramElementDoc) d1, (ProgramElementDoc) d2);
+                result = compareFullyQualifiedNames(d1, d2);
+                if (result != 0) {
+                    return result;
+                }
+                if (d1 instanceof ExecutableMemberDoc && d2 instanceof ExecutableMemberDoc) {
+                    Parameter[] param1 = ((ExecutableMemberDoc) d1).parameters();
+                    Parameter[] param2 = ((ExecutableMemberDoc) d2).parameters();
+                    result = compareParameters(false, param1, param2);
                     if (result != 0) {
                         return result;
                     }
+                    return compareParameters(true, param1, param2);
                 }
-                if (d1 instanceof ExecutableMemberDoc && d2 instanceof ExecutableMemberDoc) {
-                    return compareExecutableMembers((ExecutableMemberDoc)d1, (ExecutableMemberDoc)d2);
-                }
-                return 0;
+                return compareDocKinds(d1, d2);
             }
         };
     }
 
+
     /**
      * A general purpose comparator to sort Doc entities, basically provides the building blocks
      * for creating specific comparators for an use-case.
      * @param <T> a Doc entity
      */
     static abstract class DocComparator<T extends Doc> implements Comparator<Doc> {
+        static enum DocKinds {
+           PACKAGE,
+           FIELD,
+           ENUM,
+           ANNOTATION,
+           INTERFACE,
+           CLASS,
+           CONSTRUCTOR,
+           METHOD
+        };
+        private DocKinds getValue(Doc d) {
+            if (d.isAnnotationType() || d.isAnnotationTypeElement()) {
+                return DocKinds.ANNOTATION;
+            } else if (d.isEnum() || d.isEnumConstant()) {
+                return DocKinds.ENUM;
+            } else if (d.isField()) {
+                return DocKinds.FIELD;
+            } else if (d.isInterface()) {
+                return DocKinds.INTERFACE;
+            } else if (d.isClass()) {
+                return DocKinds.CLASS;
+            } else if (d.isConstructor()) {
+                return DocKinds.CONSTRUCTOR;
+            } else if (d.isMethod()) {
+                return DocKinds.METHOD;
+            } else {
+                return DocKinds.PACKAGE;
+            }
+        }
         /**
-         * compares two parameter arrays by comparing each Type of the parameter in the array,
-         * as possible, if the matched strings are identical, and  have mismatched array lengths
-         * then compare the lengths.
+         * Compares two Doc entities' kinds, and these are ordered as defined in
+         * the DocKinds enumeration.
+         * @param d1 the first Doc object
+         * @param d2 the second Doc object
+         * @return a negative integer, zero, or a positive integer as the first
+         *         argument is less than, equal to, or greater than the second.
+         */
+        protected int compareDocKinds(Doc d1, Doc d2) {
+            return getValue(d1).compareTo(getValue(d2));
+        }
+        /**
+         * Compares two parameter arrays by comparing each Type of the parameter in the array,
+         * and as many as possible, otherwise compare their lengths.
+         * @param ignoreCase specifies case sensitive or insensitive comparison.
          * @param params1 the first parameter array.
          * @param params2 the first parameter array.
          * @return a negative integer, zero, or a positive integer as the first
          *         argument is less than, equal to, or greater than the second.
          */
-        protected int compareParameters(Parameter[] params1, Parameter[] params2) {
-            if (params1.length == 0 && params2.length == 0) {
-                return 0;
-            }
+        protected int compareParameters(boolean ignoreCase, Parameter[] params1, Parameter[] params2) {
             // try to compare as many as possible
             for (int i = 0; i < params1.length && i < params2.length; i++) {
-                int result = compareStrings(params1[i].typeName(), params2[i].typeName());
+                int result = compareStrings(ignoreCase, params1[i].typeName(), params2[i].typeName());
                 if (result != 0) {
                     return result;
                 }
@@ -901,41 +967,32 @@
         }
 
         /**
-         * Compares two MemberDocs, typically the name of a method,
-         * field or constructor.
-         * @param e1 the first MemberDoc.
-         * @param e2 the second MemberDoc.
+         * Compares two Doc entities typically the simple name of a method,
+         * field, constructor etc.
+         * @param d1 the first Doc.
+         * @param d2 the second Doc.
          * @return a negative integer, zero, or a positive integer as the first
          *         argument is less than, equal to, or greater than the second.
          */
-        protected int compareMembers(MemberDoc e1, MemberDoc e2) {
-            return compareStrings(e1.name(), e2.name());
-        }
-
-        /**
-         * Compares two ExecutableMemberDocs such as methods and constructors,
-         * as well as the parameters the entity might take.
-         * @param m1 the first ExecutableMemberDoc.
-         * @param m2 the second  ExecutableMemberDoc.
-         * @return a negative integer, zero, or a positive integer as the first
-         *         argument is less than, equal to, or greater than the second.
-         */
-        protected int compareExecutableMembers(ExecutableMemberDoc m1, ExecutableMemberDoc m2) {
-            int result = compareMembers(m1, m2);
-            if (result == 0)
-                result = compareParameters(m1.parameters(), m2.parameters());
-            return result;
+        protected int compareNames(Doc d1, Doc d2) {
+            return compareStrings(d1.name(), d2.name());
         }
 
         /**
          * Compares the fully qualified names of the entities
-         * @param p1 the first ProgramElementDoc.
-         * @param p2 the first ProgramElementDoc.
+         * @param d1 the first entity
+         * @param d2 the second entity
          * @return a negative integer, zero, or a positive integer as the first
          *         argument is less than, equal to, or greater than the second.
          */
-        protected int compareProgramElementDoc(ProgramElementDoc p1, ProgramElementDoc p2) {
-            return compareStrings(p1.qualifiedName(), p2.qualifiedName());
+        protected int compareFullyQualifiedNames(Doc d1, Doc d2) {
+            String name1 = (d1 instanceof ProgramElementDoc)
+                    ? ((ProgramElementDoc)d1).qualifiedName()
+                    : d1.name();
+            String name2 = (d2 instanceof ProgramElementDoc)
+                    ? ((ProgramElementDoc)d2).qualifiedName()
+                    : d2.name();
+            return compareStrings(name1, name2);
         }
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/javac/api/JavacTool.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/JavacTool.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -161,7 +161,7 @@
         }
     }
 
-    public static void processOptions(Context context,
+    private void processOptions(Context context,
                                        JavaFileManager fileManager,
                                        Iterable<String> options)
     {
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java	Fri Jul 11 05:59:08 2014 -0700
@@ -277,6 +277,11 @@
      */
     public static final long LAMBDA_METHOD = 1L<<49;
 
+    /**
+     * Flag to control recursion in TransTypes
+     */
+    public static final long TYPE_TRANSLATED = 1L<<50;
+
     /** Modifier masks.
      */
     public static final int
@@ -386,7 +391,8 @@
         BAD_OVERRIDE(Flags.BAD_OVERRIDE),
         SIGNATURE_POLYMORPHIC(Flags.SIGNATURE_POLYMORPHIC),
         THROWS(Flags.THROWS),
-        LAMBDA_METHOD(Flags.LAMBDA_METHOD);
+        LAMBDA_METHOD(Flags.LAMBDA_METHOD),
+        TYPE_TRANSLATED(Flags.TYPE_TRANSLATED);
 
         Flag(long flag) {
             this.value = flag;
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Source.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Source.java	Fri Jul 11 05:59:08 2014 -0700
@@ -237,6 +237,9 @@
     public boolean allowFunctionalInterfaceMostSpecific() {
         return compareTo(JDK1_8) >= 0;
     }
+    public boolean allowPostApplicabilityVarargsAccessCheck() {
+        return compareTo(JDK1_8) >= 0;
+    }
     public static SourceVersion toSourceVersion(Source source) {
         switch(source) {
         case JDK1_2:
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java	Fri Jul 11 05:59:08 2014 -0700
@@ -770,42 +770,41 @@
 
         @Override
         public List<Attribute.Compound> getAnnotationMirrors() {
-            return onlyTypeVariableAnnotations(owner.getRawTypeAttributes());
-        }
-
-        private List<Attribute.Compound> onlyTypeVariableAnnotations(
-                List<Attribute.TypeCompound> candidates) {
-            // Declaration annotations on TypeParameters are stored in type attributes
+            // Declaration annotations on type variables are stored in type attributes
+            // on the owner of the TypeVariableSymbol
+            List<Attribute.TypeCompound> candidates = owner.getRawTypeAttributes();
+            int index = owner.getTypeParameters().indexOf(this);
             List<Attribute.Compound> res = List.nil();
             for (Attribute.TypeCompound a : candidates) {
-                if (a.position.type == TargetType.CLASS_TYPE_PARAMETER ||
-                    a.position.type == TargetType.METHOD_TYPE_PARAMETER)
+                if (isCurrentSymbolsAnnotation(a, index))
                     res = res.prepend(a);
             }
 
-            return res = res.reverse();
+            return res.reverse();
         }
 
-
-
         // Helper to getAnnotation[s]
         @Override
         public <A extends Annotation> Attribute.Compound getAttribute(Class<A> annoType) {
-
             String name = annoType.getName();
 
             // Declaration annotations on type variables are stored in type attributes
             // on the owner of the TypeVariableSymbol
             List<Attribute.TypeCompound> candidates = owner.getRawTypeAttributes();
+            int index = owner.getTypeParameters().indexOf(this);
             for (Attribute.TypeCompound anno : candidates)
-                if (anno.position.type == TargetType.CLASS_TYPE_PARAMETER ||
-                        anno.position.type == TargetType.METHOD_TYPE_PARAMETER)
-                    if (name.contentEquals(anno.type.tsym.flatName()))
-                        return anno;
+                if (isCurrentSymbolsAnnotation(anno, index) &&
+                    name.contentEquals(anno.type.tsym.flatName()))
+                    return anno;
 
             return null;
         }
-
+            //where:
+            boolean isCurrentSymbolsAnnotation(Attribute.TypeCompound anno, int index) {
+                return (anno.position.type == TargetType.CLASS_TYPE_PARAMETER ||
+                        anno.position.type == TargetType.METHOD_TYPE_PARAMETER) &&
+                       anno.position.parameter_index == index;
+            }
 
 
         @Override
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Fri Jul 11 05:59:08 2014 -0700
@@ -92,6 +92,7 @@
     final JCDiagnostic.Factory diags;
     final Annotate annotate;
     final DeferredLintHandler deferredLintHandler;
+    final TypeEnvs typeEnvs;
 
     public static Attr instance(Context context) {
         Attr instance = context.get(attrKey);
@@ -120,6 +121,7 @@
         diags = JCDiagnostic.Factory.instance(context);
         annotate = Annotate.instance(context);
         deferredLintHandler = DeferredLintHandler.instance(context);
+        typeEnvs = TypeEnvs.instance(context);
 
         Options options = Options.instance(context);
 
@@ -429,7 +431,7 @@
     }
 
     public Type attribType(JCTree node, TypeSymbol sym) {
-        Env<AttrContext> env = enter.typeEnvs.get(sym);
+        Env<AttrContext> env = typeEnvs.get(sym);
         Env<AttrContext> localEnv = env.dup(node, env.info.dup());
         return attribTree(node, localEnv, unknownTypeInfo);
     }
@@ -4252,7 +4254,7 @@
             // ... and attribute the bound class
             c.flags_field |= UNATTRIBUTED;
             Env<AttrContext> cenv = enter.classEnv(cd, env);
-            enter.typeEnvs.put(c, cenv);
+            typeEnvs.put(c, cenv);
             attribClass(c);
             return owntype;
         }
@@ -4398,9 +4400,9 @@
             c.flags_field &= ~UNATTRIBUTED;
 
             // Get environment current at the point of class definition.
-            Env<AttrContext> env = enter.typeEnvs.get(c);
-
-            // The info.lint field in the envs stored in enter.typeEnvs is deliberately uninitialized,
+            Env<AttrContext> env = typeEnvs.get(c);
+
+            // The info.lint field in the envs stored in typeEnvs is deliberately uninitialized,
             // because the annotations were not available at the time the env was created. Therefore,
             // we look up the environment chain for the first enclosing environment for which the
             // lint value is set. Typically, this is the parent env, but might be further if there
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Fri Jul 11 05:59:08 2014 -0700
@@ -78,6 +78,7 @@
     final Flow flow;
     final Names names;
     final Annotate annotate;
+    final TypeEnvs typeEnvs;
 
     public static DeferredAttr instance(Context context) {
         DeferredAttr instance = context.get(deferredAttrKey);
@@ -102,6 +103,7 @@
         names = Names.instance(context);
         stuckTree = make.Ident(names.empty).setType(Type.stuckType);
         annotate = Annotate.instance(context);
+        typeEnvs = TypeEnvs.instance(context);
         emptyDeferredAttrContext =
             new DeferredAttrContext(AttrMode.CHECK, null, MethodResolutionPhase.BOX, infer.emptyContext, null, null) {
                 @Override
@@ -420,7 +422,7 @@
                 //it is possible that nested expressions inside argument expression
                 //are left unchecked - in such cases there's nothing to clean up.
                 if (csym == null) return;
-                enter.typeEnvs.remove(csym);
+                typeEnvs.remove(csym);
                 chk.compiled.remove(csym.flatname);
                 syms.classes.remove(csym.flatname);
                 super.visitClassDef(tree);
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Enter.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Enter.java	Fri Jul 11 05:59:08 2014 -0700
@@ -103,6 +103,7 @@
     Names names;
     JavaFileManager fileManager;
     PkgInfo pkginfoOpt;
+    TypeEnvs typeEnvs;
 
     private final Todo todo;
 
@@ -139,13 +140,9 @@
 
         Options options = Options.instance(context);
         pkginfoOpt = PkgInfo.get(options);
+        typeEnvs = TypeEnvs.instance(context);
     }
 
-    /** A hashtable mapping classes and packages to the environments current
-     *  at the points of their definitions.
-     */
-    Map<TypeSymbol,Env<AttrContext>> typeEnvs = new HashMap<>();
-
     /** Accessor for typeEnvs
      */
     public Env<AttrContext> getEnv(TypeSymbol sym) {
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java	Fri Jul 11 05:59:08 2014 -0700
@@ -79,6 +79,7 @@
     private final ConstFold cfolder;
     private final Target target;
     private final Source source;
+    private final TypeEnvs typeEnvs;
     private final boolean allowEnums;
     private final Name dollarAssertionsDisabled;
     private final Name classDollar;
@@ -99,6 +100,7 @@
         cfolder = ConstFold.instance(context);
         target = Target.instance(context);
         source = Source.instance(context);
+        typeEnvs = TypeEnvs.instance(context);
         allowEnums = source.allowEnums();
         dollarAssertionsDisabled = names.
             fromString(target.syntheticNameChar() + "assertionsDisabled");
@@ -2450,10 +2452,16 @@
     }
 
     public void visitClassDef(JCClassDecl tree) {
+        Env<AttrContext> prevEnv = attrEnv;
         ClassSymbol currentClassPrev = currentClass;
         MethodSymbol currentMethodSymPrev = currentMethodSym;
+
         currentClass = tree.sym;
         currentMethodSym = null;
+        attrEnv = typeEnvs.remove(currentClass);
+        if (attrEnv == null)
+            attrEnv = prevEnv;
+
         classdefs.put(currentClass, tree);
 
         proxies = proxies.dup(currentClass);
@@ -2525,6 +2533,7 @@
         // Append translated tree to `translated' queue.
         translated.append(tree);
 
+        attrEnv = prevEnv;
         currentClass = currentClassPrev;
         currentMethodSym = currentMethodSymPrev;
 
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Fri Jul 11 05:59:08 2014 -0700
@@ -82,6 +82,7 @@
     private final Target target;
     private final DeferredLintHandler deferredLintHandler;
     private final Lint lint;
+    private final TypeEnvs typeEnvs;
 
     public static MemberEnter instance(Context context) {
         MemberEnter instance = context.get(memberEnterKey);
@@ -107,6 +108,7 @@
         target = Target.instance(context);
         deferredLintHandler = DeferredLintHandler.instance(context);
         lint = Lint.instance(context);
+        typeEnvs = TypeEnvs.instance(context);
         allowTypeAnnos = source.allowTypeAnnotations();
     }
 
@@ -1000,7 +1002,7 @@
 
         ClassSymbol c = (ClassSymbol)sym;
         ClassType ct = (ClassType)c.type;
-        Env<AttrContext> env = enter.typeEnvs.get(c);
+        Env<AttrContext> env = typeEnvs.get(c);
         JCClassDecl tree = (JCClassDecl)env.tree;
         boolean wasFirst = isFirst;
         isFirst = false;
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Fri Jul 11 05:59:08 2014 -0700
@@ -95,6 +95,7 @@
     public final boolean varargsEnabled;
     public final boolean allowMethodHandles;
     public final boolean allowFunctionalInterfaceMostSpecific;
+    public final boolean checkVarargsAccessDuringResolution;
     private final boolean debugResolve;
     private final boolean compactMethodDiags;
     final EnumSet<VerboseResolutionMode> verboseResolutionMode;
@@ -136,6 +137,8 @@
         Target target = Target.instance(context);
         allowMethodHandles = target.hasMethodHandles();
         allowFunctionalInterfaceMostSpecific = source.allowFunctionalInterfaceMostSpecific();
+        checkVarargsAccessDuringResolution =
+                source.allowPostApplicabilityVarargsAccessCheck();
         polymorphicSignatureScope = new Scope(syms.noSymbol);
 
         inapplicableMethodException = new InapplicableMethodException(diags);
@@ -833,7 +836,10 @@
                                     Warner warn) {
             super.argumentsAcceptable(env, deferredAttrContext, argtypes, formals, warn);
             //should we expand formals?
-            if (deferredAttrContext.phase.isVarargsRequired()) {
+            if ((!checkVarargsAccessDuringResolution ||
+                (checkVarargsAccessDuringResolution &&
+                 deferredAttrContext.mode == AttrMode.CHECK)) &&
+                deferredAttrContext.phase.isVarargsRequired()) {
                 //check varargs element type accessibility
                 varargsAccessible(env, types.elemtype(formals.last()),
                         deferredAttrContext.inferenceContext);
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Fri Jul 11 05:59:08 2014 -0700
@@ -966,10 +966,11 @@
             translateClass((ClassSymbol)st.tsym);
         }
 
-        Env<AttrContext> myEnv = enter.typeEnvs.remove(c);
-        if (myEnv == null) {
+        Env<AttrContext> myEnv = enter.getEnv(c);
+        if (myEnv == null || (c.flags_field & TYPE_TRANSLATED) != 0) {
             return;
         }
+        c.flags_field |= TYPE_TRANSLATED;
 
         /*  The two assertions below are set for early detection of any attempt
          *  to translate a class that:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/TypeEnvs.java	Fri Jul 11 05:59:08 2014 -0700
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.javac.comp;
+
+import java.util.Collection;
+import java.util.HashMap;
+import com.sun.tools.javac.code.Symbol.TypeSymbol;
+import com.sun.tools.javac.util.Context;
+
+/** This class contains the type environments used by Enter, MemberEnter,
+ *  Attr, DeferredAttr, and Lower.
+ *
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
+ *  This code and its internal interfaces are subject to change or
+ *  deletion without notice.</b>
+ */
+class TypeEnvs {
+    private static final long serialVersionUID = 571524752489954631L;
+
+    protected static final Context.Key<TypeEnvs> typeEnvsKey = new Context.Key<>();
+    public static TypeEnvs instance(Context context) {
+        TypeEnvs instance = context.get(typeEnvsKey);
+        if (instance == null)
+            instance = new TypeEnvs(context);
+        return instance;
+    }
+
+    private HashMap<TypeSymbol,Env<AttrContext>> map;
+    protected TypeEnvs(Context context) {
+        map = new HashMap<>();
+        context.put(typeEnvsKey, this);
+    }
+
+    Env<AttrContext> get(TypeSymbol sym) { return map.get(sym); }
+    Env<AttrContext> put(TypeSymbol sym, Env<AttrContext> env) { return map.put(sym, env); }
+    Env<AttrContext> remove(TypeSymbol sym) { return map.remove(sym); }
+    Collection<Env<AttrContext>> values() { return map.values(); }
+    void clear() { map.clear(); }
+}
--- a/langtools/src/share/classes/com/sun/tools/javac/main/Main.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/Main.java	Fri Jul 11 05:59:08 2014 -0700
@@ -384,7 +384,7 @@
     /** Programmatic interface for main function.
      * @param args    The command line parameters.
      */
-    public Result compile(String[] args,
+    protected Result compile(String[] args,
                        Context context,
                        List<JavaFileObject> fileObjects,
                        Iterable<? extends Processor> processors)
--- a/langtools/src/share/classes/com/sun/tools/javac/util/JCDiagnostic.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/JCDiagnostic.java	Fri Jul 11 05:59:08 2014 -0700
@@ -354,13 +354,41 @@
     private final DiagnosticType type;
     private final DiagnosticSource source;
     private final DiagnosticPosition position;
-    private final int line;
-    private final int column;
     private final String key;
     protected final Object[] args;
     private final Set<DiagnosticFlag> flags;
     private final LintCategory lintCategory;
 
+    /** source line position (set lazily) */
+    private SourcePosition sourcePosition;
+
+    /**
+     * This class is used to defer the line/column position fetch logic after diagnostic construction.
+     */
+    class SourcePosition {
+
+        private final int line;
+        private final int column;
+
+        SourcePosition() {
+            int n = (position == null ? Position.NOPOS : position.getPreferredPosition());
+            if (n == Position.NOPOS || source == null)
+                line = column = -1;
+            else {
+                line = source.getLineNumber(n);
+                column = source.getColumnNumber(n, true);
+            }
+        }
+
+        public int getLineNumber() {
+            return line;
+        }
+
+        public int getColumnNumber() {
+            return column;
+        }
+    }
+
     /**
      * Create a diagnostic object.
      * @param formatter the formatter to use for the diagnostic
@@ -390,14 +418,6 @@
         this.position = pos;
         this.key = key;
         this.args = args;
-
-        int n = (pos == null ? Position.NOPOS : pos.getPreferredPosition());
-        if (n == Position.NOPOS || source == null)
-            line = column = -1;
-        else {
-            line = source.getLineNumber(n);
-            column = source.getColumnNumber(n, true);
-        }
     }
 
     /**
@@ -494,7 +514,10 @@
      * @return  the line number within the source referred to by this diagnostic
      */
     public long getLineNumber() {
-        return line;
+        if (sourcePosition == null) {
+            sourcePosition = new SourcePosition();
+        }
+        return sourcePosition.getLineNumber();
     }
 
     /**
@@ -502,7 +525,10 @@
      * @return  the column number within the line of source referred to by this diagnostic
      */
     public long getColumnNumber() {
-        return column;
+        if (sourcePosition == null) {
+            sourcePosition = new SourcePosition();
+        }
+        return sourcePosition.getColumnNumber();
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/sjavac/comp/Dependencies.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/src/share/classes/com/sun/tools/sjavac/comp/Dependencies.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -72,10 +72,6 @@
     private Dependencies(Context context) {
         context.put(dependenciesKey, this);
         log = Log.instance(context);
-    }
-
-    public void reset()
-    {
         deps = new HashMap<>();
         explicitPackages = new HashSet<>();
         publicApiPerClass = new HashMap<>();
--- a/langtools/src/share/classes/com/sun/tools/sjavac/server/CompilerThread.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/src/share/classes/com/sun/tools/sjavac/server/CompilerThread.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * 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,23 +39,26 @@
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
-import java.util.Map;
 import java.util.concurrent.Future;
+
+import javax.tools.JavaCompiler.CompilationTask;
 import javax.tools.JavaFileManager;
 import javax.tools.JavaFileObject;
 import javax.tools.StandardJavaFileManager;
 
+import com.sun.tools.javac.api.JavacTaskImpl;
+import com.sun.tools.javac.util.BaseFileManager;
 import com.sun.tools.javac.util.Context;
 import com.sun.tools.javac.util.ListBuffer;
 import com.sun.tools.javac.util.Log;
-import com.sun.tools.javac.util.BaseFileManager;
 import com.sun.tools.javac.util.StringUtils;
 import com.sun.tools.sjavac.comp.AttrWithDeps;
 import com.sun.tools.sjavac.comp.Dependencies;
 import com.sun.tools.sjavac.comp.JavaCompilerWithDeps;
+import com.sun.tools.sjavac.comp.ResolveWithDeps;
 import com.sun.tools.sjavac.comp.SmartFileManager;
-import com.sun.tools.sjavac.comp.ResolveWithDeps;
 
 /**
  * The compiler thread maintains a JavaCompiler instance and
@@ -78,7 +81,6 @@
     // The necessary classes to do a compilation.
     private com.sun.tools.javac.api.JavacTool compiler;
     private StandardJavaFileManager fileManager;
-    private BaseFileManager fileManagerBase;
     private SmartFileManager smartFileManager;
     private Context context;
 
@@ -127,10 +129,8 @@
         inUse = true;
         compiler = com.sun.tools.javac.api.JavacTool.create();
         fileManager = compiler.getStandardFileManager(null, null, null);
-        fileManagerBase = (BaseFileManager)fileManager;
         smartFileManager = new SmartFileManager(fileManager);
         context = new Context();
-        context.put(JavaFileManager.class, smartFileManager);
         ResolveWithDeps.preRegister(context);
         AttrWithDeps.preRegister(context);
         JavaCompilerWithDeps.preRegister(context, this);
@@ -145,7 +145,6 @@
         inUse = false;
         compiler = null;
         fileManager = null;
-        fileManagerBase = null;
         smartFileManager = null;
         context = null;
         subTasks = null;
@@ -315,24 +314,13 @@
             com.sun.tools.javac.main.Main.Result rc = com.sun.tools.javac.main.Main.Result.OK;
             try {
                 if (compilationUnits.size() > 0) {
-                    // Bind the new logger to the existing context.
-                    context.put(Log.outKey, stderr);
-                    Log.instance(context).setWriter(Log.WriterKind.NOTICE, stdout);
-                    Log.instance(context).setWriter(Log.WriterKind.WARNING, stderr);
-                    Log.instance(context).setWriter(Log.WriterKind.ERROR, stderr);
-                    // Process the options.
-                    com.sun.tools.javac.api.JavacTool.processOptions(context, smartFileManager, the_options);
-                    fileManagerBase.setContext(context);
                     smartFileManager.setVisibleSources(visibleSources);
                     smartFileManager.cleanArtifacts();
                     smartFileManager.setLog(stdout);
-                    Dependencies.instance(context).reset();
-
-                    com.sun.tools.javac.main.Main ccompiler = new com.sun.tools.javac.main.Main("javacTask", stderr);
-                    String[] aa = the_options.toArray(new String[0]);
 
                     // Do the compilation!
-                    rc = ccompiler.compile(aa, context, compilationUnits.toList(), null);
+                    CompilationTask task = compiler.getTask(stderr, smartFileManager, null, the_options, null, compilationUnits, context);
+                    rc = ((JavacTaskImpl) task).doCall();
 
                     while (numActiveSubTasks()>0) {
                         try { Thread.sleep(1000); } catch (InterruptedException e) { }
--- a/langtools/test/com/sun/javadoc/lib/JavadocTester.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/test/com/sun/javadoc/lib/JavadocTester.java	Fri Jul 11 05:59:08 2014 -0700
@@ -451,8 +451,12 @@
         for (String s : strings) {
             int currentIndex = fileString.indexOf(s);
             checking(s + " at index " + currentIndex);
-            if (currentIndex >= prevIndex) {
-                passed(s + "is in the correct order");
+            if (currentIndex == -1) {
+                failed(s + " not found.");
+                continue;
+            }
+            if (currentIndex > prevIndex) {
+                passed(s + " is in the correct order");
             } else {
                 failed(s + " is in the wrong order.");
             }
--- a/langtools/test/com/sun/javadoc/testOrdering/TestOrdering.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/test/com/sun/javadoc/testOrdering/TestOrdering.java	Fri Jul 11 05:59:08 2014 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8039410 8042601
+ * @bug 8039410 8042601 8042829
  * @summary test to determine if members are ordered correctly
  * @author ksrini
  * @library ../lib/
@@ -31,6 +31,16 @@
  * @run main TestOrdering
  */
 
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import static java.nio.file.StandardOpenOption.*;
+
 public class TestOrdering extends JavadocTester {
 
     public static void main(String[] args) throws Exception {
@@ -39,7 +49,7 @@
     }
 
     @Test
-    void testUnnamedPackages() {
+    void testUnnamedPackagesForClassUse() {
         javadoc("-d", "out",
                 "-sourcepath", testSrc,
                 "-use",
@@ -49,16 +59,94 @@
     }
 
     @Test
-    void testNamedPackages() {
+    void testNamedPackagesForClassUse() {
         javadoc("-d", "out-1",
                 "-sourcepath", testSrc,
                 "-use",
                 "pkg1");
         checkExit(Exit.OK);
         checkClassUseOrdering("pkg1/class-use/UsedClass.html");
-        checkIndexPathOrdering("index-all.html");
     }
 
+    enum ListOrder { NONE, REVERSE, SHUFFLE };
+    /*
+     * By default we do not shuffle the input list, in order to keep the list deterministic,
+     * and the test predictable. However, we can turn on the stress mode, by setting the following
+     * property if required.
+     */
+    static final ListOrder STRESS_MODE = Boolean.getBoolean("TestOrder.STRESS")
+            ? ListOrder.SHUFFLE
+            : ListOrder.REVERSE;
+
+    /*
+     * Controls the number of sibling packages,  pkg0, pkg1, pkg2, .....
+     */
+    static final int MAX_PACKAGES = 4;
+
+    /*
+     * Controls the number of children packages, pkg0, pkg0.pkg, pkg0.pkg.pkg, .....
+     * Note: having too long a depth (> 256 chars on Windows), will likely lead to
+     * cause problems with automated build and test systems.
+     */
+    static final int MAX_SUBPACKAGES_DEPTH = 4;
+    @Test
+    void testIndexOrdering() throws IOException {
+        final String clsname = "Add";
+        List<String> cmdArgs = new ArrayList();
+        cmdArgs.add("-d");
+        cmdArgs.add("out-2");
+        cmdArgs.add("-sourcepath");
+        cmdArgs.add("src");
+        cmdArgs.add("-package");
+        System.out.println("STRESS_MODE: " + STRESS_MODE);
+        emitFile(null, clsname, STRESS_MODE);
+        for (int width = 0 ; width < MAX_PACKAGES ; width++) {
+            String wpkgname = "add" + width;
+            String dpkgname = wpkgname;
+            emitFile(wpkgname, clsname, ListOrder.NONE); // list as-is
+            cmdArgs.add(wpkgname);
+            for (int depth = 1 ; depth < MAX_SUBPACKAGES_DEPTH ; depth++) {
+                dpkgname = dpkgname + ".add";
+                emitFile(dpkgname, clsname, STRESS_MODE);
+                cmdArgs.add(dpkgname);
+            }
+        }
+        File srcDir = new File(new File("."), "src");
+        cmdArgs.add(new File(srcDir, clsname + ".java").getPath());
+        javadoc(cmdArgs.toArray(new String[cmdArgs.size()]));
+        checkExit(Exit.OK);
+        checkOrder("index-all.html", composeTestVectors());
+    }
+    String[] composeTestVectors() {
+        List<String> testList = new ArrayList<>();
+
+        for (String x : expectedMethodOrdering) {
+            testList.add(x);
+            for (int i = 0; i < MAX_PACKAGES; i++) {
+                String wpkg = "add" + i;
+                testList.add(wpkg + "/" + x);
+                String dpkg = wpkg;
+                for (int j = 1; j < MAX_SUBPACKAGES_DEPTH; j++) {
+                    dpkg = dpkg + "/" + "add";
+                    testList.add(dpkg + "/" + x);
+                }
+            }
+        }
+        for (String x : expectedEnumOrdering) {
+            testList.add(x.replace("REPLACE_ME", "&lt;Unnamed&gt;"));
+            for (int i = 0; i < MAX_PACKAGES; i++) {
+                String wpkg = "add" + i;
+                testList.add(wpkg + "/" + x.replace("REPLACE_ME", wpkg));
+                String dpkg = wpkg;
+                for (int j = 1; j < MAX_SUBPACKAGES_DEPTH; j++) {
+                    dpkg = dpkg + "/" + "add";
+                    testList.add(dpkg + "/" + x.replace("REPLACE_ME", pathToPackage(dpkg)));
+                }
+            }
+        }
+        testList.addAll(Arrays.asList(expectedFieldOrdering));
+        return testList.toArray(new String[testList.size()]);
+    }
     void checkExecutableMemberOrdering(String usePage) {
         String contents = readFile(usePage);
         // check constructors
@@ -109,29 +197,125 @@
         }
     }
 
-    void checkIndexPathOrdering(String indexPage) {
-        checkOrder(indexPage,
-            "pkg1/UsedClass.html#add--",
-            "pkg1/ZZTop.html#add--",
-            "pkg1/UsedClass.html#add-double-",
-            "pkg1/UsedClass.html#add-java.lang.Double-",
-            "pkg1/ZZTop.html#add-double-",
-            "pkg1/ZZTop.html#add-java.lang.Double-",
-            "pkg1/UsedClass.html#add-double-byte-",
-            "pkg1/ZZTop.html#add-double-byte-",
-            "pkg1/UsedClass.html#add-double-double-",
-            "pkg1/UsedClass.html#add-double-java.lang.Double-",
-            "pkg1/ZZTop.html#add-double-double-",
-            "pkg1/ZZTop.html#add-double-java.lang.Double-",
-            "pkg1/UsedClass.html#add-float-",
-            "pkg1/ZZTop.html#add-float-",
-            "pkg1/UsedClass.html#add-float-int-",
-            "pkg1/ZZTop.html#add-float-int-",
-            "pkg1/UsedClass.html#add-int-",
-            "pkg1/ZZTop.html#add-int-",
-            "pkg1/UsedClass.html#add-int-float-",
-            "pkg1/ZZTop.html#add-int-float-",
-            "pkg1/UsedClass.html#add-java.lang.Integer-",
-            "pkg1/ZZTop.html#add-java.lang.Integer-");
+    static String[] contents = {
+        "public add ADDADD;",
+        "public add AddAdd;",
+        "public add addadd;",
+        "public enum add {add, ADD, addd, ADDD};",
+        "public enum ADD {ADD, add, addd, ADDD};",
+        "public void   add(){}",
+        "public void   add(double d){}",
+        "public void   add(int i, float f){}",
+        "public void   add(float f, int i){}",
+        "public void   add(double d, byte b){}",
+        "public Double add(Double d) {return (double) 22/7;}",
+        "public double add(double d1, double d2) {return d1 + d2;}",
+        "public double add(double d1, Double  d2) {return d1 + d2;}",
+        "public Float  add(float f) {return (float) 22/7;}",
+        "public void   add(int i){}",
+        "public int    add(Integer i) {return 0;}"
+    };
+
+    void emitFile(String pkgname, String clsname, ListOrder order) throws IOException {
+        File srcDir = new File("src");
+        File outDir = pkgname == null
+            ? srcDir
+            : new File(srcDir, pkgname.replace(".", File.separator));
+        File outFile = new File(outDir, clsname + ".java");
+        outDir.mkdirs();
+        List<String> scratch = new ArrayList<>(Arrays.asList(contents));
+        switch (order) {
+            case SHUFFLE:
+                Collections.shuffle(scratch);
+                break;
+            case REVERSE:
+                Collections.reverse(scratch);
+                break;
+            default:
+                // leave list as-is
+        }
+        // insert the header
+        scratch.add(0, "public class " + clsname + " {");
+        if (pkgname != null) {
+            scratch.add(0, "package " + pkgname + ";");
+        }
+        // append the footer
+        scratch.add("}");
+        Files.write(outFile.toPath(), scratch, CREATE, TRUNCATE_EXISTING);
+    }
+
+    String pathToPackage(String in) {
+        return in.replace("/", ".");
     }
+
+    final String expectedMethodOrdering[] = {
+        "Add.html#add--",
+        "Add.html#add-double-",
+        "Add.html#add-java.lang.Double-",
+        "Add.html#add-double-byte-",
+        "Add.html#add-double-double-",
+        "Add.html#add-double-java.lang.Double-",
+        "Add.html#add-float-",
+        "Add.html#add-float-int-",
+        "Add.html#add-int-",
+        "Add.html#add-int-float-",
+        "Add.html#add-java.lang.Integer-"
+    };
+    final String expectedEnumOrdering[] = {
+        "Add.add.html\" title=\"enum in REPLACE_ME\"",
+        "Add.ADD.html\" title=\"enum in REPLACE_ME\""
+    };
+    final String expectedFieldOrdering[] = {
+        "Add.html#addadd\"",
+        "add0/add/add/add/Add.html#addadd\"",
+        "add0/add/add/Add.html#addadd\"",
+        "add0/add/Add.html#addadd\"",
+        "add0/Add.html#addadd\"",
+        "add1/add/add/add/Add.html#addadd\"",
+        "add1/add/add/Add.html#addadd\"",
+        "add1/add/Add.html#addadd\"",
+        "add1/Add.html#addadd\"",
+        "add2/add/add/add/Add.html#addadd\"",
+        "add2/add/add/Add.html#addadd\"",
+        "add2/add/Add.html#addadd\"",
+        "add2/Add.html#addadd\"",
+        "add3/add/add/add/Add.html#addadd\"",
+        "add3/add/add/Add.html#addadd\"",
+        "add3/add/Add.html#addadd\"",
+        "add3/Add.html#addadd\"",
+        "Add.html#AddAdd\"",
+        "add0/add/add/add/Add.html#AddAdd\"",
+        "add0/add/add/Add.html#AddAdd\"",
+        "add0/add/Add.html#AddAdd\"",
+        "add0/Add.html#AddAdd\"",
+        "add1/add/add/add/Add.html#AddAdd\"",
+        "add1/add/add/Add.html#AddAdd\"",
+        "add1/add/Add.html#AddAdd\"",
+        "add1/Add.html#AddAdd\"",
+        "add2/add/add/add/Add.html#AddAdd\"",
+        "add2/add/add/Add.html#AddAdd\"",
+        "add2/add/Add.html#AddAdd\"",
+        "add2/Add.html#AddAdd\"",
+        "add3/add/add/add/Add.html#AddAdd\"",
+        "add3/add/add/Add.html#AddAdd\"",
+        "add3/add/Add.html#AddAdd\"",
+        "add3/Add.html#AddAdd\"",
+        "Add.html#ADDADD\"",
+        "add0/add/add/add/Add.html#ADDADD\"",
+        "add0/add/add/Add.html#ADDADD\"",
+        "add0/add/Add.html#ADDADD\"",
+        "add0/Add.html#ADDADD\"",
+        "add1/add/add/add/Add.html#ADDADD\"",
+        "add1/add/add/Add.html#ADDADD\"",
+        "add1/add/Add.html#ADDADD\"",
+        "add1/Add.html#ADDADD\"",
+        "add2/add/add/add/Add.html#ADDADD\"",
+        "add2/add/add/Add.html#ADDADD\"",
+        "add2/add/Add.html#ADDADD\"",
+        "add2/Add.html#ADDADD\"",
+        "add3/add/add/add/Add.html#ADDADD\"",
+        "add3/add/add/Add.html#ADDADD\"",
+        "add3/add/Add.html#ADDADD\"",
+        "add3/Add.html#ADDADD\""
+    };
 }
--- a/langtools/test/com/sun/javadoc/testOrdering/pkg1/UsedClass.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/test/com/sun/javadoc/testOrdering/pkg1/UsedClass.java	Fri Jul 11 05:59:08 2014 -0700
@@ -23,72 +23,6 @@
 
 package pkg1;
 /**
- * For index and class-use testing
+ * For class-use testing
  */
-public class UsedClass {
-
-    /**
-     * just an empty param method.
-     */
-    public void   add(){}
-
-    /**
-     * @param d param
-     */
-    public void   add(double d){}
-
-    /**
-     * @param i param
-     * @param f param
-     */
-    public void   add(int i, float f){}
-
-    /**
-     * @param f param
-     * @param i param
-     */
-    public void   add(float f, int i){}
-
-    /**
-     * @param d param
-     * @param b param
-     */
-    public void   add(double d, byte b){}
-
-    /**
-     * @param d param
-     * @return Double
-     */
-    public Double add(Double d) {return (double) 22/7;}
-
-    /**
-     * @param d1 param
-     * @param d2 param
-     * @return double
-     */
-    public double add(double d1, double d2) {return d1 + d2;}
-
-    /**
-     * @param d1 param
-     * @param d2 param
-     * @return double
-     */
-    public double add(double d1, Double  d2) {return d1 + d2;}
-
-    /**
-     * @param f param
-     * @return Float
-     */
-    public Float  add(float f) {return (float) 22/7;}
-
-    /**
-     * @param i param
-     */
-    public void   add(int i){}
-
-    /**
-     * @param i param
-     * @return double
-     */
-    public int    add(Integer i) {return 0;}
-}
+public class UsedClass {}
--- a/langtools/test/com/sun/javadoc/testOrdering/pkg1/ZZTop.java	Wed Jul 09 16:44:30 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package pkg1;
-/**
- * For index testing only
- */
-public class ZZTop {
-
-    /**
-     * just an empty param method.
-     */
-    public void   add(){}
-
-    /**
-     * @param d param
-     */
-    public void   add(double d){}
-
-    /**
-     * @param i param
-     * @param f param
-     */
-    public void   add(int i, float f){}
-
-    /**
-     * @param f param
-     * @param i param
-     */
-    public void   add(float f, int i){}
-
-    /**
-     * @param d param
-     * @param b param
-     */
-    public void   add(double d, byte b){}
-
-    /**
-     * @param d param
-     * @return Double
-     */
-    public Double add(Double d) {return (double) 22/7;}
-
-    /**
-     * @param d1 param
-     * @param d2 param
-     * @return double
-     */
-    public double add(double d1, double d2) {return d1 + d2;}
-
-    /**
-     * @param d1 param
-     * @param d2 param
-     * @return double
-     */
-    public double add(double d1, Double  d2) {return d1 + d2;}
-
-    /**
-     * @param f param
-     * @return Float
-     */
-    public Float  add(float f) {return (float) 22/7;}
-
-    /**
-     * @param i param
-     */
-    public void   add(int i){}
-
-    /**
-     * @param i param
-     * @return double
-     */
-    public int    add(Integer i) {return 0;}
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T8038975/AccessTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * 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 8038975
+ * @summary Access control in enhanced for
+ * @compile AccessTest.java
+ */
+
+import a.*;
+public class AccessTest {
+    private static class Impl extends B {
+        public void method(Inner inner) {
+            for (A a : inner)
+                System.out.println(a);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T8038975/a/A.java	Fri Jul 11 05:59:08 2014 -0700
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package a;
+public class A { }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T8038975/a/B.java	Fri Jul 11 05:59:08 2014 -0700
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package a;
+public class B {
+    protected abstract class Inner implements Iterable<A> { }
+}
--- a/langtools/test/tools/javac/options/xprefer/XPreferTest.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/test/tools/javac/options/xprefer/XPreferTest.java	Fri Jul 11 05:59:08 2014 -0700
@@ -26,7 +26,6 @@
  * @summary Tests which path is used to represent an implicit type given
  * various xprefer arguments and multiple .class / .java files involved.
  * @bug 8028196
- * @ignore 8042839 XPreferTest fails on Windows
  */
 
 import java.io.File;
@@ -42,6 +41,7 @@
 import java.util.ListIterator;
 import java.util.NoSuchElementException;
 import java.util.Scanner;
+import java.util.regex.Pattern;
 
 import javax.tools.JavaCompiler;
 import javax.tools.JavaCompiler.CompilationTask;
@@ -180,10 +180,16 @@
             Scanner s = new Scanner(compilerOutput);
             while (s.hasNextLine()) {
                 String line = s.nextLine();
-                if (line.matches("\\[loading .*\\]"))
-                    for (Dir dir : Dir.values())
-                        if (line.contains(dir.file.getName() + "/" + classId))
+                if (line.matches("\\[loading .*\\]")) {
+                    for (Dir dir : Dir.values()) {
+                        // On Windows all paths are printed with '/' except
+                        // paths inside zip-files, which are printed with '\'.
+                        // For this reason we accept both '/' and '\' below.
+                        String regex = dir.file.getName() + "[\\\\/]" + classId;
+                        if (Pattern.compile(regex).matcher(line).find())
                             return dir;
+                    }
+                }
             }
             return null;
         }
--- a/langtools/test/tools/javac/processing/model/element/TestTypeParameterAnnotations.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/test/tools/javac/processing/model/element/TestTypeParameterAnnotations.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8011027
+ * @bug 8011027 8046916
  * @library /tools/javac/lib
  * @build JavacTestingAbstractProcessor TestTypeParameterAnnotations
  * @compile -processor TestTypeParameterAnnotations -proc:only TestTypeParameterAnnotations.java
@@ -33,10 +33,16 @@
 import java.lang.annotation.*;
 import javax.annotation.processing.*;
 import javax.lang.model.element.*;
-import javax.lang.model.util.*;
 import javax.tools.*;
 
-public class TestTypeParameterAnnotations<@Foo @Bar @Baz T> extends JavacTestingAbstractProcessor {
+@ExpectedTypeParameterAnnotations(typeParameterName="T1",
+                                  annotations={"Foo1", "Bar1", "Baz1"})
+@ExpectedTypeParameterAnnotations(typeParameterName="T2", annotations={})
+@ExpectedTypeParameterAnnotations(typeParameterName="T3",
+                                  annotations={"Foo2", "Bar2", "Baz2"})
+@ExpectedTypeParameterAnnotations(typeParameterName="T4", annotations={})
+public class TestTypeParameterAnnotations<@Foo1 @Bar1 @Baz1 T1, T2, @Foo2 @Bar2 @Baz2 T3, T4> extends
+        JavacTestingAbstractProcessor {
     int round = 0;
 
     public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
@@ -74,82 +80,69 @@
     int check(Element e, List<? extends TypeParameterElement> typarams) {
         if (typarams.isEmpty())
             return 0;
-        if (typarams.size() != 1)
-            return 0;
 
-        for (TypeParameterElement tpe: typarams) {
-            boolean b1 = checkAnnotationMirrors(tpe, tpe.getAnnotationMirrors());
-            boolean b2 = checkAnnotationMirrors(tpe, elements.getAllAnnotationMirrors(tpe));
-            boolean b3 = checkGetAnnotation(tpe);
-            boolean b4 = checkGetAnnotations(tpe);
-            return b1 && b2 && b3 && b4 ? 1 : 0;
-        }
-        return 0;
-    }
-
-    boolean checkAnnotationMirrors(TypeParameterElement tpe, List<? extends AnnotationMirror> l) {
-        if (l.size() != 3) {
-            error("To few annotations, got " + l.size() +
-                    ", should be 3", tpe);
-            return false;
+        for (TypeParameterElement tpe : typarams) {
+            ExpectedTypeParameterAnnotations expected = null;
+            for (ExpectedTypeParameterAnnotations a : e.getAnnotationsByType(ExpectedTypeParameterAnnotations.class)) {
+                if (tpe.getSimpleName().contentEquals(a.typeParameterName())) {
+                    expected = a;
+                    break;
+                }
+            }
+            if (expected == null) {
+                throw new IllegalStateException("Does not have expected values annotation.");
+            }
+            checkAnnotationMirrors(tpe, tpe.getAnnotationMirrors(), expected);
+            checkAnnotationMirrors(tpe, elements.getAllAnnotationMirrors(tpe), expected);
+            checkGetAnnotation(tpe, expected);
+            checkGetAnnotations(tpe, expected);
         }
 
-        AnnotationMirror m = l.get(0);
-        if (!m.getAnnotationType().asElement().equals(elements.getTypeElement("Foo"))) {
-            error("Wrong type of annotation, was expecting @Foo", m.getAnnotationType().asElement());
-            return false;
-        }
-        m = l.get(1);
-        if (!m.getAnnotationType().asElement().equals(elements.getTypeElement("Bar"))) {
-            error("Wrong type of annotation, was expecting @Bar", m.getAnnotationType().asElement());
-            return false;
-        }
-        m = l.get(2);
-        if (!m.getAnnotationType().asElement().equals(elements.getTypeElement("Baz"))) {
-            error("Wrong type of annotation, was expecting @Baz", m.getAnnotationType().asElement());
-            return false;
-        }
-        return true;
+        return typarams.size();
     }
 
-    boolean checkGetAnnotation(TypeParameterElement tpe) {
-        Foo f = tpe.getAnnotation(Foo.class);
-        if (f == null)
-            error("Expecting @Foo to be present in getAnnotation()", tpe);
+    void checkAnnotationMirrors(TypeParameterElement tpe, List<? extends AnnotationMirror> l, ExpectedTypeParameterAnnotations expected) {
+        String[] expectedAnnotations = expected.annotations();
 
-        Bar b = tpe.getAnnotation(Bar.class);
-        if (b == null)
-            error("Expecting @Bar to be present in getAnnotation()", tpe);
+        if (l.size() != expectedAnnotations.length) {
+            error("Incorrect number of annotations, got " + l.size() +
+                    ", should be " + expectedAnnotations.length, tpe);
+            return ;
+        }
 
-        Baz z = tpe.getAnnotation(Baz.class);
-        if (z == null)
-            error("Expecting @Baz to be present in getAnnotation()", tpe);
-
-        return f != null &&
-            b != null &&
-            z != null;
+        for (int i = 0; i < expectedAnnotations.length; i++) {
+            AnnotationMirror m = l.get(i);
+            if (!m.getAnnotationType().asElement().equals(elements.getTypeElement(expectedAnnotations[i]))) {
+                error("Wrong type of annotation, was expecting @Foo", m.getAnnotationType().asElement());
+                return ;
+            }
+        }
     }
 
-    boolean checkGetAnnotations(TypeParameterElement tpe) {
-        Foo[] f = tpe.getAnnotationsByType(Foo.class);
-        if (f.length != 1) {
-            error("Expecting 1 @Foo to be present in getAnnotationsByType()", tpe);
-            return false;
-        }
+    void checkGetAnnotation(TypeParameterElement tpe, ExpectedTypeParameterAnnotations expected) {
+        List<String> expectedAnnotations = Arrays.asList(expected.annotations());
+
+        for (Class<? extends Annotation> c : ALL_ANNOTATIONS) {
+            Object a = tpe.getAnnotation(c);
 
-        Bar[] b = tpe.getAnnotationsByType(Bar.class);
-        if (b.length != 1) {
-            error("Expecting 1 @Bar to be present in getAnnotationsByType()", tpe);
-            return false;
+            if (a != null ^ expectedAnnotations.indexOf(c.getName()) != (-1)) {
+                error("Unexpected behavior for " + c.getName(), tpe);
+                return ;
+            }
         }
+    }
 
-        Baz[] z = tpe.getAnnotationsByType(Baz.class);
-        if (z.length != 1) {
-            error("Expecting 1 @Baz to be present in getAnnotationsByType()", tpe);
-            return false;
+    void checkGetAnnotations(TypeParameterElement tpe, ExpectedTypeParameterAnnotations expected) {
+        List<String> expectedAnnotations = Arrays.asList(expected.annotations());
+
+        for (Class<? extends Annotation> c : ALL_ANNOTATIONS) {
+            Object[] a = tpe.getAnnotationsByType(c);
+
+            if (a.length > 0 ^ expectedAnnotations.indexOf(c.getName()) != (-1)) {
+                error("Unexpected behavior for " + c.getName(), tpe);
+                return ;
+            }
         }
-
-        return true;
     }
 
     void note(String msg) {
@@ -168,23 +161,71 @@
         messager.printMessage(Diagnostic.Kind.ERROR, msg);
     }
 
+    Class<? extends Annotation>[] ALL_ANNOTATIONS = new Class[] {
+        Foo1.class, Bar1.class, Baz1.class,
+        Foo2.class, Bar2.class, Baz2.class,
+    };
+
     // additional generic elements to test
-    <@Foo @Bar @Baz X> X m(X x) { return x; }
+    @ExpectedTypeParameterAnnotations(typeParameterName="W",
+                                      annotations={"Foo1", "Bar1", "Baz1"})
+    @ExpectedTypeParameterAnnotations(typeParameterName="X", annotations={})
+    @ExpectedTypeParameterAnnotations(typeParameterName="Y",
+                                      annotations={"Foo2", "Bar2", "Baz2"})
+    @ExpectedTypeParameterAnnotations(typeParameterName="Z", annotations={})
+    <@Foo1 @Bar1 @Baz1 W, X, @Foo2 @Bar2 @Baz2 Y, Z> X m(X x) { return x; }
 
-    interface Intf<@Foo @Bar @Baz X> { X m() ; }
+    @ExpectedTypeParameterAnnotations(typeParameterName="W",
+                                      annotations={"Foo1", "Bar1", "Baz1"})
+    @ExpectedTypeParameterAnnotations(typeParameterName="X", annotations={})
+    @ExpectedTypeParameterAnnotations(typeParameterName="Y",
+                                      annotations={"Foo2", "Bar2", "Baz2"})
+    @ExpectedTypeParameterAnnotations(typeParameterName="Z", annotations={})
+    interface Intf<@Foo1 @Bar1 @Baz1 W, X, @Foo2 @Bar2 @Baz2 Y, Z> { X m() ; }
 
-    class Class<@Foo @Bar @Baz X> {
-        <@Foo @Bar @Baz Y> Class() { }
+    @ExpectedTypeParameterAnnotations(typeParameterName="W",
+                                      annotations={"Foo1", "Bar1", "Baz1"})
+    @ExpectedTypeParameterAnnotations(typeParameterName="X", annotations={})
+    @ExpectedTypeParameterAnnotations(typeParameterName="Y",
+                                      annotations={"Foo2", "Bar2", "Baz2"})
+    @ExpectedTypeParameterAnnotations(typeParameterName="Z", annotations={})
+    class Clazz<@Foo1 @Bar1 @Baz1 W, X, @Foo2 @Bar2 @Baz2 Y, Z> {
+        @ExpectedTypeParameterAnnotations(typeParameterName="W",
+                                          annotations={"Foo1", "Bar1", "Baz1"})
+        @ExpectedTypeParameterAnnotations(typeParameterName="X", annotations={})
+        @ExpectedTypeParameterAnnotations(typeParameterName="Y",
+                                          annotations={"Foo2", "Bar2", "Baz2"})
+        @ExpectedTypeParameterAnnotations(typeParameterName="Z", annotations={})
+        <@Foo1 @Bar1 @Baz1 W, X, @Foo2 @Bar2 @Baz2 Y, Z> Clazz() { }
     }
 
-    final int expect = 5;  // top level class, plus preceding examples
+    final int expect = 5 * 4;  // top level class, plus preceding examples, 4 type variables each
 }
 
 @Target(ElementType.TYPE_PARAMETER)
-@interface Foo {}
+@interface Foo1 {}
+
+@Target(ElementType.TYPE_PARAMETER)
+@interface Bar1 {}
+
+@Target(ElementType.TYPE_PARAMETER)
+@interface Baz1 {}
+
+@Target(ElementType.TYPE_PARAMETER)
+@interface Foo2 {}
 
 @Target(ElementType.TYPE_PARAMETER)
-@interface Bar {}
+@interface Bar2 {}
 
 @Target(ElementType.TYPE_PARAMETER)
-@interface Baz {}
+@interface Baz2 {}
+
+@Repeatable(ExpectedTypeParameterAnnotationsCollection.class)
+@interface ExpectedTypeParameterAnnotations {
+    public String typeParameterName();
+    public String[] annotations();
+}
+
+@interface ExpectedTypeParameterAnnotationsCollection {
+    public ExpectedTypeParameterAnnotations[] value();
+}
--- a/langtools/test/tools/javac/varargs/6313164/T6313164.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/test/tools/javac/varargs/6313164/T6313164.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1,18 +1,26 @@
 /*
  * @test /nodynamiccopyright/
- * @bug     6313164
+ * @bug     6313164 8036953
  * @author mcimadamore
  * @summary  javac generates code that fails byte code verification for the varargs feature
- * @compile/fail/ref=T6313164.out -XDrawDiagnostics T6313164.java
+ * @compile/fail/ref=T6313164Source7.out -source 7 -XDrawDiagnostics T6313164.java
+ * @compile/fail/ref=T6313164Source8AndHigher.out -XDrawDiagnostics T6313164.java
  */
 import p1.*;
 
 class T6313164 {
-    { B b = new B();
-      b.foo1(new B(), new B()); //error - A not accesible
-      b.foo2(new B(), new B()); //ok - A not accessible, but foo2(Object...) applicable
-      b.foo3(null, null); //error - A (inferred) not accesible
-      b.foo4(null, null); //error - A (inferred in 15.12.2.8 - no resolution backtrack) not accesible
-      b.foo4(new B(), new C()); //ok - A (inferred in 15.12.2.7) not accessible, but foo4(Object...) applicable
+    {
+        B b = new B();
+        b.foo1(new B(), new B()); //error - A not accessible
+        /*   7  : ok - A not accessible, but foo2(Object...) applicable
+         *   8+ : error - A not accessible
+         */
+        b.foo2(new B(), new B());
+        b.foo3(null, null); //error - A (inferred) not accessible
+        b.foo4(null, null); //error - A not accesible
+        /*   7  : ok - A not accessible, but foo4(Object...) applicable
+         *   8+ : error - A not accessible
+         */
+        b.foo4(new B(), new C());
     }
 }
--- a/langtools/test/tools/javac/varargs/6313164/T6313164.out	Wed Jul 09 16:44:30 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-T6313164.java:12:8: compiler.err.cant.apply.symbol: kindname.method, foo1, p1.A[], p1.B,p1.B, kindname.class, p1.B, (compiler.misc.inaccessible.varargs.type: p1.A, kindname.class, T6313164)
-T6313164.java:14:13: compiler.err.prob.found.req: (compiler.misc.inaccessible.varargs.type: p1.A, kindname.class, T6313164)
-T6313164.java:15:13: compiler.err.prob.found.req: (compiler.misc.inaccessible.varargs.type: p1.A, kindname.class, T6313164)
-- compiler.note.unchecked.filename: B.java
-- compiler.note.unchecked.recompile
-3 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/varargs/6313164/T6313164Source7.out	Fri Jul 11 05:59:08 2014 -0700
@@ -0,0 +1,6 @@
+- compiler.warn.source.no.bootclasspath: 1.7
+T6313164.java:14:10: compiler.err.cant.apply.symbol: kindname.method, foo1, p1.A[], p1.B,p1.B, kindname.class, p1.B, (compiler.misc.inaccessible.varargs.type: p1.A, kindname.class, T6313164)
+T6313164.java:19:15: compiler.err.prob.found.req: (compiler.misc.inaccessible.varargs.type: p1.A, kindname.class, T6313164)
+T6313164.java:20:15: compiler.err.prob.found.req: (compiler.misc.inaccessible.varargs.type: p1.A, kindname.class, T6313164)
+3 errors
+1 warning
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/varargs/6313164/T6313164Source8AndHigher.out	Fri Jul 11 05:59:08 2014 -0700
@@ -0,0 +1,6 @@
+T6313164.java:14:15: compiler.err.cant.apply.symbol: kindname.method, foo1, p1.A[], p1.B,p1.B, kindname.class, p1.B, (compiler.misc.inaccessible.varargs.type: p1.A, kindname.class, T6313164)
+T6313164.java:18:15: compiler.err.cant.apply.symbol: kindname.method, foo2, p1.A[], p1.B,p1.B, kindname.class, p1.B, (compiler.misc.inaccessible.varargs.type: p1.A, kindname.class, T6313164)
+T6313164.java:19:15: compiler.err.prob.found.req: (compiler.misc.inaccessible.varargs.type: p1.A, kindname.class, T6313164)
+T6313164.java:20:15: compiler.err.prob.found.req: (compiler.misc.inaccessible.varargs.type: p1.A, kindname.class, T6313164)
+T6313164.java:24:15: compiler.err.prob.found.req: (compiler.misc.inaccessible.varargs.type: p1.A, kindname.class, T6313164)
+5 errors
--- a/langtools/test/tools/javac/varargs/6313164/T7175433.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/test/tools/javac/varargs/6313164/T7175433.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1,31 +1,8 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
+ * @test /nodynamiccopyright/
  * @bug 7175433 6313164
  * @summary Inference cleanup: add helper class to handle inference variables
- *
+ * @compile/fail/ref=T7175433.out -XDrawDiagnostics T7175433.java
  */
 
 import java.util.List;
@@ -34,26 +11,16 @@
 
     private class Foo { }
 
-    <Z> List<Z> m(Object... o) { T7175433.assertTrue(true); return null; }
-    <Z> List<Z> m(Foo... o) { T7175433.assertTrue(false); return null; }
+    <Z> List<Z> m(Object... o) { return null; }
+    <Z> List<Z> m(Foo... o) { return null; }
 
     Foo getFoo() { return null; }
 }
 
 public class T7175433 {
 
-    static int assertionCount;
-
-    static void assertTrue(boolean b) {
-        assertionCount++;
-        if (!b) {
-            throw new AssertionError();
-        }
-    }
-
     public static void main(String[] args) {
         Bar b = new Bar();
         b.m(b.getFoo());
-        assertTrue(assertionCount == 1);
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/varargs/6313164/T7175433.out	Fri Jul 11 05:59:08 2014 -0700
@@ -0,0 +1,2 @@
+T7175433.java:24:12: compiler.err.prob.found.req: (compiler.misc.inaccessible.varargs.type: Bar.Foo, kindname.class, T7175433)
+1 error
--- a/langtools/test/tools/javac/varargs/6313164/p1/B.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/test/tools/javac/varargs/6313164/p1/B.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,13 +23,12 @@
 
 package p1;
 
+@SuppressWarnings("unchecked")
 public class B extends A {
-    public B() {}
     public void foo1(A... args) { }
     public void foo2(A... args) { }
     public void foo2(Object... args) { }
     public <X extends A> void foo3(X... args) { }
     public <X extends A> void foo4(X... args) { }
     public void foo4(Object... args) { }
-
 }
--- a/langtools/test/tools/sjavac/SJavac.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/langtools/test/tools/sjavac/SJavac.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,8 +34,12 @@
 class SJavac {
 
     public static void main(String... args) throws Exception {
-        SJavac s = new SJavac();
-        s.test();
+        try {
+            SJavac s = new SJavac();
+            s.test();
+        } finally {
+            System.out.println("\ntest complete\n");
+        }
     }
 
     FileSystem defaultfs = FileSystems.getDefault();
@@ -412,7 +416,7 @@
     }
 
     void incrementalCompileTestFullyQualifiedRef() throws Exception {
-        System.out.println("Verify that \"alfa.omega.A a;\" does create a proper dependency.");
+        System.out.println("\nVerify that \"alfa.omega.A a;\" does create a proper dependency.");
         System.out.println("----------------------------------------------------------------");
 
         populate(gensrc,
@@ -517,8 +521,7 @@
         if (rc == 0) throw new Exception("Expected error during compile! Did not fail!");
     }
 
-    Map<String,Long> collectState(Path dir) throws IOException
-    {
+    Map<String,Long> collectState(Path dir) throws IOException {
         final Map<String,Long> files = new HashMap<>();
         Files.walkFileTree(dir, new SimpleFileVisitor<Path>() {
                  @Override
--- a/nashorn/.hgtags	Wed Jul 09 16:44:30 2014 +0200
+++ b/nashorn/.hgtags	Fri Jul 11 05:59:08 2014 -0700
@@ -252,3 +252,5 @@
 fed8c83dfba4dce94d2ae1cb82f026634ff2a3e4 jdk9-b16
 4a47b7cfecdf2a865811ab08a7ef49c942801d7c jdk9-b17
 893c337bc95fef3885baa3e4ffc30d68f62a829f jdk9-b18
+46e36a92e37c06dea50f8c829549d9d0bfed4e3c jdk9-b19
+d703c59c556f9fcd9604272806ef7acf55c92363 jdk9-b20
--- a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MemberInfo.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MemberInfo.java	Fri Jul 11 05:59:08 2014 -0700
@@ -412,6 +412,10 @@
                     }
                 }
             }
+            break;
+
+            default:
+            break;
         }
     }
 
@@ -450,7 +454,7 @@
 
         if (type.getSort() == Type.OBJECT) {
             try {
-                final Class clazz = Class.forName(type.getClassName(), false, myLoader);
+                final Class<?> clazz = Class.forName(type.getClassName(), false, myLoader);
                 return ScriptObject.class.isAssignableFrom(clazz);
             } catch (final ClassNotFoundException cnfe) {
                 return false;
--- a/nashorn/make/project.properties	Wed Jul 09 16:44:30 2014 +0200
+++ b/nashorn/make/project.properties	Fri Jul 11 05:59:08 2014 -0700
@@ -283,7 +283,7 @@
   -XX:+HeapDumpOnOutOfMemoryError
 
 # turn on assertions for tests
-run.test.jvmargs.main=${run.test.jvmargs.common} -ea -Dnashorn.lazy
+run.test.jvmargs.main=${run.test.jvmargs.common} -ea
 
 # extra jvmargs that might be useful for debugging
 #
@@ -305,7 +305,7 @@
 # -XX:+PrintNMethods
 
 # Use best known performance options for octane
-run.test.jvmargs.octane.main=${run.test.jvmargs.common} -Dnashorn.lazy -XX:+UnlockDiagnosticVMOptions -XX:+UseNewCode -XX:TypeProfileLevel=222
+run.test.jvmargs.octane.main=${run.test.jvmargs.common} -XX:+UnlockDiagnosticVMOptions -XX:+UseNewCode -XX:TypeProfileLevel=222
 
 # Security manager args - make sure that we run with the nashorn.policy that the build creates
 run.test.jvmsecurityargs=-Xverify:all -Djava.security.manager -Djava.security.policy=${basedir}/build/nashorn.policy
--- a/nashorn/src/jdk/nashorn/internal/codegen/Compiler.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/Compiler.java	Fri Jul 11 05:59:08 2014 -0700
@@ -47,7 +47,9 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.Consumer;
 import java.util.logging.Level;
+
 import jdk.internal.dynalink.support.NameCodec;
 import jdk.nashorn.internal.codegen.ClassEmitter.Flag;
 import jdk.nashorn.internal.codegen.types.Type;
@@ -421,7 +423,14 @@
 
     @Override
     public DebugLogger initLogger(final Context ctxt) {
-        return ctxt.getLogger(this.getClass());
+        return ctxt.getLogger(this.getClass(), new Consumer<DebugLogger>() {
+            @Override
+            public void accept(final DebugLogger newLogger) {
+                if (!Compiler.this.getScriptEnvironment()._lazy_compilation) {
+                    newLogger.warning("WARNING: Running with lazy compilation switched off. This is not a default setting.");
+                }
+            }
+        });
     }
 
     ScriptEnvironment getScriptEnvironment() {
--- a/nashorn/src/jdk/nashorn/internal/ir/BinaryNode.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/BinaryNode.java	Fri Jul 11 05:59:08 2014 -0700
@@ -45,7 +45,7 @@
 public final class BinaryNode extends Expression implements Assignment<Expression>, Optimistic {
     // Placeholder for "undecided optimistic ADD type". Unfortunately, we can't decide the type of ADD during optimistic
     // type calculation as it can have local variables as its operands that will decide its ultimate type.
-    private static final Type OPTIMISTIC_UNDECIDED_TYPE = Type.typeFor(new Object(){}.getClass());
+    private static final Type OPTIMISTIC_UNDECIDED_TYPE = Type.typeFor(new Object(){/*empty*/}.getClass());
 
     /** Left hand side argument. */
     private final Expression lhs;
--- a/nashorn/src/jdk/nashorn/internal/ir/FunctionNode.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/FunctionNode.java	Fri Jul 11 05:59:08 2014 -0700
@@ -99,7 +99,7 @@
         BYTECODE_GENERATED,
         /** method has been installed */
         BYTECODE_INSTALLED
-    };
+    }
 
     /** Source of entity. */
     private final Source source;
@@ -388,10 +388,11 @@
     }
 
     /**
-     * static source name getter
+     * Static source name getter
+     *
      * @param source
      * @param sourceURL
-     * @return
+     * @return source name
      */
     public static String getSourceName(final Source source, final String sourceURL) {
         return sourceURL != null ? sourceURL : source.getName();
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeObject.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeObject.java	Fri Jul 11 05:59:08 2014 -0700
@@ -75,7 +75,10 @@
  */
 @ScriptClass("Object")
 public final class NativeObject {
+    /** Methodhandle to proto getter */
     public static final MethodHandle GET__PROTO__ = findOwnMH("get__proto__", ScriptObject.class, Object.class);
+
+    /** Methodhandle to proto setter */
     public static final MethodHandle SET__PROTO__ = findOwnMH("set__proto__", Object.class, Object.class, Object.class);
 
     private static final Object TO_STRING = new Object();
--- a/nashorn/src/jdk/nashorn/internal/parser/Parser.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/parser/Parser.java	Fri Jul 11 05:59:08 2014 -0700
@@ -680,7 +680,7 @@
      */
     private FunctionNode program(final String scriptName, final boolean allowPropertyFunction) {
         // Make a pseudo-token for the script holding its start and length.
-        final long functionToken = Token.toDesc(FUNCTION, getProgramStartPosition(token), source.getLength());
+        final long functionToken = Token.toDesc(FUNCTION, Token.descPosition(Token.withDelimiter(token)), source.getLength());
         final int  functionLine  = line;
         // Set up the script to append elements.
 
@@ -711,20 +711,6 @@
     }
 
     /**
-     * Returns the start position of the program based on its first token. Normally returns the position of the token
-     * itself, except in case of string tokens which report their position past their opening delimiter and thus need
-     * to have one subtracted from their position.
-     * @param firstToken the first token of the program
-     * @return the start position of the program
-     */
-    private static int getProgramStartPosition(final long firstToken) {
-        final int start = Token.descPosition(firstToken);
-        switch(Token.descType(firstToken)) {
-            case STRING: case ESCSTRING: case EXECSTRING: return start - 1;
-            default: return start;
-        }
-    }
-    /**
      * Directive value or null if statement is not a directive.
      *
      * @param stmt Statement to be checked
--- a/nashorn/src/jdk/nashorn/internal/parser/Token.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/parser/Token.java	Fri Jul 11 05:59:08 2014 -0700
@@ -61,6 +61,28 @@
     }
 
     /**
+     * Normally returns the token itself, except in case of string tokens
+     * which report their position past their opening delimiter and thus
+     * need to have position and length adjusted.
+     *
+     * @param token Token descriptor.
+     * @return same or adjusted token.
+     */
+    public static long withDelimiter(final long token) {
+        final TokenType tokenType = Token.descType(token);
+        switch(tokenType) {
+            case STRING: case ESCSTRING: case EXECSTRING: {
+                final int start = Token.descPosition(token) - 1;
+                final int len = Token.descLength(token) + 2;
+                return toDesc(tokenType, start, len);
+            }
+            default: {
+                return token;
+            }
+        }
+    }
+
+    /**
      * Extract token length from a token descriptor.
      * @param token Token descriptor.
      * @return Length of the token.
--- a/nashorn/src/jdk/nashorn/internal/runtime/Context.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/Context.java	Fri Jul 11 05:59:08 2014 -0700
@@ -1236,6 +1236,16 @@
      * @return debuglogger associated with that class
      */
     public DebugLogger getLogger(final Class<? extends Loggable> clazz) {
+        return getLogger(clazz, null);
+    }
+
+    /**
+     * Get a logger, given a loggable class
+     * @param clazz a Loggable class
+     * @param initHook an init hook - if this is the first time the logger is created in the context, run the init hook
+     * @return debuglogger associated with that class
+     */
+    public DebugLogger getLogger(final Class<? extends Loggable> clazz, final Consumer<DebugLogger> initHook) {
         final String name = getLoggerName(clazz);
         DebugLogger logger = loggers.get(name);
         if (logger == null) {
@@ -1244,6 +1254,9 @@
             }
             final LoggerInfo info = env._loggers.get(name);
             logger = new DebugLogger(name, info.getLevel(), info.isQuiet());
+            if (initHook != null) {
+                initHook.accept(logger);
+            }
             loggers.put(name, logger);
         }
         return logger;
--- a/nashorn/src/jdk/nashorn/internal/runtime/FinalScriptFunctionData.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/FinalScriptFunctionData.java	Fri Jul 11 05:59:08 2014 -0700
@@ -34,6 +34,8 @@
  */
 final class FinalScriptFunctionData extends ScriptFunctionData {
 
+    private static final long serialVersionUID = -930632846167768864L;
+
     /**
      * Constructor - used for bind
      *
--- a/nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java	Fri Jul 11 05:59:08 2014 -0700
@@ -185,6 +185,7 @@
      * properties with keys that are valid array indices.</p>
      *
      * @param properties   Collection of initial properties.
+     * @param className    class name
      * @param fieldCount   Number of fields in use.
      * @param fieldMaximum Number of fields available.
      * @param spillLength  Number of used spill slots.
--- a/nashorn/src/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java	Fri Jul 11 05:59:08 2014 -0700
@@ -54,7 +54,6 @@
 import jdk.nashorn.internal.runtime.logging.DebugLogger;
 import jdk.nashorn.internal.runtime.logging.Loggable;
 import jdk.nashorn.internal.runtime.logging.Logger;
-import jdk.nashorn.internal.runtime.options.Options;
 import jdk.nashorn.internal.scripts.JS;
 
 /**
@@ -65,9 +64,6 @@
  */
 @Logger(name="recompile")
 public final class RecompilableScriptFunctionData extends ScriptFunctionData implements Loggable {
-    /** Is lazy compilation enabled? TODO: this should be the default */
-    public static final boolean LAZY_COMPILATION = Options.getBooleanProperty("nashorn.lazy");
-
     /** Prefix used for all recompiled script classes */
     public static final String RECOMPILATION_PREFIX = "Recompilation$";
 
@@ -240,6 +236,12 @@
         return "function " + (name == null ? "" : name) + "() { [native code] }";
     }
 
+    /**
+     * Setter for code and source
+     *
+     * @param code   map of code, class name to class
+     * @param source source
+     */
     public void setCodeAndSource(final Map<String, Class<?>> code, final Source source) {
         this.source = source;
         if (methodLocator != null) {
@@ -292,7 +294,7 @@
 
     private static long tokenFor(final FunctionNode fn) {
         final int  position  = Token.descPosition(fn.getFirstToken());
-        final long lastToken = fn.getLastToken();
+        final long lastToken = Token.withDelimiter(fn.getLastToken());
         // EOL uses length field to store the line number
         final int  length    = Token.descPosition(lastToken) - position + (Token.descType(lastToken) == TokenType.EOL ? 0 : Token.descLength(lastToken));
 
--- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java	Fri Jul 11 05:59:08 2014 -0700
@@ -2267,7 +2267,7 @@
 
             if (mh != null) {
                 assert func != null;
-                if (scopeAccess && func != null && func.isStrict()) {
+                if (scopeAccess && func.isStrict()) {
                     mh = bindTo(mh, UNDEFINED);
                 }
                 return new GuardedInvocation(
--- a/nashorn/src/jdk/nashorn/internal/runtime/Source.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/Source.java	Fri Jul 11 05:59:08 2014 -0700
@@ -99,12 +99,13 @@
                 // Force any access errors
                 data.checkPermissionAndClose();
                 return existingSource;
-            } else {
-                // All sources in cache must be fully loaded
-                data.load();
-                CACHE.put(newSource, newSource);
-                return newSource;
             }
+
+            // All sources in cache must be fully loaded
+            data.load();
+            CACHE.put(newSource, newSource);
+
+            return newSource;
         } catch (final RuntimeException e) {
             final Throwable cause = e.getCause();
             if (cause instanceof IOException) {
@@ -291,7 +292,9 @@
         }
 
         protected void checkPermissionAndClose() throws IOException {
-            try (InputStream in = url.openStream()) {}
+            try (InputStream in = url.openStream()) {
+                // empty
+            }
             debug("permission checked for ", url);
         }
 
@@ -366,20 +369,24 @@
     }
 
     /**
-     * Returns an instance
+     * Returns a Source instance
      *
      * @param name    source name
      * @param content contents as char array
+     *
+     * @return source instance
      */
     public static Source sourceFor(final String name, final char[] content) {
         return new Source(name, baseName(name), new RawData(content));
     }
 
     /**
-     * Returns an instance
+     * Returns a Source instance
      *
      * @param name    source name
      * @param content contents as string
+     *
+     * @return source instance
      */
     public static Source sourceFor(final String name, final String content) {
         return new Source(name, baseName(name), new RawData(content));
@@ -391,6 +398,8 @@
      * @param name  source name
      * @param url   url from which source can be loaded
      *
+     * @return source instance
+     *
      * @throws IOException if source cannot be loaded
      */
     public static Source sourceFor(final String name, final URL url) throws IOException {
@@ -404,6 +413,8 @@
      * @param url   url from which source can be loaded
      * @param cs    Charset used to convert bytes to chars
      *
+     * @return source instance
+     *
      * @throws IOException if source cannot be loaded
      */
     public static Source sourceFor(final String name, final URL url, final Charset cs) throws IOException {
@@ -416,6 +427,8 @@
      * @param name  source name
      * @param file  file from which source can be loaded
      *
+     * @return source instance
+     *
      * @throws IOException if source cannot be loaded
      */
     public static Source sourceFor(final String name, final File file) throws IOException {
@@ -429,6 +442,8 @@
      * @param file  file from which source can be loaded
      * @param cs    Charset used to convert bytes to chars
      *
+     * @return source instance
+     *
      * @throws IOException if source cannot be loaded
      */
     public static Source sourceFor(final String name, final File file, final Charset cs) throws IOException {
@@ -441,6 +456,9 @@
      *
      * @param name source name
      * @param reader reader from which source can be loaded
+     *
+     * @return source instance
+     *
      * @throws IOException if source cannot be loaded
      */
     public static Source sourceFor(final String name, final Reader reader) throws IOException {
@@ -542,9 +560,9 @@
      * @return Index of first character of line.
      */
     private int findBOLN(final int position) {
-        final char[] data = data();
+        final char[] d = data();
         for (int i = position - 1; i > 0; i--) {
-            final char ch = data[i];
+            final char ch = d[i];
 
             if (ch == '\n' || ch == '\r') {
                 return i + 1;
@@ -560,10 +578,10 @@
      * @return Index of last character of line.
      */
     private int findEOLN(final int position) {
-        final char[] data = data();
-        final int length = data.length;
+        final char[] d = data();
+        final int length = d.length;
         for (int i = position; i < length; i++) {
-            final char ch = data[i];
+            final char ch = d[i];
 
             if (ch == '\n' || ch == '\r') {
                 return i - 1;
@@ -583,12 +601,12 @@
      * @return Line number.
      */
     public int getLine(final int position) {
-        final char[] data = data();
+        final char[] d = data();
         // Line count starts at 1.
         int line = 1;
 
         for (int i = 0; i < position; i++) {
-            final char ch = data[i];
+            final char ch = d[i];
             // Works for both \n and \r\n.
             if (ch == '\n') {
                 line++;
--- a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayFilter.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayFilter.java	Fri Jul 11 05:59:08 2014 -0700
@@ -141,21 +141,6 @@
         return this;
     }
 
-    private static void printTrace(final Throwable t, final String msg) {
-        final java.io.StringWriter sw = new java.io.StringWriter();
-        final java.io.PrintWriter pw = new java.io.PrintWriter(sw, false);
-        pw.println(msg);
-        final StackTraceElement[] trace = t.getStackTrace();
-        for(final StackTraceElement e: trace) {
-            pw.println(" at " + e);
-            if(e.getClassName().startsWith("jdk.nashorn.")) {
-                break;
-            }
-        }
-        pw.flush();
-        System.out.println(sw.toString());
-    }
-
     @Override
     public Type getOptimisticType() {
         return underlying.getOptimisticType();
--- a/nashorn/src/jdk/nashorn/internal/runtime/logging/DebugLogger.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/logging/DebugLogger.java	Fri Jul 11 05:59:08 2014 -0700
@@ -540,7 +540,7 @@
 
     /**
      * Shorthand for outputting a log string as log level
-     * {@link java.util.logging.Level#FINE} on this logger
+     * {@link java.util.logging.Level#SEVERE} on this logger
      * @param objs object array to log - use this to perform lazy concatenation to avoid unconditional toString overhead
      */
     public void severe(final Object... objs) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8047035.js	Fri Jul 11 05:59:08 2014 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+/**
+ * JDK-8047035: (function() "hello")() crashes in Lexer with jdk9
+ *
+ * @test
+ * @run
+ */
+
+// should not print ")" at the end
+print(function() "hello");
+print(function() '');
+
+// The following should not crash inside lexer
+print((function() '')());
+print((function() "hello")());
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8047035.js.EXPECTED	Fri Jul 11 05:59:08 2014 -0700
@@ -0,0 +1,4 @@
+function() "hello"
+function() ''
+
+hello
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8047057.js	Fri Jul 11 05:59:08 2014 -0700
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+/**
+ * JDK-8047057: Add a regression test for the passing test cases from JDK-8042304
+ *
+ * @test
+ * @run
+ */
+
+// commented out makeFuncAndCall calls are still result in crash
+// Tests commented with //** fail only within test framework.
+// Pass fine with standalone "jjs" mode.
+
+function makeFuncAndCall(code) {
+    Function(code)();
+}
+
+function makeFuncExpectError(code, ErrorType) {
+    try {
+        makeFuncAndCall(code);
+    } catch (e) {
+        if (! (e instanceof ErrorType)) {
+            fail(ErrorType.name + " expected, got " + e);
+        }
+    }
+}
+
+// makeFuncAndCall("switch(0) { default: {break;} return }");
+// makeFuncAndCall("L: { { break L; } return; }");
+makeFuncAndCall("L: { while(0) break L; return; }");
+makeFuncExpectError("L: {while(0) break L; return [](); }", TypeError);
+// makeFuncAndCall("do with({}) break ; while(0);");
+makeFuncAndCall("while(0) with({}) continue ;");
+//** makeFuncAndCall("eval([]);");
+//** makeFuncAndCall("try{} finally{[]}");
+makeFuncAndCall("try { } catch(x if 1) { try { } catch(x2) { } }");
+makeFuncAndCall("try { } catch(x if 1) { try { return; } catch(x2) { { } } }");
+makeFuncAndCall("Error() * (false)[-0]--");
+makeFuncAndCall("try { var x = 1, x = null; } finally { }");
+makeFuncAndCall("try { var x = {}, x = []; } catch(x3) { }");
+//** makeFuncAndCall("[delete this]");
+// makeFuncAndCall("if(eval('', eval('', function() {}))) { }");
+// makeFuncAndCall("if(eval('', eval('', function() {}))) { }");
+// makeFuncAndCall("eval(\"[,,];\", [11,12,13,14].some)");
+// makeFuncAndCall("eval(\"1.2e3\", ({})[ /x/ ])");
+// makeFuncAndCall("eval(\"x4\", x3);");
+makeFuncAndCall("with({5.0000000000000000000000: String()}){(false); }");
+makeFuncAndCall("try { var x = undefined, x = 5.0000000000000000000000; } catch(x) { x = undefined; }");
+makeFuncAndCall("(function (x){ x %= this}(false))");
+// makeFuncAndCall("eval.apply.apply(function(){ eval('') })");
+makeFuncAndCall("(false % !this) && 0");
+makeFuncAndCall("with({8: 'fafafa'.replace()}){ }");
+makeFuncAndCall("(function (x) '' )(true)");
+makeFuncExpectError("new eval(function(){})", TypeError);
--- a/nashorn/test/src/UnnamedPackageTestCallback.java	Wed Jul 09 16:44:30 2014 +0200
+++ b/nashorn/test/src/UnnamedPackageTestCallback.java	Fri Jul 11 05:59:08 2014 -0700
@@ -23,6 +23,14 @@
  * questions.
  */
 
+/**
+ * Interface for callbacks used by the test suite.
+ */
 public interface UnnamedPackageTestCallback {
+    /**
+     * Call function
+     * @param s string argument
+     * @return string
+     */
     String call(String s);
 }