Merge
authorprr
Tue, 03 Mar 2015 08:49:13 -0800
changeset 29263 66e30e926405
parent 29262 1698800c8606 (current diff)
parent 29247 57d4fecf7fcc (diff)
child 29264 5172066a2da6
child 29512 073c09fc07fd
Merge
hotspot/src/share/vm/oops/oop.inline2.hpp
jdk/make/lib/SoundLibraries.gmk
jdk/src/java.base/share/classes/sun/security/acl/AclEntryImpl.java
jdk/src/java.base/share/classes/sun/security/acl/AclImpl.java
jdk/src/java.base/share/classes/sun/security/acl/AllPermissionsImpl.java
jdk/src/java.base/share/classes/sun/security/acl/GroupImpl.java
jdk/src/java.base/share/classes/sun/security/acl/OwnerImpl.java
jdk/src/java.base/share/classes/sun/security/acl/PermissionImpl.java
jdk/src/java.base/share/classes/sun/security/acl/PrincipalImpl.java
jdk/src/java.base/share/classes/sun/security/acl/WorldGroupImpl.java
jdk/src/java.desktop/share/native/libjsound/SoundDefs.h
jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_TW.java
jdk/test/com/sun/management/OperatingSystemMXBean/GetTotalSwapSpaceSize.java
jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh
jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/TabulatorsTest.java
jdk/test/sun/security/acl/PermissionImpl/PermissionEqualsHashCode.java
--- a/.hgtags	Mon Feb 23 10:47:32 2015 -0800
+++ b/.hgtags	Tue Mar 03 08:49:13 2015 -0800
@@ -294,3 +294,4 @@
 5b8db585a33c3cc48e70e688ceee57dd9271dc5d jdk9-b49
 1550b2f6b63d1411fa84dc7bbc6f04809aedb43f jdk9-b50
 6efe265424e3f1ea596408a1f71baf2de316c772 jdk9-b51
+d6224d6021459ac8b3832e822f5acc849fa944af jdk9-b52
--- a/.hgtags-top-repo	Mon Feb 23 10:47:32 2015 -0800
+++ b/.hgtags-top-repo	Tue Mar 03 08:49:13 2015 -0800
@@ -294,3 +294,4 @@
 d91ed1951b948210590ce1394bea5515357246ba jdk9-b49
 d1f37d39ff2421f956a6ddf316cf763807bc3363 jdk9-b50
 6207b4b8731ca75c51b031c47daa813ab92ef558 jdk9-b51
+1822e59f17121b09e7899cf338cfb6e37fe5fceb jdk9-b52
--- a/common/autoconf/basics.m4	Mon Feb 23 10:47:32 2015 -0800
+++ b/common/autoconf/basics.m4	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -77,26 +77,30 @@
 # $1: The name of the variable to fix
 AC_DEFUN([BASIC_FIXUP_PATH],
 [
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
-    BASIC_FIXUP_PATH_CYGWIN($1)
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
-    BASIC_FIXUP_PATH_MSYS($1)
-  else
-    # We're on a unix platform. Hooray! :)
-    path="[$]$1"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      AC_MSG_NOTICE([The path of $1, which resolves as "$path", is invalid.])
-      AC_MSG_ERROR([Spaces are not allowed in this path.])
+  # Only process if variable expands to non-empty
+  
+  if test "x[$]$1" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+      BASIC_FIXUP_PATH_CYGWIN($1)
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+      BASIC_FIXUP_PATH_MSYS($1)
+    else
+      # We're on a unix platform. Hooray! :)
+      path="[$]$1"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        AC_MSG_NOTICE([The path of $1, which resolves as "$path", is invalid.])
+        AC_MSG_ERROR([Spaces are not allowed in this path.])
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.])
+      fi
+
+      $1="`cd "$path"; $THEPWDCMD -L`"
     fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.])
-    fi
-
-    $1="`cd "$path"; $THEPWDCMD -L`"
   fi
 ])
 
@@ -113,57 +117,61 @@
 # $1: The name of the variable to fix
 AC_DEFUN([BASIC_FIXUP_EXECUTABLE],
 [
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
-    BASIC_FIXUP_EXECUTABLE_CYGWIN($1)
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
-    BASIC_FIXUP_EXECUTABLE_MSYS($1)
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="[$]$1"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
+  # Only process if variable expands to non-empty
+  
+  if test "x[$]$1" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+      BASIC_FIXUP_EXECUTABLE_CYGWIN($1)
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+      BASIC_FIXUP_EXECUTABLE_MSYS($1)
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="[$]$1"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
 
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        AC_MSG_NOTICE([The path of $1, which resolves as "$complete", is not found.])
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          AC_MSG_NOTICE([This might be caused by spaces in the path, which is not allowed.])
         fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
+        AC_MSG_ERROR([Cannot locate the the path of $1])
+      fi
     fi
 
-    if test "x$new_path" = x; then
-      AC_MSG_NOTICE([The path of $1, which resolves as "$complete", is not found.])
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        AC_MSG_NOTICE([This might be caused by spaces in the path, which is not allowed.])
-      fi
-      AC_MSG_ERROR([Cannot locate the the path of $1])
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
     fi
-  fi
 
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    $1="$new_complete"
-    AC_MSG_NOTICE([Rewriting $1 to "$new_complete"])
+    if test "x$complete" != "x$new_complete"; then
+      $1="$new_complete"
+      AC_MSG_NOTICE([Rewriting $1 to "$new_complete"])
+    fi
   fi
 ])
 
--- a/common/autoconf/generated-configure.sh	Mon Feb 23 10:47:32 2015 -0800
+++ b/common/autoconf/generated-configure.sh	Tue Mar 03 08:49:13 2015 -0800
@@ -3386,7 +3386,7 @@
 
 # Include these first...
 #
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -4393,7 +4393,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1424202275
+DATE_WHEN_GENERATED=1424872170
 
 ###############################################################################
 #
@@ -14155,7 +14155,10 @@
 
   # We can only call BASIC_FIXUP_PATH after BASIC_CHECK_PATHS_WINDOWS.
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$CURDIR" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -14216,7 +14219,7 @@
 $as_echo "$as_me: Rewriting CURDIR to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$CURDIR"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -14257,27 +14260,31 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$CURDIR"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CURDIR, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$CURDIR"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CURDIR, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of CURDIR, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of CURDIR, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    CURDIR="`cd "$path"; $THEPWDCMD -L`"
-  fi
-
-
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of CURDIR, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      CURDIR="`cd "$path"; $THEPWDCMD -L`"
+    fi
+  fi
+
+
+  # Only process if variable expands to non-empty
+
+  if test "x$TOPDIR" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -14338,7 +14345,7 @@
 $as_echo "$as_me: Rewriting TOPDIR to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$TOPDIR"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -14379,23 +14386,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$TOPDIR"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of TOPDIR, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$TOPDIR"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of TOPDIR, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of TOPDIR, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of TOPDIR, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    TOPDIR="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of TOPDIR, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      TOPDIR="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
   # SRC_ROOT is a traditional alias for TOPDIR.
@@ -14797,7 +14805,10 @@
 if test "${with_devkit+set}" = set; then :
   withval=$with_devkit;
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$with_devkit" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -14858,7 +14869,7 @@
 $as_echo "$as_me: Rewriting with_devkit to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$with_devkit"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -14899,23 +14910,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$with_devkit"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_devkit, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$with_devkit"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_devkit, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of with_devkit, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of with_devkit, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    with_devkit="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of with_devkit, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      with_devkit="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
         DEVKIT_ROOT="$with_devkit"
@@ -15271,7 +15283,10 @@
 $as_echo "$CONF_NAME" >&6; }
 
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$OUTPUT_ROOT" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -15332,7 +15347,7 @@
 $as_echo "$as_me: Rewriting OUTPUT_ROOT to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$OUTPUT_ROOT"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -15373,23 +15388,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$OUTPUT_ROOT"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OUTPUT_ROOT, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$OUTPUT_ROOT"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OUTPUT_ROOT, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of OUTPUT_ROOT, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of OUTPUT_ROOT, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    OUTPUT_ROOT="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of OUTPUT_ROOT, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      OUTPUT_ROOT="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
 
@@ -15511,7 +15527,10 @@
         else
           FOUND_MAKE=$MAKE_CANDIDATE
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$FOUND_MAKE" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -15625,7 +15644,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -15740,56 +15759,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$FOUND_MAKE"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$FOUND_MAKE"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    FOUND_MAKE="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      FOUND_MAKE="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;}
+    fi
   fi
 
         fi
@@ -15884,7 +15904,10 @@
         else
           FOUND_MAKE=$MAKE_CANDIDATE
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$FOUND_MAKE" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -15998,7 +16021,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -16113,56 +16136,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$FOUND_MAKE"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$FOUND_MAKE"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    FOUND_MAKE="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      FOUND_MAKE="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;}
+    fi
   fi
 
         fi
@@ -16254,7 +16278,10 @@
         else
           FOUND_MAKE=$MAKE_CANDIDATE
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$FOUND_MAKE" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -16368,7 +16395,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -16483,56 +16510,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$FOUND_MAKE"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$FOUND_MAKE"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    FOUND_MAKE="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      FOUND_MAKE="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;}
+    fi
   fi
 
         fi
@@ -16629,7 +16657,10 @@
         else
           FOUND_MAKE=$MAKE_CANDIDATE
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$FOUND_MAKE" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -16743,7 +16774,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -16858,56 +16889,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$FOUND_MAKE"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$FOUND_MAKE"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    FOUND_MAKE="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      FOUND_MAKE="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;}
+    fi
   fi
 
         fi
@@ -16998,7 +17030,10 @@
         else
           FOUND_MAKE=$MAKE_CANDIDATE
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$FOUND_MAKE" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -17112,7 +17147,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -17227,56 +17262,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$FOUND_MAKE"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$FOUND_MAKE"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    FOUND_MAKE="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      FOUND_MAKE="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;}
+    fi
   fi
 
         fi
@@ -20116,7 +20152,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -20177,7 +20216,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -20218,23 +20257,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -20441,7 +20481,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -20502,7 +20545,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -20543,23 +20586,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -20628,7 +20672,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -20689,7 +20736,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -20730,23 +20777,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -20808,7 +20856,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -20869,7 +20920,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -20910,23 +20961,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -20987,7 +21039,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -21048,7 +21103,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -21089,23 +21144,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -21166,7 +21222,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -21227,7 +21286,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -21268,23 +21327,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -21336,7 +21396,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -21397,7 +21460,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -21438,23 +21501,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -21481,7 +21545,10 @@
   if test "x$JAVA_HOME" != x; then
     JAVA_HOME_PROCESSED="$JAVA_HOME"
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$JAVA_HOME_PROCESSED" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -21542,7 +21609,7 @@
 $as_echo "$as_me: Rewriting JAVA_HOME_PROCESSED to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$JAVA_HOME_PROCESSED"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -21583,23 +21650,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$JAVA_HOME_PROCESSED"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$JAVA_HOME_PROCESSED"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    JAVA_HOME_PROCESSED="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      JAVA_HOME_PROCESSED="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
     if test ! -d "$JAVA_HOME_PROCESSED"; then
@@ -21647,7 +21715,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -21708,7 +21779,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -21749,23 +21820,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -21968,7 +22040,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -22029,7 +22104,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -22070,23 +22145,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -22176,7 +22252,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -22237,7 +22316,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -22278,23 +22357,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -22349,7 +22429,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -22410,7 +22493,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -22451,23 +22534,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -22550,7 +22634,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -22611,7 +22698,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -22652,23 +22739,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -22723,7 +22811,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -22784,7 +22875,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -22825,23 +22916,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -22924,7 +23016,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -22985,7 +23080,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -23026,23 +23121,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -23097,7 +23193,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -23158,7 +23257,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -23199,23 +23298,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -23298,7 +23398,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -23359,7 +23462,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -23400,23 +23503,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -23471,7 +23575,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -23532,7 +23639,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -23573,23 +23680,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -23659,7 +23767,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -23720,7 +23831,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -23761,23 +23872,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -23830,7 +23942,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -23891,7 +24006,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -23932,23 +24047,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -24019,7 +24135,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -24080,7 +24199,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -24121,23 +24240,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -24190,7 +24310,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -24251,7 +24374,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -24292,23 +24415,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -24378,7 +24502,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -24439,7 +24566,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -24480,23 +24607,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -24549,7 +24677,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -24610,7 +24741,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -24651,23 +24782,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -24738,178 +24870,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
-
-  # Input might be given as Windows format, start by converting to
-  # unix format.
-  path="$BOOT_JDK"
-  new_path=`$CYGPATH -u "$path"`
-
-  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
-  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
-  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
-  # "foo.exe" is OK but "foo" is an error.
-  #
-  # This test is therefore slightly more accurate than "test -f" to check for file precense.
-  # It is also a way to make sure we got the proper file name for the real test later on.
-  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
-  if test "x$test_shortpath" = x; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5
-  fi
-
-  # Call helper function which possibly converts this using DOS-style short mode.
-  # If so, the updated path is stored in $new_path.
-
-  input_path="$new_path"
-  # Check if we need to convert this using DOS-style short mode. If the path
-  # contains just simple characters, use it. Otherwise (spaces, weird characters),
-  # take no chances and rewrite it.
-  # Note: m4 eats our [], so we need to use [ and ] instead.
-  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
-  if test "x$has_forbidden_chars" != x; then
-    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
-    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
-    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
-    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
-      # Going to short mode and back again did indeed matter. Since short mode is
-      # case insensitive, let's make it lowercase to improve readability.
-      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-      # Now convert it back to Unix-stile (cygpath)
-      input_path=`$CYGPATH -u "$shortmode_path"`
-      new_path="$input_path"
-    fi
-  fi
-
-  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
-  if test "x$test_cygdrive_prefix" = x; then
-    # As a simple fix, exclude /usr/bin since it's not a real path.
-    if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
-      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
-      # a path prefixed by /cygdrive for fixpath to work.
-      new_path="$CYGWIN_ROOT_PATH$input_path"
-    fi
-  fi
-
-
-  if test "x$path" != "x$new_path"; then
-    BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
-$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
-  fi
-
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
-
-  path="$BOOT_JDK"
-  has_colon=`$ECHO $path | $GREP ^.:`
-  new_path="$path"
-  if test "x$has_colon" = x; then
-    # Not in mixed or Windows style, start by that.
-    new_path=`cmd //c echo $path`
-  fi
-
-
-  input_path="$new_path"
-  # Check if we need to convert this using DOS-style short mode. If the path
-  # contains just simple characters, use it. Otherwise (spaces, weird characters),
-  # take no chances and rewrite it.
-  # Note: m4 eats our [], so we need to use [ and ] instead.
-  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
-  if test "x$has_forbidden_chars" != x; then
-    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
-    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-  fi
-
-
-  windows_path="$new_path"
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
-    unix_path=`$CYGPATH -u "$windows_path"`
-    new_path="$unix_path"
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
-    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
-    new_path="$unix_path"
-  fi
-
-  if test "x$path" != "x$new_path"; then
-    BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
-$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
-  fi
-
-  # Save the first 10 bytes of this path to the storage, so fixpath can work.
-  all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
-
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
-  fi
-
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
-$as_echo_n "checking for Boot JDK... " >&6; }
-            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
-$as_echo "$BOOT_JDK" >&6; }
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
-$as_echo_n "checking Boot JDK version... " >&6; }
-            BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' '  '`
-            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
-$as_echo "$BOOT_JDK_VERSION" >&6; }
-          fi # end check jdk version
-        fi # end check javac
-      fi # end check java
-    fi # end check boot jdk found
-  fi
-
-    done
-  fi
-
-
-    # If previous step claimed to have found a JDK, check it to see if it seems to be valid.
-    if test "x$BOOT_JDK_FOUND" = xmaybe; then
-      # Do we have a bin/java?
-      if test ! -x "$BOOT_JDK/bin/java"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;}
-        BOOT_JDK_FOUND=no
-      else
-        # Do we have a bin/javac?
-        if test ! -x "$BOOT_JDK/bin/javac"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;}
-          { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5
-$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
-          BOOT_JDK_FOUND=no
-        else
-          # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
-          BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
-
-          # Extra M4 quote needed to protect [] in grep expression.
-          FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
-          if test "x$FOUND_CORRECT_VERSION" = x; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
-$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-            { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
-$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
-            BOOT_JDK_FOUND=no
-          else
-            # We're done! :-)
-            BOOT_JDK_FOUND=yes
-
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -24970,7 +24934,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -25011,23 +24975,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -25045,6 +25010,7 @@
     fi # end check boot jdk found
   fi
 
+    done
   fi
 
 
@@ -25079,7 +25045,10 @@
             # We're done! :-)
             BOOT_JDK_FOUND=yes
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -25140,7 +25109,7 @@
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$BOOT_JDK"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -25181,23 +25150,198 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$BOOT_JDK"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
+  fi
+
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+$as_echo_n "checking for Boot JDK... " >&6; }
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+$as_echo "$BOOT_JDK" >&6; }
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+$as_echo_n "checking Boot JDK version... " >&6; }
+            BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' '  '`
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+$as_echo "$BOOT_JDK_VERSION" >&6; }
+          fi # end check jdk version
+        fi # end check javac
+      fi # end check java
+    fi # end check boot jdk found
+  fi
+
+  fi
+
+
+    # If previous step claimed to have found a JDK, check it to see if it seems to be valid.
+    if test "x$BOOT_JDK_FOUND" = xmaybe; then
+      # Do we have a bin/java?
+      if test ! -x "$BOOT_JDK/bin/java"; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;}
+        BOOT_JDK_FOUND=no
+      else
+        # Do we have a bin/javac?
+        if test ! -x "$BOOT_JDK/bin/javac"; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;}
+          { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5
+$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
+          BOOT_JDK_FOUND=no
+        else
+          # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
+          BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
+
+          # Extra M4 quote needed to protect [] in grep expression.
+          FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep  '\"1\.[89]\.'`
+          if test "x$FOUND_CORRECT_VERSION" = x; then
+            { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
+            { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
+$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
+            BOOT_JDK_FOUND=no
+          else
+            # We're done! :-)
+            BOOT_JDK_FOUND=yes
+
+  # Only process if variable expands to non-empty
+
+  if test "x$BOOT_JDK" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+
+  # Input might be given as Windows format, start by converting to
+  # unix format.
+  path="$BOOT_JDK"
+  new_path=`$CYGPATH -u "$path"`
+
+  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
+  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
+  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
+  # "foo.exe" is OK but "foo" is an error.
+  #
+  # This test is therefore slightly more accurate than "test -f" to check for file precense.
+  # It is also a way to make sure we got the proper file name for the real test later on.
+  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
+  if test "x$test_shortpath" = x; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5
+  fi
+
+  # Call helper function which possibly converts this using DOS-style short mode.
+  # If so, the updated path is stored in $new_path.
+
+  input_path="$new_path"
+  # Check if we need to convert this using DOS-style short mode. If the path
+  # contains just simple characters, use it. Otherwise (spaces, weird characters),
+  # take no chances and rewrite it.
+  # Note: m4 eats our [], so we need to use [ and ] instead.
+  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
+  if test "x$has_forbidden_chars" != x; then
+    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
+    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
+    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
+      # Going to short mode and back again did indeed matter. Since short mode is
+      # case insensitive, let's make it lowercase to improve readability.
+      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+      # Now convert it back to Unix-stile (cygpath)
+      input_path=`$CYGPATH -u "$shortmode_path"`
+      new_path="$input_path"
+    fi
+  fi
+
+  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
+  if test "x$test_cygdrive_prefix" = x; then
+    # As a simple fix, exclude /usr/bin since it's not a real path.
+    if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
+      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
+      # a path prefixed by /cygdrive for fixpath to work.
+      new_path="$CYGWIN_ROOT_PATH$input_path"
+    fi
+  fi
+
+
+  if test "x$path" != "x$new_path"; then
+    BOOT_JDK="$new_path"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
+  fi
+
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+
+  path="$BOOT_JDK"
+  has_colon=`$ECHO $path | $GREP ^.:`
+  new_path="$path"
+  if test "x$has_colon" = x; then
+    # Not in mixed or Windows style, start by that.
+    new_path=`cmd //c echo $path`
+  fi
+
+
+  input_path="$new_path"
+  # Check if we need to convert this using DOS-style short mode. If the path
+  # contains just simple characters, use it. Otherwise (spaces, weird characters),
+  # take no chances and rewrite it.
+  # Note: m4 eats our [], so we need to use [ and ] instead.
+  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
+  if test "x$has_forbidden_chars" != x; then
+    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+  fi
+
+
+  windows_path="$new_path"
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    unix_path=`$CYGPATH -u "$windows_path"`
+    new_path="$unix_path"
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+    new_path="$unix_path"
+  fi
+
+  if test "x$path" != "x$new_path"; then
+    BOOT_JDK="$new_path"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
+  fi
+
+  # Save the first 10 bytes of this path to the storage, so fixpath can work.
+  all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
+
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$BOOT_JDK"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -27154,7 +27298,10 @@
   if test "x$VS_ENV_CMD" != x; then
     # We have found a Visual Studio environment on disk, let's extract variables from the vsvars bat file.
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$VS_ENV_CMD" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -27268,7 +27415,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -27383,56 +27530,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$VS_ENV_CMD"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$VS_ENV_CMD"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of VS_ENV_CMD" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    VS_ENV_CMD="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting VS_ENV_CMD to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of VS_ENV_CMD" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      VS_ENV_CMD="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting VS_ENV_CMD to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting VS_ENV_CMD to \"$new_complete\"" >&6;}
+    fi
   fi
 
 
@@ -27548,9 +27696,27 @@
       IFS=";"
       for i in $VS_INCLUDE; do
         ipath=$i
-	IFS="$OLDIFS"
-
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+        # Only process non-empty elements
+        if test "x$ipath" != x; then
+          IFS="$OLDIFS"
+          # Check that directory exists before calling fixup_path
+          testpath=$ipath
+
+  windows_path="$testpath"
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    unix_path=`$CYGPATH -u "$windows_path"`
+    testpath="$unix_path"
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+    testpath="$unix_path"
+  fi
+
+          if test -d "$testpath"; then
+
+  # Only process if variable expands to non-empty
+
+  if test "x$ipath" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -27611,7 +27777,7 @@
 $as_echo "$as_me: Rewriting ipath to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$ipath"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -27652,34 +27818,55 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$ipath"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of ipath, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$ipath"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of ipath, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of ipath, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of ipath, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    ipath="`cd "$path"; $THEPWDCMD -L`"
-  fi
-
-	IFS=";"
-      	SYSROOT_CFLAGS="$SYSROOT_CFLAGS -I$ipath"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of ipath, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      ipath="`cd "$path"; $THEPWDCMD -L`"
+    fi
+  fi
+
+            SYSROOT_CFLAGS="$SYSROOT_CFLAGS -I$ipath"
+          fi
+          IFS=";"
+        fi
       done
       # Convert VS_LIB into SYSROOT_LDFLAGS
       for i in $VS_LIB; do
         libpath=$i
-	IFS="$OLDIFS"
-
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+        # Only process non-empty elements
+        if test "x$libpath" != x; then
+          IFS="$OLDIFS"
+          # Check that directory exists before calling fixup_path
+          testpath=$libpath
+
+  windows_path="$testpath"
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    unix_path=`$CYGPATH -u "$windows_path"`
+    testpath="$unix_path"
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+    testpath="$unix_path"
+  fi
+
+          if test -d "$testpath"; then
+
+  # Only process if variable expands to non-empty
+
+  if test "x$libpath" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -27740,7 +27927,7 @@
 $as_echo "$as_me: Rewriting libpath to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$libpath"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -27781,27 +27968,30 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$libpath"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of libpath, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$libpath"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of libpath, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of libpath, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of libpath, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    libpath="`cd "$path"; $THEPWDCMD -L`"
-  fi
-
-	IFS=";"
-      	SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -libpath:$libpath"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of libpath, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      libpath="`cd "$path"; $THEPWDCMD -L`"
+    fi
+  fi
+
+            SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -libpath:$libpath"
+          fi
+          IFS=";"
+        fi
       done
       IFS="$OLDIFS"
     fi
@@ -28076,7 +28266,10 @@
 
   # Now we have a compiler binary in CC. Make sure it's okay.
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$CC" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -28190,7 +28383,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -28305,56 +28498,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$CC"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$CC"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of CC, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    CC="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CC to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      CC="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CC to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting CC to \"$new_complete\"" >&6;}
+    fi
   fi
 
   TEST_COMPILER="$CC"
@@ -28533,7 +28727,10 @@
 fi
 
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$PROPER_COMPILER_CC" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -28647,7 +28844,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -28762,56 +28959,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$PROPER_COMPILER_CC"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$PROPER_COMPILER_CC"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CC" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    PROPER_COMPILER_CC="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting PROPER_COMPILER_CC to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CC" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      PROPER_COMPILER_CC="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting PROPER_COMPILER_CC to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting PROPER_COMPILER_CC to \"$new_complete\"" >&6;}
+    fi
   fi
 
     PATH="$RETRY_COMPILER_SAVED_PATH"
@@ -29816,7 +30014,10 @@
 
   # Now we have a compiler binary in CXX. Make sure it's okay.
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$CXX" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -29930,7 +30131,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -30045,56 +30246,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$CXX"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$CXX"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of CXX, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    CXX="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXX to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      CXX="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXX to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting CXX to \"$new_complete\"" >&6;}
+    fi
   fi
 
   TEST_COMPILER="$CXX"
@@ -30273,7 +30475,10 @@
 fi
 
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$PROPER_COMPILER_CXX" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -30387,7 +30592,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -30502,56 +30707,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$PROPER_COMPILER_CXX"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$PROPER_COMPILER_CXX"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CXX" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    PROPER_COMPILER_CXX="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting PROPER_COMPILER_CXX to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CXX" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      PROPER_COMPILER_CXX="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting PROPER_COMPILER_CXX to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting PROPER_COMPILER_CXX to \"$new_complete\"" >&6;}
+    fi
   fi
 
     PATH="$RETRY_COMPILER_SAVED_PATH"
@@ -31135,7 +31341,10 @@
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$CPP" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -31249,7 +31458,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -31364,56 +31573,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$CPP"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$CPP"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of CPP, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    CPP="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CPP to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      CPP="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CPP to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting CPP to \"$new_complete\"" >&6;}
+    fi
   fi
 
   ac_ext=cpp
@@ -31550,7 +31760,10 @@
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$CXXCPP" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -31664,7 +31877,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -31779,56 +31992,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$CXXCPP"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$CXXCPP"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of CXXCPP, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    CXXCPP="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXXCPP to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      CXXCPP="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXXCPP to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting CXXCPP to \"$new_complete\"" >&6;}
+    fi
   fi
 
 
@@ -31894,7 +32108,10 @@
 
 
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$LD" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -32008,7 +32225,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -32123,56 +32340,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$LD"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LD, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$LD"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LD, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of LD, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of LD" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    LD="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting LD to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of LD" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      LD="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting LD to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting LD to \"$new_complete\"" >&6;}
+    fi
   fi
 
     # Verify that we indeed succeeded with this trick.
@@ -32389,7 +32607,10 @@
 
 
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$AS" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -32503,7 +32724,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -32618,56 +32839,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$AS"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$AS"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of AS, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    AS="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AS to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      AS="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AS to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting AS to \"$new_complete\"" >&6;}
+    fi
   fi
 
   else
@@ -33017,7 +33239,10 @@
 
   fi
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$AR" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -33131,7 +33356,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -33246,56 +33471,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$AR"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$AR"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of AR, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    AR="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AR to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      AR="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AR to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting AR to \"$new_complete\"" >&6;}
+    fi
   fi
 
 
@@ -33553,7 +33779,10 @@
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$OBJC" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -33667,7 +33896,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -33782,56 +34011,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$OBJC"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJC, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$OBJC"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJC, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of OBJC, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of OBJC" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    OBJC="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJC to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of OBJC" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      OBJC="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJC to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting OBJC to \"$new_complete\"" >&6;}
+    fi
   fi
 
 
@@ -34021,7 +34251,10 @@
 
 
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$LIPO" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -34135,7 +34368,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -34250,56 +34483,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$LIPO"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$LIPO"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of LIPO, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    LIPO="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting LIPO to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      LIPO="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting LIPO to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting LIPO to \"$new_complete\"" >&6;}
+    fi
   fi
 
   else
@@ -34362,7 +34596,10 @@
 
 
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$MT" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -34476,7 +34713,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -34591,56 +34828,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$MT"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MT, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$MT"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MT, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of MT, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of MT" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    MT="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MT to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of MT" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      MT="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MT to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting MT to \"$new_complete\"" >&6;}
+    fi
   fi
 
     # Setup the resource compiler (RC)
@@ -34699,7 +34937,10 @@
 
 
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$RC" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -34813,7 +35054,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -34928,56 +35169,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$RC"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of RC, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$RC"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of RC, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of RC, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of RC" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    RC="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting RC to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of RC" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      RC="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting RC to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting RC to \"$new_complete\"" >&6;}
+    fi
   fi
 
     # Extract the first word of "dumpbin", so it can be a program name with args.
@@ -35018,7 +35260,10 @@
 
 
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$DUMPBIN" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -35132,7 +35377,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -35247,56 +35492,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$DUMPBIN"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$DUMPBIN"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    DUMPBIN="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting DUMPBIN to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      DUMPBIN="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting DUMPBIN to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting DUMPBIN to \"$new_complete\"" >&6;}
+    fi
   fi
 
     # We need to check for 'msbuild.exe' because at the place where we expect to
@@ -35533,7 +35779,10 @@
 
 
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$STRIP" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -35647,7 +35896,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -35762,56 +36011,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$STRIP"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$STRIP"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    STRIP="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      STRIP="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting STRIP to \"$new_complete\"" >&6;}
+    fi
   fi
 
 
@@ -36001,7 +36251,10 @@
 
 
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$NM" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -36115,7 +36368,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -36230,56 +36483,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$NM"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$NM"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    NM="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      NM="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting NM to \"$new_complete\"" >&6;}
+    fi
   fi
 
 
@@ -36469,7 +36723,10 @@
 
 
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$GNM" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -36583,7 +36840,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -36698,56 +36955,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$GNM"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of GNM, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$GNM"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of GNM, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of GNM, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of GNM" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    GNM="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting GNM to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of GNM" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      GNM="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting GNM to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting GNM to \"$new_complete\"" >&6;}
+    fi
   fi
 
 
@@ -36938,7 +37196,10 @@
 
 
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$MCS" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -37052,7 +37313,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -37167,56 +37428,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$MCS"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$MCS"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of MCS, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    MCS="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MCS to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      MCS="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MCS to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting MCS to \"$new_complete\"" >&6;}
+    fi
   fi
 
   elif test "x$OPENJDK_TARGET_OS" != xwindows; then
@@ -37518,7 +37780,10 @@
 
 
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$STRIP" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -37632,7 +37897,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -37747,56 +38012,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$STRIP"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$STRIP"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    STRIP="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      STRIP="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting STRIP to \"$new_complete\"" >&6;}
+    fi
   fi
 
 
@@ -38096,7 +38362,10 @@
 
 
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$NM" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -38210,7 +38479,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -38325,56 +38594,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$NM"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$NM"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    NM="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      NM="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting NM to \"$new_complete\"" >&6;}
+    fi
   fi
 
     GNM="$NM"
@@ -38683,7 +38953,10 @@
     # Only call fixup if objcopy was found.
     if test -n "$OBJCOPY"; then
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$OBJCOPY" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -38797,7 +39070,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -38912,56 +39185,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$OBJCOPY"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$OBJCOPY"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    OBJCOPY="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJCOPY to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      OBJCOPY="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJCOPY to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting OBJCOPY to \"$new_complete\"" >&6;}
+    fi
   fi
 
     fi
@@ -39267,7 +39541,10 @@
     # Only used for compare.sh; we can live without it. BASIC_FIXUP_EXECUTABLE
     # bails if argument is missing.
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$OBJDUMP" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -39381,7 +39658,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -39496,56 +39773,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$OBJDUMP"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$OBJDUMP"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    OBJDUMP="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJDUMP to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      OBJDUMP="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJDUMP to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting OBJDUMP to \"$new_complete\"" >&6;}
+    fi
   fi
 
   fi
@@ -39760,7 +40038,10 @@
 
 
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BUILD_CC" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -39874,7 +40155,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -39989,56 +40270,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$BUILD_CC"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$BUILD_CC"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    BUILD_CC="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CC to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      BUILD_CC="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CC to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting BUILD_CC to \"$new_complete\"" >&6;}
+    fi
   fi
 
 
@@ -40228,7 +40510,10 @@
 
 
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BUILD_CXX" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -40342,7 +40627,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -40457,56 +40742,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$BUILD_CXX"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$BUILD_CXX"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    BUILD_CXX="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CXX to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      BUILD_CXX="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CXX to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting BUILD_CXX to \"$new_complete\"" >&6;}
+    fi
   fi
 
 
@@ -40696,7 +40982,10 @@
 
 
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$BUILD_LD" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -40810,7 +41099,7 @@
   # remove trailing .exe if any
   new_path="${new_path/%.exe/}"
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   # First separate the path from the arguments. This will split at the first
   # space.
@@ -40925,56 +41214,57 @@
     all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   fi
 
-  else
-    # We're on a unix platform. Hooray! :)
-    # First separate the path from the arguments. This will split at the first
-    # space.
-    complete="$BUILD_LD"
-    path="${complete%% *}"
-    tmp="$complete EOL"
-    arguments="${tmp#* }"
-
-    # Cannot rely on the command "which" here since it doesn't always work.
-    is_absolute_path=`$ECHO "$path" | $GREP ^/`
-    if test -z "$is_absolute_path"; then
-      # Path to executable is not absolute. Find it.
-      IFS_save="$IFS"
-      IFS=:
-      for p in $PATH; do
-        if test -f "$p/$path" && test -x "$p/$path"; then
-          new_path="$p/$path"
-          break
-        fi
-      done
-      IFS="$IFS_save"
-    else
-      # This is an absolute path, we can use it without further modifications.
-      new_path="$path"
-    fi
-
-    if test "x$new_path" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      # First separate the path from the arguments. This will split at the first
+      # space.
+      complete="$BUILD_LD"
+      path="${complete%% *}"
+      tmp="$complete EOL"
+      arguments="${tmp#* }"
+
+      # Cannot rely on the command "which" here since it doesn't always work.
+      is_absolute_path=`$ECHO "$path" | $GREP ^/`
+      if test -z "$is_absolute_path"; then
+        # Path to executable is not absolute. Find it.
+        IFS_save="$IFS"
+        IFS=:
+        for p in $PATH; do
+          if test -f "$p/$path" && test -x "$p/$path"; then
+            new_path="$p/$path"
+            break
+          fi
+        done
+        IFS="$IFS_save"
+      else
+        # This is an absolute path, we can use it without further modifications.
+        new_path="$path"
+      fi
+
+      if test "x$new_path" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+        has_space=`$ECHO "$complete" | $GREP " "`
+        if test "x$has_space" != x; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of BUILD_LD" "$LINENO" 5
-    fi
-  fi
-
-  # Now join together the path and the arguments once again
-  if test "x$arguments" != xEOL; then
-    new_complete="$new_path ${arguments% *}"
-  else
-    new_complete="$new_path"
-  fi
-
-  if test "x$complete" != "x$new_complete"; then
-    BUILD_LD="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_LD to \"$new_complete\"" >&5
+        fi
+        as_fn_error $? "Cannot locate the the path of BUILD_LD" "$LINENO" 5
+      fi
+    fi
+
+    # Now join together the path and the arguments once again
+    if test "x$arguments" != xEOL; then
+      new_complete="$new_path ${arguments% *}"
+    else
+      new_complete="$new_path"
+    fi
+
+    if test "x$complete" != "x$new_complete"; then
+      BUILD_LD="$new_complete"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_LD to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting BUILD_LD to \"$new_complete\"" >&6;}
+    fi
   fi
 
   else
@@ -41307,7 +41597,10 @@
 
       # use JT_HOME enviroment var.
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$JT_HOME" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -41368,7 +41661,7 @@
 $as_echo "$as_me: Rewriting JT_HOME to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$JT_HOME"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -41409,23 +41702,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$JT_HOME"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JT_HOME, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$JT_HOME"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JT_HOME, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of JT_HOME, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of JT_HOME, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    JT_HOME="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of JT_HOME, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      JT_HOME="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
 
@@ -44698,7 +44992,10 @@
 
   if test "x$FOUND_FREETYPE" = xyes; then
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -44759,7 +45056,7 @@
 $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -44800,27 +45097,31 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
-  fi
-
-
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
+    fi
+  fi
+
+
+  # Only process if variable expands to non-empty
+
+  if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -44881,7 +45182,7 @@
 $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$POTENTIAL_FREETYPE_LIB_PATH"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -44922,23 +45223,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$POTENTIAL_FREETYPE_LIB_PATH"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$POTENTIAL_FREETYPE_LIB_PATH"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
 
@@ -45051,7 +45353,10 @@
 
   if test "x$FOUND_FREETYPE" = xyes; then
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -45112,7 +45417,7 @@
 $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -45153,27 +45458,31 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
-  fi
-
-
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
+    fi
+  fi
+
+
+  # Only process if variable expands to non-empty
+
+  if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -45234,7 +45543,7 @@
 $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$POTENTIAL_FREETYPE_LIB_PATH"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -45275,23 +45584,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$POTENTIAL_FREETYPE_LIB_PATH"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$POTENTIAL_FREETYPE_LIB_PATH"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
 
@@ -45665,7 +45975,10 @@
 
   if test "x$FOUND_FREETYPE" = xyes; then
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -45726,7 +46039,7 @@
 $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -45767,27 +46080,31 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
-  fi
-
-
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
+    fi
+  fi
+
+
+  # Only process if variable expands to non-empty
+
+  if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -45848,7 +46165,7 @@
 $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$POTENTIAL_FREETYPE_LIB_PATH"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -45889,23 +46206,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$POTENTIAL_FREETYPE_LIB_PATH"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$POTENTIAL_FREETYPE_LIB_PATH"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
 
@@ -45993,7 +46311,10 @@
 
   if test "x$FOUND_FREETYPE" = xyes; then
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -46054,7 +46375,7 @@
 $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -46095,27 +46416,31 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
-  fi
-
-
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
+    fi
+  fi
+
+
+  # Only process if variable expands to non-empty
+
+  if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -46176,7 +46501,7 @@
 $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$POTENTIAL_FREETYPE_LIB_PATH"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -46217,23 +46542,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$POTENTIAL_FREETYPE_LIB_PATH"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$POTENTIAL_FREETYPE_LIB_PATH"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
 
@@ -46312,7 +46638,10 @@
 
   if test "x$FOUND_FREETYPE" = xyes; then
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -46373,7 +46702,7 @@
 $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -46414,27 +46743,31 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
-  fi
-
-
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
+    fi
+  fi
+
+
+  # Only process if variable expands to non-empty
+
+  if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -46495,7 +46828,7 @@
 $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$POTENTIAL_FREETYPE_LIB_PATH"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -46536,23 +46869,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$POTENTIAL_FREETYPE_LIB_PATH"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$POTENTIAL_FREETYPE_LIB_PATH"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
 
@@ -46631,7 +46965,10 @@
 
   if test "x$FOUND_FREETYPE" = xyes; then
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -46692,7 +47029,7 @@
 $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -46733,27 +47070,31 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
-  fi
-
-
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
+    fi
+  fi
+
+
+  # Only process if variable expands to non-empty
+
+  if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -46814,7 +47155,7 @@
 $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$POTENTIAL_FREETYPE_LIB_PATH"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -46855,23 +47196,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$POTENTIAL_FREETYPE_LIB_PATH"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$POTENTIAL_FREETYPE_LIB_PATH"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
 
@@ -46951,7 +47293,10 @@
 
   if test "x$FOUND_FREETYPE" = xyes; then
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -47012,7 +47357,7 @@
 $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -47053,27 +47398,31 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
-  fi
-
-
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
+    fi
+  fi
+
+
+  # Only process if variable expands to non-empty
+
+  if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -47134,7 +47483,7 @@
 $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$POTENTIAL_FREETYPE_LIB_PATH"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -47175,23 +47524,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$POTENTIAL_FREETYPE_LIB_PATH"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$POTENTIAL_FREETYPE_LIB_PATH"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
 
@@ -47272,7 +47622,10 @@
 
   if test "x$FOUND_FREETYPE" = xyes; then
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -47333,7 +47686,7 @@
 $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -47374,27 +47727,31 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
-  fi
-
-
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
+    fi
+  fi
+
+
+  # Only process if variable expands to non-empty
+
+  if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -47455,7 +47812,7 @@
 $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$POTENTIAL_FREETYPE_LIB_PATH"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -47496,23 +47853,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$POTENTIAL_FREETYPE_LIB_PATH"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$POTENTIAL_FREETYPE_LIB_PATH"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
 
@@ -47589,7 +47947,10 @@
 
   if test "x$FOUND_FREETYPE" = xyes; then
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -47650,7 +48011,7 @@
 $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -47691,27 +48052,31 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
-  fi
-
-
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
+    fi
+  fi
+
+
+  # Only process if variable expands to non-empty
+
+  if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -47772,7 +48137,7 @@
 $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$POTENTIAL_FREETYPE_LIB_PATH"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -47813,23 +48178,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$POTENTIAL_FREETYPE_LIB_PATH"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$POTENTIAL_FREETYPE_LIB_PATH"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
 
@@ -47906,7 +48272,10 @@
 
   if test "x$FOUND_FREETYPE" = xyes; then
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -47967,7 +48336,7 @@
 $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -48008,27 +48377,31 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
-  fi
-
-
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
+    fi
+  fi
+
+
+  # Only process if variable expands to non-empty
+
+  if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -48089,7 +48462,7 @@
 $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$POTENTIAL_FREETYPE_LIB_PATH"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -48130,23 +48503,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$POTENTIAL_FREETYPE_LIB_PATH"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$POTENTIAL_FREETYPE_LIB_PATH"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
 
@@ -48206,7 +48580,10 @@
     # Set FREETYPE_CFLAGS, _LIBS and _LIB_PATH from include and lib dir.
     if test "x$FREETYPE_CFLAGS" = x; then
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$FREETYPE_INCLUDE_PATH" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -48267,7 +48644,7 @@
 $as_echo "$as_me: Rewriting FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$FREETYPE_INCLUDE_PATH"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -48308,23 +48685,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$FREETYPE_INCLUDE_PATH"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$FREETYPE_INCLUDE_PATH"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
       if test -d $FREETYPE_INCLUDE_PATH/freetype2/freetype; then
@@ -48336,7 +48714,10 @@
 
     if test "x$FREETYPE_LIBS" = x; then
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$FREETYPE_LIB_PATH" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -48397,7 +48778,7 @@
 $as_echo "$as_me: Rewriting FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$FREETYPE_LIB_PATH"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -48438,23 +48819,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$FREETYPE_LIB_PATH"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$FREETYPE_LIB_PATH"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
       if test "x$OPENJDK_TARGET_OS" = xwindows; then
@@ -50252,7 +50634,10 @@
 
   MSVCR_DLL=$MSVC_DLL
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$MSVCR_DLL" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -50313,7 +50698,7 @@
 $as_echo "$as_me: Rewriting MSVCR_DLL to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$MSVCR_DLL"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -50354,23 +50739,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$MSVCR_DLL"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$MSVCR_DLL"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of MSVCR_DLL, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    MSVCR_DLL="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of MSVCR_DLL, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      MSVCR_DLL="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
   MSVCR_DLL=$MSVCR_DLL
@@ -50753,7 +51139,10 @@
 
   MSVCP_DLL=$MSVC_DLL
 
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+  # Only process if variable expands to non-empty
+
+  if test "x$MSVCP_DLL" != x; then
+    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 
   # Input might be given as Windows format, start by converting to
   # unix format.
@@ -50814,7 +51203,7 @@
 $as_echo "$as_me: Rewriting MSVCP_DLL to \"$new_path\"" >&6;}
   fi
 
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 
   path="$MSVCP_DLL"
   has_colon=`$ECHO $path | $GREP ^.:`
@@ -50855,23 +51244,24 @@
   # Save the first 10 bytes of this path to the storage, so fixpath can work.
   all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
 
-  else
-    # We're on a unix platform. Hooray! :)
-    path="$MSVCP_DLL"
-    has_space=`$ECHO "$path" | $GREP " "`
-    if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVCP_DLL, which resolves as \"$path\", is invalid." >&5
+    else
+      # We're on a unix platform. Hooray! :)
+      path="$MSVCP_DLL"
+      has_space=`$ECHO "$path" | $GREP " "`
+      if test "x$has_space" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVCP_DLL, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of MSVCP_DLL, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-
-    # Use eval to expand a potential ~
-    eval path="$path"
-    if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of MSVCP_DLL, which resolves as \"$path\", is not found." "$LINENO" 5
-    fi
-
-    MSVCP_DLL="`cd "$path"; $THEPWDCMD -L`"
+        as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      fi
+
+      # Use eval to expand a potential ~
+      eval path="$path"
+      if test ! -f "$path" && test ! -d "$path"; then
+        as_fn_error $? "The path of MSVCP_DLL, which resolves as \"$path\", is not found." "$LINENO" 5
+      fi
+
+      MSVCP_DLL="`cd "$path"; $THEPWDCMD -L`"
+    fi
   fi
 
   MSVCP_DLL=$MSVCP_DLL
--- a/common/autoconf/toolchain_windows.m4	Mon Feb 23 10:47:32 2015 -0800
+++ b/common/autoconf/toolchain_windows.m4	Tue Mar 03 08:49:13 2015 -0800
@@ -351,18 +351,34 @@
       IFS=";"
       for i in $VS_INCLUDE; do
         ipath=$i
-	IFS="$OLDIFS"
-        BASIC_FIXUP_PATH([ipath])
-	IFS=";"
-      	SYSROOT_CFLAGS="$SYSROOT_CFLAGS -I$ipath"
+        # Only process non-empty elements
+        if test "x$ipath" != x; then
+          IFS="$OLDIFS"
+          # Check that directory exists before calling fixup_path
+          testpath=$ipath
+          BASIC_WINDOWS_REWRITE_AS_UNIX_PATH([testpath])
+          if test -d "$testpath"; then
+            BASIC_FIXUP_PATH([ipath])
+            SYSROOT_CFLAGS="$SYSROOT_CFLAGS -I$ipath"
+          fi
+          IFS=";"
+        fi
       done
       # Convert VS_LIB into SYSROOT_LDFLAGS
       for i in $VS_LIB; do
         libpath=$i
-	IFS="$OLDIFS"
-        BASIC_FIXUP_PATH([libpath])
-	IFS=";"
-      	SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -libpath:$libpath"
+        # Only process non-empty elements
+        if test "x$libpath" != x; then
+          IFS="$OLDIFS"
+          # Check that directory exists before calling fixup_path
+          testpath=$libpath
+          BASIC_WINDOWS_REWRITE_AS_UNIX_PATH([testpath])
+          if test -d "$testpath"; then
+            BASIC_FIXUP_PATH([libpath])
+            SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -libpath:$libpath"
+          fi
+          IFS=";"
+        fi
       done
       IFS="$OLDIFS"
     fi
--- a/common/bin/unshuffle_list.txt	Mon Feb 23 10:47:32 2015 -0800
+++ b/common/bin/unshuffle_list.txt	Tue Mar 03 08:49:13 2015 -0800
@@ -180,7 +180,6 @@
 jdk/src/java.base/share/classes/sun/nio/cs : jdk/src/share/classes/sun/nio/cs
 jdk/src/java.base/share/classes/sun/nio/fs : jdk/src/share/classes/sun/nio/fs
 jdk/src/java.base/share/classes/sun/reflect : jdk/src/share/classes/sun/reflect
-jdk/src/java.base/share/classes/sun/security/acl : jdk/src/share/classes/sun/security/acl
 jdk/src/java.base/share/classes/sun/security/action : jdk/src/share/classes/sun/security/action
 jdk/src/java.base/share/classes/sun/security/internal : jdk/src/share/classes/sun/security/internal
 jdk/src/java.base/share/classes/sun/security/jca : jdk/src/share/classes/sun/security/jca
--- a/corba/.hgtags	Mon Feb 23 10:47:32 2015 -0800
+++ b/corba/.hgtags	Tue Mar 03 08:49:13 2015 -0800
@@ -294,3 +294,4 @@
 9285d14eb7b6b0815679bae98dd936dbc136218d jdk9-b49
 224f593393e5b01b3c8f1e591b7f4b1790a3737a jdk9-b50
 2309c02386d1fa4ced5051873ffb9e04874f7a44 jdk9-b51
+b8538bbb6f224ab1dabba579137099c166ad4724 jdk9-b52
--- a/corba/src/java.corba/share/classes/javax/rmi/CORBA/GetORBPropertiesFileAction.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/corba/src/java.corba/share/classes/javax/rmi/CORBA/GetORBPropertiesFileAction.java	Tue Mar 03 08:49:13 2015 -0800
@@ -43,7 +43,6 @@
 
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import sun.security.action.GetPropertyAction;
 import java.util.Properties;
 
 class GetORBPropertiesFileAction implements PrivilegedAction {
--- a/hotspot/.hgtags	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/.hgtags	Tue Mar 03 08:49:13 2015 -0800
@@ -454,3 +454,4 @@
 360cd1fc42f10941a9fd17cc32d5b85a22d12a0b jdk9-b49
 e0947f58c9c1426aa0d98b98ebb78357b27a7b99 jdk9-b50
 403b9cbadb04d3d1201823591cf931dc93b38e3a jdk9-b51
+9fb7fdc554db5be5c5b10f88f529ec3b870c44e3 jdk9-b52
--- a/hotspot/src/cpu/ppc/vm/icBuffer_ppc.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/cpu/ppc/vm/icBuffer_ppc.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, 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.
  *
@@ -32,7 +32,6 @@
 #include "memory/resourceArea.hpp"
 #include "nativeInst_ppc.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 
 #define __ masm.
 
--- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -29,6 +29,7 @@
 #include "interp_masm_ppc_64.hpp"
 #include "interpreter/interpreterRuntime.hpp"
 #include "prims/jvmtiThreadState.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 #ifdef PRODUCT
 #define BLOCK_COMMENT(str) // nothing
--- a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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.
  *
@@ -25,6 +25,7 @@
 
 #include "precompiled.hpp"
 #include "asm/macroAssembler.inline.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "interpreter/interpreter.hpp"
 #include "memory/allocation.inline.hpp"
 #include "prims/methodHandles.hpp"
--- a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,7 @@
 #include "runtime/basicLock.hpp"
 #include "runtime/biasedLocking.hpp"
 #include "runtime/os.hpp"
+#include "runtime/sharedRuntime.hpp"
 #include "runtime/stubRoutines.hpp"
 
 void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) {
--- a/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
 #include "memory/resourceArea.hpp"
 #include "nativeInst_sparc.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 
 int InlineCacheBuffer::ic_stub_code_size() {
 #ifdef _LP64
--- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -2943,24 +2943,14 @@
       }
 
       bind   (IsInflated);
-      if (EmitSync & 64) {
-         // If m->owner != null goto IsLocked
-         // Test-and-CAS vs CAS
-         // Pessimistic form avoids futile (doomed) CAS attempts
-         // The optimistic form avoids RTS->RTO cache line upgrades.
-         ld_ptr(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner), Rscratch);
-         andcc(Rscratch, Rscratch, G0);
-         brx(Assembler::notZero, false, Assembler::pn, done);
-         delayed()->nop();
-         // m->owner == null : it's unlocked.
-      }
 
       // Try to CAS m->owner from null to Self
       // Invariant: if we acquire the lock then _recursions should be 0.
       add(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner), Rmark);
       mov(G2_thread, Rscratch);
       cas_ptr(Rmark, G0, Rscratch);
-      cmp(Rscratch, G0);
+      andcc(Rscratch, Rscratch, G0);             // set ICCs for done: icc.zf iff success
+      // set icc.zf : 1=success 0=failure
       // ST box->displaced_header = NonZero.
       // Any non-zero value suffices:
       //    markOopDesc::unused_mark(), G2_thread, RBox, RScratch, rsp, etc.
--- a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 "precompiled.hpp"
 #include "asm/macroAssembler.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interp_masm.hpp"
 #include "memory/allocation.inline.hpp"
--- a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,7 @@
 #include "runtime/basicLock.hpp"
 #include "runtime/biasedLocking.hpp"
 #include "runtime/os.hpp"
+#include "runtime/sharedRuntime.hpp"
 #include "runtime/stubRoutines.hpp"
 
 int C1_MacroAssembler::lock_object(Register hdr, Register obj, Register disp_hdr, Register scratch, Label& slow_case) {
--- a/hotspot/src/cpu/x86/vm/icBuffer_x86.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/cpu/x86/vm/icBuffer_x86.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,6 @@
 #include "memory/resourceArea.hpp"
 #include "nativeInst_x86.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 
 int InlineCacheBuffer::ic_stub_code_size() {
   return NativeMovConstReg::instruction_size +
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1718,27 +1718,6 @@
       // Force all sync thru slow-path: slow_enter() and slow_exit()
       movptr (Address(boxReg, 0), (int32_t)intptr_t(markOopDesc::unused_mark()));
       cmpptr (rsp, (int32_t)NULL_WORD);
-  } else
-  if (EmitSync & 2) {
-      Label DONE_LABEL ;
-      if (UseBiasedLocking) {
-         // Note: tmpReg maps to the swap_reg argument and scrReg to the tmp_reg argument.
-         biased_locking_enter(boxReg, objReg, tmpReg, scrReg, false, DONE_LABEL, NULL, counters);
-      }
-
-      movptr(tmpReg, Address(objReg, 0));           // fetch markword
-      orptr (tmpReg, 0x1);
-      movptr(Address(boxReg, 0), tmpReg);           // Anticipate successful CAS
-      if (os::is_MP()) {
-        lock();
-      }
-      cmpxchgptr(boxReg, Address(objReg, 0));       // Updates tmpReg
-      jccb(Assembler::equal, DONE_LABEL);
-      // Recursive locking
-      subptr(tmpReg, rsp);
-      andptr(tmpReg, (int32_t) (NOT_LP64(0xFFFFF003) LP64_ONLY(7 - os::vm_page_size())) );
-      movptr(Address(boxReg, 0), tmpReg);
-      bind(DONE_LABEL);
   } else {
     // Possible cases that we'll encounter in fast_lock
     // ------------------------------------------------
@@ -1923,29 +1902,19 @@
     }
 #else // _LP64
     // It's inflated
-
-    // TODO: someday avoid the ST-before-CAS penalty by
-    // relocating (deferring) the following ST.
-    // We should also think about trying a CAS without having
-    // fetched _owner.  If the CAS is successful we may
-    // avoid an RTO->RTS upgrade on the $line.
-
-    // Without cast to int32_t a movptr will destroy r10 which is typically obj
-    movptr(Address(boxReg, 0), (int32_t)intptr_t(markOopDesc::unused_mark()));
-
-    movptr (boxReg, tmpReg);
-    movptr(tmpReg, Address(boxReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)));
-    testptr(tmpReg, tmpReg);
-    jccb   (Assembler::notZero, DONE_LABEL);
-
-    // It's inflated and appears unlocked
+    movq(scrReg, tmpReg);
+    xorq(tmpReg, tmpReg);
+
     if (os::is_MP()) {
       lock();
     }
-    cmpxchgptr(r15_thread, Address(boxReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)));
+    cmpxchgptr(r15_thread, Address(scrReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)));
+    // Unconditionally set box->_displaced_header = markOopDesc::unused_mark().
+    // Without cast to int32_t movptr will destroy r10 which is typically obj.
+    movptr(Address(boxReg, 0), (int32_t)intptr_t(markOopDesc::unused_mark()));
     // Intentional fall-through into DONE_LABEL ...
+    // Propagate ICC.ZF from CAS above into DONE_LABEL.
 #endif // _LP64
-
 #if INCLUDE_RTM_OPT
     } // use_rtm()
 #endif
--- a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 "precompiled.hpp"
 #include "asm/macroAssembler.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterRuntime.hpp"
 #include "memory/allocation.inline.hpp"
--- a/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -32,7 +32,6 @@
 #include "memory/resourceArea.hpp"
 #include "nativeInst_zero.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 
 int InlineCacheBuffer::ic_stub_code_size() {
   // NB set this once the functions below are implemented
--- a/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,12 +24,12 @@
 
 /**
  * A SAX based parser of LogCompilation output from HotSpot.  It takes a complete
- * @author never
  */
 
 package com.sun.hotspot.tools.compiler;
 
 import java.io.FileReader;
+import java.io.PrintStream;
 import java.io.Reader;
 import java.util.ArrayDeque;
 import java.util.ArrayList;
@@ -134,6 +134,44 @@
         }
     };
 
+    class Jvms {
+        Jvms(Method method, int bci) {
+            this.method = method;
+            this.bci = bci;
+        }
+        final public Method method;
+        final public int bci;
+        final public String toString() {
+            return "@" + bci + " " + method;
+        }
+    }
+
+    class LockElimination extends BasicLogEvent {
+
+        ArrayList<Jvms> jvms = new ArrayList<Jvms>(1);
+        final String kind;
+        final String classId;
+        final String tagName;
+        LockElimination(String tagName, double start, String id, String kind, String classId) {
+            super(start, id);
+            this.kind = kind;
+            this.classId = classId;
+            this.tagName = tagName;
+        }
+
+        @Override
+        public void print(PrintStream stream) {
+            stream.printf("%s %s %s %s  %.3f ", getId(), tagName, kind, classId, getStart());
+            stream.print(jvms.toString());
+            stream.print("\n");
+        }
+
+        void addJVMS(Method method, int bci) {
+            jvms.add(new Jvms(method, bci));
+        }
+
+    }
+
     private ArrayList<LogEvent> events = new ArrayList<LogEvent>();
 
     private HashMap<String, String> types = new HashMap<String, String>();
@@ -147,6 +185,7 @@
     private CallSite site;
     private CallSite methodHandleSite;
     private Stack<Phase> phaseStack = new Stack<Phase>();
+    private LockElimination currentLockElimination;
     private UncommonTrapEvent currentTrap;
     private Stack<CallSite> lateInlineScope;
     private boolean lateInlining;
@@ -192,7 +231,12 @@
         }
 
         LogParser log = new LogParser();
-        p.parse(new InputSource(reader), log);
+        try {
+            p.parse(new InputSource(reader), log);
+        } catch (Throwable th) {
+            th.printStackTrace();
+            // Carry on with what we've got...
+        }
 
         // Associate compilations with their NMethods
         for (NMethod nm : log.nmethods.values()) {
@@ -418,8 +462,23 @@
                 // uncommon trap inserted during parsing.
                 // ignore for now
             }
+        } else if (qname.startsWith("eliminate_lock")) {
+            String id = atts.getValue("compile_id");
+            if (id != null) {
+                id = makeId(atts);
+                String kind = atts.getValue("kind");
+                String classId = atts.getValue("class_id");
+                currentLockElimination = new LockElimination(qname, Double.parseDouble(search(atts, "stamp")), id, kind, classId);
+                events.add(currentLockElimination);
+            }
         } else if (qname.equals("late_inline")) {
-            long inlineId = Long.parseLong(search(atts, "inline_id"));
+            long inlineId = 0;
+            try {
+                Long.parseLong(search(atts, "inline_id"));
+            } catch (InternalError ex) {
+                // Log files from older hotspots may lack inline_id,
+                // and zero is an acceptable substitute that allows processing to continue.
+            }
             lateInlineScope = new Stack<CallSite>();
             site = new CallSite(-999, method(search(atts, "method")));
             site.setInlineId(inlineId);
@@ -428,13 +487,14 @@
             // <jvms bci='4' method='java/io/DataInputStream readChar ()C' bytes='40' count='5815' iicount='20815'/>
             if (currentTrap != null) {
                 currentTrap.addJVMS(atts.getValue("method"), Integer.parseInt(atts.getValue("bci")));
+            } else if (currentLockElimination != null) {
+                  currentLockElimination.addJVMS(method(atts.getValue("method")), Integer.parseInt(atts.getValue("bci")));
             } else if (lateInlineScope != null) {
                 bci = Integer.parseInt(search(atts, "bci"));
                 site = new CallSite(bci, method(search(atts, "method")));
                 lateInlineScope.push(site);
             } else {
                 // Ignore <eliminate_allocation type='667'>,
-                //        <eliminate_lock lock='1'>,
                 //        <replace_string_concat arguments='2' string_alloc='0' multiple='0'>
             }
         } else if (qname.equals("inline_id")) {
@@ -512,6 +572,8 @@
             }
         } else if (qname.equals("uncommon_trap")) {
             currentTrap = null;
+        } else if (qname.startsWith("eliminate_lock")) {
+            currentLockElimination = null;
         } else if (qname.equals("late_inline")) {
             // Populate late inlining info.
             if (scopes.size() != 0) {
@@ -522,8 +584,8 @@
             CallSite caller = lateInlineScope.pop();
             Method m = compile.getMethod();
             if (m != caller.getMethod()) {
-                System.out.println(m);
-                System.out.println(caller.getMethod() + " bci: " + bci);
+                System.err.println(m);
+                System.err.println(caller.getMethod() + " bci: " + bci);
                 throw new InternalError("call site and late_inline info don't match");
             }
 
--- a/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/UncommonTrapEvent.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/UncommonTrapEvent.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,7 @@
     }
 
     public void print(PrintStream stream) {
-        stream.printf("%s uncommon trap %s %s\n", getId(), getReason(), getAction());
+        stream.printf("%s uncommon trap %.3f %s %s\n", getId(), getStart(), getReason(), getAction());
         stream.print(getJvms());
     }
 
--- a/hotspot/src/share/vm/adlc/main.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/adlc/main.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -220,7 +220,6 @@
   AD.addInclude(AD._CPP_file, "oops/markOop.hpp");
   AD.addInclude(AD._CPP_file, "oops/method.hpp");
   AD.addInclude(AD._CPP_file, "oops/oop.inline.hpp");
-  AD.addInclude(AD._CPP_file, "oops/oop.inline2.hpp");
   AD.addInclude(AD._CPP_file, "opto/cfgnode.hpp");
   AD.addInclude(AD._CPP_file, "opto/locknode.hpp");
   AD.addInclude(AD._CPP_file, "opto/opcodes.hpp");
--- a/hotspot/src/share/vm/c1/c1_Compilation.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/c1/c1_Compilation.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,12 +29,12 @@
 #include "c1/c1_LIRAssembler.hpp"
 #include "c1/c1_LinearScan.hpp"
 #include "c1/c1_MacroAssembler.hpp"
+#include "c1/c1_RangeCheckElimination.hpp"
 #include "c1/c1_ValueMap.hpp"
 #include "c1/c1_ValueStack.hpp"
 #include "code/debugInfoRec.hpp"
 #include "compiler/compileLog.hpp"
-#include "c1/c1_RangeCheckElimination.hpp"
-
+#include "runtime/sharedRuntime.hpp"
 
 typedef enum {
   _t_compile,
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -34,6 +34,7 @@
 #include "ci/ciMemberName.hpp"
 #include "compiler/compileBroker.hpp"
 #include "interpreter/bytecode.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/compilationPolicy.hpp"
 #include "runtime/vm_version.hpp"
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -32,6 +32,7 @@
 #include "ci/ciArrayKlass.hpp"
 #include "ci/ciInstance.hpp"
 #include "ci/ciObjArray.hpp"
+#include "memory/cardTableModRefBS.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/stubRoutines.hpp"
--- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 "ci/ciMethodBlocks.hpp"
 #include "ci/ciStreams.hpp"
 #include "interpreter/bytecode.hpp"
+#include "oops/oop.inline.hpp"
 #include "utilities/bitMap.inline.hpp"
 
 
--- a/hotspot/src/share/vm/ci/ciArray.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/ci/ciArray.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,8 @@
 #include "ci/ciConstant.hpp"
 #include "ci/ciKlass.hpp"
 #include "ci/ciUtilities.hpp"
-#include "oops/objArrayOop.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "oops/typeArrayOop.hpp"
 
 // ciArray
--- a/hotspot/src/share/vm/ci/ciBaseObject.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/ci/ciBaseObject.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
 #include "ci/ciBaseObject.hpp"
 #include "ci/ciUtilities.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
-#include "oops/oop.inline2.hpp"
 
 // ------------------------------------------------------------------
 // ciBaseObject::set_ident
--- a/hotspot/src/share/vm/ci/ciCallSite.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/ci/ciCallSite.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "ci/ciCallSite.hpp"
 #include "ci/ciUtilities.hpp"
 
--- a/hotspot/src/share/vm/ci/ciEnv.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/ci/ciEnv.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,8 +46,8 @@
 #include "memory/universe.inline.hpp"
 #include "oops/methodData.hpp"
 #include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "prims/jvmtiExport.hpp"
 #include "runtime/init.hpp"
 #include "runtime/reflection.hpp"
--- a/hotspot/src/share/vm/ci/ciField.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/ci/ciField.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,6 @@
 #include "interpreter/linkResolver.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "runtime/fieldDescriptor.hpp"
 
 // ciField
--- a/hotspot/src/share/vm/ci/ciInstance.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/ci/ciInstance.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,6 +27,7 @@
 
 #include "ci/ciObject.hpp"
 #include "oops/instanceOop.hpp"
+#include "oops/oop.hpp"
 
 // ciInstance
 //
--- a/hotspot/src/share/vm/ci/ciMetadata.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/ci/ciMetadata.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
 #include "ci/ciObject.hpp"
 #include "ci/ciUtilities.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
-#include "oops/oop.inline2.hpp"
 
 // ------------------------------------------------------------------
 // ciMetadata::print
--- a/hotspot/src/share/vm/ci/ciMethodData.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/ci/ciMethodData.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
 #include "ci/ciObject.hpp"
 #include "ci/ciUtilities.hpp"
 #include "oops/methodData.hpp"
-#include "oops/oop.inline.hpp"
+#include "oops/oop.hpp"
 #include "runtime/deoptimization.hpp"
 
 class ciBitData;
--- a/hotspot/src/share/vm/ci/ciObjArray.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/ci/ciObjArray.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
 #include "ci/ciNullObject.hpp"
 #include "ci/ciObjArray.hpp"
 #include "ci/ciUtilities.hpp"
-#include "oops/objArrayOop.hpp"
+#include "oops/objArrayOop.inline.hpp"
 
 // ciObjArray
 //
--- a/hotspot/src/share/vm/ci/ciObject.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/ci/ciObject.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
 #include "ci/ciObject.hpp"
 #include "ci/ciUtilities.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
-#include "oops/oop.inline2.hpp"
+#include "oops/oop.inline.hpp"
 
 // ciObject
 //
--- a/hotspot/src/share/vm/ci/ciObjectFactory.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/ci/ciObjectFactory.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,11 +40,11 @@
 #include "ci/ciTypeArray.hpp"
 #include "ci/ciTypeArrayKlass.hpp"
 #include "ci/ciUtilities.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
 #include "memory/allocation.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "runtime/fieldType.hpp"
 #include "utilities/macros.hpp"
 #if INCLUDE_ALL_GCS
--- a/hotspot/src/share/vm/ci/ciReplay.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/ci/ciReplay.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,7 @@
 #include "memory/allocation.inline.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
 #include "utilities/copy.hpp"
 #include "utilities/macros.hpp"
 
--- a/hotspot/src/share/vm/ci/ciTypeFlow.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/ci/ciTypeFlow.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,7 @@
 #include "interpreter/bytecode.hpp"
 #include "interpreter/bytecodes.hpp"
 #include "memory/allocation.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "opto/compile.hpp"
 #include "opto/node.hpp"
 #include "runtime/deoptimization.hpp"
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -25,10 +25,9 @@
 #include "precompiled.hpp"
 #include "classfile/classFileParser.hpp"
 #include "classfile/classLoader.hpp"
-#include "classfile/classLoaderData.hpp"
 #include "classfile/classLoaderData.inline.hpp"
 #include "classfile/defaultMethods.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/symbolTable.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/verificationType.hpp"
--- a/hotspot/src/share/vm/classfile/classFileParser.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/classfile/classFileParser.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,9 +27,7 @@
 
 #include "classfile/classFileStream.hpp"
 #include "memory/resourceArea.hpp"
-#include "oops/oop.inline.hpp"
 #include "oops/typeArrayOop.hpp"
-#include "runtime/handles.inline.hpp"
 #include "utilities/accessFlags.hpp"
 #include "classfile/symbolTable.hpp"
 
--- a/hotspot/src/share/vm/classfile/classLoader.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/classfile/classLoader.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -152,40 +152,6 @@
 }
 
 
-MetaIndex::MetaIndex(char** meta_package_names, int num_meta_package_names) {
-  if (num_meta_package_names == 0) {
-    _meta_package_names = NULL;
-    _num_meta_package_names = 0;
-  } else {
-    _meta_package_names = NEW_C_HEAP_ARRAY(char*, num_meta_package_names, mtClass);
-    _num_meta_package_names = num_meta_package_names;
-    memcpy(_meta_package_names, meta_package_names, num_meta_package_names * sizeof(char*));
-  }
-}
-
-
-MetaIndex::~MetaIndex() {
-  FREE_C_HEAP_ARRAY(char*, _meta_package_names);
-}
-
-
-bool MetaIndex::may_contain(const char* class_name) {
-  if ( _num_meta_package_names == 0) {
-    return false;
-  }
-  size_t class_name_len = strlen(class_name);
-  for (int i = 0; i < _num_meta_package_names; i++) {
-    char* pkg = _meta_package_names[i];
-    size_t pkg_len = strlen(pkg);
-    size_t min_len = MIN2(class_name_len, pkg_len);
-    if (!strncmp(class_name, pkg, min_len)) {
-      return true;
-    }
-  }
-  return false;
-}
-
-
 ClassPathEntry::ClassPathEntry() {
   set_next(NULL);
 }
@@ -315,7 +281,6 @@
 LazyClassPathEntry::LazyClassPathEntry(const char* path, const struct stat* st, bool throw_exception) : ClassPathEntry() {
   _path = os::strdup_check_oom(path);
   _st = *st;
-  _meta_index = NULL;
   _resolved_entry = NULL;
   _has_error = false;
   _throw_exception = throw_exception;
@@ -354,10 +319,6 @@
 }
 
 ClassFileStream* LazyClassPathEntry::open_stream(const char* name, TRAPS) {
-  if (_meta_index != NULL &&
-      !_meta_index->may_contain(name)) {
-    return NULL;
-  }
   if (_has_error) {
     return NULL;
   }
@@ -463,16 +424,6 @@
 }
 #endif
 
-static void print_meta_index(LazyClassPathEntry* entry,
-                             GrowableArray<char*>& meta_packages) {
-  tty->print("[Meta index for %s=", entry->name());
-  for (int i = 0; i < meta_packages.length(); i++) {
-    if (i > 0) tty->print(" ");
-    tty->print("%s", meta_packages.at(i));
-  }
-  tty->print_cr("]");
-}
-
 #if INCLUDE_CDS
 void ClassLoader::exit_with_path_failure(const char* error, const char* message) {
   assert(DumpSharedSpaces, "only called at dump time");
@@ -508,123 +459,6 @@
   }
 }
 
-void ClassLoader::setup_bootstrap_meta_index() {
-  // Set up meta index which allows us to open boot jars lazily if
-  // class data sharing is enabled
-  const char* meta_index_path = Arguments::get_meta_index_path();
-  const char* meta_index_dir  = Arguments::get_meta_index_dir();
-  setup_meta_index(meta_index_path, meta_index_dir, 0);
-}
-
-void ClassLoader::setup_meta_index(const char* meta_index_path, const char* meta_index_dir, int start_index) {
-  const char* known_version = "% VERSION 2";
-  FILE* file = fopen(meta_index_path, "r");
-  int line_no = 0;
-#if INCLUDE_CDS
-  if (DumpSharedSpaces) {
-    if (file != NULL) {
-      _shared_paths_misc_info->add_required_file(meta_index_path);
-    } else {
-      _shared_paths_misc_info->add_nonexist_path(meta_index_path);
-    }
-  }
-#endif
-  if (file != NULL) {
-    ResourceMark rm;
-    LazyClassPathEntry* cur_entry = NULL;
-    GrowableArray<char*> boot_class_path_packages(10);
-    char package_name[256];
-    bool skipCurrentJar = false;
-    while (fgets(package_name, sizeof(package_name), file) != NULL) {
-      ++line_no;
-      // Remove trailing newline
-      package_name[strlen(package_name) - 1] = '\0';
-      switch(package_name[0]) {
-        case '%':
-        {
-          if ((line_no == 1) && (strcmp(package_name, known_version) != 0)) {
-            if (TraceClassLoading && Verbose) {
-              tty->print("[Unsupported meta index version]");
-            }
-            fclose(file);
-            return;
-          }
-        }
-
-        // These directives indicate jar files which contain only
-        // classes, only non-classfile resources, or a combination of
-        // the two. See src/share/classes/sun/misc/MetaIndex.java and
-        // make/tools/MetaIndex/BuildMetaIndex.java in the J2SE
-        // workspace.
-        case '#':
-        case '!':
-        case '@':
-        {
-          // Hand off current packages to current lazy entry (if any)
-          if ((cur_entry != NULL) &&
-              (boot_class_path_packages.length() > 0)) {
-            if ((TraceClassLoading || TraceClassPaths) && Verbose) {
-              print_meta_index(cur_entry, boot_class_path_packages);
-            }
-            MetaIndex* index = new MetaIndex(boot_class_path_packages.adr_at(0),
-                                             boot_class_path_packages.length());
-            cur_entry->set_meta_index(index);
-          }
-          cur_entry = NULL;
-          boot_class_path_packages.clear();
-
-          // Find lazy entry corresponding to this jar file
-          int count = 0;
-          for (ClassPathEntry* entry = _first_entry; entry != NULL; entry = entry->next(), count++) {
-            if (count >= start_index &&
-                entry->is_lazy() &&
-                string_starts_with(entry->name(), meta_index_dir) &&
-                string_ends_with(entry->name(), &package_name[2])) {
-              cur_entry = (LazyClassPathEntry*) entry;
-              break;
-            }
-          }
-
-          // If the first character is '@', it indicates the following jar
-          // file is a resource only jar file in which case, we should skip
-          // reading the subsequent entries since the resource loading is
-          // totally handled by J2SE side.
-          if (package_name[0] == '@') {
-            if (cur_entry != NULL) {
-              cur_entry->set_meta_index(new MetaIndex(NULL, 0));
-            }
-            cur_entry = NULL;
-            skipCurrentJar = true;
-          } else {
-            skipCurrentJar = false;
-          }
-
-          break;
-        }
-
-        default:
-        {
-          if (!skipCurrentJar && cur_entry != NULL) {
-            char* new_name = os::strdup_check_oom(package_name);
-            boot_class_path_packages.append(new_name);
-          }
-        }
-      }
-    }
-    // Hand off current packages to current lazy entry (if any)
-    if ((cur_entry != NULL) &&
-        (boot_class_path_packages.length() > 0)) {
-      if ((TraceClassLoading || TraceClassPaths) && Verbose) {
-        print_meta_index(cur_entry, boot_class_path_packages);
-      }
-      MetaIndex* index = new MetaIndex(boot_class_path_packages.adr_at(0),
-                                       boot_class_path_packages.length());
-      cur_entry->set_meta_index(index);
-    }
-    fclose(file);
-  }
-}
-
 #if INCLUDE_CDS
 void ClassLoader::check_shared_classpath(const char *path) {
   if (strcmp(path, "") == 0) {
@@ -1315,10 +1149,6 @@
   }
 #endif
   setup_bootstrap_search_path();
-  if (LazyBootClassLoader) {
-    // set up meta index which makes boot classpath initialization lazier
-    setup_bootstrap_meta_index();
-  }
 }
 
 #if INCLUDE_CDS
@@ -1486,12 +1316,7 @@
 }
 
 bool ClassPathZipEntry::is_jrt() {
-  real_jzfile* zip = (real_jzfile*) _zip;
-  int len = (int)strlen(zip->name);
-  // Check whether zip name ends in "rt.jar"
-  // This will match other archives named rt.jar as well, but this is
-  // only used for debugging.
-  return string_ends_with(zip->name, "rt.jar");
+  return false;
 }
 
 void LazyClassPathEntry::compile_the_world(Handle loader, TRAPS) {
@@ -1519,7 +1344,7 @@
   ClassPathEntry* e = _first_entry;
   jlong start = os::javaTimeMillis();
   while (e != NULL) {
-    // We stop at rt.jar, unless it is the first bootstrap path entry
+    // We stop at bootmodules.jimage, unless it is the first bootstrap path entry
     if (e->is_jrt() && e != _first_entry) break;
     e->compile_the_world(system_class_loader, CATCH);
     e = e->next();
--- a/hotspot/src/share/vm/classfile/classLoader.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/classfile/classLoader.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,18 +33,6 @@
 #include <sys/stat.h>
 
 
-// Meta-index (optional, to be able to skip opening boot classpath jar files)
-class MetaIndex: public CHeapObj<mtClass> {
- private:
-  char** _meta_package_names;
-  int    _num_meta_package_names;
- public:
-  MetaIndex(char** meta_package_names, int num_meta_package_names);
-  ~MetaIndex();
-  bool may_contain(const char* class_name);
-};
-
-
 // Class path entry (directory or zip file)
 
 class ClassPathEntry: public CHeapObj<mtClass> {
@@ -122,7 +110,6 @@
  private:
   const char* _path; // dir or file
   struct stat _st;
-  MetaIndex* _meta_index;
   bool _has_error;
   bool _throw_exception;
   volatile ClassPathEntry* _resolved_entry;
@@ -135,7 +122,6 @@
   u1* open_entry(const char* name, jint* filesize, bool nul_terminate, TRAPS);
 
   ClassFileStream* open_stream(const char* name, TRAPS);
-  void set_meta_index(MetaIndex* meta_index) { _meta_index = meta_index; }
   virtual bool is_lazy();
   // Debugging
   NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
@@ -231,9 +217,6 @@
   static bool add_package(const char *pkgname, int classpath_index, TRAPS);
 
   // Initialization
-  static void setup_bootstrap_meta_index();
-  static void setup_meta_index(const char* meta_index_path, const char* meta_index_dir,
-                               int start_index);
   static void setup_bootstrap_search_path();
   static void setup_search_path(const char *class_path);
 
--- a/hotspot/src/share/vm/classfile/classLoaderData.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,6 +57,8 @@
 #include "memory/metadataFactory.hpp"
 #include "memory/metaspaceShared.hpp"
 #include "memory/oopFactory.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/jniHandles.hpp"
 #include "runtime/mutex.hpp"
--- a/hotspot/src/share/vm/classfile/classLoaderStats.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/classfile/classLoaderStats.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 "precompiled.hpp"
 #include "classfile/classLoaderStats.hpp"
+#include "oops/oop.inline.hpp"
 #include "utilities/globalDefinitions.hpp"
 
 
--- a/hotspot/src/share/vm/classfile/dictionary.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/classfile/dictionary.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
 
 #include "classfile/systemDictionary.hpp"
 #include "oops/instanceKlass.hpp"
-#include "oops/oop.inline.hpp"
+#include "oops/oop.hpp"
 #include "utilities/hashtable.hpp"
 
 class DictionaryEntry;
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 "classfile/altHashing.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/stringTable.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "code/debugInfo.hpp"
@@ -39,6 +39,8 @@
 #include "oops/instanceMirrorKlass.hpp"
 #include "oops/klass.hpp"
 #include "oops/method.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "oops/symbol.hpp"
 #include "oops/typeArrayOop.hpp"
 #include "prims/jvmtiRedefineClassesTrace.hpp"
@@ -149,6 +151,10 @@
 
 bool java_lang_String::initialized  = false;
 
+bool java_lang_String::is_instance(oop obj) {
+  return is_instance_inlined(obj);
+}
+
 void java_lang_String::compute_offsets() {
   assert(!initialized, "offsets should be initialized only once");
 
@@ -2730,6 +2736,11 @@
   }
 }
 
+bool java_lang_invoke_LambdaForm::is_instance(oop obj) {
+  return obj != NULL && is_subclass(obj->klass());
+}
+
+
 oop java_lang_invoke_MethodHandle::type(oop mh) {
   return mh->obj_field(_type_offset);
 }
@@ -3076,6 +3087,10 @@
   return false;
 }
 
+bool java_lang_ClassLoader::is_instance(oop obj) {
+  return obj != NULL && is_subclass(obj->klass());
+}
+
 
 // For class loader classes, parallelCapable defined
 // based on non-null field
--- a/hotspot/src/share/vm/classfile/javaClasses.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/classfile/javaClasses.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -204,9 +204,8 @@
   static Symbol* as_symbol_or_null(oop java_string);
 
   // Testers
-  static bool is_instance(oop obj) {
-    return obj != NULL && obj->klass() == SystemDictionary::String_klass();
-  }
+  static bool is_instance(oop obj);
+  static bool is_instance_inlined(oop obj);
 
   // Debugging
   static void print(oop java_string, outputStream* st);
@@ -273,9 +272,8 @@
   static Symbol* as_signature(oop java_class, bool intern_if_not_found, TRAPS);
   static void print_signature(oop java_class, outputStream *st);
   // Testing
-  static bool is_instance(oop obj) {
-    return obj != NULL && obj->klass() == SystemDictionary::Class_klass();
-  }
+  static bool is_instance(oop obj);
+
   static bool is_primitive(oop java_class);
   static BasicType primitive_type(oop java_class);
   static oop primitive_mirror(BasicType t);
@@ -989,9 +987,7 @@
   static bool is_subclass(Klass* klass) {
     return klass->is_subclass_of(SystemDictionary::MethodHandle_klass());
   }
-  static bool is_instance(oop obj) {
-    return obj != NULL && is_subclass(obj->klass());
-  }
+  static bool is_instance(oop obj);
 
   // Accessors for code generation:
   static int type_offset_in_bytes()             { return _type_offset; }
@@ -1016,9 +1012,7 @@
   static bool is_subclass(Klass* klass) {
     return klass->is_subclass_of(SystemDictionary::DirectMethodHandle_klass());
   }
-  static bool is_instance(oop obj) {
-    return obj != NULL && is_subclass(obj->klass());
-  }
+  static bool is_instance(oop obj);
 
   // Accessors for code generation:
   static int member_offset_in_bytes()           { return _member_offset; }
@@ -1045,9 +1039,7 @@
     return SystemDictionary::LambdaForm_klass() != NULL &&
       klass->is_subclass_of(SystemDictionary::LambdaForm_klass());
   }
-  static bool is_instance(oop obj) {
-    return obj != NULL && is_subclass(obj->klass());
-  }
+  static bool is_instance(oop obj);
 
   // Accessors for code generation:
   static int vmentry_offset_in_bytes()          { return _vmentry_offset; }
@@ -1111,9 +1103,7 @@
   static bool is_subclass(Klass* klass) {
     return klass->is_subclass_of(SystemDictionary::MemberName_klass());
   }
-  static bool is_instance(oop obj) {
-    return obj != NULL && is_subclass(obj->klass());
-  }
+  static bool is_instance(oop obj);
 
   static bool is_method(oop obj);
 
@@ -1166,9 +1156,7 @@
   static Symbol*        as_signature(oop mt, bool intern_if_not_found, TRAPS);
   static void           print_signature(oop mt, outputStream* st);
 
-  static bool is_instance(oop obj) {
-    return obj != NULL && obj->klass() == SystemDictionary::MethodType_klass();
-  }
+  static bool is_instance(oop obj);
 
   static bool equals(oop mt1, oop mt2);
 
@@ -1190,19 +1178,17 @@
 
 public:
   // Accessors
-  static oop              target(         oop site)             { return site->obj_field(             _target_offset);         }
-  static void         set_target(         oop site, oop target) {        site->obj_field_put(         _target_offset, target); }
+  static oop              target(         oop site);
+  static void         set_target(         oop site, oop target);
 
-  static volatile oop     target_volatile(oop site)             { return oop((oopDesc *)(site->obj_field_volatile(_target_offset))); }
-  static void         set_target_volatile(oop site, oop target) {        site->obj_field_put_volatile(_target_offset, target); }
+  static volatile oop     target_volatile(oop site);
+  static void         set_target_volatile(oop site, oop target);
 
   // Testers
   static bool is_subclass(Klass* klass) {
     return klass->is_subclass_of(SystemDictionary::CallSite_klass());
   }
-  static bool is_instance(oop obj) {
-    return obj != NULL && is_subclass(obj->klass());
-  }
+  static bool is_instance(oop obj);
 
   // Accessors for code generation:
   static int target_offset_in_bytes()           { return _target_offset; }
@@ -1268,9 +1254,7 @@
   static bool is_subclass(Klass* klass) {
     return klass->is_subclass_of(SystemDictionary::ClassLoader_klass());
   }
-  static bool is_instance(oop obj) {
-    return obj != NULL && is_subclass(obj->klass());
-  }
+  static bool is_instance(oop obj);
 
   // Debugging
   friend class JavaClasses;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/classfile/javaClasses.inline.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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_CLASSFILE_JAVACLASSES_INLINE_HPP
+#define SHARE_VM_CLASSFILE_JAVACLASSES_INLINE_HPP
+
+#include "classfile/javaClasses.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oopsHierarchy.hpp"
+
+inline volatile oop java_lang_invoke_CallSite::target_volatile(oop site) {
+  return oop((oopDesc *)(site->obj_field_volatile(_target_offset)));
+}
+
+inline void java_lang_invoke_CallSite::set_target_volatile(oop site, oop target) {
+  site->obj_field_put_volatile(_target_offset, target);
+}
+
+inline oop  java_lang_invoke_CallSite::target(oop site) {
+  return site->obj_field(_target_offset);
+}
+
+inline void java_lang_invoke_CallSite::set_target(oop site, oop target) {
+  site->obj_field_put(_target_offset, target);
+}
+
+inline bool java_lang_String::is_instance_inlined(oop obj) {
+  return obj != NULL && obj->klass() == SystemDictionary::String_klass();
+}
+
+inline bool java_lang_invoke_CallSite::is_instance(oop obj) {
+  return obj != NULL && is_subclass(obj->klass());
+}
+
+inline bool java_lang_invoke_MemberName::is_instance(oop obj) {
+  return obj != NULL && is_subclass(obj->klass());
+}
+
+inline bool java_lang_invoke_MethodType::is_instance(oop obj) {
+  return obj != NULL && obj->klass() == SystemDictionary::MethodType_klass();
+}
+
+inline bool java_lang_invoke_MethodHandle::is_instance(oop obj) {
+  return obj != NULL && is_subclass(obj->klass());
+}
+
+inline bool java_lang_Class::is_instance(oop obj) {
+  return obj != NULL && obj->klass() == SystemDictionary::Class_klass();
+}
+
+inline bool java_lang_invoke_DirectMethodHandle::is_instance(oop obj) {
+  return obj != NULL && is_subclass(obj->klass());
+}
+
+#endif // SHARE_VM_CLASSFILE_JAVACLASSES_INLINE_HPP
--- a/hotspot/src/share/vm/classfile/stringTable.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/classfile/stringTable.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,6 @@
 #include "memory/filemap.hpp"
 #include "memory/gcLocker.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "utilities/hashtable.inline.hpp"
--- a/hotspot/src/share/vm/classfile/symbolTable.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/classfile/symbolTable.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -33,7 +33,6 @@
 #include "memory/filemap.hpp"
 #include "memory/gcLocker.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "utilities/hashtable.inline.hpp"
--- a/hotspot/src/share/vm/classfile/systemDictionary.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -25,7 +25,7 @@
 #include "precompiled.hpp"
 #include "classfile/classLoaderData.inline.hpp"
 #include "classfile/dictionary.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/loaderConstraints.hpp"
 #include "classfile/placeholders.hpp"
 #include "classfile/resolutionErrors.hpp"
@@ -44,8 +44,8 @@
 #include "oops/klass.inline.hpp"
 #include "oops/methodData.hpp"
 #include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "oops/typeArrayKlass.hpp"
 #include "prims/jvmtiEnvBase.hpp"
 #include "prims/methodHandles.hpp"
--- a/hotspot/src/share/vm/classfile/verificationType.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/classfile/verificationType.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
 #include "classfile/systemDictionary.hpp"
 #include "memory/allocation.hpp"
 #include "oops/instanceKlass.hpp"
-#include "oops/oop.inline.hpp"
+#include "oops/oop.hpp"
 #include "oops/symbol.hpp"
 #include "runtime/handles.hpp"
 #include "runtime/signature.hpp"
--- a/hotspot/src/share/vm/code/codeCache.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/code/codeCache.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -39,6 +39,7 @@
 #include "oops/method.hpp"
 #include "oops/objArrayOop.hpp"
 #include "oops/oop.inline.hpp"
+#include "oops/verifyOopClosure.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/icache.hpp"
--- a/hotspot/src/share/vm/code/dependencies.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/code/dependencies.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,6 +27,7 @@
 #include "ci/ciEnv.hpp"
 #include "ci/ciKlass.hpp"
 #include "ci/ciMethod.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "code/dependencies.hpp"
 #include "compiler/compileLog.hpp"
 #include "oops/oop.inline.hpp"
--- a/hotspot/src/share/vm/code/icBuffer.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/code/icBuffer.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,6 @@
 #include "memory/universe.inline.hpp"
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/stubRoutines.hpp"
 
--- a/hotspot/src/share/vm/code/nmethod.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/code/nmethod.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,7 @@
 #include "compiler/disassembler.hpp"
 #include "interpreter/bytecode.hpp"
 #include "oops/methodData.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "prims/jvmtiImpl.hpp"
 #include "runtime/atomic.inline.hpp"
--- a/hotspot/src/share/vm/compiler/disassembler.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/compiler/disassembler.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
 #include "compiler/disassembler.hpp"
 #include "gc_interface/collectedHeap.hpp"
 #include "memory/cardTableModRefBS.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/fprofiler.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/os.hpp"
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -129,8 +129,8 @@
 // GenCollectedHeap heap.
 class VM_GenCollectFullConcurrent: public VM_GC_Operation {
  public:
-  VM_GenCollectFullConcurrent(unsigned int gc_count_before,
-                              unsigned int full_gc_count_before,
+  VM_GenCollectFullConcurrent(uint gc_count_before,
+                              uint full_gc_count_before,
                               GCCause::Cause gc_cause)
     : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true /* full */)
   {
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -333,7 +333,7 @@
   HeapRegion* lists[] = {_head,   _survivor_head};
   const char* names[] = {"YOUNG", "SURVIVOR"};
 
-  for (unsigned int list = 0; list < ARRAY_SIZE(lists); ++list) {
+  for (uint list = 0; list < ARRAY_SIZE(lists); ++list) {
     gclog_or_tty->print_cr("%s LIST CONTENTS", names[list]);
     HeapRegion *curr = lists[list];
     if (curr == NULL)
@@ -765,8 +765,8 @@
   assert_heap_not_locked_and_not_at_safepoint();
   assert(!is_humongous(word_size), "we do not allow humongous TLABs");
 
-  unsigned int dummy_gc_count_before;
-  int dummy_gclocker_retry_count = 0;
+  uint dummy_gc_count_before;
+  uint dummy_gclocker_retry_count = 0;
   return attempt_allocation(word_size, &dummy_gc_count_before, &dummy_gclocker_retry_count);
 }
 
@@ -776,8 +776,8 @@
   assert_heap_not_locked_and_not_at_safepoint();
 
   // Loop until the allocation is satisfied, or unsatisfied after GC.
-  for (int try_count = 1, gclocker_retry_count = 0; /* we'll return */; try_count += 1) {
-    unsigned int gc_count_before;
+  for (uint try_count = 1, gclocker_retry_count = 0; /* we'll return */; try_count += 1) {
+    uint gc_count_before;
 
     HeapWord* result = NULL;
     if (!is_humongous(word_size)) {
@@ -829,8 +829,8 @@
 
 HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size,
                                                    AllocationContext_t context,
-                                                   unsigned int *gc_count_before_ret,
-                                                   int* gclocker_retry_count_ret) {
+                                                   uint* gc_count_before_ret,
+                                                   uint* gclocker_retry_count_ret) {
   // Make sure you read the note in attempt_allocation_humongous().
 
   assert_heap_not_locked_and_not_at_safepoint();
@@ -847,7 +847,7 @@
   HeapWord* result = NULL;
   for (int try_count = 1; /* we'll return */; try_count += 1) {
     bool should_try_gc;
-    unsigned int gc_count_before;
+    uint gc_count_before;
 
     {
       MutexLockerEx x(Heap_lock);
@@ -891,7 +891,7 @@
     if (should_try_gc) {
       bool succeeded;
       result = do_collection_pause(word_size, gc_count_before, &succeeded,
-          GCCause::_g1_inc_collection_pause);
+                                   GCCause::_g1_inc_collection_pause);
       if (result != NULL) {
         assert(succeeded, "only way to get back a non-NULL result");
         return result;
@@ -945,8 +945,8 @@
 }
 
 HeapWord* G1CollectedHeap::attempt_allocation_humongous(size_t word_size,
-                                                        unsigned int * gc_count_before_ret,
-                                                        int* gclocker_retry_count_ret) {
+                                                        uint* gc_count_before_ret,
+                                                        uint* gclocker_retry_count_ret) {
   // The structure of this method has a lot of similarities to
   // attempt_allocation_slow(). The reason these two were not merged
   // into a single one is that such a method would require several "if
@@ -979,7 +979,7 @@
   HeapWord* result = NULL;
   for (int try_count = 1; /* we'll return */; try_count += 1) {
     bool should_try_gc;
-    unsigned int gc_count_before;
+    uint gc_count_before;
 
     {
       MutexLockerEx x(Heap_lock);
@@ -1017,7 +1017,7 @@
 
       bool succeeded;
       result = do_collection_pause(word_size, gc_count_before, &succeeded,
-          GCCause::_g1_humongous_allocation);
+                                   GCCause::_g1_humongous_allocation);
       if (result != NULL) {
         assert(succeeded, "only way to get back a non-NULL result");
         return result;
@@ -1815,7 +1815,7 @@
   assert(n_rem_sets > 0, "Invariant.");
 
   _worker_cset_start_region = NEW_C_HEAP_ARRAY(HeapRegion*, n_queues, mtGC);
-  _worker_cset_start_region_time_stamp = NEW_C_HEAP_ARRAY(unsigned int, n_queues, mtGC);
+  _worker_cset_start_region_time_stamp = NEW_C_HEAP_ARRAY(uint, n_queues, mtGC);
   _evacuation_failed_info_array = NEW_C_HEAP_ARRAY(EvacuationFailedInfo, n_queues, mtGC);
 
   for (int i = 0; i < n_queues; i++) {
@@ -2396,9 +2396,9 @@
 void G1CollectedHeap::collect(GCCause::Cause cause) {
   assert_heap_not_locked();
 
-  unsigned int gc_count_before;
-  unsigned int old_marking_count_before;
-  unsigned int full_gc_count_before;
+  uint gc_count_before;
+  uint old_marking_count_before;
+  uint full_gc_count_before;
   bool retry_gc;
 
   do {
@@ -3418,7 +3418,7 @@
 }
 
 HeapWord* G1CollectedHeap::do_collection_pause(size_t word_size,
-                                               unsigned int gc_count_before,
+                                               uint gc_count_before,
                                                bool* succeeded,
                                                GCCause::Cause gc_cause) {
   assert_heap_not_locked_and_not_at_safepoint();
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -325,11 +325,11 @@
 
   // Keeps track of how many "old marking cycles" (i.e., Full GCs or
   // concurrent cycles) we have started.
-  volatile unsigned int _old_marking_cycles_started;
+  volatile uint _old_marking_cycles_started;
 
   // Keeps track of how many "old marking cycles" (i.e., Full GCs or
   // concurrent cycles) we have completed.
-  volatile unsigned int _old_marking_cycles_completed;
+  volatile uint _old_marking_cycles_completed;
 
   bool _concurrent_cycle_started;
   bool _heap_summary_sent;
@@ -497,22 +497,22 @@
   // the mutator alloc region without taking the Heap_lock. This
   // should only be used for non-humongous allocations.
   inline HeapWord* attempt_allocation(size_t word_size,
-                                      unsigned int* gc_count_before_ret,
-                                      int* gclocker_retry_count_ret);
+                                      uint* gc_count_before_ret,
+                                      uint* gclocker_retry_count_ret);
 
   // Second-level mutator allocation attempt: take the Heap_lock and
   // retry the allocation attempt, potentially scheduling a GC
   // pause. This should only be used for non-humongous allocations.
   HeapWord* attempt_allocation_slow(size_t word_size,
                                     AllocationContext_t context,
-                                    unsigned int* gc_count_before_ret,
-                                    int* gclocker_retry_count_ret);
+                                    uint* gc_count_before_ret,
+                                    uint* gclocker_retry_count_ret);
 
   // Takes the Heap_lock and attempts a humongous allocation. It can
   // potentially schedule a GC pause.
   HeapWord* attempt_allocation_humongous(size_t word_size,
-                                         unsigned int* gc_count_before_ret,
-                                         int* gclocker_retry_count_ret);
+                                         uint* gc_count_before_ret,
+                                         uint* gclocker_retry_count_ret);
 
   // Allocation attempt that should be called during safepoints (e.g.,
   // at the end of a successful GC). expect_null_mutator_alloc_region
@@ -686,7 +686,7 @@
   // +ExplicitGCInvokesConcurrent).
   void increment_old_marking_cycles_completed(bool concurrent);
 
-  unsigned int old_marking_cycles_completed() {
+  uint old_marking_cycles_completed() {
     return _old_marking_cycles_completed;
   }
 
@@ -745,7 +745,7 @@
   // methods that call do_collection_pause() release the Heap_lock
   // before the call, so it's easy to read gc_count_before just before.
   HeapWord* do_collection_pause(size_t         word_size,
-                                unsigned int   gc_count_before,
+                                uint           gc_count_before,
                                 bool*          succeeded,
                                 GCCause::Cause gc_cause);
 
@@ -981,7 +981,7 @@
   // The heap region entry for a given worker is valid iff
   // the associated time stamp value matches the current value
   // of G1CollectedHeap::_gc_time_stamp.
-  unsigned int* _worker_cset_start_region_time_stamp;
+  uint* _worker_cset_start_region_time_stamp;
 
   enum G1H_process_roots_tasks {
     G1H_PS_filter_satb_buffers,
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -131,8 +131,8 @@
 }
 
 inline HeapWord* G1CollectedHeap::attempt_allocation(size_t word_size,
-                                                     unsigned int* gc_count_before_ret,
-                                                     int* gclocker_retry_count_ret) {
+                                                     uint* gc_count_before_ret,
+                                                     uint* gclocker_retry_count_ret) {
   assert_heap_not_locked_and_not_at_safepoint();
   assert(!is_humongous(word_size), "attempt_allocation() should not "
          "be called for humongous allocation requests");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,239 @@
+/*
+ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc_implementation/g1/concurrentMark.inline.hpp"
+#include "gc_implementation/g1/dirtyCardQueue.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1EvacFailure.hpp"
+#include "gc_implementation/g1/g1_globals.hpp"
+#include "gc_implementation/g1/g1OopClosures.inline.hpp"
+#include "gc_implementation/g1/heapRegion.hpp"
+#include "gc_implementation/g1/heapRegionRemSet.hpp"
+
+class UpdateRSetDeferred : public OopsInHeapRegionClosure {
+private:
+  G1CollectedHeap* _g1;
+  DirtyCardQueue *_dcq;
+  G1SATBCardTableModRefBS* _ct_bs;
+
+public:
+  UpdateRSetDeferred(G1CollectedHeap* g1, DirtyCardQueue* dcq) :
+    _g1(g1), _ct_bs(_g1->g1_barrier_set()), _dcq(dcq) {}
+
+  virtual void do_oop(narrowOop* p) { do_oop_work(p); }
+  virtual void do_oop(      oop* p) { do_oop_work(p); }
+  template <class T> void do_oop_work(T* p) {
+    assert(_from->is_in_reserved(p), "paranoia");
+    if (!_from->is_in_reserved(oopDesc::load_decode_heap_oop(p)) &&
+        !_from->is_survivor()) {
+      size_t card_index = _ct_bs->index_for(p);
+      if (_ct_bs->mark_card_deferred(card_index)) {
+        _dcq->enqueue((jbyte*)_ct_bs->byte_for_index(card_index));
+      }
+    }
+  }
+};
+
+class RemoveSelfForwardPtrObjClosure: public ObjectClosure {
+private:
+  G1CollectedHeap* _g1;
+  ConcurrentMark* _cm;
+  HeapRegion* _hr;
+  size_t _marked_bytes;
+  OopsInHeapRegionClosure *_update_rset_cl;
+  bool _during_initial_mark;
+  bool _during_conc_mark;
+  uint _worker_id;
+  HeapWord* _end_of_last_gap;
+  HeapWord* _last_gap_threshold;
+  HeapWord* _last_obj_threshold;
+
+public:
+  RemoveSelfForwardPtrObjClosure(G1CollectedHeap* g1, ConcurrentMark* cm,
+                                 HeapRegion* hr,
+                                 OopsInHeapRegionClosure* update_rset_cl,
+                                 bool during_initial_mark,
+                                 bool during_conc_mark,
+                                 uint worker_id) :
+    _g1(g1), _cm(cm), _hr(hr), _marked_bytes(0),
+    _update_rset_cl(update_rset_cl),
+    _during_initial_mark(during_initial_mark),
+    _during_conc_mark(during_conc_mark),
+    _worker_id(worker_id),
+    _end_of_last_gap(hr->bottom()),
+    _last_gap_threshold(hr->bottom()),
+    _last_obj_threshold(hr->bottom()) { }
+
+  size_t marked_bytes() { return _marked_bytes; }
+
+  // <original comment>
+  // The original idea here was to coalesce evacuated and dead objects.
+  // However that caused complications with the block offset table (BOT).
+  // In particular if there were two TLABs, one of them partially refined.
+  // |----- TLAB_1--------|----TLAB_2-~~~(partially refined part)~~~|
+  // The BOT entries of the unrefined part of TLAB_2 point to the start
+  // of TLAB_2. If the last object of the TLAB_1 and the first object
+  // of TLAB_2 are coalesced, then the cards of the unrefined part
+  // would point into middle of the filler object.
+  // The current approach is to not coalesce and leave the BOT contents intact.
+  // </original comment>
+  //
+  // We now reset the BOT when we start the object iteration over the
+  // region and refine its entries for every object we come across. So
+  // the above comment is not really relevant and we should be able
+  // to coalesce dead objects if we want to.
+  void do_object(oop obj) {
+    HeapWord* obj_addr = (HeapWord*) obj;
+    assert(_hr->is_in(obj_addr), "sanity");
+    size_t obj_size = obj->size();
+    HeapWord* obj_end = obj_addr + obj_size;
+
+    if (_end_of_last_gap != obj_addr) {
+      // there was a gap before obj_addr
+      _last_gap_threshold = _hr->cross_threshold(_end_of_last_gap, obj_addr);
+    }
+
+    if (obj->is_forwarded() && obj->forwardee() == obj) {
+      // The object failed to move.
+
+      // We consider all objects that we find self-forwarded to be
+      // live. What we'll do is that we'll update the prev marking
+      // info so that they are all under PTAMS and explicitly marked.
+      if (!_cm->isPrevMarked(obj)) {
+        _cm->markPrev(obj);
+      }
+      if (_during_initial_mark) {
+        // For the next marking info we'll only mark the
+        // self-forwarded objects explicitly if we are during
+        // initial-mark (since, normally, we only mark objects pointed
+        // to by roots if we succeed in copying them). By marking all
+        // self-forwarded objects we ensure that we mark any that are
+        // still pointed to be roots. During concurrent marking, and
+        // after initial-mark, we don't need to mark any objects
+        // explicitly and all objects in the CSet are considered
+        // (implicitly) live. So, we won't mark them explicitly and
+        // we'll leave them over NTAMS.
+        _cm->grayRoot(obj, obj_size, _worker_id, _hr);
+      }
+      _marked_bytes += (obj_size * HeapWordSize);
+      obj->set_mark(markOopDesc::prototype());
+
+      // While we were processing RSet buffers during the collection,
+      // we actually didn't scan any cards on the collection set,
+      // since we didn't want to update remembered sets with entries
+      // that point into the collection set, given that live objects
+      // from the collection set are about to move and such entries
+      // will be stale very soon.
+      // This change also dealt with a reliability issue which
+      // involved scanning a card in the collection set and coming
+      // across an array that was being chunked and looking malformed.
+      // The problem is that, if evacuation fails, we might have
+      // remembered set entries missing given that we skipped cards on
+      // the collection set. So, we'll recreate such entries now.
+      obj->oop_iterate(_update_rset_cl);
+    } else {
+
+      // The object has been either evacuated or is dead. Fill it with a
+      // dummy object.
+      MemRegion mr(obj_addr, obj_size);
+      CollectedHeap::fill_with_object(mr);
+
+      // must nuke all dead objects which we skipped when iterating over the region
+      _cm->clearRangePrevBitmap(MemRegion(_end_of_last_gap, obj_end));
+    }
+    _end_of_last_gap = obj_end;
+    _last_obj_threshold = _hr->cross_threshold(obj_addr, obj_end);
+  }
+};
+
+class RemoveSelfForwardPtrHRClosure: public HeapRegionClosure {
+  G1CollectedHeap* _g1h;
+  ConcurrentMark* _cm;
+  uint _worker_id;
+  HeapRegionClaimer* _hrclaimer;
+
+  DirtyCardQueue _dcq;
+  UpdateRSetDeferred _update_rset_cl;
+
+public:
+  RemoveSelfForwardPtrHRClosure(G1CollectedHeap* g1h,
+                                uint worker_id,
+                                HeapRegionClaimer* hrclaimer) :
+      _g1h(g1h), _dcq(&g1h->dirty_card_queue_set()), _update_rset_cl(g1h, &_dcq),
+      _worker_id(worker_id), _cm(_g1h->concurrent_mark()), _hrclaimer(hrclaimer) {
+  }
+
+  bool doHeapRegion(HeapRegion *hr) {
+    bool during_initial_mark = _g1h->g1_policy()->during_initial_mark_pause();
+    bool during_conc_mark = _g1h->mark_in_progress();
+
+    assert(!hr->is_humongous(), "sanity");
+    assert(hr->in_collection_set(), "bad CS");
+
+    if (_hrclaimer->claim_region(hr->hrm_index())) {
+      if (hr->evacuation_failed()) {
+        RemoveSelfForwardPtrObjClosure rspc(_g1h, _cm, hr, &_update_rset_cl,
+                                            during_initial_mark,
+                                            during_conc_mark,
+                                            _worker_id);
+
+        hr->note_self_forwarding_removal_start(during_initial_mark,
+                                               during_conc_mark);
+        _g1h->check_bitmaps("Self-Forwarding Ptr Removal", hr);
+
+        // In the common case (i.e. when there is no evacuation
+        // failure) we make sure that the following is done when
+        // the region is freed so that it is "ready-to-go" when it's
+        // re-allocated. However, when evacuation failure happens, a
+        // region will remain in the heap and might ultimately be added
+        // to a CSet in the future. So we have to be careful here and
+        // make sure the region's RSet is ready for parallel iteration
+        // whenever this might be required in the future.
+        hr->rem_set()->reset_for_par_iteration();
+        hr->reset_bot();
+        _update_rset_cl.set_region(hr);
+        hr->object_iterate(&rspc);
+
+        hr->rem_set()->clean_strong_code_roots(hr);
+
+        hr->note_self_forwarding_removal_end(during_initial_mark,
+                                             during_conc_mark,
+                                             rspc.marked_bytes());
+      }
+    }
+    return false;
+  }
+};
+
+G1ParRemoveSelfForwardPtrsTask::G1ParRemoveSelfForwardPtrsTask(G1CollectedHeap* g1h) :
+    AbstractGangTask("G1 Remove Self-forwarding Pointers"), _g1h(g1h),
+    _hrclaimer(g1h->workers()->active_workers()) {}
+
+void G1ParRemoveSelfForwardPtrsTask::work(uint worker_id) {
+  RemoveSelfForwardPtrHRClosure rsfp_cl(_g1h, worker_id, &_hrclaimer);
+
+  HeapRegion* hr = _g1h->start_cset_region_for_worker(worker_id);
+  _g1h->collection_set_iterate_from(hr, &rsfp_cl);
+}
--- a/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,229 +25,24 @@
 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1EVACFAILURE_HPP
 #define SHARE_VM_GC_IMPLEMENTATION_G1_G1EVACFAILURE_HPP
 
-#include "gc_implementation/g1/concurrentMark.inline.hpp"
-#include "gc_implementation/g1/dirtyCardQueue.hpp"
-#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
-#include "gc_implementation/g1/g1_globals.hpp"
-#include "gc_implementation/g1/g1OopClosures.inline.hpp"
-#include "gc_implementation/g1/heapRegion.hpp"
-#include "gc_implementation/g1/heapRegionRemSet.hpp"
+#include "gc_implementation/g1/g1OopClosures.hpp"
+#include "gc_implementation/g1/heapRegionManager.hpp"
+#include "utilities/globalDefinitions.hpp"
 #include "utilities/workgroup.hpp"
 
-// Closures and tasks associated with any self-forwarding pointers
-// installed as a result of an evacuation failure.
-
-class UpdateRSetDeferred : public OopsInHeapRegionClosure {
-private:
-  G1CollectedHeap* _g1;
-  DirtyCardQueue *_dcq;
-  G1SATBCardTableModRefBS* _ct_bs;
-
-public:
-  UpdateRSetDeferred(G1CollectedHeap* g1, DirtyCardQueue* dcq) :
-    _g1(g1), _ct_bs(_g1->g1_barrier_set()), _dcq(dcq) {}
-
-  virtual void do_oop(narrowOop* p) { do_oop_work(p); }
-  virtual void do_oop(      oop* p) { do_oop_work(p); }
-  template <class T> void do_oop_work(T* p) {
-    assert(_from->is_in_reserved(p), "paranoia");
-    if (!_from->is_in_reserved(oopDesc::load_decode_heap_oop(p)) &&
-        !_from->is_survivor()) {
-      size_t card_index = _ct_bs->index_for(p);
-      if (_ct_bs->mark_card_deferred(card_index)) {
-        _dcq->enqueue((jbyte*)_ct_bs->byte_for_index(card_index));
-      }
-    }
-  }
-};
-
-class RemoveSelfForwardPtrObjClosure: public ObjectClosure {
-private:
-  G1CollectedHeap* _g1;
-  ConcurrentMark* _cm;
-  HeapRegion* _hr;
-  size_t _marked_bytes;
-  OopsInHeapRegionClosure *_update_rset_cl;
-  bool _during_initial_mark;
-  bool _during_conc_mark;
-  uint _worker_id;
-  HeapWord* _end_of_last_gap;
-  HeapWord* _last_gap_threshold;
-  HeapWord* _last_obj_threshold;
-
-public:
-  RemoveSelfForwardPtrObjClosure(G1CollectedHeap* g1, ConcurrentMark* cm,
-                                 HeapRegion* hr,
-                                 OopsInHeapRegionClosure* update_rset_cl,
-                                 bool during_initial_mark,
-                                 bool during_conc_mark,
-                                 uint worker_id) :
-    _g1(g1), _cm(cm), _hr(hr), _marked_bytes(0),
-    _update_rset_cl(update_rset_cl),
-    _during_initial_mark(during_initial_mark),
-    _during_conc_mark(during_conc_mark),
-    _worker_id(worker_id),
-    _end_of_last_gap(hr->bottom()),
-    _last_gap_threshold(hr->bottom()),
-    _last_obj_threshold(hr->bottom()) { }
-
-  size_t marked_bytes() { return _marked_bytes; }
-
-  // <original comment>
-  // The original idea here was to coalesce evacuated and dead objects.
-  // However that caused complications with the block offset table (BOT).
-  // In particular if there were two TLABs, one of them partially refined.
-  // |----- TLAB_1--------|----TLAB_2-~~~(partially refined part)~~~|
-  // The BOT entries of the unrefined part of TLAB_2 point to the start
-  // of TLAB_2. If the last object of the TLAB_1 and the first object
-  // of TLAB_2 are coalesced, then the cards of the unrefined part
-  // would point into middle of the filler object.
-  // The current approach is to not coalesce and leave the BOT contents intact.
-  // </original comment>
-  //
-  // We now reset the BOT when we start the object iteration over the
-  // region and refine its entries for every object we come across. So
-  // the above comment is not really relevant and we should be able
-  // to coalesce dead objects if we want to.
-  void do_object(oop obj) {
-    HeapWord* obj_addr = (HeapWord*) obj;
-    assert(_hr->is_in(obj_addr), "sanity");
-    size_t obj_size = obj->size();
-    HeapWord* obj_end = obj_addr + obj_size;
-
-    if (_end_of_last_gap != obj_addr) {
-      // there was a gap before obj_addr
-      _last_gap_threshold = _hr->cross_threshold(_end_of_last_gap, obj_addr);
-    }
-
-    if (obj->is_forwarded() && obj->forwardee() == obj) {
-      // The object failed to move.
+class G1CollectedHeap;
 
-      // We consider all objects that we find self-forwarded to be
-      // live. What we'll do is that we'll update the prev marking
-      // info so that they are all under PTAMS and explicitly marked.
-      if (!_cm->isPrevMarked(obj)) {
-        _cm->markPrev(obj);
-      }
-      if (_during_initial_mark) {
-        // For the next marking info we'll only mark the
-        // self-forwarded objects explicitly if we are during
-        // initial-mark (since, normally, we only mark objects pointed
-        // to by roots if we succeed in copying them). By marking all
-        // self-forwarded objects we ensure that we mark any that are
-        // still pointed to be roots. During concurrent marking, and
-        // after initial-mark, we don't need to mark any objects
-        // explicitly and all objects in the CSet are considered
-        // (implicitly) live. So, we won't mark them explicitly and
-        // we'll leave them over NTAMS.
-        _cm->grayRoot(obj, obj_size, _worker_id, _hr);
-      }
-      _marked_bytes += (obj_size * HeapWordSize);
-      obj->set_mark(markOopDesc::prototype());
-
-      // While we were processing RSet buffers during the collection,
-      // we actually didn't scan any cards on the collection set,
-      // since we didn't want to update remembered sets with entries
-      // that point into the collection set, given that live objects
-      // from the collection set are about to move and such entries
-      // will be stale very soon.
-      // This change also dealt with a reliability issue which
-      // involved scanning a card in the collection set and coming
-      // across an array that was being chunked and looking malformed.
-      // The problem is that, if evacuation fails, we might have
-      // remembered set entries missing given that we skipped cards on
-      // the collection set. So, we'll recreate such entries now.
-      obj->oop_iterate(_update_rset_cl);
-    } else {
-
-      // The object has been either evacuated or is dead. Fill it with a
-      // dummy object.
-      MemRegion mr(obj_addr, obj_size);
-      CollectedHeap::fill_with_object(mr);
-
-      // must nuke all dead objects which we skipped when iterating over the region
-      _cm->clearRangePrevBitmap(MemRegion(_end_of_last_gap, obj_end));
-    }
-    _end_of_last_gap = obj_end;
-    _last_obj_threshold = _hr->cross_threshold(obj_addr, obj_end);
-  }
-};
-
-class RemoveSelfForwardPtrHRClosure: public HeapRegionClosure {
-  G1CollectedHeap* _g1h;
-  ConcurrentMark* _cm;
-  uint _worker_id;
-  HeapRegionClaimer* _hrclaimer;
-
-  DirtyCardQueue _dcq;
-  UpdateRSetDeferred _update_rset_cl;
-
-public:
-  RemoveSelfForwardPtrHRClosure(G1CollectedHeap* g1h,
-                                uint worker_id,
-                                HeapRegionClaimer* hrclaimer) :
-      _g1h(g1h), _dcq(&g1h->dirty_card_queue_set()), _update_rset_cl(g1h, &_dcq),
-      _worker_id(worker_id), _cm(_g1h->concurrent_mark()), _hrclaimer(hrclaimer) {
-  }
-
-  bool doHeapRegion(HeapRegion *hr) {
-    bool during_initial_mark = _g1h->g1_policy()->during_initial_mark_pause();
-    bool during_conc_mark = _g1h->mark_in_progress();
-
-    assert(!hr->is_humongous(), "sanity");
-    assert(hr->in_collection_set(), "bad CS");
-
-    if (_hrclaimer->claim_region(hr->hrm_index())) {
-      if (hr->evacuation_failed()) {
-        RemoveSelfForwardPtrObjClosure rspc(_g1h, _cm, hr, &_update_rset_cl,
-                                            during_initial_mark,
-                                            during_conc_mark,
-                                            _worker_id);
-
-        hr->note_self_forwarding_removal_start(during_initial_mark,
-                                               during_conc_mark);
-        _g1h->check_bitmaps("Self-Forwarding Ptr Removal", hr);
-
-        // In the common case (i.e. when there is no evacuation
-        // failure) we make sure that the following is done when
-        // the region is freed so that it is "ready-to-go" when it's
-        // re-allocated. However, when evacuation failure happens, a
-        // region will remain in the heap and might ultimately be added
-        // to a CSet in the future. So we have to be careful here and
-        // make sure the region's RSet is ready for parallel iteration
-        // whenever this might be required in the future.
-        hr->rem_set()->reset_for_par_iteration();
-        hr->reset_bot();
-        _update_rset_cl.set_region(hr);
-        hr->object_iterate(&rspc);
-
-        hr->rem_set()->clean_strong_code_roots(hr);
-
-        hr->note_self_forwarding_removal_end(during_initial_mark,
-                                             during_conc_mark,
-                                             rspc.marked_bytes());
-      }
-    }
-    return false;
-  }
-};
-
+// Task to fixup self-forwarding pointers
+// installed as a result of an evacuation failure.
 class G1ParRemoveSelfForwardPtrsTask: public AbstractGangTask {
 protected:
   G1CollectedHeap* _g1h;
   HeapRegionClaimer _hrclaimer;
 
 public:
-  G1ParRemoveSelfForwardPtrsTask(G1CollectedHeap* g1h) :
-      AbstractGangTask("G1 Remove Self-forwarding Pointers"), _g1h(g1h),
-      _hrclaimer(g1h->workers()->active_workers()) {}
+  G1ParRemoveSelfForwardPtrsTask(G1CollectedHeap* g1h);
 
-  void work(uint worker_id) {
-    RemoveSelfForwardPtrHRClosure rsfp_cl(_g1h, worker_id, &_hrclaimer);
-
-    HeapRegion* hr = _g1h->start_cset_region_for_worker(worker_id);
-    _g1h->collection_set_iterate_from(hr, &rsfp_cl);
-  }
+  void work(uint worker_id);
 };
 
 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1EVACFAILURE_HPP
--- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -27,6 +27,7 @@
 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc_implementation/g1/heapRegion.hpp"
 #include "gc_implementation/g1/satbQueue.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/orderAccess.inline.hpp"
--- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -28,7 +28,7 @@
 #include "gc_implementation/g1/g1RegionToSpaceMapper.hpp"
 #include "memory/cardTableModRefBS.hpp"
 #include "memory/memRegion.hpp"
-#include "oops/oop.inline.hpp"
+#include "oops/oop.hpp"
 #include "utilities/macros.hpp"
 
 class DirtyCardQueueSet;
--- a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
  */
 
 #include "precompiled.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
 #include "gc_implementation/g1/g1GCPhaseTimes.hpp"
 #include "gc_implementation/g1/g1StringDedup.hpp"
@@ -51,7 +51,7 @@
 }
 
 bool G1StringDedup::is_candidate_from_mark(oop obj) {
-  if (java_lang_String::is_instance(obj)) {
+  if (java_lang_String::is_instance_inlined(obj)) {
     bool from_young = G1CollectedHeap::heap()->heap_region_containing_raw(obj)->is_young();
     if (from_young && obj->age() < StringDeduplicationAgeThreshold) {
       // Candidate found. String is being evacuated from young to old but has not
@@ -73,7 +73,7 @@
 }
 
 bool G1StringDedup::is_candidate_from_evacuation(bool from_young, bool to_young, oop obj) {
-  if (from_young && java_lang_String::is_instance(obj)) {
+  if (from_young && java_lang_String::is_instance_inlined(obj)) {
     if (to_young && obj->age() == StringDeduplicationAgeThreshold) {
       // Candidate found. String is being evacuated from young to young and just
       // reached the deduplication age threshold.
--- a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,9 +23,11 @@
  */
 
 #include "precompiled.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
+#include "gc_implementation/g1/g1StringDedup.hpp"
 #include "gc_implementation/g1/g1StringDedupQueue.hpp"
 #include "memory/gcLocker.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "utilities/stack.inline.hpp"
--- a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,13 +24,14 @@
 
 #include "precompiled.hpp"
 #include "classfile/altHashing.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc_implementation/g1/g1StringDedupTable.hpp"
 #include "memory/gcLocker.hpp"
 #include "memory/padded.inline.hpp"
 #include "oops/typeArrayOop.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/mutexLocker.hpp"
 
 //
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.inline.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.inline.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 "gc_implementation/g1/g1CollectedHeap.hpp"
 #include "gc_implementation/g1/heapRegion.hpp"
 #include "memory/space.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/atomic.inline.hpp"
 
 // This version requires locking.
--- a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,12 +34,11 @@
 #include "gc_implementation/g1/vm_operations_g1.hpp"
 #include "runtime/interfaceSupport.hpp"
 
-VM_G1CollectForAllocation::VM_G1CollectForAllocation(
-                                                  unsigned int gc_count_before,
-                                                  size_t word_size)
+VM_G1CollectForAllocation::VM_G1CollectForAllocation(uint gc_count_before,
+                                                     size_t word_size)
   : VM_G1OperationWithAllocRequest(gc_count_before, word_size,
                                    GCCause::_allocation_failure) {
-  guarantee(word_size > 0, "an allocation should always be requested");
+  guarantee(word_size != 0, "An allocation should always be requested with this operation.");
 }
 
 void VM_G1CollectForAllocation::doit() {
@@ -57,12 +56,11 @@
   g1h->do_full_collection(false /* clear_all_soft_refs */);
 }
 
-VM_G1IncCollectionPause::VM_G1IncCollectionPause(
-                                      unsigned int   gc_count_before,
-                                      size_t         word_size,
-                                      bool           should_initiate_conc_mark,
-                                      double         target_pause_time_ms,
-                                      GCCause::Cause gc_cause)
+VM_G1IncCollectionPause::VM_G1IncCollectionPause(uint           gc_count_before,
+                                                 size_t         word_size,
+                                                 bool           should_initiate_conc_mark,
+                                                 double         target_pause_time_ms,
+                                                 GCCause::Cause gc_cause)
   : VM_G1OperationWithAllocRequest(gc_count_before, word_size, gc_cause),
     _should_initiate_conc_mark(should_initiate_conc_mark),
     _target_pause_time_ms(target_pause_time_ms),
@@ -75,7 +73,7 @@
 }
 
 bool VM_G1IncCollectionPause::doit_prologue() {
-  bool res = VM_GC_Operation::doit_prologue();
+  bool res = VM_G1OperationWithAllocRequest::doit_prologue();
   if (!res) {
     if (_should_initiate_conc_mark) {
       // The prologue can fail for a couple of reasons. The first is that another GC
@@ -165,7 +163,7 @@
 }
 
 void VM_G1IncCollectionPause::doit_epilogue() {
-  VM_GC_Operation::doit_epilogue();
+  VM_G1OperationWithAllocRequest::doit_epilogue();
 
   // If the pause was initiated by a System.gc() and
   // +ExplicitGCInvokesConcurrent, we have to wait here for the cycle
--- a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,20 +36,17 @@
 //     - VM_G1CollectForAllocation
 //     - VM_G1IncCollectionPause
 
-class VM_G1OperationWithAllocRequest: public VM_GC_Operation {
+class VM_G1OperationWithAllocRequest : public VM_CollectForAllocation {
 protected:
-  size_t    _word_size;
-  HeapWord* _result;
   bool      _pause_succeeded;
   AllocationContext_t _allocation_context;
 
 public:
-  VM_G1OperationWithAllocRequest(unsigned int gc_count_before,
-                                 size_t       word_size,
+  VM_G1OperationWithAllocRequest(uint           gc_count_before,
+                                 size_t         word_size,
                                  GCCause::Cause gc_cause)
-    : VM_GC_Operation(gc_count_before, gc_cause),
-      _word_size(word_size), _result(NULL), _pause_succeeded(false) { }
-  HeapWord* result() { return _result; }
+    : VM_CollectForAllocation(word_size, gc_count_before, gc_cause),
+      _pause_succeeded(false) {}
   bool pause_succeeded() { return _pause_succeeded; }
   void set_allocation_context(AllocationContext_t context) { _allocation_context = context; }
   AllocationContext_t  allocation_context() { return _allocation_context; }
@@ -57,8 +54,8 @@
 
 class VM_G1CollectFull: public VM_GC_Operation {
 public:
-  VM_G1CollectFull(unsigned int gc_count_before,
-                   unsigned int full_gc_count_before,
+  VM_G1CollectFull(uint gc_count_before,
+                   uint full_gc_count_before,
                    GCCause::Cause cause)
     : VM_GC_Operation(gc_count_before, cause, full_gc_count_before, true) { }
   virtual VMOp_Type type() const { return VMOp_G1CollectFull; }
@@ -70,7 +67,7 @@
 
 class VM_G1CollectForAllocation: public VM_G1OperationWithAllocRequest {
 public:
-  VM_G1CollectForAllocation(unsigned int gc_count_before,
+  VM_G1CollectForAllocation(uint         gc_count_before,
                             size_t       word_size);
   virtual VMOp_Type type() const { return VMOp_G1CollectForAllocation; }
   virtual void doit();
@@ -84,9 +81,9 @@
   bool         _should_initiate_conc_mark;
   bool         _should_retry_gc;
   double       _target_pause_time_ms;
-  unsigned int _old_marking_cycles_completed_before;
+  uint         _old_marking_cycles_completed_before;
 public:
-  VM_G1IncCollectionPause(unsigned int   gc_count_before,
+  VM_G1IncCollectionPause(uint           gc_count_before,
                           size_t         word_size,
                           bool           should_initiate_conc_mark,
                           double         target_pause_time_ms,
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -126,7 +126,9 @@
 
 bool ObjectStartArray::object_starts_in_range(HeapWord* start_addr,
                                               HeapWord* end_addr) const {
-  assert(start_addr <= end_addr, "range is wrong");
+  assert(start_addr <= end_addr,
+         err_msg("Range is wrong. start_addr (" PTR_FORMAT ") is after end_addr (" PTR_FORMAT ")",
+                 p2i(start_addr), p2i(end_addr)));
   if (start_addr > end_addr) {
     return false;
   }
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -119,8 +119,13 @@
 
   MemRegion covered_region() { return _covered_region; }
 
+#define assert_covered_region_contains(addr)                                                                 \
+        assert(_covered_region.contains(addr),                                                               \
+               err_msg(#addr " (" PTR_FORMAT ") is not in covered region [" PTR_FORMAT ", " PTR_FORMAT "]",  \
+                       p2i(addr), p2i(_covered_region.start()), p2i(_covered_region.end())))
+
   void allocate_block(HeapWord* p) {
-    assert(_covered_region.contains(p), "Must be in covered region");
+    assert_covered_region_contains(p);
     jbyte* block = block_for_addr(p);
     HeapWord* block_base = addr_for_block(block);
     size_t offset = pointer_delta(p, block_base, sizeof(HeapWord*));
@@ -135,7 +140,7 @@
   // object in that block. Scroll backwards by one, and the first
   // object hit should be at the beginning of the block
   HeapWord* object_start(HeapWord* addr) const {
-    assert(_covered_region.contains(addr), "Must be in covered region");
+    assert_covered_region_contains(addr);
     jbyte* block = block_for_addr(addr);
     HeapWord* scroll_forward = offset_addr_for_block(block--);
     while (scroll_forward > addr) {
@@ -153,13 +158,14 @@
   }
 
   bool is_block_allocated(HeapWord* addr) {
-    assert(_covered_region.contains(addr), "Must be in covered region");
+    assert_covered_region_contains(addr);
     jbyte* block = block_for_addr(addr);
     if (*block == clean_block)
       return false;
 
     return true;
   }
+#undef assert_covered_region_contains
 
   // Return true if an object starts in the range of heap addresses.
   // If an object starts at an address corresponding to
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -260,7 +260,7 @@
 
   uint loop_count = 0;
   uint gc_count = 0;
-  int gclocker_stalled_count = 0;
+  uint gclocker_stalled_count = 0;
 
   while (result == NULL) {
     // We don't want to have multiple collections for a single filled generation.
@@ -520,8 +520,8 @@
   assert(!Heap_lock->owned_by_self(),
     "this thread should not own the Heap_lock");
 
-  unsigned int gc_count      = 0;
-  unsigned int full_gc_count = 0;
+  uint gc_count      = 0;
+  uint full_gc_count = 0;
   {
     MutexLocker ml(Heap_lock);
     // This value is guarded by the Heap_lock
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,12 +32,10 @@
 #include "utilities/dtrace.hpp"
 
 // The following methods are used by the parallel scavenge collector
-VM_ParallelGCFailedAllocation::VM_ParallelGCFailedAllocation(size_t size,
-                                                      unsigned int gc_count) :
-  VM_GC_Operation(gc_count, GCCause::_allocation_failure),
-  _size(size),
-  _result(NULL)
-{
+VM_ParallelGCFailedAllocation::VM_ParallelGCFailedAllocation(size_t word_size,
+                                                             uint gc_count) :
+    VM_CollectForAllocation(word_size, gc_count, GCCause::_allocation_failure) {
+  assert(word_size != 0, "An allocation should always be requested with this operation.");
 }
 
 void VM_ParallelGCFailedAllocation::doit() {
@@ -47,7 +45,7 @@
   assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "must be a ParallelScavengeHeap");
 
   GCCauseSetter gccs(heap, _gc_cause);
-  _result = heap->failed_mem_allocate(_size);
+  _result = heap->failed_mem_allocate(_word_size);
 
   if (_result == NULL && GC_locker::is_active_and_needs_gc()) {
     set_gc_locked();
@@ -55,8 +53,8 @@
 }
 
 // Only used for System.gc() calls
-VM_ParallelGCSystemGC::VM_ParallelGCSystemGC(unsigned int gc_count,
-                                             unsigned int full_gc_count,
+VM_ParallelGCSystemGC::VM_ParallelGCSystemGC(uint gc_count,
+                                             uint full_gc_count,
                                              GCCause::Cause gc_cause) :
   VM_GC_Operation(gc_count, gc_cause, full_gc_count, true /* full */)
 {
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,26 +29,19 @@
 #include "gc_implementation/shared/vmGCOperations.hpp"
 #include "gc_interface/gcCause.hpp"
 
-class VM_ParallelGCFailedAllocation: public VM_GC_Operation {
- private:
-  size_t    _size;
-  HeapWord* _result;
-
+class VM_ParallelGCFailedAllocation : public VM_CollectForAllocation {
  public:
-  VM_ParallelGCFailedAllocation(size_t size, unsigned int gc_count);
+  VM_ParallelGCFailedAllocation(size_t word_size, uint gc_count);
 
   virtual VMOp_Type type() const {
     return VMOp_ParallelGCFailedAllocation;
   }
   virtual void doit();
-
-  HeapWord* result() const       { return _result; }
 };
 
 class VM_ParallelGCSystemGC: public VM_GC_Operation {
  public:
-  VM_ParallelGCSystemGC(unsigned int gc_count, unsigned int full_gc_count,
-                        GCCause::Cause gc_cause);
+  VM_ParallelGCSystemGC(uint gc_count, uint full_gc_count, GCCause::Cause gc_cause);
   virtual VMOp_Type type() const { return VMOp_ParallelGCSystemGC; }
   virtual void doit();
 };
--- a/hotspot/src/share/vm/gc_implementation/shared/gcTrace.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/gc_implementation/shared/gcTrace.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,7 @@
 #include "gc_implementation/shared/objectCountEventSender.hpp"
 #include "memory/heapInspection.hpp"
 #include "memory/referenceProcessorStats.hpp"
+#include "memory/resourceArea.hpp"
 #include "runtime/os.hpp"
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/macros.hpp"
--- a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,6 +41,11 @@
 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
 #endif // INCLUDE_ALL_GCS
 
+VM_GC_Operation::~VM_GC_Operation() {
+  CollectedHeap* ch = Universe::heap();
+  ch->collector_policy()->set_all_soft_refs_clear(false);
+}
+
 // The same dtrace probe can't be inserted in two different files, so we
 // have to call it here, so it's only in one file.  Can't create new probes
 // for the other file anymore.   The dtrace probes have to remain stable.
@@ -179,10 +184,10 @@
 
   GenCollectedHeap* gch = GenCollectedHeap::heap();
   GCCauseSetter gccs(gch, _gc_cause);
-  _res = gch->satisfy_failed_allocation(_size, _tlab);
-  assert(gch->is_in_reserved_or_null(_res), "result not in heap");
+  _result = gch->satisfy_failed_allocation(_word_size, _tlab);
+  assert(gch->is_in_reserved_or_null(_result), "result not in heap");
 
-  if (_res == NULL && GC_locker::is_active_and_needs_gc()) {
+  if (_result == NULL && GC_locker::is_active_and_needs_gc()) {
     set_gc_locked();
   }
 }
--- a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
 #ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP
 #define SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP
 
+#include "gc_interface/collectedHeap.hpp"
 #include "memory/heapInspection.hpp"
 #include "runtime/handles.hpp"
 #include "runtime/jniHandles.hpp"
@@ -38,11 +39,12 @@
 //  VM_Operation
 //      VM_GC_Operation
 //          VM_GC_HeapInspection
-//          VM_GenCollectForAllocation
 //          VM_GenCollectFull
 //          VM_GenCollectFullConcurrent
-//          VM_ParallelGCFailedAllocation
 //          VM_ParallelGCSystemGC
+//          VM_CollectForAllocation
+//              VM_GenCollectForAllocation
+//              VM_ParallelGCFailedAllocation
 //  VM_GC_Operation
 //   - implements methods common to all classes in the hierarchy:
 //     prevents multiple gc requests and manages lock on heap;
@@ -51,6 +53,7 @@
 //   - prints class histogram on SIGBREAK if PrintClassHistogram
 //     is specified; and also the attach "inspectheap" operation
 //
+//  VM_CollectForAllocation
 //  VM_GenCollectForAllocation
 //  VM_ParallelGCFailedAllocation
 //   - this operation is invoked when allocation is failed;
@@ -66,13 +69,13 @@
 
 class VM_GC_Operation: public VM_Operation {
  protected:
-  BasicLock     _pending_list_basic_lock; // for refs pending list notification (PLL)
-  unsigned int  _gc_count_before;         // gc count before acquiring PLL
-  unsigned int  _full_gc_count_before;    // full gc count before acquiring PLL
-  bool          _full;                    // whether a "full" collection
-  bool          _prologue_succeeded;      // whether doit_prologue succeeded
+  BasicLock      _pending_list_basic_lock; // for refs pending list notification (PLL)
+  uint           _gc_count_before;         // gc count before acquiring PLL
+  uint           _full_gc_count_before;    // full gc count before acquiring PLL
+  bool           _full;                    // whether a "full" collection
+  bool           _prologue_succeeded;      // whether doit_prologue succeeded
   GCCause::Cause _gc_cause;                // the putative cause for this gc op
-  bool          _gc_locked;               // will be set if gc was locked
+  bool           _gc_locked;               // will be set if gc was locked
 
   virtual bool skip_operation() const;
 
@@ -81,9 +84,9 @@
   void release_and_notify_pending_list_lock();
 
  public:
-  VM_GC_Operation(unsigned int gc_count_before,
+  VM_GC_Operation(uint gc_count_before,
                   GCCause::Cause _cause,
-                  unsigned int full_gc_count_before = 0,
+                  uint full_gc_count_before = 0,
                   bool full = false) {
     _full = full;
     _prologue_succeeded = false;
@@ -104,10 +107,7 @@
     // mutators have run.  Soft refs will be cleared again in this
     // collection.
   }
-  ~VM_GC_Operation() {
-    CollectedHeap* ch = Universe::heap();
-    ch->collector_policy()->set_all_soft_refs_clear(false);
-  }
+  ~VM_GC_Operation();
 
   // Acquire the reference synchronization lock
   virtual bool doit_prologue();
@@ -160,38 +160,46 @@
   bool collect();
 };
 
+class VM_CollectForAllocation : public VM_GC_Operation {
+ protected:
+  size_t    _word_size; // Size of object to be allocated (in number of words)
+  HeapWord* _result;    // Allocation result (NULL if allocation failed)
 
-class VM_GenCollectForAllocation: public VM_GC_Operation {
+ public:
+  VM_CollectForAllocation(size_t word_size, uint gc_count_before, GCCause::Cause cause)
+    : VM_GC_Operation(gc_count_before, cause), _result(NULL), _word_size(word_size) {}
+
+  HeapWord* result() const {
+    return _result;
+  }
+};
+
+class VM_GenCollectForAllocation : public VM_CollectForAllocation {
  private:
-  HeapWord*   _res;
-  size_t      _size;                       // size of object to be allocated.
   bool        _tlab;                       // alloc is of a tlab.
  public:
-  VM_GenCollectForAllocation(size_t size,
+  VM_GenCollectForAllocation(size_t word_size,
                              bool tlab,
-                             unsigned int gc_count_before)
-    : VM_GC_Operation(gc_count_before, GCCause::_allocation_failure),
-      _size(size),
+                             uint gc_count_before)
+    : VM_CollectForAllocation(word_size, gc_count_before, GCCause::_allocation_failure),
       _tlab(tlab) {
-    _res = NULL;
+    assert(word_size != 0, "An allocation should always be requested with this operation.");
   }
   ~VM_GenCollectForAllocation()  {}
   virtual VMOp_Type type() const { return VMOp_GenCollectForAllocation; }
   virtual void doit();
-  HeapWord* result() const       { return _res; }
 };
 
-
 // VM operation to invoke a collection of the heap as a
 // GenCollectedHeap heap.
 class VM_GenCollectFull: public VM_GC_Operation {
  private:
   int _max_level;
  public:
-  VM_GenCollectFull(unsigned int gc_count_before,
-                    unsigned int full_gc_count_before,
+  VM_GenCollectFull(uint gc_count_before,
+                    uint full_gc_count_before,
                     GCCause::Cause gc_cause,
-                      int max_level)
+                    int max_level)
     : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true /* full */),
       _max_level(max_level) { }
   ~VM_GenCollectFull() {}
@@ -208,9 +216,9 @@
  public:
   VM_CollectForMetadataAllocation(ClassLoaderData* loader_data,
                                   size_t size, Metaspace::MetadataType mdtype,
-                                      unsigned int gc_count_before,
-                                      unsigned int full_gc_count_before,
-                                      GCCause::Cause gc_cause)
+                                  uint gc_count_before,
+                                  uint full_gc_count_before,
+                                  GCCause::Cause gc_cause)
     : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true),
       _loader_data(loader_data), _size(size), _mdtype(mdtype), _result(NULL) {
   }
--- a/hotspot/src/share/vm/gc_interface/collectedHeap.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/gc_interface/collectedHeap.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@
 #include "gc_interface/allocTracer.hpp"
 #include "gc_interface/collectedHeap.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/barrierSet.inline.hpp"
 #include "memory/metaspace.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/instanceMirrorKlass.hpp"
@@ -124,6 +125,14 @@
   }
 }
 
+void CollectedHeap::print_on_error(outputStream* st) const {
+  st->print_cr("Heap:");
+  print_extended_on(st);
+  st->cr();
+
+  _barrier_set->print_on(st);
+}
+
 void CollectedHeap::register_nmethod(nmethod* nm) {
   assert_locked_or_safepoint(CodeCache_lock);
 }
--- a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,6 @@
 #include "gc_interface/gcCause.hpp"
 #include "gc_implementation/shared/gcWhen.hpp"
 #include "memory/allocation.hpp"
-#include "memory/barrierSet.hpp"
 #include "runtime/handles.hpp"
 #include "runtime/perfData.hpp"
 #include "runtime/safepoint.hpp"
@@ -576,13 +575,7 @@
     print_on(st);
   }
 
-  virtual void print_on_error(outputStream* st) const {
-    st->print_cr("Heap:");
-    print_extended_on(st);
-    st->cr();
-
-    _barrier_set->print_on(st);
-  }
+  virtual void print_on_error(outputStream* st) const;
 
   // Print all GC threads (other than the VM thread)
   // used by this heap.
--- a/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "interpreter/bytecodeHistogram.hpp"
 #include "interpreter/bytecodeTracer.hpp"
 #include "interpreter/bytecodes.hpp"
--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "compiler/compileBroker.hpp"
@@ -38,6 +39,7 @@
 #include "oops/instanceKlass.hpp"
 #include "oops/methodData.hpp"
 #include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/symbol.hpp"
 #include "prims/jvmtiExport.hpp"
--- a/hotspot/src/share/vm/interpreter/linkResolver.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -35,6 +35,7 @@
 #include "memory/universe.inline.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/methodHandles.hpp"
 #include "prims/nativeLookup.hpp"
 #include "runtime/compilationPolicy.hpp"
--- a/hotspot/src/share/vm/memory/barrierSet.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/memory/barrierSet.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -160,7 +160,7 @@
   // (For efficiency reasons, this operation is specialized for certain
   // barrier types.  Semantically, it should be thought of as a call to the
   // virtual "_work" function below, which must implement the barrier.)
-  inline void write_region(MemRegion mr);
+  void write_region(MemRegion mr);
 protected:
   virtual void write_region_work(MemRegion mr) = 0;
 public:
--- a/hotspot/src/share/vm/memory/barrierSet.inline.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/memory/barrierSet.inline.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
 #define SHARE_VM_MEMORY_BARRIERSET_INLINE_HPP
 
 #include "memory/barrierSet.hpp"
-#include "memory/cardTableModRefBS.hpp"
+#include "memory/cardTableModRefBS.inline.hpp"
 
 // Inline functions of BarrierSet, which de-virtualize certain
 // performance-critical calls when the barrier is the most common
@@ -76,7 +76,7 @@
 }
 
 
-void BarrierSet::write_region(MemRegion mr) {
+inline void BarrierSet::write_region(MemRegion mr) {
   if (kind() == CardTableModRef) {
     ((CardTableModRefBS*)this)->inline_write_region(mr);
   } else {
--- a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -24,7 +24,7 @@
 
 #include "precompiled.hpp"
 #include "memory/allocation.inline.hpp"
-#include "memory/cardTableModRefBS.hpp"
+#include "memory/cardTableModRefBS.inline.hpp"
 #include "memory/cardTableRS.hpp"
 #include "memory/sharedHeap.hpp"
 #include "memory/space.hpp"
--- a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -27,7 +27,6 @@
 
 #include "memory/modRefBarrierSet.hpp"
 #include "oops/oop.hpp"
-#include "oops/oop.inline2.hpp"
 
 // This kind of "BarrierSet" allows a "CollectedHeap" to detect and
 // enumerate ref fields that have been modified (since the last
@@ -45,6 +44,7 @@
 class OopsInGenClosure;
 class DirtyCardToOopClosure;
 class ClearNoncleanCardWrapper;
+class CardTableRS;
 
 class CardTableModRefBS: public ModRefBarrierSet {
   // Some classes get to look at some private stuff.
@@ -333,15 +333,7 @@
 
   template <class T> inline void inline_write_ref_field_pre(T* field, oop newVal) {}
 
-  template <class T> inline void inline_write_ref_field(T* field, oop newVal, bool release) {
-    jbyte* byte = byte_for((void*)field);
-    if (release) {
-      // Perform a releasing store if requested.
-      OrderAccess::release_store((volatile jbyte*) byte, dirty_card);
-    } else {
-      *byte = dirty_card;
-    }
-  }
+  template <class T> inline void inline_write_ref_field(T* field, oop newVal, bool release);
 
   // These are used by G1, when it uses the card table as a temporary data
   // structure for card claiming.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/memory/cardTableModRefBS.inline.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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_MEMORY_CARDTABLEMODREFBS_INLINE_HPP
+#define SHARE_VM_MEMORY_CARDTABLEMODREFBS_INLINE_HPP
+
+#include "memory/cardTableModRefBS.hpp"
+#include "oops/oopsHierarchy.hpp"
+#include "runtime/orderAccess.inline.hpp"
+
+template <class T> inline void CardTableModRefBS::inline_write_ref_field(T* field, oop newVal, bool release) {
+  jbyte* byte = byte_for((void*)field);
+  if (release) {
+    // Perform a releasing store if requested.
+    OrderAccess::release_store((volatile jbyte*) byte, dirty_card);
+  } else {
+    *byte = dirty_card;
+  }
+}
+
+#endif // SHARE_VM_MEMORY_CARDTABLEMODREFBS_INLINE_HPP
--- a/hotspot/src/share/vm/memory/collectorPolicy.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/memory/collectorPolicy.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -597,7 +597,7 @@
   HeapWord* result = NULL;
 
   // Loop until the allocation is satisfied, or unsatisfied after GC.
-  for (int try_count = 1, gclocker_stalled_count = 0; /* return or throw */; try_count += 1) {
+  for (uint try_count = 1, gclocker_stalled_count = 0; /* return or throw */; try_count += 1) {
     HandleMark hm; // Discard any handles allocated in each iteration.
 
     // First allocation attempt is lock-free.
@@ -611,7 +611,7 @@
         return result;
       }
     }
-    unsigned int gc_count_before;  // Read inside the Heap_lock locked region.
+    uint gc_count_before;  // Read inside the Heap_lock locked region.
     {
       MutexLocker ml(Heap_lock);
       if (PrintGC && Verbose) {
--- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -41,7 +41,6 @@
 #include "memory/sharedHeap.hpp"
 #include "memory/space.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "runtime/biasedLocking.hpp"
 #include "runtime/fprofiler.hpp"
 #include "runtime/handles.hpp"
--- a/hotspot/src/share/vm/memory/genOopClosures.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/memory/genOopClosures.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -189,16 +189,4 @@
   inline void do_oop_nv(narrowOop* p);
 };
 
-class VerifyOopClosure: public OopClosure {
- protected:
-  template <class T> inline void do_oop_work(T* p) {
-    oop obj = oopDesc::load_decode_heap_oop(p);
-    guarantee(obj->is_oop_or_null(), err_msg("invalid oop: " INTPTR_FORMAT, p2i((oopDesc*) obj)));
-  }
- public:
-  virtual void do_oop(oop* p);
-  virtual void do_oop(narrowOop* p);
-  static VerifyOopClosure verify_oop;
-};
-
 #endif // SHARE_VM_MEMORY_GENOOPCLOSURES_HPP
--- a/hotspot/src/share/vm/memory/heapInspection.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/memory/heapInspection.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,10 +24,12 @@
 
 #include "precompiled.hpp"
 #include "classfile/classLoaderData.hpp"
+#include "classfile/systemDictionary.hpp"
 #include "gc_interface/collectedHeap.hpp"
 #include "memory/genCollectedHeap.hpp"
 #include "memory/heapInspection.hpp"
 #include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/os.hpp"
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/macros.hpp"
@@ -39,6 +41,19 @@
 
 // HeapInspection
 
+inline KlassInfoEntry::~KlassInfoEntry() {
+  if (_subclasses != NULL) {
+    delete _subclasses;
+  }
+}
+
+inline void KlassInfoEntry::add_subclass(KlassInfoEntry* cie) {
+  if (_subclasses == NULL) {
+    _subclasses = new  (ResourceObj::C_HEAP, mtInternal) GrowableArray<KlassInfoEntry*>(4, true);
+  }
+  _subclasses->append(cie);
+}
+
 int KlassInfoEntry::compare(KlassInfoEntry* e1, KlassInfoEntry* e2) {
   if(e1->_instance_words > e2->_instance_words) {
     return -1;
@@ -129,7 +144,7 @@
   _table->lookup(k);
 }
 
-KlassInfoTable::KlassInfoTable(bool need_class_stats) {
+KlassInfoTable::KlassInfoTable(bool add_all_classes) {
   _size_of_instances_in_words = 0;
   _size = 0;
   _ref = (HeapWord*) Universe::boolArrayKlassObj();
@@ -141,7 +156,7 @@
     for (int index = 0; index < _size; index++) {
       _buckets[index].initialize();
     }
-    if (need_class_stats) {
+    if (add_all_classes) {
       AllClassesFinder finder(this);
       ClassLoaderDataGraph::classes_do(&finder);
     }
@@ -299,6 +314,191 @@
   st->cr();
 }
 
+class HierarchyClosure : public KlassInfoClosure {
+private:
+  GrowableArray<KlassInfoEntry*> *_elements;
+public:
+  HierarchyClosure(GrowableArray<KlassInfoEntry*> *_elements) : _elements(_elements) {}
+
+  void do_cinfo(KlassInfoEntry* cie) {
+    // ignore array classes
+    if (cie->klass()->oop_is_instance()) {
+      _elements->append(cie);
+    }
+  }
+};
+
+void KlassHierarchy::print_class_hierarchy(outputStream* st, bool print_interfaces,
+                                           bool print_subclasses, char* classname) {
+  ResourceMark rm;
+  Stack <KlassInfoEntry*, mtClass> class_stack;
+  GrowableArray<KlassInfoEntry*> elements;
+
+  // Add all classes to the KlassInfoTable, which allows for quick lookup.
+  // A KlassInfoEntry will be created for each class.
+  KlassInfoTable cit(true);
+  if (cit.allocation_failed()) {
+    st->print_cr("ERROR: Ran out of C-heap; hierarchy not generated");
+    return;
+  }
+
+  // Add all created KlassInfoEntry instances to the elements array for easy
+  // iteration, and to allow each KlassInfoEntry instance to have a unique index.
+  HierarchyClosure hc(&elements);
+  cit.iterate(&hc);
+
+  for(int i = 0; i < elements.length(); i++) {
+    KlassInfoEntry* cie = elements.at(i);
+    const InstanceKlass* k = (InstanceKlass*)cie->klass();
+    Klass* super = ((InstanceKlass*)k)->java_super();
+
+    // Set the index for the class.
+    cie->set_index(i + 1);
+
+    // Add the class to the subclass array of its superclass.
+    if (super != NULL) {
+      KlassInfoEntry* super_cie = cit.lookup(super);
+      assert(super_cie != NULL, "could not lookup superclass");
+      super_cie->add_subclass(cie);
+    }
+  }
+
+  // Set the do_print flag for each class that should be printed.
+  for(int i = 0; i < elements.length(); i++) {
+    KlassInfoEntry* cie = elements.at(i);
+    if (classname == NULL) {
+      // We are printing all classes.
+      cie->set_do_print(true);
+    } else {
+      // We are only printing the hierarchy of a specific class.
+      if (strcmp(classname, cie->klass()->external_name()) == 0) {
+        KlassHierarchy::set_do_print_for_class_hierarchy(cie, &cit, print_subclasses);
+      }
+    }
+  }
+
+  // Now we do a depth first traversal of the class hierachry. The class_stack will
+  // maintain the list of classes we still need to process. Start things off
+  // by priming it with java.lang.Object.
+  KlassInfoEntry* jlo_cie = cit.lookup(SystemDictionary::Object_klass());
+  assert(jlo_cie != NULL, "could not lookup java.lang.Object");
+  class_stack.push(jlo_cie);
+
+  // Repeatedly pop the top item off the stack, print its class info,
+  // and push all of its subclasses on to the stack. Do this until there
+  // are no classes left on the stack.
+  while (!class_stack.is_empty()) {
+    KlassInfoEntry* curr_cie = class_stack.pop();
+    if (curr_cie->do_print()) {
+      print_class(st, curr_cie, print_interfaces);
+      if (curr_cie->subclasses() != NULL) {
+        // Current class has subclasses, so push all of them onto the stack.
+        for (int i = 0; i < curr_cie->subclasses()->length(); i++) {
+          KlassInfoEntry* cie = curr_cie->subclasses()->at(i);
+          if (cie->do_print()) {
+            class_stack.push(cie);
+          }
+        }
+      }
+    }
+  }
+
+  st->flush();
+}
+
+// Sets the do_print flag for every superclass and subclass of the specified class.
+void KlassHierarchy::set_do_print_for_class_hierarchy(KlassInfoEntry* cie, KlassInfoTable* cit,
+                                                      bool print_subclasses) {
+  // Set do_print for all superclasses of this class.
+  Klass* super = ((InstanceKlass*)cie->klass())->java_super();
+  while (super != NULL) {
+    KlassInfoEntry* super_cie = cit->lookup(super);
+    super_cie->set_do_print(true);
+    super = super->super();
+  }
+
+  // Set do_print for this class and all of its subclasses.
+  Stack <KlassInfoEntry*, mtClass> class_stack;
+  class_stack.push(cie);
+  while (!class_stack.is_empty()) {
+    KlassInfoEntry* curr_cie = class_stack.pop();
+    curr_cie->set_do_print(true);
+    if (print_subclasses && curr_cie->subclasses() != NULL) {
+      // Current class has subclasses, so push all of them onto the stack.
+      for (int i = 0; i < curr_cie->subclasses()->length(); i++) {
+        KlassInfoEntry* cie = curr_cie->subclasses()->at(i);
+        class_stack.push(cie);
+      }
+    }
+  }
+}
+
+static void print_indent(outputStream* st, int indent) {
+  while (indent != 0) {
+    st->print("|");
+    indent--;
+    if (indent != 0) {
+      st->print("  ");
+    }
+  }
+}
+
+// Print the class name and its unique ClassLoader identifer.
+static void print_classname(outputStream* st, Klass* klass) {
+  oop loader_oop = klass->class_loader_data()->class_loader();
+  st->print("%s/", klass->external_name());
+  if (loader_oop == NULL) {
+    st->print("null");
+  } else {
+    st->print(INTPTR_FORMAT, klass->class_loader_data());
+  }
+}
+
+static void print_interface(outputStream* st, Klass* intf_klass, const char* intf_type, int indent) {
+  print_indent(st, indent);
+  st->print("  implements ");
+  print_classname(st, intf_klass);
+  st->print(" (%s intf)\n", intf_type);
+}
+
+void KlassHierarchy::print_class(outputStream* st, KlassInfoEntry* cie, bool print_interfaces) {
+  ResourceMark rm;
+  InstanceKlass* klass = (InstanceKlass*)cie->klass();
+  int indent = 0;
+
+  // Print indentation with proper indicators of superclass.
+  Klass* super = klass->super();
+  while (super != NULL) {
+    super = super->super();
+    indent++;
+  }
+  print_indent(st, indent);
+  if (indent != 0) st->print("--");
+
+  // Print the class name, its unique ClassLoader identifer, and if it is an interface.
+  print_classname(st, klass);
+  if (klass->is_interface()) {
+    st->print(" (intf)");
+  }
+  st->print("\n");
+
+  // Print any interfaces the class has.
+  if (print_interfaces) {
+    Array<Klass*>* local_intfs = klass->local_interfaces();
+    Array<Klass*>* trans_intfs = klass->transitive_interfaces();
+    for (int i = 0; i < local_intfs->length(); i++) {
+      print_interface(st, local_intfs->at(i), "declared", indent);
+    }
+    for (int i = 0; i < trans_intfs->length(); i++) {
+      Klass* trans_interface = trans_intfs->at(i);
+      // Only print transitive interfaces if they are not also declared.
+      if (!local_intfs->contains(trans_interface)) {
+        print_interface(st, trans_interface, "inherited", indent);
+      }
+    }
+  }
+}
+
 void KlassInfoHisto::print_class_stats(outputStream* st,
                                       bool csv_format, const char *columns) {
   ResourceMark rm;
@@ -320,6 +520,8 @@
     elements()->at(i)->set_index(i+1);
   }
 
+  // First iteration is for accumulating stats totals in colsum_table[].
+  // Second iteration is for printing stats for each class.
   for (int pass=1; pass<=2; pass++) {
     if (pass == 2) {
       print_title(st, csv_format, selected, width_table, name_table);
@@ -328,6 +530,7 @@
       KlassInfoEntry* e = (KlassInfoEntry*)elements()->at(i);
       const Klass* k = e->klass();
 
+      // Get the stats for this class.
       memset(&sz, 0, sizeof(sz));
       sz._inst_count = e->count();
       sz._inst_bytes = HeapWordSize * e->words();
@@ -335,11 +538,13 @@
       sz._total_bytes = sz._ro_bytes + sz._rw_bytes;
 
       if (pass == 1) {
+        // Add the stats for this class to the overall totals.
         for (int c=0; c<KlassSizeStats::_num_columns; c++) {
           colsum_table[c] += col_table[c];
         }
       } else {
         int super_index = -1;
+        // Print the stats for this class.
         if (k->oop_is_instance()) {
           Klass* super = ((InstanceKlass*)k)->java_super();
           if (super) {
@@ -373,6 +578,8 @@
     }
 
     if (pass == 1) {
+      // Calculate the minimum width needed for the column by accounting for the
+      // column header width and the width of the largest value in the column.
       for (int c=0; c<KlassSizeStats::_num_columns; c++) {
         width_table[c] = col_width(colsum_table[c], name_table[c]);
       }
@@ -381,6 +588,7 @@
 
   sz_sum._inst_size = 0;
 
+  // Print the column totals.
   if (csv_format) {
     st->print(",");
     for (int c=0; c<KlassSizeStats::_num_columns; c++) {
@@ -514,6 +722,7 @@
 
   KlassInfoTable cit(_print_class_stats);
   if (!cit.allocation_failed()) {
+    // populate table with object allocation info
     size_t missed_count = populate_table(&cit);
     if (missed_count != 0) {
       st->print_cr("WARNING: Ran out of C-heap; undercounted " SIZE_FORMAT
@@ -533,7 +742,7 @@
     histo.sort();
     histo.print_histo_on(st, _print_class_stats, _csv_format, _columns);
   } else {
-    st->print_cr("WARNING: Ran out of C-heap; histogram not generated");
+    st->print_cr("ERROR: Ran out of C-heap; histogram not generated");
   }
   st->flush();
 }
--- a/hotspot/src/share/vm/memory/heapInspection.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/memory/heapInspection.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,8 +25,9 @@
 #ifndef SHARE_VM_MEMORY_HEAPINSPECTION_HPP
 #define SHARE_VM_MEMORY_HEAPINSPECTION_HPP
 
-#include "memory/allocation.inline.hpp"
-#include "oops/oop.inline.hpp"
+#include "memory/allocation.hpp"
+#include "oops/objArrayOop.hpp"
+#include "oops/oop.hpp"
 #include "oops/annotations.hpp"
 #include "utilities/macros.hpp"
 
@@ -188,11 +189,15 @@
   long            _instance_count;
   size_t          _instance_words;
   long            _index;
+  bool            _do_print; // True if we should print this class when printing the class hierarchy.
+  GrowableArray<KlassInfoEntry*>* _subclasses;
 
  public:
   KlassInfoEntry(Klass* k, KlassInfoEntry* next) :
-    _klass(k), _instance_count(0), _instance_words(0), _next(next), _index(-1)
+    _klass(k), _instance_count(0), _instance_words(0), _next(next), _index(-1),
+    _do_print(false), _subclasses(NULL)
   {}
+  ~KlassInfoEntry();
   KlassInfoEntry* next() const   { return _next; }
   bool is_equal(const Klass* k)  { return k == _klass; }
   Klass* klass()  const      { return _klass; }
@@ -202,6 +207,10 @@
   void set_words(size_t wds) { _instance_words = wds; }
   void set_index(long index) { _index = index; }
   long index()    const      { return _index; }
+  GrowableArray<KlassInfoEntry*>* subclasses() const { return _subclasses; }
+  void add_subclass(KlassInfoEntry* cie);
+  void set_do_print(bool do_print) { _do_print = do_print; }
+  bool do_print() const      { return _do_print; }
   int compare(KlassInfoEntry* e1, KlassInfoEntry* e2);
   void print_on(outputStream* st) const;
   const char* name() const;
@@ -248,7 +257,7 @@
   };
 
  public:
-  KlassInfoTable(bool need_class_stats);
+  KlassInfoTable(bool add_all_classes);
   ~KlassInfoTable();
   bool record_instance(const oop obj);
   void iterate(KlassInfoClosure* cic);
@@ -256,6 +265,18 @@
   size_t size_of_instances_in_words() const;
 
   friend class KlassInfoHisto;
+  friend class KlassHierarchy;
+};
+
+class KlassHierarchy : AllStatic {
+ public:
+  static void print_class_hierarchy(outputStream* st, bool print_interfaces,  bool print_subclasses,
+                                    char* classname);
+
+ private:
+  static void set_do_print_for_class_hierarchy(KlassInfoEntry* cie, KlassInfoTable* cit,
+                                               bool print_subclasse);
+  static void print_class(outputStream* st, KlassInfoEntry* cie, bool print_subclasses);
 };
 
 class KlassInfoHisto : public StackObj {
--- a/hotspot/src/share/vm/memory/space.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/memory/space.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,6 @@
 #include "memory/space.inline.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "runtime/java.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/prefetch.inline.hpp"
--- a/hotspot/src/share/vm/memory/space.inline.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/memory/space.inline.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 "gc_implementation/shared/markSweep.inline.hpp"
 #include "gc_implementation/shared/spaceDecorator.hpp"
 #include "gc_interface/collectedHeap.hpp"
+#include "memory/generation.hpp"
 #include "memory/space.hpp"
 #include "memory/universe.hpp"
 #include "runtime/prefetch.inline.hpp"
--- a/hotspot/src/share/vm/memory/universe.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/memory/universe.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -50,6 +50,7 @@
 #include "oops/instanceKlass.hpp"
 #include "oops/instanceMirrorKlass.hpp"
 #include "oops/instanceRefKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/typeArrayKlass.hpp"
 #include "prims/jvmtiRedefineClassesTrace.hpp"
--- a/hotspot/src/share/vm/oops/compiledICHolder.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/oops/compiledICHolder.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
 #include "oops/compiledICHolder.hpp"
 #include "oops/klass.hpp"
 #include "oops/method.hpp"
-#include "oops/oop.inline2.hpp"
 #include "runtime/atomic.inline.hpp"
 
 volatile int CompiledICHolder::_live_count;
--- a/hotspot/src/share/vm/oops/constantPool.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/oops/constantPool.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -24,7 +24,7 @@
 
 #include "precompiled.hpp"
 #include "classfile/classLoaderData.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/metadataOnStackMark.hpp"
 #include "classfile/stringTable.hpp"
 #include "classfile/systemDictionary.hpp"
@@ -36,11 +36,14 @@
 #include "oops/constantPool.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/fieldType.hpp"
 #include "runtime/init.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/signature.hpp"
 #include "runtime/vframe.hpp"
+#include "utilities/copy.hpp"
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
--- a/hotspot/src/share/vm/oops/cpCache.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/oops/cpCache.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
 #include "interpreter/rewriter.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/cpCache.hpp"
-#include "oops/objArrayOop.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "prims/methodHandles.hpp"
--- a/hotspot/src/share/vm/oops/klass.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/oops/klass.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -35,7 +35,7 @@
 #include "memory/resourceArea.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/klass.inline.hpp"
-#include "oops/oop.inline2.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/orderAccess.inline.hpp"
 #include "trace/traceMacros.hpp"
--- a/hotspot/src/share/vm/oops/markOop.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/oops/markOop.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,17 +25,40 @@
 #include "precompiled.hpp"
 #include "oops/markOop.hpp"
 #include "runtime/thread.inline.hpp"
+#include "runtime/objectMonitor.inline.hpp"
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
 void markOopDesc::print_on(outputStream* st) const {
-  if (is_locked()) {
-    st->print("locked(" INTPTR_FORMAT ")->", value());
-    markOop(*(markOop*)value())->print_on(st);
+  if (is_marked()) {
+    st->print(" marked(" INTPTR_FORMAT ")", value());
+  } else if (is_locked()) {
+    st->print(" locked(" INTPTR_FORMAT ")->", value());
+    if (is_neutral()) {
+      st->print("is_neutral");
+      if (has_no_hash()) st->print(" no_hash");
+      else st->print(" hash=" INTPTR_FORMAT, hash());
+      st->print(" age=%d", age());
+    } else if (has_bias_pattern()) {
+      st->print("is_biased");
+      JavaThread* jt = biased_locker();
+      st->print(" biased_locker=" INTPTR_FORMAT, p2i(jt));
+    } else if (has_monitor()) {
+      ObjectMonitor* mon = monitor();
+      if (mon == NULL)
+        st->print("monitor=NULL");
+      else {
+        BasicLock * bl = (BasicLock *) mon->owner();
+        st->print("monitor={count="INTPTR_FORMAT",waiters="INTPTR_FORMAT",recursions="INTPTR_FORMAT",owner="INTPTR_FORMAT"}",
+                mon->count(), mon->waiters(), mon->recursions(), p2i(bl));
+      }
+    } else {
+      st->print("??");
+    }
   } else {
     assert(is_unlocked() || has_bias_pattern(), "just checking");
     st->print("mark(");
-    if (has_bias_pattern())  st->print("biased,");
+    if (has_bias_pattern()) st->print("biased,");
     st->print("hash %#lx,", hash());
     st->print("age %d)", age());
   }
--- a/hotspot/src/share/vm/oops/methodData.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/oops/methodData.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,6 +36,7 @@
 #include "runtime/deoptimization.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/orderAccess.inline.hpp"
+#include "utilities/copy.hpp"
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
--- a/hotspot/src/share/vm/oops/objArrayKlass.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/oops/objArrayKlass.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,11 +35,9 @@
 #include "memory/universe.inline.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/klass.inline.hpp"
-#include "oops/objArrayKlass.hpp"
 #include "oops/objArrayKlass.inline.hpp"
-#include "oops/objArrayOop.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "oops/symbol.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/mutexLocker.hpp"
--- a/hotspot/src/share/vm/oops/objArrayOop.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/oops/objArrayOop.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -78,15 +78,7 @@
   HeapWord* base() const      { return (HeapWord*) arrayOopDesc::base(T_OBJECT); }
 
   // Accessing
-  oop obj_at(int index) const {
-    // With UseCompressedOops decode the narrow oop in the objArray to an
-    // uncompressed oop.  Otherwise this is simply a "*" operator.
-    if (UseCompressedOops) {
-      return load_decode_heap_oop(obj_at_addr<narrowOop>(index));
-    } else {
-      return load_decode_heap_oop(obj_at_addr<oop>(index));
-    }
-  }
+  oop obj_at(int index) const;
 
   void obj_at_put(int index, oop value) {
     if (UseCompressedOops) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/oops/objArrayOop.inline.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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_OOPS_OBJARRAYOOP_INLINE_HPP
+#define SHARE_VM_OOPS_OBJARRAYOOP_INLINE_HPP
+
+#include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/globals.hpp"
+
+inline oop objArrayOopDesc::obj_at(int index) const {
+  // With UseCompressedOops decode the narrow oop in the objArray to an
+  // uncompressed oop.  Otherwise this is simply a "*" operator.
+  if (UseCompressedOops) {
+    return load_decode_heap_oop(obj_at_addr<narrowOop>(index));
+  } else {
+    return load_decode_heap_oop(obj_at_addr<oop>(index));
+  }
+}
+
+#endif // SHARE_VM_OOPS_OBJARRAYOOP_INLINE_HPP
--- a/hotspot/src/share/vm/oops/oop.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/oops/oop.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,8 +24,9 @@
 
 #include "precompiled.hpp"
 #include "classfile/altHashing.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "oops/oop.inline.hpp"
+#include "oops/verifyOopClosure.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/thread.inline.hpp"
 #include "utilities/copy.hpp"
@@ -120,5 +121,24 @@
 
 VerifyOopClosure VerifyOopClosure::verify_oop;
 
+template <class T> void VerifyOopClosure::do_oop_work(T* p) {
+  oop obj = oopDesc::load_decode_heap_oop(p);
+  guarantee(obj->is_oop_or_null(), err_msg("invalid oop: " INTPTR_FORMAT, p2i((oopDesc*) obj)));
+}
+
 void VerifyOopClosure::do_oop(oop* p)       { VerifyOopClosure::do_oop_work(p); }
 void VerifyOopClosure::do_oop(narrowOop* p) { VerifyOopClosure::do_oop_work(p); }
+
+// type test operations that doesn't require inclusion of oop.inline.hpp.
+bool oopDesc::is_instance_noinline()          const { return is_instance();            }
+bool oopDesc::is_instanceMirror_noinline()    const { return is_instanceMirror();      }
+bool oopDesc::is_instanceClassLoader_noline() const { return is_instanceClassLoader(); }
+bool oopDesc::is_instanceRef_noline()         const { return is_instanceRef();         }
+bool oopDesc::is_array_noinline()             const { return is_array();               }
+bool oopDesc::is_objArray_noinline()          const { return is_objArray();            }
+bool oopDesc::is_typeArray_noinline()         const { return is_typeArray();           }
+
+bool oopDesc::has_klass_gap() {
+  // Only has a klass gap when compressed class pointers are used.
+  return UseCompressedClassPointers;
+}
--- a/hotspot/src/share/vm/oops/oop.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/oops/oop.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,7 @@
   // to be able to figure out the size of an object knowing its klass.
   int size_given_klass(Klass* klass);
 
-  // type test operations (inlined in oop.inline.h)
+  // type test operations (inlined in oop.inline.hpp)
   bool is_instance()            const;
   bool is_instanceMirror()      const;
   bool is_instanceClassLoader() const;
@@ -117,6 +117,15 @@
   bool is_objArray()            const;
   bool is_typeArray()           const;
 
+  // type test operations that don't require inclusion of oop.inline.hpp.
+  bool is_instance_noinline()          const;
+  bool is_instanceMirror_noinline()    const;
+  bool is_instanceClassLoader_noline() const;
+  bool is_instanceRef_noline()         const;
+  bool is_array_noinline()             const;
+  bool is_objArray_noinline()          const;
+  bool is_typeArray_noinline()         const;
+
  private:
   // field addresses in oop
   void*     field_base(int offset)        const;
@@ -370,10 +379,15 @@
   markOop  displaced_mark() const;
   void     set_displaced_mark(markOop m);
 
+  static bool has_klass_gap();
+
   // for code generation
-  static int mark_offset_in_bytes()    { return offset_of(oopDesc, _mark); }
-  static int klass_offset_in_bytes()   { return offset_of(oopDesc, _metadata._klass); }
-  static int klass_gap_offset_in_bytes();
+  static int mark_offset_in_bytes()      { return offset_of(oopDesc, _mark); }
+  static int klass_offset_in_bytes()     { return offset_of(oopDesc, _metadata._klass); }
+  static int klass_gap_offset_in_bytes() {
+    assert(has_klass_gap(), "only applicable to compressed klass pointers");
+    return klass_offset_in_bytes() + sizeof(narrowKlass);
+  }
 };
 
 #endif // SHARE_VM_OOPS_OOP_HPP
--- a/hotspot/src/share/vm/oops/oop.inline.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/oops/oop.inline.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -71,11 +71,6 @@
   }
 }
 
-inline int oopDesc::klass_gap_offset_in_bytes() {
-  assert(UseCompressedClassPointers, "only applicable to compressed klass pointers");
-  return oopDesc::klass_offset_in_bytes() + sizeof(narrowKlass);
-}
-
 inline Klass** oopDesc::klass_addr() {
   // Only used internally and with CMS and will not work with
   // UseCompressedOops
@@ -602,8 +597,11 @@
   klass()->oop_follow_contents(this);
 }
 
+inline bool oopDesc::is_scavengable() const {
+  return Universe::heap()->is_scavengable(this);
+}
+
 // Used by scavengers
-
 inline bool oopDesc::is_forwarded() const {
   // The extra heap check is needed since the obj might be locked, in which case the
   // mark would point to a stack location and have the sentinel bit cleared
--- a/hotspot/src/share/vm/oops/oop.inline2.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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_OOPS_OOP_INLINE2_HPP
-#define SHARE_VM_OOPS_OOP_INLINE2_HPP
-
-#include "gc_interface/collectedHeap.hpp"
-#include "memory/generation.hpp"
-#include "memory/universe.hpp"
-#include "oops/oop.hpp"
-
-// Implementation of all inlined member functions defined in oop.hpp
-// We need a separate file to avoid circular references
-
-inline bool oopDesc::is_scavengable() const {
-  return Universe::heap()->is_scavengable(this);
-}
-#endif // SHARE_VM_OOPS_OOP_INLINE2_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/oops/verifyOopClosure.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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_OOPS_VERIFYOOPCLOSURE_HPP
+#define SHARE_VM_OOPS_VERIFYOOPCLOSURE_HPP
+
+#include "memory/iterator.hpp"
+
+class VerifyOopClosure: public OopClosure {
+ protected:
+  template <class T> void do_oop_work(T* p);
+ public:
+  virtual void do_oop(oop* p);
+  virtual void do_oop(narrowOop* p);
+  static VerifyOopClosure verify_oop;
+};
+
+#endif // SHARE_VM_OOPS_VERIFYOOPCLOSURE_HPP
--- a/hotspot/src/share/vm/opto/callGenerator.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/opto/callGenerator.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,7 @@
 #include "opto/rootnode.hpp"
 #include "opto/runtime.hpp"
 #include "opto/subnode.hpp"
-
+#include "runtime/sharedRuntime.hpp"
 
 // Utility function.
 const TypeFunc* CallGenerator::tf() const {
--- a/hotspot/src/share/vm/opto/callnode.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/opto/callnode.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "compiler/compileLog.hpp"
 #include "ci/bcEscapeAnalyzer.hpp"
 #include "compiler/oopMap.hpp"
 #include "opto/callGenerator.hpp"
@@ -1673,6 +1674,9 @@
       // The lock could be marked eliminated by lock coarsening
       // code during first IGVN before EA. Replace coarsened flag
       // to eliminate all associated locks/unlocks.
+#ifdef ASSERT
+      this->log_lock_optimization(phase->C,"eliminate_lock_set_non_esc1");
+#endif
       this->set_non_esc_obj();
       return result;
     }
@@ -1734,6 +1738,9 @@
           AbstractLockNode* lock = lock_ops.at(i);
 
           // Mark it eliminated by coarsening and update any counters
+#ifdef ASSERT
+          lock->log_lock_optimization(phase->C, "eliminate_lock_set_coarsened");
+#endif
           lock->set_coarsened();
         }
       } else if (ctrl->is_Region() &&
@@ -1752,16 +1759,33 @@
 
 //=============================================================================
 bool LockNode::is_nested_lock_region() {
+  return is_nested_lock_region(NULL);
+}
+
+// p is used for access to compilation log; no logging if NULL
+bool LockNode::is_nested_lock_region(Compile * c) {
   BoxLockNode* box = box_node()->as_BoxLock();
   int stk_slot = box->stack_slot();
-  if (stk_slot <= 0)
+  if (stk_slot <= 0) {
+#ifdef ASSERT
+    this->log_lock_optimization(c, "eliminate_lock_INLR_1");
+#endif
     return false; // External lock or it is not Box (Phi node).
+  }
 
   // Ignore complex cases: merged locks or multiple locks.
   Node* obj = obj_node();
   LockNode* unique_lock = NULL;
-  if (!box->is_simple_lock_region(&unique_lock, obj) ||
-      (unique_lock != this)) {
+  if (!box->is_simple_lock_region(&unique_lock, obj)) {
+#ifdef ASSERT
+    this->log_lock_optimization(c, "eliminate_lock_INLR_2a");
+#endif
+    return false;
+  }
+  if (unique_lock != this) {
+#ifdef ASSERT
+    this->log_lock_optimization(c, "eliminate_lock_INLR_2b");
+#endif
     return false;
   }
 
@@ -1781,6 +1805,9 @@
       }
     }
   }
+#ifdef ASSERT
+  this->log_lock_optimization(c, "eliminate_lock_INLR_3");
+#endif
   return false;
 }
 
@@ -1812,12 +1839,43 @@
       // The lock could be marked eliminated by lock coarsening
       // code during first IGVN before EA. Replace coarsened flag
       // to eliminate all associated locks/unlocks.
+#ifdef ASSERT
+      this->log_lock_optimization(phase->C, "eliminate_lock_set_non_esc2");
+#endif
       this->set_non_esc_obj();
     }
   }
   return result;
 }
 
+const char * AbstractLockNode::kind_as_string() const {
+  return is_coarsened()   ? "coarsened" :
+         is_nested()      ? "nested" :
+         is_non_esc_obj() ? "non_escaping" :
+         "?";
+}
+
+void AbstractLockNode::log_lock_optimization(Compile *C, const char * tag)  const {
+  if (C == NULL) {
+    return;
+  }
+  CompileLog* log = C->log();
+  if (log != NULL) {
+    log->begin_head("%s lock='%d' compile_id='%d' class_id='%s' kind='%s'",
+          tag, is_Lock(), C->compile_id(),
+          is_Unlock() ? "unlock" : is_Lock() ? "lock" : "?",
+          kind_as_string());
+    log->stamp();
+    log->end_head();
+    JVMState* p = is_Unlock() ? (as_Unlock()->dbg_jvms()) : jvms();
+    while (p != NULL) {
+      log->elem("jvms bci='%d' method='%d'", p->bci(), log->identify(p->method()));
+      p = p->caller();
+    }
+    log->tail(tag);
+  }
+}
+
 ArrayCopyNode::ArrayCopyNode(Compile* C, bool alloc_tightly_coupled)
   : CallNode(arraycopy_type(), NULL, TypeRawPtr::BOTTOM),
     _alloc_tightly_coupled(alloc_tightly_coupled),
--- a/hotspot/src/share/vm/opto/callnode.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/opto/callnode.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -985,6 +985,9 @@
   bool is_coarsened()   const { return (_kind == Coarsened); }
   bool is_nested()      const { return (_kind == Nested); }
 
+  const char * kind_as_string() const;
+  void log_lock_optimization(Compile* c, const char * tag) const;
+
   void set_non_esc_obj() { _kind = NonEscObj; set_eliminated_lock_counter(); }
   void set_coarsened()   { _kind = Coarsened; set_eliminated_lock_counter(); }
   void set_nested()      { _kind = Nested; set_eliminated_lock_counter(); }
@@ -1045,15 +1048,24 @@
   }
 
   bool is_nested_lock_region(); // Is this Lock nested?
+  bool is_nested_lock_region(Compile * c); // Why isn't this Lock nested?
 };
 
 //------------------------------Unlock---------------------------------------
 // High-level unlock operation
 class UnlockNode : public AbstractLockNode {
+private:
+#ifdef ASSERT
+  JVMState* const _dbg_jvms;      // Pointer to list of JVM State objects
+#endif
 public:
   virtual int Opcode() const;
   virtual uint size_of() const; // Size is bigger
-  UnlockNode(Compile* C, const TypeFunc *tf) : AbstractLockNode( tf ) {
+  UnlockNode(Compile* C, const TypeFunc *tf) : AbstractLockNode( tf )
+#ifdef ASSERT
+    , _dbg_jvms(NULL)
+#endif
+  {
     init_class_id(Class_Unlock);
     init_flags(Flag_is_macro);
     C->add_macro_node(this);
@@ -1061,6 +1073,14 @@
   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
   // unlock is never a safepoint
   virtual bool        guaranteed_safepoint()  { return false; }
+#ifdef ASSERT
+  void set_dbg_jvms(JVMState* s) {
+    *(JVMState**)&_dbg_jvms = s;  // override const attribute in the accessor
+  }
+  JVMState* dbg_jvms() const { return _dbg_jvms; }
+#else
+  JVMState* dbg_jvms() const { return NULL; }
+#endif
 };
 
 class GraphKit;
--- a/hotspot/src/share/vm/opto/cfgnode.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/opto/cfgnode.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1015,7 +1015,6 @@
     if( jtip && ttip ) {
       if( jtip->is_loaded() &&  jtip->klass()->is_interface() &&
           ttip->is_loaded() && !ttip->klass()->is_interface() ) {
-        // Happens in a CTW of rt.jar, 320-341, no extra flags
         assert(ft == ttip->cast_to_ptr_type(jtip->ptr()) ||
                ft->isa_narrowoop() && ft->make_ptr() == ttip->cast_to_ptr_type(jtip->ptr()), "");
         jt = ft;
--- a/hotspot/src/share/vm/opto/compile.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/opto/compile.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -64,6 +64,7 @@
 #include "opto/type.hpp"
 #include "opto/vectornode.hpp"
 #include "runtime/arguments.hpp"
+#include "runtime/sharedRuntime.hpp"
 #include "runtime/signature.hpp"
 #include "runtime/stubRoutines.hpp"
 #include "runtime/timer.hpp"
--- a/hotspot/src/share/vm/opto/convertnode.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/opto/convertnode.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
 #include "opto/matcher.hpp"
 #include "opto/phaseX.hpp"
 #include "opto/subnode.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 //=============================================================================
 //------------------------------Identity---------------------------------------
--- a/hotspot/src/share/vm/opto/escape.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/opto/escape.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1802,6 +1802,9 @@
             // The lock could be marked eliminated by lock coarsening
             // code during first IGVN before EA. Replace coarsened flag
             // to eliminate all associated locks/unlocks.
+#ifdef ASSERT
+            alock->log_lock_optimization(C, "eliminate_lock_set_non_esc3");
+#endif
             alock->set_non_esc_obj();
           }
         }
--- a/hotspot/src/share/vm/opto/graphKit.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/opto/graphKit.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -3244,6 +3244,9 @@
 
   const TypeFunc *tf = OptoRuntime::complete_monitor_exit_Type();
   UnlockNode *unlock = new UnlockNode(C, tf);
+#ifdef ASSERT
+  unlock->set_dbg_jvms(sync_jvms());
+#endif
   uint raw_idx = Compile::AliasIdxRaw;
   unlock->init_req( TypeFunc::Control, control() );
   unlock->init_req( TypeFunc::Memory , memory(raw_idx) );
@@ -3754,6 +3757,17 @@
   sync_kit(ideal);
 }
 
+Node* GraphKit::byte_map_base_node() {
+  // Get base of card map
+  CardTableModRefBS* ct = (CardTableModRefBS*)(Universe::heap()->barrier_set());
+  assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust users of this code");
+  if (ct->byte_map_base != NULL) {
+    return makecon(TypeRawPtr::make((address)ct->byte_map_base));
+  } else {
+    return null();
+  }
+}
+
 // vanilla/CMS post barrier
 // Insert a write-barrier store.  This is to let generational GC work; we have
 // to flag all oop-stores before the next GC point.
--- a/hotspot/src/share/vm/opto/graphKit.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/opto/graphKit.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -104,16 +104,7 @@
   // (See also macro MakeConX in type.hpp, which uses intcon or longcon.)
 
   // Helper for byte_map_base
-  Node* byte_map_base_node() {
-    // Get base of card map
-    CardTableModRefBS* ct = (CardTableModRefBS*)(Universe::heap()->barrier_set());
-    assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust users of this code");
-    if (ct->byte_map_base != NULL) {
-      return makecon(TypeRawPtr::make((address)ct->byte_map_base));
-    } else {
-      return null();
-    }
-  }
+  Node* byte_map_base_node();
 
   jint  find_int_con(Node* n, jint value_if_unknown) {
     return _gvn.find_int_con(n, value_if_unknown);
--- a/hotspot/src/share/vm/opto/lcm.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/opto/lcm.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,7 @@
 #include "opto/cfgnode.hpp"
 #include "opto/machnode.hpp"
 #include "opto/runtime.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 // Optimization - Graph Style
 
--- a/hotspot/src/share/vm/opto/library_call.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/opto/library_call.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -2598,8 +2598,7 @@
   // bypassing each other.  Happens after null checks, so the
   // exception paths do not take memory state from the memory barrier,
   // so there's no problems making a strong assert about mixing users
-  // of safe & unsafe memory.  Otherwise fails in a CTW of rt.jar
-  // around 5701, class sun/reflect/UnsafeBooleanFieldAccessorImpl.
+  // of safe & unsafe memory.
   if (need_mem_bar) insert_mem_bar(Op_MemBarCPUOrder);
 
   if (!is_store) {
--- a/hotspot/src/share/vm/opto/loopnode.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/opto/loopnode.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -436,6 +436,19 @@
       return false; // cyclic loop or this loop trips only once
   }
 
+  if (phi_incr != NULL) {
+    // check if there is a possiblity of IV overflowing after the first increment
+    if (stride_con > 0) {
+      if (init_t->_hi > max_jint - stride_con) {
+        return false;
+      }
+    } else {
+      if (init_t->_lo < min_jint - stride_con) {
+        return false;
+      }
+    }
+  }
+
   // =================================================
   // ---- SUCCESS!   Found A Trip-Counted Loop!  -----
   //
--- a/hotspot/src/share/vm/opto/macro.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/opto/macro.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1890,7 +1890,7 @@
     // Box is used only in one lock region. Mark this box as eliminated.
     _igvn.hash_delete(oldbox);
     oldbox->as_BoxLock()->set_eliminated(); // This changes box's hash value
-    _igvn.hash_insert(oldbox);
+     _igvn.hash_insert(oldbox);
 
     for (uint i = 0; i < oldbox->outcnt(); i++) {
       Node* u = oldbox->raw_out(i);
@@ -1899,6 +1899,9 @@
         // Check lock's box since box could be referenced by Lock's debug info.
         if (alock->box_node() == oldbox) {
           // Mark eliminated all related locks and unlocks.
+#ifdef ASSERT
+          alock->log_lock_optimization(C, "eliminate_lock_set_non_esc4");
+#endif
           alock->set_non_esc_obj();
         }
       }
@@ -1925,6 +1928,9 @@
       AbstractLockNode* alock = u->as_AbstractLock();
       if (alock->box_node() == oldbox && alock->obj_node()->eqv_uncast(obj)) {
         // Replace Box and mark eliminated all related locks and unlocks.
+#ifdef ASSERT
+        alock->log_lock_optimization(C, "eliminate_lock_set_non_esc5");
+#endif
         alock->set_non_esc_obj();
         _igvn.rehash_node_delayed(alock);
         alock->set_box_node(newbox);
@@ -1971,26 +1977,38 @@
        return;
     } else if (!alock->is_non_esc_obj()) { // Not eliminated or coarsened
       // Only Lock node has JVMState needed here.
-      if (alock->jvms() != NULL && alock->as_Lock()->is_nested_lock_region()) {
-        // Mark eliminated related nested locks and unlocks.
-        Node* obj = alock->obj_node();
-        BoxLockNode* box_node = alock->box_node()->as_BoxLock();
-        assert(!box_node->is_eliminated(), "should not be marked yet");
-        // Note: BoxLock node is marked eliminated only here
-        // and it is used to indicate that all associated lock
-        // and unlock nodes are marked for elimination.
-        box_node->set_eliminated(); // Box's hash is always NO_HASH here
-        for (uint i = 0; i < box_node->outcnt(); i++) {
-          Node* u = box_node->raw_out(i);
-          if (u->is_AbstractLock()) {
-            alock = u->as_AbstractLock();
-            if (alock->box_node() == box_node) {
-              // Verify that this Box is referenced only by related locks.
-              assert(alock->obj_node()->eqv_uncast(obj), "");
-              // Mark all related locks and unlocks.
-              alock->set_nested();
+      // Not that preceding claim is documented anywhere else.
+      if (alock->jvms() != NULL) {
+        if (alock->as_Lock()->is_nested_lock_region()) {
+          // Mark eliminated related nested locks and unlocks.
+          Node* obj = alock->obj_node();
+          BoxLockNode* box_node = alock->box_node()->as_BoxLock();
+          assert(!box_node->is_eliminated(), "should not be marked yet");
+          // Note: BoxLock node is marked eliminated only here
+          // and it is used to indicate that all associated lock
+          // and unlock nodes are marked for elimination.
+          box_node->set_eliminated(); // Box's hash is always NO_HASH here
+          for (uint i = 0; i < box_node->outcnt(); i++) {
+            Node* u = box_node->raw_out(i);
+            if (u->is_AbstractLock()) {
+              alock = u->as_AbstractLock();
+              if (alock->box_node() == box_node) {
+                // Verify that this Box is referenced only by related locks.
+                assert(alock->obj_node()->eqv_uncast(obj), "");
+                // Mark all related locks and unlocks.
+#ifdef ASSERT
+                alock->log_lock_optimization(C, "eliminate_lock_set_nested");
+#endif
+                alock->set_nested();
+              }
             }
           }
+        } else {
+#ifdef ASSERT
+          alock->log_lock_optimization(C, "eliminate_lock_NOT_nested_lock_region");
+          if (C->log() != NULL)
+            alock->as_Lock()->is_nested_lock_region(C); // rerun for debugging output
+#endif
         }
       }
       return;
@@ -2035,19 +2053,10 @@
     assert(oldbox->is_eliminated(), "should be done already");
   }
 #endif
-  CompileLog* log = C->log();
-  if (log != NULL) {
-    log->head("eliminate_lock lock='%d'",
-              alock->is_Lock());
-    JVMState* p = alock->jvms();
-    while (p != NULL) {
-      log->elem("jvms bci='%d' method='%d'", p->bci(), log->identify(p->method()));
-      p = p->caller();
-    }
-    log->tail("eliminate_lock");
-  }
 
-  #ifndef PRODUCT
+  alock->log_lock_optimization(C, "eliminate_lock");
+
+#ifndef PRODUCT
   if (PrintEliminateLocks) {
     if (alock->is_Lock()) {
       tty->print_cr("++++ Eliminated: %d Lock", alock->_idx);
@@ -2055,7 +2064,7 @@
       tty->print_cr("++++ Eliminated: %d Unlock", alock->_idx);
     }
   }
-  #endif
+#endif
 
   Node* mem  = alock->in(TypeFunc::Memory);
   Node* ctrl = alock->in(TypeFunc::Control);
--- a/hotspot/src/share/vm/opto/matcher.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/opto/matcher.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -38,6 +38,7 @@
 #include "opto/type.hpp"
 #include "opto/vectornode.hpp"
 #include "runtime/os.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 OptoReg::Name OptoReg::c_frame_pointer;
 
--- a/hotspot/src/share/vm/opto/memnode.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/opto/memnode.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,6 +40,7 @@
 #include "opto/narrowptrnode.hpp"
 #include "opto/phaseX.hpp"
 #include "opto/regmask.hpp"
+#include "utilities/copy.hpp"
 
 // Portions of code courtesy of Clifford Click
 
--- a/hotspot/src/share/vm/opto/parse2.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/opto/parse2.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 "compiler/compileLog.hpp"
 #include "interpreter/linkResolver.hpp"
 #include "memory/universe.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "opto/addnode.hpp"
 #include "opto/castnode.hpp"
 #include "opto/convertnode.hpp"
--- a/hotspot/src/share/vm/opto/stringopts.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/opto/stringopts.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,6 +34,7 @@
 #include "opto/runtime.hpp"
 #include "opto/stringopts.hpp"
 #include "opto/subnode.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 #define __ kit.
 
--- a/hotspot/src/share/vm/opto/type.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/opto/type.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -3122,7 +3122,6 @@
   if (ftip != NULL && ktip != NULL &&
       ftip->is_loaded() &&  ftip->klass()->is_interface() &&
       ktip->is_loaded() && !ktip->klass()->is_interface()) {
-    // Happens in a CTW of rt.jar, 320-341, no extra flags
     assert(!ftip->klass_is_exact(), "interface could not be exact");
     return ktip->cast_to_ptr_type(ftip->ptr());
   }
--- a/hotspot/src/share/vm/precompiled/precompiled.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/precompiled/precompiled.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -160,8 +160,6 @@
 # include "oops/objArrayKlass.hpp"
 # include "oops/objArrayOop.hpp"
 # include "oops/oop.hpp"
-# include "oops/oop.inline.hpp"
-# include "oops/oop.inline2.hpp"
 # include "oops/oopsHierarchy.hpp"
 # include "oops/symbol.hpp"
 # include "oops/typeArrayKlass.hpp"
--- a/hotspot/src/share/vm/prims/forte.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/prims/forte.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@
 #include "memory/space.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "prims/forte.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/thread.inline.hpp"
--- a/hotspot/src/share/vm/prims/jni.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/prims/jni.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2012 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -42,7 +42,7 @@
 #include "oops/markOop.hpp"
 #include "oops/method.hpp"
 #include "oops/objArrayKlass.hpp"
-#include "oops/objArrayOop.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/symbol.hpp"
 #include "oops/typeArrayKlass.hpp"
--- a/hotspot/src/share/vm/prims/jniCheck.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/prims/jniCheck.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "memory/guardedMemory.hpp"
--- a/hotspot/src/share/vm/prims/jvm.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/prims/jvm.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -25,18 +25,21 @@
 #include "precompiled.hpp"
 #include "classfile/classLoader.hpp"
 #include "classfile/javaAssertions.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/stringTable.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
 #include "interpreter/bytecode.hpp"
+#include "memory/barrierSet.inline.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/fieldStreams.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/method.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvm.h"
 #include "prims/jvm_misc.hpp"
 #include "prims/jvmtiExport.hpp"
--- a/hotspot/src/share/vm/prims/jvmtiEnter.xsl	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/prims/jvmtiEnter.xsl	Tue Mar 03 08:49:13 2015 -0800
@@ -1,6 +1,6 @@
 <?xml version="1.0"?> 
 <!--
- Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
  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,6 +39,7 @@
 # include "precompiled.hpp"
 # include "utilities/macros.hpp"
 #if INCLUDE_JVMTI
+# include "oops/oop.inline.hpp"
 # include "prims/jvmtiEnter.hpp"
 # include "prims/jvmtiRawMonitor.hpp"
 # include "prims/jvmtiUtil.hpp"
--- a/hotspot/src/share/vm/prims/jvmtiEnv.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/prims/jvmtiEnv.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,8 @@
 #include "memory/resourceArea.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/instanceKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jniCheck.hpp"
 #include "prims/jvm_misc.hpp"
 #include "prims/jvmtiAgentThread.hpp"
--- a/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,6 +27,7 @@
 #include "jvmtifiles/jvmtiEnv.hpp"
 #include "oops/objArrayKlass.hpp"
 #include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvmtiEnvBase.hpp"
 #include "prims/jvmtiEventController.inline.hpp"
 #include "prims/jvmtiExtensions.hpp"
--- a/hotspot/src/share/vm/prims/jvmtiExport.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/prims/jvmtiExport.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@
 #include "memory/resourceArea.hpp"
 #include "oops/objArrayKlass.hpp"
 #include "oops/objArrayOop.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvmtiCodeBlobEvents.hpp"
 #include "prims/jvmtiEventController.hpp"
 #include "prims/jvmtiEventController.inline.hpp"
--- a/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,9 +24,11 @@
 
 #include "precompiled.hpp"
 #include "classfile/systemDictionary.hpp"
+#include "gc_interface/collectedHeap.hpp"
 #include "memory/universe.inline.hpp"
 #include "prims/jvmtiGetLoadedClasses.hpp"
 #include "runtime/thread.hpp"
+#include "utilities/stack.inline.hpp"
 
 
 // The closure for GetLoadedClasses
--- a/hotspot/src/share/vm/prims/jvmtiImpl.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/prims/jvmtiImpl.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 "jvmtifiles/jvmtiEnv.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/instanceKlass.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvmtiAgentThread.hpp"
 #include "prims/jvmtiEventController.inline.hpp"
 #include "prims/jvmtiImpl.hpp"
--- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -36,6 +36,7 @@
 #include "memory/universe.inline.hpp"
 #include "oops/fieldStreams.hpp"
 #include "oops/klassVtable.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvmtiImpl.hpp"
 #include "prims/jvmtiRedefineClasses.hpp"
 #include "prims/methodComparator.hpp"
--- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,8 @@
 #include "jvmtifiles/jvmtiEnv.hpp"
 #include "oops/instanceMirrorKlass.hpp"
 #include "oops/objArrayKlass.hpp"
-#include "oops/oop.inline2.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvmtiEventController.hpp"
 #include "prims/jvmtiEventController.inline.hpp"
 #include "prims/jvmtiExport.hpp"
--- a/hotspot/src/share/vm/prims/methodHandles.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/prims/methodHandles.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -23,13 +23,17 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/stringTable.hpp"
 #include "code/codeCache.hpp"
 #include "compiler/compileBroker.hpp"
 #include "interpreter/interpreter.hpp"
 #include "interpreter/oopMapCache.hpp"
+#include "interpreter/linkResolver.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/oopFactory.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/methodHandles.hpp"
 #include "runtime/compilationPolicy.hpp"
 #include "runtime/javaCalls.hpp"
@@ -405,7 +409,7 @@
     return java_lang_invoke_MethodType::as_signature(type_str, intern_if_not_found, THREAD);
   } else if (java_lang_Class::is_instance(type_str)) {
     return java_lang_Class::as_signature(type_str, false, THREAD);
-  } else if (java_lang_String::is_instance(type_str)) {
+  } else if (java_lang_String::is_instance_inlined(type_str)) {
     if (intern_if_not_found) {
       return java_lang_String::as_symbol(type_str, THREAD);
     } else {
--- a/hotspot/src/share/vm/prims/unsafe.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/prims/unsafe.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -25,6 +25,8 @@
 #include "precompiled.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "memory/allocation.inline.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jni.h"
 #include "prims/jvm.h"
 #include "runtime/atomic.inline.hpp"
--- a/hotspot/src/share/vm/prims/wbtestmethods/parserTests.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/prims/wbtestmethods/parserTests.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,16 +23,14 @@
  */
 
 #include "precompiled.hpp"
-
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/symbolTable.hpp"
-
+#include "memory/oopFactory.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "prims/jni.h"
 #include "prims/whitebox.hpp"
 #include "prims/wbtestmethods/parserTests.hpp"
 #include "runtime/interfaceSupport.hpp"
-
-#include "memory/oopFactory.hpp"
-
 #include "services/diagnosticArgument.hpp"
 #include "services/diagnosticFramework.hpp"
 
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -109,8 +109,6 @@
 SystemProperty *Arguments::_java_class_path = NULL;
 SystemProperty *Arguments::_sun_boot_class_path = NULL;
 
-char* Arguments::_meta_index_path = NULL;
-char* Arguments::_meta_index_dir = NULL;
 char* Arguments::_ext_dirs = NULL;
 
 // Check if head of 'option' matches 'name', and sets 'tail' to the remaining
--- a/hotspot/src/share/vm/runtime/arguments.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/runtime/arguments.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -260,10 +260,6 @@
   static SystemProperty *_java_class_path;
   static SystemProperty *_sun_boot_class_path;
 
-  // Meta-index for knowing what packages are in the boot class path
-  static char* _meta_index_path;
-  static char* _meta_index_dir;
-
   // temporary: to emit warning if the default ext dirs are not empty.
   // remove this variable when the warning is no longer needed.
   static char* _ext_dirs;
@@ -600,16 +596,10 @@
   static void set_ext_dirs(char *value)     { _ext_dirs = os::strdup_check_oom(value); }
   static void set_sysclasspath(char *value) { _sun_boot_class_path->set_value(value); }
   static void append_sysclasspath(const char *value) { _sun_boot_class_path->append_value(value); }
-  static void set_meta_index_path(char* meta_index_path, char* meta_index_dir) {
-    _meta_index_path = meta_index_path;
-    _meta_index_dir  = meta_index_dir;
-  }
 
   static char* get_java_home() { return _java_home->value(); }
   static char* get_dll_dir() { return _sun_boot_library_path->value(); }
   static char* get_sysclasspath() { return _sun_boot_class_path->value(); }
-  static char* get_meta_index_path() { return _meta_index_path; }
-  static char* get_meta_index_dir()  { return _meta_index_dir;  }
   static char* get_ext_dirs()        { return _ext_dirs;  }
   static char* get_appclasspath() { return _java_class_path->value(); }
   static void  fix_appclasspath();
--- a/hotspot/src/share/vm/runtime/basicLock.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/runtime/basicLock.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,9 @@
 
 void BasicLock::print_on(outputStream* st) const {
   st->print("monitor");
+  markOop moop = displaced_header();
+  if (moop != NULL)
+    moop->print_on(st);
 }
 
 void BasicLock::move_to(oop obj, BasicLock* dest) {
--- a/hotspot/src/share/vm/runtime/biasedLocking.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/runtime/biasedLocking.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 "oops/klass.inline.hpp"
 #include "oops/markOop.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/basicLock.hpp"
 #include "runtime/biasedLocking.hpp"
--- a/hotspot/src/share/vm/runtime/deoptimization.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/runtime/deoptimization.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 "memory/resourceArea.hpp"
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
+#include "oops/verifyOopClosure.hpp"
 #include "prims/jvmtiThreadState.hpp"
 #include "runtime/biasedLocking.hpp"
 #include "runtime/compilationPolicy.hpp"
--- a/hotspot/src/share/vm/runtime/fieldDescriptor.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/runtime/fieldDescriptor.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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/universe.inline.hpp"
 #include "oops/annotations.hpp"
 #include "oops/instanceKlass.hpp"
+#include "oops/oop.inline.hpp"
 #include "oops/fieldStreams.hpp"
 #include "runtime/fieldDescriptor.hpp"
 #include "runtime/handles.inline.hpp"
--- a/hotspot/src/share/vm/runtime/fprofiler.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/runtime/fprofiler.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,6 @@
 #include "memory/allocation.inline.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
 #include "oops/symbol.hpp"
 #include "runtime/deoptimization.hpp"
 #include "runtime/fprofiler.hpp"
--- a/hotspot/src/share/vm/runtime/frame.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/runtime/frame.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,7 @@
 #include "oops/methodData.hpp"
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
+#include "oops/verifyOopClosure.hpp"
 #include "prims/methodHandles.hpp"
 #include "runtime/frame.inline.hpp"
 #include "runtime/handles.inline.hpp"
--- a/hotspot/src/share/vm/runtime/globals.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1520,7 +1520,7 @@
           "How much the GC can expand the eden by while the GC locker "     \
           "is active (as a percentage)")                                    \
                                                                             \
-  diagnostic(intx, GCLockerRetryAllocationCount, 2,                         \
+  diagnostic(uintx, GCLockerRetryAllocationCount, 2,                        \
           "Number of times to retry allocations when "                      \
           "blocked by the GC locker")                                       \
                                                                             \
--- a/hotspot/src/share/vm/runtime/handles.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/runtime/handles.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -123,10 +123,10 @@
   };
 
 
-DEF_HANDLE(instance         , is_instance         )
-DEF_HANDLE(array            , is_array            )
-DEF_HANDLE(objArray         , is_objArray         )
-DEF_HANDLE(typeArray        , is_typeArray        )
+DEF_HANDLE(instance         , is_instance_noinline         )
+DEF_HANDLE(array            , is_array_noinline            )
+DEF_HANDLE(objArray         , is_objArray_noinline         )
+DEF_HANDLE(typeArray        , is_typeArray_noinline        )
 
 //------------------------------------------------------------------------------------------------------------------------
 
--- a/hotspot/src/share/vm/runtime/interfaceSupport.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/runtime/interfaceSupport.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -511,6 +511,12 @@
     Thread* THREAD = thread;                                         \
     debug_only(VMEntryWrapper __vew;)
 
+#define JRT_BLOCK_NO_ASYNC                                           \
+    {                                                                \
+    ThreadInVMfromJavaNoAsyncException __tiv(thread);                \
+    Thread* THREAD = thread;                                         \
+    debug_only(VMEntryWrapper __vew;)
+
 #define JRT_BLOCK_END }
 
 #define JRT_END }
--- a/hotspot/src/share/vm/runtime/os.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/runtime/os.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1223,14 +1223,6 @@
   const char* home = Arguments::get_java_home();
   int home_len = (int)strlen(home);
 
-  static const char* meta_index_dir_format = "%/lib/";
-  static const char* meta_index_format = "%/lib/meta-index";
-  char* meta_index = format_boot_path(meta_index_format, home, home_len, fileSep, pathSep);
-  if (meta_index == NULL) return false;
-  char* meta_index_dir = format_boot_path(meta_index_dir_format, home, home_len, fileSep, pathSep);
-  if (meta_index_dir == NULL) return false;
-  Arguments::set_meta_index_path(meta_index, meta_index_dir);
-
   char* sysclasspath = NULL;
   struct stat st;
 
@@ -1244,38 +1236,17 @@
   }
   FREE_C_HEAP_ARRAY(char, jimage);
 
-  // images build if rt.jar exists
-  char* rt_jar = format_boot_path("%/lib/rt.jar", home, home_len, fileSep, pathSep);
-  if (rt_jar == NULL) return false;
-  bool has_rt_jar = (os::stat(rt_jar, &st) == 0);
-  FREE_C_HEAP_ARRAY(char, rt_jar);
+  // check if developer build with exploded modules
+  char* modules_dir = format_boot_path("%/modules", home, home_len, fileSep, pathSep);
+  if (os::stat(modules_dir, &st) == 0) {
+    if ((st.st_mode & S_IFDIR) == S_IFDIR) {
+      sysclasspath = expand_entries_to_path(modules_dir, fileSep, pathSep);
+    }
+  }
 
-  if (has_rt_jar) {
-    // Any modification to the JAR-file list, for the boot classpath must be
-    // aligned with install/install/make/common/Pack.gmk. Note: boot class
-    // path class JARs, are stripped for StackMapTable to reduce download size.
-    static const char classpath_format[] =
-      "%/lib/resources.jar:"
-      "%/lib/rt.jar:"
-      "%/lib/jsse.jar:"
-      "%/lib/jce.jar:"
-      "%/lib/charsets.jar:"
-      "%/lib/jfr.jar:"
-      "%/classes";
-    sysclasspath = format_boot_path(classpath_format, home, home_len, fileSep, pathSep);
-  } else {
-    // no rt.jar, check if developer build with exploded modules
-    char* modules_dir = format_boot_path("%/modules", home, home_len, fileSep, pathSep);
-    if (os::stat(modules_dir, &st) == 0) {
-      if ((st.st_mode & S_IFDIR) == S_IFDIR) {
-        sysclasspath = expand_entries_to_path(modules_dir, fileSep, pathSep);
-      }
-    }
-
-    // fallback to classes
-    if (sysclasspath == NULL)
-      sysclasspath = format_boot_path("%/classes", home, home_len, fileSep, pathSep);
-  }
+  // fallback to classes
+  if (sysclasspath == NULL)
+    sysclasspath = format_boot_path("%/classes", home, home_len, fileSep, pathSep);
 
   if (sysclasspath == NULL) return false;
   Arguments::set_sysclasspath(sysclasspath);
--- a/hotspot/src/share/vm/runtime/reflection.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/runtime/reflection.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,8 @@
 #include "memory/universe.inline.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/objArrayKlass.hpp"
-#include "oops/objArrayOop.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvm.h"
 #include "prims/jvmtiExport.hpp"
 #include "runtime/arguments.hpp"
--- a/hotspot/src/share/vm/runtime/serviceThread.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/runtime/serviceThread.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,9 +30,10 @@
 #include "runtime/os.hpp"
 #include "prims/jvmtiImpl.hpp"
 #include "services/allocationContextService.hpp"
-#include "services/gcNotifier.hpp"
 #include "services/diagnosticArgument.hpp"
 #include "services/diagnosticFramework.hpp"
+#include "services/gcNotifier.hpp"
+#include "services/lowMemoryDetector.hpp"
 
 ServiceThread* ServiceThread::_instance = NULL;
 
--- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1792,7 +1792,17 @@
 
 
 // Handles the uncommon case in locking, i.e., contention or an inflated lock.
-JRT_ENTRY_NO_ASYNC(void, SharedRuntime::complete_monitor_locking_C(oopDesc* _obj, BasicLock* lock, JavaThread* thread))
+JRT_BLOCK_ENTRY(void, SharedRuntime::complete_monitor_locking_C(oopDesc* _obj, BasicLock* lock, JavaThread* thread))
+  if (!SafepointSynchronize::is_synchronizing()) {
+    // Only try quick_enter() if we're not trying to reach a safepoint
+    // so that the calling thread reaches the safepoint more quickly.
+    if (ObjectSynchronizer::quick_enter(_obj, thread, lock)) return;
+  }
+  // NO_ASYNC required because an async exception on the state transition destructor
+  // would leave you with the lock held and it would never be released.
+  // The normal monitorenter NullPointerException is thrown without acquiring a lock
+  // and the model is that an exception implies the method failed.
+  JRT_BLOCK_NO_ASYNC
   oop obj(_obj);
   if (PrintBiasedLockingStatistics) {
     Atomic::inc(BiasedLocking::slow_path_entry_count_addr());
@@ -1805,6 +1815,7 @@
     ObjectSynchronizer::slow_enter(h_obj, lock, CHECK);
   }
   assert(!HAS_PENDING_EXCEPTION, "Should have no exception here");
+  JRT_BLOCK_END
 JRT_END
 
 // Handles the uncommon cases of monitor unlocking in compiled code
--- a/hotspot/src/share/vm/runtime/synchronizer.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/runtime/synchronizer.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -122,6 +122,70 @@
 static volatile int MonitorPopulation = 0;  // # Extant -- in circulation
 #define CHAINMARKER (cast_to_oop<intptr_t>(-1))
 
+
+// =====================> Quick functions
+
+// The quick_* forms are special fast-path variants used to improve
+// performance.  In the simplest case, a "quick_*" implementation could
+// simply return false, in which case the caller will perform the necessary
+// state transitions and call the slow-path form.
+// The fast-path is designed to handle frequently arising cases in an efficient
+// manner and is just a degenerate "optimistic" variant of the slow-path.
+// returns true  -- to indicate the call was satisfied.
+// returns false -- to indicate the call needs the services of the slow-path.
+// A no-loitering ordinance is in effect for code in the quick_* family
+// operators: safepoints or indefinite blocking (blocking that might span a
+// safepoint) are forbidden. Generally the thread_state() is _in_Java upon
+// entry.
+
+// The LockNode emitted directly at the synchronization site would have
+// been too big if it were to have included support for the cases of inflated
+// recursive enter and exit, so they go here instead.
+// Note that we can't safely call AsyncPrintJavaStack() from within
+// quick_enter() as our thread state remains _in_Java.
+
+bool ObjectSynchronizer::quick_enter(oop obj, Thread * Self,
+                                     BasicLock * Lock) {
+  assert(!SafepointSynchronize::is_at_safepoint(), "invariant");
+  assert(Self->is_Java_thread(), "invariant");
+  assert(((JavaThread *) Self)->thread_state() == _thread_in_Java, "invariant");
+  No_Safepoint_Verifier nsv;
+  if (obj == NULL) return false;       // Need to throw NPE
+  const markOop mark = obj->mark();
+
+  if (mark->has_monitor()) {
+    ObjectMonitor * const m = mark->monitor();
+    assert(m->object() == obj, "invariant");
+    Thread * const owner = (Thread *) m->_owner;
+
+    // Lock contention and Transactional Lock Elision (TLE) diagnostics
+    // and observability
+    // Case: light contention possibly amenable to TLE
+    // Case: TLE inimical operations such as nested/recursive synchronization
+
+    if (owner == Self) {
+      m->_recursions++;
+      return true;
+    }
+
+    if (owner == NULL &&
+        Atomic::cmpxchg_ptr(Self, &(m->_owner), NULL) == NULL) {
+      assert(m->_recursions == 0, "invariant");
+      assert(m->_owner == Self, "invariant");
+      return true;
+    }
+  }
+
+  // Note that we could inflate in quick_enter.
+  // This is likely a useful optimization
+  // Critically, in quick_enter() we must not:
+  // -- perform bias revocation, or
+  // -- block indefinitely, or
+  // -- reach a safepoint
+
+  return false;        // revert to slow-path
+}
+
 // -----------------------------------------------------------------------------
 //  Fast Monitor Enter/Exit
 // This the fast monitor enter. The interpreter and compiler use
--- a/hotspot/src/share/vm/runtime/synchronizer.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/runtime/synchronizer.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -72,6 +72,8 @@
   static void notify(Handle obj, TRAPS);
   static void notifyall(Handle obj, TRAPS);
 
+  static bool quick_enter(oop obj, Thread* Self, BasicLock* Lock);
+
   // Special internal-use-only method for use by JVM infrastructure
   // that needs to wait() on a java-level object but that can't risk
   // throwing unexpected InterruptedExecutionExceptions.
--- a/hotspot/src/share/vm/runtime/thread.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,7 @@
 #include "oops/objArrayOop.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/symbol.hpp"
+#include "oops/verifyOopClosure.hpp"
 #include "prims/jvm_misc.hpp"
 #include "prims/jvmtiExport.hpp"
 #include "prims/jvmtiThreadState.hpp"
--- a/hotspot/src/share/vm/runtime/vframe.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/runtime/vframe.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -189,6 +189,7 @@
       if (monitor->eliminated() && is_compiled_frame()) { // Eliminated in compiled code
         if (monitor->owner_is_scalar_replaced()) {
           Klass* k = java_lang_Class::as_Klass(monitor->owner_klass());
+          // format below for lockbits matches this one.
           st->print("\t- eliminated <owner is scalar replaced> (a %s)", k->external_name());
         } else {
           oop obj = monitor->owner();
@@ -206,9 +207,10 @@
         // see if we have completed the lock or we are blocked trying to
         // acquire it - we can only be blocked if the monitor is inflated
 
+        markOop mark = NULL;
         const char *lock_state = "locked"; // assume we have the monitor locked
         if (!found_first_monitor && frame_count == 0) {
-          markOop mark = monitor->owner()->mark();
+          mark = monitor->owner()->mark();
           if (mark->has_monitor() &&
               ( // we have marked ourself as pending on this monitor
                 mark->monitor() == thread()->current_pending_monitor() ||
@@ -216,11 +218,19 @@
                 !mark->monitor()->is_entered(thread())
               )) {
             lock_state = "waiting to lock";
+          } else {
+            mark = NULL; // Disable printing below
           }
         }
+        print_locked_object_class_name(st, monitor->owner(), lock_state);
+        if (Verbose && mark != NULL) {
+          // match with format above, replacing "-" with " ".
+          st->print("\t  lockbits=");
+          mark->print_on(st);
+          st->cr();
+        }
 
         found_first_monitor = true;
-        print_locked_object_class_name(st, monitor->owner(), lock_state);
       }
     }
   }
@@ -577,10 +587,15 @@
       tty->print("( null )");
     } else {
       monitor->owner()->print_value();
-      tty->print("(" INTPTR_FORMAT ")", (address)monitor->owner());
+      tty->print("(owner=" INTPTR_FORMAT ")", (address)monitor->owner());
     }
-    if (monitor->eliminated() && is_compiled_frame())
-      tty->print(" ( lock is eliminated )");
+    if (monitor->eliminated()) {
+      if(is_compiled_frame()) {
+        tty->print(" ( lock is eliminated in compiled frame )");
+      } else {
+        tty->print(" ( lock is eliminated, frame not compiled )");
+      }
+    }
     tty->cr();
     tty->print("\t  ");
     monitor->lock()->print_on(tty);
--- a/hotspot/src/share/vm/runtime/vframe_hp.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/runtime/vframe_hp.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "code/codeCache.hpp"
 #include "code/debugInfoRec.hpp"
 #include "code/nmethod.hpp"
--- a/hotspot/src/share/vm/runtime/vmThread.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/runtime/vmThread.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
 #include "memory/resourceArea.hpp"
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
+#include "oops/verifyOopClosure.hpp"
 #include "runtime/interfaceSupport.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/os.hpp"
--- a/hotspot/src/share/vm/runtime/vm_operations.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/runtime/vm_operations.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 "compiler/compileBroker.hpp"
 #include "compiler/compilerOracle.hpp"
 #include "gc_implementation/shared/isGCActiveMark.hpp"
+#include "memory/heapInspection.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/symbol.hpp"
 #include "runtime/arguments.hpp"
@@ -486,3 +487,9 @@
 void VM_PrintCodeCache::doit() {
   CodeCache::print_layout(_out);
 }
+
+#if INCLUDE_SERVICES
+void VM_PrintClassHierarchy::doit() {
+  KlassHierarchy::print_class_hierarchy(_out, _print_interfaces, _print_subclasses, _classname);
+}
+#endif
--- a/hotspot/src/share/vm/runtime/vm_operations.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/runtime/vm_operations.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -105,6 +105,7 @@
   template(PrintCompileQueue)                     \
   template(PrintCodeList)                         \
   template(PrintCodeCache)                        \
+  template(PrintClassHierarchy)                   \
 
 class VM_Operation: public CHeapObj<mtInternal> {
  public:
@@ -457,5 +458,21 @@
   void doit();
 };
 
+#if INCLUDE_SERVICES
+class VM_PrintClassHierarchy: public VM_Operation {
+ private:
+  outputStream* _out;
+  bool _print_interfaces;
+  bool _print_subclasses;
+  char* _classname;
+
+ public:
+  VM_PrintClassHierarchy(outputStream* st, bool print_interfaces, bool print_subclasses, char* classname) :
+    _out(st), _print_interfaces(print_interfaces), _print_subclasses(print_subclasses),
+    _classname(classname) {}
+  VMOp_Type type() const { return VMOp_PrintClassHierarchy; }
+  void doit();
+};
+#endif // INCLUDE_SERVICES
 
 #endif // SHARE_VM_RUNTIME_VM_OPERATIONS_HPP
--- a/hotspot/src/share/vm/services/attachListener.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/services/attachListener.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -27,6 +27,7 @@
 #include "classfile/systemDictionary.hpp"
 #include "gc_implementation/shared/vmGCOperations.hpp"
 #include "memory/resourceArea.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvmtiExport.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/globals.hpp"
--- a/hotspot/src/share/vm/services/diagnosticCommand.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/services/diagnosticCommand.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
 #include "classfile/classLoaderStats.hpp"
 #include "classfile/compactHashtable.hpp"
 #include "gc_implementation/shared/vmGCOperations.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/os.hpp"
 #include "services/diagnosticArgument.hpp"
@@ -57,6 +58,7 @@
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HeapDumpDCmd>(DCmd_Source_Internal | DCmd_Source_AttachAPI, true, false));
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHistogramDCmd>(full_export, true, false));
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassStatsDCmd>(full_export, true, false));
+  DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHierarchyDCmd>(full_export, true, false));
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SymboltableDCmd>(full_export, true, false));
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<StringtableDCmd>(full_export, true, false));
 #endif // INCLUDE_SERVICES
@@ -695,3 +697,35 @@
   VMThread::execute(&printCodeCacheOp);
 }
 
+#if INCLUDE_SERVICES
+ClassHierarchyDCmd::ClassHierarchyDCmd(outputStream* output, bool heap) :
+                                       DCmdWithParser(output, heap),
+  _print_interfaces("-i", "Inherited interfaces should be printed.", "BOOLEAN", false, "false"),
+  _print_subclasses("-s", "If a classname is specified, print its subclasses. "
+                    "Otherwise only its superclasses are printed.", "BOOLEAN", false, "false"),
+  _classname("classname", "Name of class whose hierarchy should be printed. "
+             "If not specified, all class hierarchies are printed.",
+             "STRING", false) {
+  _dcmdparser.add_dcmd_option(&_print_interfaces);
+  _dcmdparser.add_dcmd_option(&_print_subclasses);
+  _dcmdparser.add_dcmd_argument(&_classname);
+}
+
+void ClassHierarchyDCmd::execute(DCmdSource source, TRAPS) {
+  VM_PrintClassHierarchy printClassHierarchyOp(output(), _print_interfaces.value(),
+                                               _print_subclasses.value(), _classname.value());
+  VMThread::execute(&printClassHierarchyOp);
+}
+
+int ClassHierarchyDCmd::num_arguments() {
+  ResourceMark rm;
+  ClassHierarchyDCmd* dcmd = new ClassHierarchyDCmd(NULL, false);
+  if (dcmd != NULL) {
+    DCmdMark mark(dcmd);
+    return dcmd->_dcmdparser.num_arguments();
+  } else {
+    return 0;
+  }
+}
+
+#endif
--- a/hotspot/src/share/vm/services/diagnosticCommand.hpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/services/diagnosticCommand.hpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -271,6 +271,34 @@
   virtual void execute(DCmdSource source, TRAPS);
 };
 
+
+class ClassHierarchyDCmd : public DCmdWithParser {
+protected:
+  DCmdArgument<bool> _print_interfaces; // true if inherited interfaces should be printed.
+  DCmdArgument<bool> _print_subclasses; // true if subclasses of the specified classname should be printed.
+  DCmdArgument<char*> _classname; // Optional single class name whose hierarchy should be printed.
+public:
+  ClassHierarchyDCmd(outputStream* output, bool heap);
+  static const char* name() {
+    return "VM.class_hierarchy";
+  }
+  static const char* description() {
+    return "Print a list of all loaded classes, indented to show the class hiearchy. "
+           "The name of each class is followed by the ClassLoaderData* of its ClassLoader, "
+           "or \"null\" if loaded by the bootstrap class loader.";
+  }
+  static const char* impact() {
+      return "Medium: Depends on number of loaded classes.";
+  }
+  static const JavaPermission permission() {
+    JavaPermission p = {"java.lang.management.ManagementPermission",
+                        "monitor", NULL};
+    return p;
+  }
+  static int num_arguments();
+  virtual void execute(DCmdSource source, TRAPS);
+};
+
 // See also: thread_dump in attachListener.cpp
 class ThreadDumpDCmd : public DCmdWithParser {
 protected:
--- a/hotspot/src/share/vm/services/diagnosticFramework.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/services/diagnosticFramework.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 "precompiled.hpp"
 #include "memory/oopFactory.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "services/diagnosticArgument.hpp"
--- a/hotspot/src/share/vm/services/heapDumper.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/services/heapDumper.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,8 @@
 #include "memory/genCollectedHeap.hpp"
 #include "memory/universe.hpp"
 #include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
+#include "oops/oop.inline.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/jniHandles.hpp"
 #include "runtime/os.hpp"
--- a/hotspot/src/share/vm/services/management.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/services/management.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -30,6 +30,7 @@
 #include "memory/resourceArea.hpp"
 #include "oops/klass.hpp"
 #include "oops/objArrayKlass.hpp"
+#include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/globals.hpp"
--- a/hotspot/src/share/vm/services/writeableFlags.cpp	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/src/share/vm/services/writeableFlags.cpp	Tue Mar 03 08:49:13 2015 -0800
@@ -223,4 +223,5 @@
     ShouldNotReachHere();
   }
   return ERR_OTHER;
-}
\ No newline at end of file
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/loopopts/CountedLoopProblem.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 8072753
+ * @summary Inner loop induction variable increment occurs before compare which causes integer overflow
+ * @run main/othervm CountedLoopProblem
+ *
+ */
+
+import java.util.*;
+
+public class CountedLoopProblem {
+    public static void main(String[] args) throws Exception {
+        Random r = new Random(42);
+        int x = 0;
+        StringBuilder sb = new StringBuilder();
+        for(int i = 0; i < 1000000; ++i) {
+            int v = Math.abs(r.nextInt());
+            sb.append('+').append(v).append('\n');
+            x += v;
+            // To trigger the problem we must OSR in the following loop
+            // To make the problem 100% reproducible run with -XX:-TieredCompilation -XX:OSROnlyBCI=62
+            while(x < 0) x += 1000000000;
+            sb.append('=').append(x).append('\n');
+        }
+        if (sb.toString().hashCode() != 0xaba94591) {
+            throw new Exception("Unexpected result");
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/serviceability/dcmd/vm/ClassHierarchyTest.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,199 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary Test of diagnostic command VM.class_hierarchy
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng ClassHierarchyTest
+ */
+
+import org.testng.annotations.Test;
+import org.testng.Assert;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.channels.FileChannel;
+import java.util.Iterator;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class ClassHierarchyTest {
+
+    // $> jcmd DcmdTestClass VM.class_hierarchy  DcmdTestClass | grep DcmdTestClass\$\$Lambda
+    // |--DcmdTestClass$$Lambda$1/4081552/0xa529fbb0
+
+    // > VM.class_hierarchy DcmdBaseClass
+    // java.lang.Object/null
+    // |--DcmdBaseClass/0xa4abcd48
+
+    // > VM.class_hierarchy DcmdBaseClass -s
+    // java.lang.Object/null
+    // |--DcmdBaseClass/0xa4abcd48
+    // |  |--DcmdTestClass/0xa4abcd48
+
+    // > VM.class_hierarchy DcmdBaseClass -i -s
+    // java.lang.Object/null
+    // |--DcmdBaseClass/0xa4abcd48
+    // |  implements Intf2/0xa4abcd48 (declared intf)
+    // |  implements Intf1/0xa4abcd48 (inherited intf)
+    // |  |--DcmdTestClass/0xa4abcd48
+    // |  |  implements Intf1/0xa4abcd48 (inherited intf)
+    // |  |  implements Intf2/0xa4abcd48 (inherited intf)
+
+    static Pattern expected_lambda_line =
+        Pattern.compile("\\|--DcmdTestClass\\$\\$Lambda.*");
+
+    static Pattern expected_lines[] = {
+        Pattern.compile("java.lang.Object/null"),
+        Pattern.compile("\\|--DcmdBaseClass/0x(\\p{XDigit}*)"),
+        Pattern.compile("\\|  implements Intf2/0x(\\p{XDigit}*) \\(declared intf\\)"),
+        Pattern.compile("\\|  implements Intf1/0x(\\p{XDigit}*) \\(inherited intf\\)"),
+        Pattern.compile("\\|  \\|--DcmdTestClass/0x(\\p{XDigit}*)"),
+        Pattern.compile("\\|  \\|  implements Intf1/0x(\\p{XDigit}*) \\(inherited intf\\)"),
+        Pattern.compile("\\|  \\|  implements Intf2/0x(\\p{XDigit}*) \\(inherited intf\\)")
+    };
+
+    public void run(CommandExecutor executor) throws ClassNotFoundException {
+        OutputAnalyzer output;
+        Iterator<String> lines;
+        int i;
+
+        // Load our test class whose hierarchy we will print.
+        Class<?> c = Class.forName("DcmdTestClass");
+
+        // Verify the presence of the lamba anonymous class
+        output = executor.execute("VM.class_hierarchy");
+        lines = output.asLines().iterator();
+        Boolean foundMatch = false;
+        while (lines.hasNext()) {
+            String line = lines.next();
+            Matcher m = expected_lambda_line.matcher(line);
+            if (m.matches()) {
+                foundMatch = true;
+                break;
+            }
+        }
+        if (!foundMatch) {
+            Assert.fail("Failed to find lamda class");
+        }
+
+        // Verify the output for the simple hierachry of just DcmdBaseClass.
+        output = executor.execute("VM.class_hierarchy DcmdBaseClass");
+        lines = output.asLines().iterator();
+        i = 0;
+        while (lines.hasNext()) {
+            String line = lines.next();
+            Matcher m = expected_lines[i].matcher(line);
+            i++;
+            if (!m.matches()) {
+                Assert.fail("Failed to match line #" + i + ": " + line);
+            }
+            // Should only be two lines of output in this form.
+            if (i == 2) break;
+        }
+        if (lines.hasNext()) {
+            String line = lines.next();
+            Assert.fail("Unexpected dcmd output: " + line);
+        }
+
+        // Verify the output for the full hierarchy of DcmdBaseClass, but without interfaces.
+        output = executor.execute("VM.class_hierarchy DcmdBaseClass -s");
+        lines = output.asLines().iterator();
+        i = 0;
+        while (lines.hasNext()) {
+            String line = lines.next();
+            Matcher m = expected_lines[i].matcher(line);
+            i++;
+            if (!m.matches()) {
+                Assert.fail("Failed to match line #" + i + ": " + line);
+            }
+            // "implements" lines should not be in this output.
+            if (i == 2 || i == 4) i += 2;
+        }
+        if (lines.hasNext()) {
+            String line = lines.next();
+            Assert.fail("Unexpected dcmd output: " + line);
+        }
+
+        // Verify the output for the full hierarchy of DcmdBaseClass, including interfaces.
+        output = executor.execute("VM.class_hierarchy DcmdBaseClass -i -s");
+        lines = output.asLines().iterator();
+        i = 0;
+        String classLoaderAddr = null;
+        while (lines.hasNext()) {
+            String line = lines.next();
+            Matcher m = expected_lines[i].matcher(line);
+            i++;
+            if (!m.matches()) {
+                Assert.fail("Failed to match line #" + i + ": " + line);
+            }
+            if (i == 2) {
+                // Fetch the ClassLoader address, which should be the same in
+                // subsequent lines.
+                classLoaderAddr = m.group(1);
+                System.out.println(classLoaderAddr);
+            } else if (i > 2) {
+                if (!classLoaderAddr.equals(m.group(1))) {
+                    Assert.fail("Classloader address didn't match on line #"
+                                        + i + ": " + line);
+                }
+            }
+            if (i == expected_lines.length) break;
+        }
+        if (lines.hasNext()) {
+            String line = lines.next();
+            Assert.fail("Unexpected dcmd output: " + line);
+        }
+    }
+
+    @Test
+    public void jmx() throws ClassNotFoundException {
+        run(new JMXExecutor());
+    }
+}
+
+interface Intf1 {
+}
+
+interface Intf2 extends Intf1 {
+}
+
+class DcmdBaseClass implements Intf2 {
+}
+
+class DcmdTestClass extends DcmdBaseClass {
+    static {
+        // Force creation of anonymous class (for the lambdaform).
+        Runnable r = () -> System.out.println("Hello");
+        r.run();
+    }
+}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java	Tue Mar 03 08:49:13 2015 -0800
@@ -33,8 +33,6 @@
 import java.util.Collections;
 import java.util.List;
 
-import sun.management.VMManagement;
-
 public final class ProcessTools {
 
   private ProcessTools() {
@@ -90,19 +88,8 @@
    * @return Process id
    */
   public static int getProcessId() throws Exception {
-
-    // Get the current process id using a reflection hack
     RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
-    Field jvm = runtime.getClass().getDeclaredField("jvm");
-
-    jvm.setAccessible(true);
-    VMManagement mgmt = (sun.management.VMManagement) jvm.get(runtime);
-
-    Method pid_method = mgmt.getClass().getDeclaredMethod("getProcessId");
-
-    pid_method.setAccessible(true);
-
-    int pid = (Integer) pid_method.invoke(mgmt);
+    int pid = Integer.parseInt(runtime.getName().split("@")[0]);
 
     return pid;
   }
--- a/jaxp/.hgtags	Mon Feb 23 10:47:32 2015 -0800
+++ b/jaxp/.hgtags	Tue Mar 03 08:49:13 2015 -0800
@@ -294,3 +294,4 @@
 786058752e0ac3e48d7aef79e0885d29d6a2a7eb jdk9-b49
 74ead7bddde19263fd463bc1bd87de84f27d1b5e jdk9-b50
 7cb3674cbd8c06222851444285bb66b2952a2a5c jdk9-b51
+57b26c883d54f45912bc3885ccad3c6b80960b1f jdk9-b52
--- a/jaxws/.hgtags	Mon Feb 23 10:47:32 2015 -0800
+++ b/jaxws/.hgtags	Tue Mar 03 08:49:13 2015 -0800
@@ -297,3 +297,4 @@
 435a49db1de0589acc86b2cc5fd61d546f94b56c jdk9-b49
 45a30e7ee623031a1532685512dd2c2d8e8fa0ad jdk9-b50
 bb9cf97a5ac6aa1aa2a1034676d64413071f58ea jdk9-b51
+1d1e7704eca9c77ebe6a8705d17ac568801f7a3b jdk9-b52
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ClassFactory.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ClassFactory.java	Tue Mar 03 08:49:13 2015 -0800
@@ -30,6 +30,8 @@
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.lang.ref.WeakReference;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.Map;
 import java.util.WeakHashMap;
 import java.util.logging.Level;
@@ -85,19 +87,25 @@
         if(consRef!=null)
             cons = consRef.get();
         if(cons==null) {
-            try {
-                cons = clazz.getDeclaredConstructor(emptyClass);
-            } catch (NoSuchMethodException e) {
-                logger.log(Level.INFO,"No default constructor found on "+clazz,e);
-                NoSuchMethodError exp;
-                if(clazz.getDeclaringClass()!=null && !Modifier.isStatic(clazz.getModifiers())) {
-                    exp = new NoSuchMethodError(Messages.NO_DEFAULT_CONSTRUCTOR_IN_INNER_CLASS.format(clazz.getName()));
-                } else {
-                    exp = new NoSuchMethodError(e.getMessage());
+            cons = AccessController.doPrivileged(new PrivilegedAction<Constructor<T>>() {
+                @Override
+                public Constructor<T> run() {
+                    try {
+                        return clazz.getDeclaredConstructor(emptyClass);
+                    } catch (NoSuchMethodException e) {
+                        logger.log(Level.INFO,"No default constructor found on "+clazz,e);
+                        NoSuchMethodError exp;
+                        if(clazz.getDeclaringClass()!=null && !Modifier.isStatic(clazz.getModifiers())) {
+                            exp = new NoSuchMethodError(Messages.NO_DEFAULT_CONSTRUCTOR_IN_INNER_CLASS
+                                                                .format(clazz.getName()));
+                        } else {
+                            exp = new NoSuchMethodError(e.getMessage());
+                        }
+                        exp.initCause(e);
+                        throw exp;
+                    }
                 }
-                exp.initCause(e);
-                throw exp;
-            }
+            });
 
             int classMod = clazz.getModifiers();
 
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/db/BindingHelper.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/db/BindingHelper.java	Tue Mar 03 08:49:13 2015 -0800
@@ -36,9 +36,6 @@
 //TODO DOMHeader DOMMessage SAAJMessage StatefulInstanceResolver
 import com.sun.xml.internal.bind.unmarshaller.DOMScanner;
 
-//TODO MtomCodec
-import com.sun.xml.internal.bind.v2.runtime.output.Encoded;
-
 //TODO ExceptionBean
 import com.sun.xml.internal.bind.marshaller.NamespacePrefixMapper;
 
--- a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPConstants.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPConstants.java	Tue Mar 03 08:49:13 2015 -0800
@@ -25,8 +25,6 @@
 
 package com.sun.tools.internal.ws.wsdl.document.soap;
 
-import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
-
 import javax.xml.namespace.QName;
 
 /**
@@ -37,7 +35,9 @@
 public interface SOAPConstants {
 
     // namespace URIs
-    public static final String URI_ENVELOPE = SOAPNamespaceConstants.ENVELOPE;
+    public static final String URI_ENVELOPE =
+        "http://schemas.xmlsoap.org/soap/envelope/";
+
     public static final String NS_WSDL_SOAP =
         "http://schemas.xmlsoap.org/wsdl/soap/";
     public static final String NS_SOAP_ENCODING = "http://schemas.xmlsoap.org/soap/encoding/";
--- a/jdk/.hgtags	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/.hgtags	Tue Mar 03 08:49:13 2015 -0800
@@ -294,3 +294,4 @@
 541a8cef4e0d54c3e4b52a98c6af3c31e2096669 jdk9-b49
 f6b8edd397ee463be208fee27517c99101293267 jdk9-b50
 a0dad230aeb3b0d5cfd5b0715029e48d50573f8c jdk9-b51
+607ea68032cd4a4cf2c7a7a41fcb39602d6a75e2 jdk9-b52
--- a/jdk/make/Tools.gmk	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/make/Tools.gmk	Tue Mar 03 08:49:13 2015 -0800
@@ -180,6 +180,8 @@
       OBJECT_DIR := $(BUILDTOOLS_OUTPUTDIR)/objs/fix_empty_sec_hdr_flags, \
       OUTPUT_DIR := $(BUILDTOOLS_OUTPUTDIR)/bin, \
       PROGRAM := fix_empty_sec_hdr_flags))
+
+  BUILD_TOOLS_JDK += $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS)
 endif
 
 $(BUILD_TOOLS_JDK): $(BUILD_INTERIM_JIMAGE) $(COPY_JIMAGE_SERVICE_PROVIDER)
@@ -189,4 +191,3 @@
 all: java-tools
 
 endif # _TOOLS_GMK
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/data/charsetmapping/IBM1166.c2b	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,1 @@
+0x15	U+0085
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/data/charsetmapping/IBM1166.map	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,256 @@
+0x00	U+0000
+0x01	U+0001
+0x02	U+0002
+0x03	U+0003
+0x04	U+009c
+0x05	U+0009
+0x06	U+0086
+0x07	U+007f
+0x08	U+0097
+0x09	U+008d
+0x0a	U+008e
+0x0b	U+000b
+0x0c	U+000c
+0x0d	U+000d
+0x0e	U+000e
+0x0f	U+000f
+0x10	U+0010
+0x11	U+0011
+0x12	U+0012
+0x13	U+0013
+0x14	U+009d
+0x15	U+000a
+0x16	U+0008
+0x17	U+0087
+0x18	U+0018
+0x19	U+0019
+0x1a	U+0092
+0x1b	U+008f
+0x1c	U+001c
+0x1d	U+001d
+0x1e	U+001e
+0x1f	U+001f
+0x20	U+0080
+0x21	U+0081
+0x22	U+0082
+0x23	U+0083
+0x24	U+0084
+0x25	U+000a
+0x26	U+0017
+0x27	U+001b
+0x28	U+0088
+0x29	U+0089
+0x2a	U+008a
+0x2b	U+008b
+0x2c	U+008c
+0x2d	U+0005
+0x2e	U+0006
+0x2f	U+0007
+0x30	U+0090
+0x31	U+0091
+0x32	U+0016
+0x33	U+0093
+0x34	U+0094
+0x35	U+0095
+0x36	U+0096
+0x37	U+0004
+0x38	U+0098
+0x39	U+0099
+0x3a	U+009a
+0x3b	U+009b
+0x3c	U+0014
+0x3d	U+0015
+0x3e	U+009e
+0x3f	U+001a
+0x40	U+0020
+0x41	U+00a0
+0x42	U+04d9
+0x43	U+0493
+0x44	U+0451
+0x45	U+0454
+0x46	U+0455
+0x47	U+0456
+0x48	U+049b
+0x49	U+0458
+0x4a	U+005b
+0x4b	U+002e
+0x4c	U+003c
+0x4d	U+0028
+0x4e	U+002b
+0x4f	U+0021
+0x50	U+0026
+0x51	U+04a3
+0x52	U+04e9
+0x53	U+04b1
+0x54	U+04af
+0x55	U+045e
+0x56	U+04bb
+0x57	U+042a
+0x58	U+2116
+0x59	U+04d8
+0x5a	U+005d
+0x5b	U+0024
+0x5c	U+002a
+0x5d	U+0029
+0x5e	U+003b
+0x5f	U+005e
+0x60	U+002d
+0x61	U+002f
+0x62	U+0492
+0x63	U+0401
+0x64	U+0404
+0x65	U+0405
+0x66	U+0406
+0x67	U+049a
+0x68	U+0408
+0x69	U+04a2
+0x6a	U+007c
+0x6b	U+002c
+0x6c	U+0025
+0x6d	U+005f
+0x6e	U+003e
+0x6f	U+003f
+0x70	U+04e8
+0x71	U+04b0
+0x72	U+04ae
+0x73	U+00ad
+0x74	U+040e
+0x75	U+04ba
+0x76	U+044e
+0x77	U+0430
+0x78	U+0431
+0x79	U+0060
+0x7a	U+003a
+0x7b	U+0023
+0x7c	U+0040
+0x7d	U+0027
+0x7e	U+003d
+0x7f	U+0022
+0x80	U+0446
+0x81	U+0061
+0x82	U+0062
+0x83	U+0063
+0x84	U+0064
+0x85	U+0065
+0x86	U+0066
+0x87	U+0067
+0x88	U+0068
+0x89	U+0069
+0x8a	U+0434
+0x8b	U+0435
+0x8c	U+0444
+0x8d	U+0433
+0x8e	U+0445
+0x8f	U+0438
+0x90	U+0439
+0x91	U+006a
+0x92	U+006b
+0x93	U+006c
+0x94	U+006d
+0x95	U+006e
+0x96	U+006f
+0x97	U+0070
+0x98	U+0071
+0x99	U+0072
+0x9a	U+043a
+0x9b	U+043b
+0x9c	U+043c
+0x9d	U+043d
+0x9e	U+043e
+0x9f	U+043f
+0xa0	U+044f
+0xa1	U+007e
+0xa2	U+0073
+0xa3	U+0074
+0xa4	U+0075
+0xa5	U+0076
+0xa6	U+0077
+0xa7	U+0078
+0xa8	U+0079
+0xa9	U+007a
+0xaa	U+0440
+0xab	U+0441
+0xac	U+0442
+0xad	U+0443
+0xae	U+0436
+0xaf	U+0432
+0xb0	U+044c
+0xb1	U+044b
+0xb2	U+0437
+0xb3	U+0448
+0xb4	U+044d
+0xb5	U+0449
+0xb6	U+0447
+0xb7	U+044a
+0xb8	U+042e
+0xb9	U+0410
+0xba	U+0411
+0xbb	U+0426
+0xbc	U+0414
+0xbd	U+0415
+0xbe	U+0424
+0xbf	U+0413
+0xc0	U+007b
+0xc1	U+0041
+0xc2	U+0042
+0xc3	U+0043
+0xc4	U+0044
+0xc5	U+0045
+0xc6	U+0046
+0xc7	U+0047
+0xc8	U+0048
+0xc9	U+0049
+0xca	U+0425
+0xcb	U+0418
+0xcc	U+0419
+0xcd	U+041a
+0xce	U+041b
+0xcf	U+041c
+0xd0	U+007d
+0xd1	U+004a
+0xd2	U+004b
+0xd3	U+004c
+0xd4	U+004d
+0xd5	U+004e
+0xd6	U+004f
+0xd7	U+0050
+0xd8	U+0051
+0xd9	U+0052
+0xda	U+041d
+0xdb	U+041e
+0xdc	U+041f
+0xdd	U+042f
+0xde	U+0420
+0xdf	U+0421
+0xe0	U+005c
+0xe1	U+20ac
+0xe2	U+0053
+0xe3	U+0054
+0xe4	U+0055
+0xe5	U+0056
+0xe6	U+0057
+0xe7	U+0058
+0xe8	U+0059
+0xe9	U+005a
+0xea	U+0422
+0xeb	U+0423
+0xec	U+0416
+0xed	U+0412
+0xee	U+042c
+0xef	U+042b
+0xf0	U+0030
+0xf1	U+0031
+0xf2	U+0032
+0xf3	U+0033
+0xf4	U+0034
+0xf5	U+0035
+0xf6	U+0036
+0xf7	U+0037
+0xf8	U+0038
+0xf9	U+0039
+0xfa	U+0417
+0xfb	U+0428
+0xfc	U+042d
+0xfd	U+0429
+0xfe	U+0427
+0xff	U+009f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/data/charsetmapping/IBM1166.nr	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,1 @@
+0x25	U+000a
--- a/jdk/make/data/charsetmapping/charsets	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/make/data/charsetmapping/charsets	Tue Mar 03 08:49:13 2015 -0800
@@ -503,7 +503,7 @@
 
 charset x-EUC-TW EUC_TW
     package sun.nio.cs.ext
-    type    source
+    type    template
     alias   euc_tw               # JDK historical
     alias   euctw
     alias   cns11643
@@ -1660,6 +1660,16 @@
     alias   EBCDIC-JP-kana
     alias   290
 
+charset x-IBM1166 IBM1166
+    package sun.nio.cs.ext
+    type    sbcs
+    hisname Cp1166
+    ascii   false
+    alias   cp1166
+    alias   ibm1166
+    alias   ibm-1166
+    alias   1166
+
 charset x-IBM300 IBM300
     package sun.nio.cs.ext
     type    dbcsonly
@@ -1816,3 +1826,17 @@
     ascii   false
     minmax  0x21 0x7e 0x21 0x7e
     internal true               # "internal implementation
+
+########################################################
+#
+# platform specific charsets, to be registered into spi
+##
+########################################################
+ 
+charset x-COMPOUND_TEXT COMPOUND_TEXT
+    package sun.nio.cs.ext
+    type    source
+    os      unix
+    alias   COMPOUND_TEXT       # JDK historical
+    alias   x11-compound_text
+    alias   x-compound-text
--- a/jdk/make/data/charsetmapping/list_old	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/make/data/charsetmapping/list_old	Tue Mar 03 08:49:13 2015 -0800
@@ -57,6 +57,7 @@
 IBM1147		IBM01147	Cp1147		false		sun.nio.cs.ext
 IBM1148		IBM01148	Cp1148		false		sun.nio.cs.ext
 IBM1149		IBM01149	Cp1149		false		sun.nio.cs.ext
+IBM1166		x-IBM1166	Cp1166		false		sun.nio.cs.ext
 IBM273		IBM273		Cp273		false		sun.nio.cs.ext
 IBM277		IBM277		Cp277		false		sun.nio.cs.ext
 IBM278		IBM278		Cp278		false		sun.nio.cs.ext
--- a/jdk/make/data/charsetmapping/stdcs-solaris	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/make/data/charsetmapping/stdcs-solaris	Tue Mar 03 08:49:13 2015 -0800
@@ -9,6 +9,7 @@
 EUC_JP
 EUC_JP_LINUX
 EUC_JP_Open
+EUC_TW
 GBK
 ISO_8859_11
 ISO_8859_3
--- a/jdk/make/gensrc/Gensrc-java.management.gmk	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/make/gensrc/Gensrc-java.management.gmk	Tue Mar 03 08:49:13 2015 -0800
@@ -25,6 +25,9 @@
 
 include GensrcCommon.gmk
 
+# Hook to include the corresponding custom file, if present.
+$(eval $(call IncludeCustomExtension, jdk, gensrc/Gensrc-java.management.gmk))
+
 ################################################################################
 
 include GensrcProperties.gmk
--- a/jdk/make/gensrc/Gensrc-jdk.charsets.gmk	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/make/gensrc/Gensrc-jdk.charsets.gmk	Tue Mar 03 08:49:13 2015 -0800
@@ -50,7 +50,9 @@
 	$(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_CS) \
 	    extcs charsets  $(CHARSET_STANDARD_OS) \
 	    $(CHARSET_EXTENDED_JAVA_TEMPLATES) \
-	    $(CHARSET_EXTENDED_JAVA_DIR) $(LOG_INFO)
+	    $(CHARSET_EXTENDED_JAVA_DIR) \
+	    $(CHARSET_COPYRIGHT_HEADER) \
+	    $(LOG_INFO)
 	$(TOUCH) '$@'
 
 $(CHARSET_DONE_CS)-hkscs: $(CHARSET_COPYRIGHT_HEADER)/HKSCS.java \
--- a/jdk/make/gensrc/GensrcCharsetMapping.gmk	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/make/gensrc/GensrcCharsetMapping.gmk	Tue Mar 03 08:49:13 2015 -0800
@@ -32,6 +32,7 @@
 CHARSET_EXTSRC_DIR := $(JDK_TOPDIR)/src/jdk.charsets/share/classes/sun/nio/cs/ext
 CHARSET_GENSRC_JAVA_DIR_BASE := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/cs
 CHARSET_DONE_BASE := $(CHARSET_GENSRC_JAVA_DIR_BASE)/_the.charsetmapping
+CHARSET_COPYRIGHT_HEADER := $(JDK_TOPDIR)/make/src/classes/build/tools/charsetmapping
 CHARSET_TEMPLATES := \
     $(CHARSET_DATA_DIR)/SingleByte-X.java.template \
     $(CHARSET_DATA_DIR)/DoubleByte-X.java.template
@@ -46,7 +47,9 @@
 	$(MKDIR) -p $(@D)
 	$(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_BASE) \
 	    stdcs charsets $(CHARSET_STANDARD_OS) \
-	    $(CHARSET_STANDARD_JAVA_TEMPLATES) $(CHARSET_EXTSRC_DIR) $(LOG_INFO)
+	    $(CHARSET_STANDARD_JAVA_TEMPLATES) $(CHARSET_EXTSRC_DIR) \
+	    $(CHARSET_COPYRIGHT_HEADER) \
+            $(LOG_INFO)
 	$(TOUCH) '$@'
 
 GENSRC_JAVA_BASE += $(CHARSET_DONE_BASE)-stdcs
--- a/jdk/make/lib/SoundLibraries.gmk	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/make/lib/SoundLibraries.gmk	Tue Mar 03 08:49:13 2015 -0800
@@ -113,6 +113,10 @@
   LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES)
 endif # OPENJDK_TARGET_OS solaris
 
+
+  ifeq ($(OPENJDK_TARGET_CPU), aarch64)
+       LIBJSOUND_CFLAGS += -DX_ARCH=X_AARCH64
+  endif
 LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"'
 
 $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND, \
--- a/jdk/make/src/classes/build/tools/charsetmapping/Charset.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/make/src/classes/build/tools/charsetmapping/Charset.java	Tue Mar 03 08:49:13 2015 -0800
@@ -31,6 +31,7 @@
     String   csName;
     String   hisName;
     String   type;
+    String   os;
     boolean  isASCII;
     int      b1Min;
     int      b1Max;
--- a/jdk/make/src/classes/build/tools/charsetmapping/EUC_TW.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/make/src/classes/build/tools/charsetmapping/EUC_TW.java	Tue Mar 03 08:49:13 2015 -0800
@@ -80,12 +80,12 @@
 
     private static Pattern euctw = Pattern.compile("(?:8ea)?(\\p{XDigit}++)\\s++(\\p{XDigit}++)?\\s*+.*");
 
-    static void genClass(String args[]) throws Exception
+    static void genClass(String pkg, String args[]) throws Exception
     {
         InputStream is = new FileInputStream(new File(args[0], "euc_tw.map"));
         PrintStream ps = new PrintStream(new File(args[1], "EUC_TWMapping.java"),
                                          "ISO-8859-1");
-        String copyright = getCopyright(new File(args[3]));
+        String copyright = getCopyright(new File(args[7], "EUC_TW.java"));
 
 
         // ranges of byte1 and byte2, something should come from a "config" file
@@ -128,7 +128,7 @@
 
             out.format(copyright);
             out.format("%n// -- This file was mechanically generated: Do not edit! -- //%n");
-            out.format("package sun.nio.cs.ext;%n%n");
+            out.format("package %s;%n%n", pkg);
             out.format("class EUC_TWMapping {%n%n");
 
             // boundaries
--- a/jdk/make/src/classes/build/tools/charsetmapping/HKSCS.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/make/src/classes/build/tools/charsetmapping/HKSCS.java	Tue Mar 03 08:49:13 2015 -0800
@@ -42,7 +42,7 @@
     private static Pattern hkscs =
         Pattern.compile("(?:0x)?+(\\p{XDigit}++)\\s++(?:0x|U\\+)?+(\\p{XDigit}++)?\\s*+(?:0x|U\\+)?(\\p{XDigit}++)?\\s*+.*");
 
-    static void genClass2008(String srcDir, String dstDir, String pkgName)
+    static void genClass2008(String srcDir, String dstDir, String pkgName, File copyright)
         throws Exception
     {
         // hkscs2008
@@ -53,10 +53,11 @@
                   pkgName,
                   "HKSCSMapping",
                   true,
-                  "");
+                  getCopyright(copyright));
+
     }
 
-    static void genClassXP(String srcDir, String dstDir, String pkgName)
+    static void genClassXP(String srcDir, String dstDir, String pkgName, File copyright)
         throws Exception
     {
         genClass0(new FileInputStream(new File(srcDir, "HKSCS_XP.map")),
@@ -66,7 +67,7 @@
                   pkgName,
                   "HKSCS_XPMapping",
                   false,
-                  "");
+                  getCopyright(copyright));
     }
 
     static void genClass2001(String args[]) throws Exception {
--- a/jdk/make/src/classes/build/tools/charsetmapping/Main.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/make/src/classes/build/tools/charsetmapping/Main.java	Tue Mar 03 08:49:13 2015 -0800
@@ -41,6 +41,7 @@
         int OS       = 4;
         int TEMPLATE = 5;
         int EXT_SRC  = 6;
+        int COPYRIGHT_SRC  = 7;
 
         if (args.length < 3 ) {
             System.out.println("Usage: java -jar charsetmapping.jar src dst spiType charsets os [template]");
@@ -54,6 +55,7 @@
             String[] osStdcs = getOSStdCSList(new File(args[SRC_DIR], args[OS]));
             boolean hasBig5_HKSCS = false;
             boolean hasMS950_HKSCS_XP = false;
+            boolean hasEUC_TW = false;
             for (String name : osStdcs) {
                 Charset cs = charsets.get(name);
                 if (cs != null) {
@@ -63,6 +65,8 @@
                     hasBig5_HKSCS = true;
                 } else if (name.equals("MS950_HKSCS_XP")) {
                     hasMS950_HKSCS_XP = true;
+                } else if (name.equals("EUC_TW")) {
+                    hasEUC_TW = true;
                 }
             }
             for (Charset cs : charsets.values()) {
@@ -89,19 +93,28 @@
                 }
             }
             // provider StandardCharsets.java / ExtendedCharsets.java
-            SPI.genClass(args[TYPE], charsets, args[SRC_DIR], args[DST_DIR], args[TEMPLATE]);
+            SPI.genClass(args[TYPE], charsets,
+                         args[SRC_DIR], args[DST_DIR],
+                         args[TEMPLATE],
+                         args[OS].endsWith("windows") ? "windows" : "unix");
 
             // HKSCSMapping2008/XP.java goes together with Big5/MS950XP_HKSCS
             if (isStandard && hasBig5_HKSCS || isExtended && !hasBig5_HKSCS) {
                 HKSCS.genClass2008(args[SRC_DIR], args[DST_DIR],
-                                   isStandard ? "sun.nio.cs" : "sun.nio.cs.ext");
+                                   isStandard ? "sun.nio.cs" : "sun.nio.cs.ext",
+                                   new File(args[COPYRIGHT_SRC], "HKSCS.java"));
             }
             if (isStandard && hasMS950_HKSCS_XP || isExtended && !hasMS950_HKSCS_XP) {
                 HKSCS.genClassXP(args[SRC_DIR], args[DST_DIR],
-                                 isStandard ? "sun.nio.cs" : "sun.nio.cs.ext");
+                                 isStandard ? "sun.nio.cs" : "sun.nio.cs.ext",
+                                 new File(args[COPYRIGHT_SRC], "HKSCS.java"));
             }
-        } else if ("euctw".equals(args[TYPE])) {
-            EUC_TW.genClass(args);
+            if (isStandard && hasEUC_TW) {
+                EUC_TW.genClass("sun.nio.cs", args);
+            }
+            if (!isStandard && !hasEUC_TW) {
+                EUC_TW.genClass("sun.nio.cs.ext", args);
+            }
         } else if ("sjis0213".equals(args[TYPE])) {
             JIS0213.genClass(args);
         } else if ("hkscs".equals(args[TYPE])) {
@@ -157,6 +170,9 @@
                     case "type":
                         cs.type = tokens[2];
                         break;
+                    case "os":
+                        cs.os = tokens[2];
+                        break;
                     case "hisname":
                         cs.hisName = tokens[2];
                         break;
--- a/jdk/make/src/classes/build/tools/charsetmapping/SPI.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/make/src/classes/build/tools/charsetmapping/SPI.java	Tue Mar 03 08:49:13 2015 -0800
@@ -33,8 +33,10 @@
 
 public class SPI {
 
-    public static void genClass(String type, LinkedHashMap<String, Charset> charsets,
-                                String srcDir, String dstDir, String template)
+    public static void genClass(String type,
+                                LinkedHashMap<String, Charset> charsets,
+                                String srcDir, String dstDir, String template,
+                                String os)
         throws Exception
     {
         try (Scanner s = new Scanner(new File(template));
@@ -50,7 +52,8 @@
                         charsets.values()
                                 .stream()
                                 .filter(cs -> cs.pkgName.equals("sun.nio.cs.ext") &&
-                                              !cs.isInternal)
+                                              !cs.isInternal &&
+                                              (cs.os == null || cs.os.equals(os)))
                                 .forEach( cs -> {
                             out.printf("        charset(\"%s\", \"%s\",%n", cs.csName, cs.clzName);
                             out.printf("                new String[] {%n");
--- a/jdk/make/src/classes/build/tools/module/boot.modules	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/make/src/classes/build/tools/module/boot.modules	Tue Mar 03 08:49:13 2015 -0800
@@ -22,6 +22,7 @@
 jdk.hprof.agent
 jdk.httpserver
 jdk.jfr
+jdk.management.cmm
 jdk.naming.rmi
 jdk.sctp
 jdk.security.auth
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/test/JtregNative.gmk	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,82 @@
+#
+# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# 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.
+#
+
+################################################################################
+# This file builds the native component of the JTReg tests for JDK.
+# It also covers the test-image part, where the built files are copied to the
+# test image.
+################################################################################
+
+default: all
+
+include $(SPEC)
+include MakeBase.gmk
+include TestFilesCompilation.gmk
+
+################################################################################
+# Targets for building the native tests themselves.
+################################################################################
+
+# Add more directories here when needed.
+BUILD_JDK_JTREG_NATIVE_SRC := \
+    $(JDK_TOPDIR)/test/native_sanity \
+    #
+
+BUILD_JDK_JTREG_OUTPUT_DIR := $(BUILD_OUTPUT)/support/test/jdk/jtreg/native
+
+BUILD_JDK_JTREG_IMAGE_DIR := $(TEST_IMAGE_DIR)/jdk/jtreg
+
+$(eval $(call SetupTestFilesCompilation, BUILD_JDK_JTREG_LIBRARIES, \
+    TYPE := LIBRARY, \
+    SOURCE_DIRS := $(BUILD_JDK_JTREG_NATIVE_SRC), \
+    OUTPUT_DIR := $(BUILD_JDK_JTREG_OUTPUT_DIR), \
+))
+
+$(eval $(call SetupTestFilesCompilation, BUILD_JDK_JTREG_EXECUTABLES, \
+    TYPE := PROGRAM, \
+    SOURCE_DIRS := $(BUILD_JDK_JTREG_NATIVE_SRC), \
+    OUTPUT_DIR := $(BUILD_JDK_JTREG_OUTPUT_DIR), \
+))
+
+build-test-jdk-jtreg-native: $(BUILD_JDK_JTREG_LIBRARIES) $(BUILD_JDK_JTREG_EXECUTABLES)
+
+
+################################################################################
+# Targets for building test-image.
+################################################################################
+
+# Copy to jdk jtreg test image
+$(eval $(call SetupCopyFiles,COPY_JDK_JTREG_NATIVE, \
+    SRC := $(BUILD_JDK_JTREG_OUTPUT_DIR), \
+    DEST := $(TEST_IMAGE_DIR)/jdk/jtreg/native, \
+    FILES := $(BUILD_JDK_JTREG_LIBRARIES) $(BUILD_JDK_JTREG_EXECUTABLES), \
+    FLATTEN := true))
+
+test-image-jdk-jtreg-native: $(COPY_JDK_JTREG_NATIVE)
+
+all: build-test-jdk-jtreg-native
+test-image: test-image-jdk-jtreg-native
+
+.PHONY: default all build-test-jdk-jtreg-native test-image-jdk-jtreg-native test-image
--- a/jdk/src/java.base/share/classes/java/io/ObjectInputStream.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/io/ObjectInputStream.java	Tue Mar 03 08:49:13 2015 -0800
@@ -40,6 +40,7 @@
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import static java.io.ObjectStreamClass.processQueue;
+import sun.misc.Unsafe;
 import sun.reflect.misc.ReflectUtil;
 
 /**
@@ -375,6 +376,7 @@
             }
             if (depth == 0) {
                 vlist.doCallbacks();
+                freeze();
             }
             return obj;
         } finally {
@@ -465,6 +467,7 @@
             }
             if (depth == 0) {
                 vlist.doCallbacks();
+                freeze();
             }
             return obj;
         } finally {
@@ -2357,6 +2360,26 @@
         }
     }
 
+    private static final Unsafe UNSAFE = Unsafe.getUnsafe();
+
+    /**
+     * Performs a "freeze" action, required to adhere to final field semantics.
+     *
+     * <p> This method can be called unconditionally before returning the graph,
+     * from the topmost readObject call, since it is expected that the
+     * additional cost of the freeze action is negligible compared to
+     * reconstituting even the most simple graph.
+     *
+     * <p> Nested calls to readObject do not issue freeze actions because the
+     * sub-graph returned from a nested call is not guaranteed to be fully
+     * initialized yet (possible cycles).
+     */
+    private void freeze() {
+        // Issue a StoreStore|StoreLoad fence, which is at least sufficient
+        // to provide final-freeze semantics.
+        UNSAFE.storeFence();
+    }
+
     /**
      * Input stream with two modes: in default mode, inputs data written in the
      * same format as DataOutputStream; in "block data" mode, inputs data
--- a/jdk/src/java.base/share/classes/java/lang/Class.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/lang/Class.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1063,16 +1063,24 @@
                 parameterClasses[i] = toClass(parameterTypes[i]);
 
             // Perform access check
-            Class<?> enclosingCandidate = enclosingInfo.getEnclosingClass();
+            final Class<?> enclosingCandidate = enclosingInfo.getEnclosingClass();
             enclosingCandidate.checkMemberAccess(Member.DECLARED,
                                                  Reflection.getCallerClass(), true);
+            // Client is ok to access declared methods but j.l.Class might not be.
+            Method[] candidates = AccessController.doPrivileged(
+                    new PrivilegedAction<Method[]>() {
+                        @Override
+                        public Method[] run() {
+                            return enclosingCandidate.getDeclaredMethods();
+                        }
+                    });
             /*
              * Loop over all declared methods; match method name,
              * number of and type of parameters, *and* return
              * type.  Matching return type is also necessary
              * because of covariant returns, etc.
              */
-            for(Method m: enclosingCandidate.getDeclaredMethods()) {
+            for(Method m: candidates) {
                 if (m.getName().equals(enclosingInfo.getName()) ) {
                     Class<?>[] candidateParamClasses = m.getParameterTypes();
                     if (candidateParamClasses.length == parameterClasses.length) {
@@ -1215,14 +1223,22 @@
                 parameterClasses[i] = toClass(parameterTypes[i]);
 
             // Perform access check
-            Class<?> enclosingCandidate = enclosingInfo.getEnclosingClass();
+            final Class<?> enclosingCandidate = enclosingInfo.getEnclosingClass();
             enclosingCandidate.checkMemberAccess(Member.DECLARED,
                                                  Reflection.getCallerClass(), true);
+            // Client is ok to access declared methods but j.l.Class might not be.
+            Constructor<?>[] candidates = AccessController.doPrivileged(
+                    new PrivilegedAction<Constructor<?>[]>() {
+                        @Override
+                        public Constructor<?>[] run() {
+                            return enclosingCandidate.getDeclaredConstructors();
+                        }
+                    });
             /*
              * Loop over all declared constructors; match number
              * of and type of parameters.
              */
-            for(Constructor<?> c: enclosingCandidate.getDeclaredConstructors()) {
+            for(Constructor<?> c: candidates) {
                 Class<?>[] candidateParamClasses = c.getParameterTypes();
                 if (candidateParamClasses.length == parameterClasses.length) {
                     boolean matches = true;
--- a/jdk/src/java.base/share/classes/java/lang/FunctionalInterface.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/lang/FunctionalInterface.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -60,6 +60,7 @@
  * @jls 4.3.2. The Class Object
  * @jls 9.8 Functional Interfaces
  * @jls 9.4.3 Interface Method Body
+ * @jls 9.6.4.9 @FunctionalInterface
  * @since 1.8
  */
 @Documented
--- a/jdk/src/java.base/share/classes/java/lang/Override.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/lang/Override.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,7 +43,9 @@
  *
  * @author  Peter von der Ah&eacute;
  * @author  Joshua Bloch
- * @jls 9.6.1.4 @Override
+ * @jls 8.4.8 Inheritance, Overriding, and Hiding
+ * @jls 9.4.1 Inheritance and Overriding
+ * @jls 9.6.4.4 @Override
  * @since 1.5
  */
 @Target(ElementType.METHOD)
--- a/jdk/src/java.base/share/classes/java/lang/SafeVarargs.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/lang/SafeVarargs.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -85,7 +85,7 @@
  * @since 1.7
  * @jls 4.7 Reifiable Types
  * @jls 8.4.1 Formal Parameters
- * @jls 9.6.3.7 @SafeVarargs
+ * @jls 9.6.4.7 @SafeVarargs
  */
 @Documented
 @Retention(RetentionPolicy.RUNTIME)
--- a/jdk/src/java.base/share/classes/java/lang/SuppressWarnings.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/lang/SuppressWarnings.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,7 +47,7 @@
  * @jls 4.12.2 Variables of Reference Type
  * @jls 5.1.9 Unchecked Conversion
  * @jls 5.5.2 Checked Casts and Unchecked Casts
- * @jls 9.6.3.5 @SuppressWarnings
+ * @jls 9.6.4.5 @SuppressWarnings
  */
 @Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE})
 @Retention(RetentionPolicy.SOURCE)
--- a/jdk/src/java.base/share/classes/java/lang/annotation/Inherited.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/lang/annotation/Inherited.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,7 +44,7 @@
  *
  * @author  Joshua Bloch
  * @since 1.5
- * @jls 9.6.3.3 @Inherited
+ * @jls 9.6.4.3 @Inherited
  */
 @Documented
 @Retention(RetentionPolicy.RUNTIME)
--- a/jdk/src/java.base/share/classes/java/lang/annotation/Repeatable.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/lang/annotation/Repeatable.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,8 +33,8 @@
  * type</em> for the repeatable annotation type.
  *
  * @since 1.8
- * @jls 9.6 Annotation Types
- * @jls 9.7 Annotations
+ * @jls 9.6.3 Repeatable Annotation Types
+ * @jls 9.7.5 Multiple Annotations of the Same Type
  */
 @Documented
 @Retention(RetentionPolicy.RUNTIME)
--- a/jdk/src/java.base/share/classes/java/lang/annotation/Retention.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/lang/annotation/Retention.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@
  *
  * @author  Joshua Bloch
  * @since 1.5
- * @jls 9.6.3.2 @Retention
+ * @jls 9.6.4.2 @Retention
  */
 @Documented
 @Retention(RetentionPolicy.RUNTIME)
--- a/jdk/src/java.base/share/classes/java/lang/annotation/Target.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/lang/annotation/Target.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -72,6 +72,7 @@
  * @since 1.5
  * @jls 9.6.4.1 @Target
  * @jls 9.7.4 Where Annotations May Appear
+ * @jls 9.7.5 Multiple Annotations of the Same Type
  */
 @Documented
 @Retention(RetentionPolicy.RUNTIME)
--- a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java	Tue Mar 03 08:49:13 2015 -0800
@@ -436,7 +436,7 @@
     }
 
     private MethodType bindArgumentType(BoundMethodHandle mh, int pos, BasicType bt) {
-        assert(mh.form == lambdaForm);
+        assert(mh.form.uncustomize() == lambdaForm);
         assert(mh.form.names[1+pos].type == bt);
         assert(BasicType.basicType(mh.type().parameterType(pos)) == bt);
         return mh.type().dropParameterTypes(pos, pos+1);
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java	Tue Mar 03 08:49:13 2015 -0800
@@ -296,7 +296,8 @@
      * constructor has default (package) access.
      *
      * @return a string describing this {@code Constructor}
-     * @jls 8.8.3. Constructor Modifiers
+     * @jls 8.8.3 Constructor Modifiers
+     * @jls 8.9.2 Enum Body Declarations
      */
     public String toString() {
         return sharedToString(Modifier.constructorModifiers(),
@@ -342,7 +343,8 @@
      * include type parameters
      *
      * @since 1.5
-     * @jls 8.8.3. Constructor Modifiers
+     * @jls 8.8.3 Constructor Modifiers
+     * @jls 8.9.2 Enum Body Declarations
      */
     @Override
     public String toGenericString() {
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Method.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Method.java	Tue Mar 03 08:49:13 2015 -0800
@@ -356,6 +356,8 @@
      * @return a string describing this {@code Method}
      *
      * @jls 8.4.3 Method Modifiers
+     * @jls 9.4   Method Declarations
+     * @jls 9.6.1 Annotation Type Elements
      */
     public String toString() {
         return sharedToString(Modifier.methodModifiers(),
@@ -409,6 +411,8 @@
      * @since 1.5
      *
      * @jls 8.4.3 Method Modifiers
+     * @jls 9.4   Method Declarations
+     * @jls 9.6.1 Annotation Type Elements
      */
     @Override
     public String toGenericString() {
--- a/jdk/src/java.base/share/classes/java/math/BigDecimal.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/math/BigDecimal.java	Tue Mar 03 08:49:13 2015 -0800
@@ -3740,8 +3740,8 @@
                 throw new ExceptionInInitializerError(ex);
             }
         }
-        static void setIntCompactVolatile(BigDecimal bd, long val) {
-            unsafe.putLongVolatile(bd, intCompactOffset, val);
+        static void setIntCompact(BigDecimal bd, long val) {
+            unsafe.putLong(bd, intCompactOffset, val);
         }
 
         static void setIntValVolatile(BigDecimal bd, BigInteger val) {
@@ -3765,7 +3765,7 @@
             throw new java.io.StreamCorruptedException(message);
         // [all values of scale are now allowed]
         }
-        UnsafeHolder.setIntCompactVolatile(this, compactValFor(intVal));
+        UnsafeHolder.setIntCompact(this, compactValFor(intVal));
     }
 
    /**
--- a/jdk/src/java.base/share/classes/java/math/BigInteger.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/math/BigInteger.java	Tue Mar 03 08:49:13 2015 -0800
@@ -4368,11 +4368,11 @@
         }
 
         static void putSign(BigInteger bi, int sign) {
-            unsafe.putIntVolatile(bi, signumOffset, sign);
+            unsafe.putInt(bi, signumOffset, sign);
         }
 
         static void putMag(BigInteger bi, int[] magnitude) {
-            unsafe.putObjectVolatile(bi, magOffset, magnitude);
+            unsafe.putObject(bi, magOffset, magnitude);
         }
     }
 
--- a/jdk/src/java.base/share/classes/java/net/SocksSocketImpl.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/net/SocksSocketImpl.java	Tue Mar 03 08:49:13 2015 -0800
@@ -388,14 +388,13 @@
             }
             while (iProxy.hasNext()) {
                 p = iProxy.next();
-                if (p == null || p == Proxy.NO_PROXY) {
+                if (p == null || p.type() != Proxy.Type.SOCKS) {
                     super.connect(epoint, remainingMillis(deadlineMillis));
                     return;
                 }
-                if (p.type() != Proxy.Type.SOCKS)
-                    throw new SocketException("Unknown proxy type : " + p.type());
+
                 if (!(p.address() instanceof InetSocketAddress))
-                    throw new SocketException("Unknow address type for proxy: " + p);
+                    throw new SocketException("Unknown address type for proxy: " + p);
                 // Use getHostString() to avoid reverse lookups
                 server = ((InetSocketAddress) p.address()).getHostString();
                 serverPort = ((InetSocketAddress) p.address()).getPort();
@@ -707,13 +706,12 @@
             }
             while (iProxy.hasNext()) {
                 p = iProxy.next();
-                if (p == null || p == Proxy.NO_PROXY) {
+                if (p == null || p.type() != Proxy.Type.SOCKS) {
                     return;
                 }
-                if (p.type() != Proxy.Type.SOCKS)
-                    throw new SocketException("Unknown proxy type : " + p.type());
+
                 if (!(p.address() instanceof InetSocketAddress))
-                    throw new SocketException("Unknow address type for proxy: " + p);
+                    throw new SocketException("Unknown address type for proxy: " + p);
                 // Use getHostString() to avoid reverse lookups
                 server = ((InetSocketAddress) p.address()).getHostString();
                 serverPort = ((InetSocketAddress) p.address()).getPort();
--- a/jdk/src/java.base/share/classes/java/security/acl/Acl.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/security/acl/Acl.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -68,11 +68,7 @@
  *
  * The {@code  java.security.acl } package provides the
  * interfaces to the ACL and related data structures (ACL entries,
- * groups, permissions, etc.), and the {@code  sun.security.acl }
- * classes provide a default implementation of the interfaces. For
- * example, {@code  java.security.acl.Acl } provides the
- * interface to an ACL and the {@code  sun.security.acl.AclImpl }
- * class provides the default implementation of the interface.<p>
+ * groups, permissions, etc.).<p>
  *
  * The {@code  java.security.acl.Acl } interface extends the
  * {@code  java.security.acl.Owner } interface. The Owner
--- a/jdk/src/java.base/share/classes/java/time/Clock.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/time/Clock.java	Tue Mar 03 08:49:13 2015 -0800
@@ -155,7 +155,7 @@
      * @return a clock that uses the best available system clock in the UTC zone, not null
      */
     public static Clock systemUTC() {
-        return new SystemClock(ZoneOffset.UTC);
+        return SystemClock.UTC;
     }
 
     /**
@@ -198,6 +198,9 @@
      */
     public static Clock system(ZoneId zone) {
         Objects.requireNonNull(zone, "zone");
+        if (zone == ZoneOffset.UTC) {
+            return SystemClock.UTC;
+        }
         return new SystemClock(zone);
     }
 
@@ -451,6 +454,8 @@
         private static final long serialVersionUID = 6740630888130243051L;
         private static final long OFFSET_SEED =
                 System.currentTimeMillis()/1000 - 1024; // initial offest
+        static final SystemClock UTC = new SystemClock(ZoneOffset.UTC);
+
         private final ZoneId zone;
         // We don't actually need a volatile here.
         // We don't care if offset is set or read concurrently by multiple
--- a/jdk/src/java.base/share/classes/java/time/Instant.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/time/Instant.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1229,8 +1229,14 @@
      * @throws ArithmeticException if numeric overflow occurs
      */
     public long toEpochMilli() {
-        long millis = Math.multiplyExact(seconds, 1000);
-        return millis + nanos / 1000_000;
+        if (seconds < 0 && nanos > 0) {
+            long millis = Math.multiplyExact(seconds+1, 1000);
+            long adjustment = nanos / 1000_000 - 1000;
+            return millis + adjustment;
+        } else {
+            long millis = Math.multiplyExact(seconds, 1000);
+            return millis + nanos / 1000_000;
+        }
     }
 
     //-----------------------------------------------------------------------
--- a/jdk/src/java.base/share/classes/java/util/Arrays.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/util/Arrays.java	Tue Mar 03 08:49:13 2015 -0800
@@ -4685,6 +4685,14 @@
      * <p>If the generator function throws an exception, it is relayed to
      * the caller and the array is left in an indeterminate state.
      *
+     * @apiNote
+     * Setting a subrange of an array, using a generator function to compute
+     * each element, can be written as follows:
+     * <pre>{@code
+     * IntStream.range(startInclusive, endExclusive)
+     *          .forEach(i -> array[i] = generator.apply(i));
+     * }</pre>
+     *
      * @param <T> type of elements of the array
      * @param array array to be initialized
      * @param generator a function accepting an index and producing the desired
@@ -4706,6 +4714,15 @@
      * is thrown from {@code parallelSetAll} and the array is left in an
      * indeterminate state.
      *
+     * @apiNote
+     * Setting a subrange of an array, in parallel, using a generator function
+     * to compute each element, can be written as follows:
+     * <pre>{@code
+     * IntStream.range(startInclusive, endExclusive)
+     *          .parallel()
+     *          .forEach(i -> array[i] = generator.apply(i));
+     * }</pre>
+     *
      * @param <T> type of elements of the array
      * @param array array to be initialized
      * @param generator a function accepting an index and producing the desired
@@ -4725,6 +4742,14 @@
      * <p>If the generator function throws an exception, it is relayed to
      * the caller and the array is left in an indeterminate state.
      *
+     * @apiNote
+     * Setting a subrange of an array, using a generator function to compute
+     * each element, can be written as follows:
+     * <pre>{@code
+     * IntStream.range(startInclusive, endExclusive)
+     *          .forEach(i -> array[i] = generator.applyAsInt(i));
+     * }</pre>
+     *
      * @param array array to be initialized
      * @param generator a function accepting an index and producing the desired
      *        value for that position
@@ -4745,6 +4770,15 @@
      * is thrown from {@code parallelSetAll} and the array is left in an
      * indeterminate state.
      *
+     * @apiNote
+     * Setting a subrange of an array, in parallel, using a generator function
+     * to compute each element, can be written as follows:
+     * <pre>{@code
+     * IntStream.range(startInclusive, endExclusive)
+     *          .parallel()
+     *          .forEach(i -> array[i] = generator.applyAsInt(i));
+     * }</pre>
+     *
      * @param array array to be initialized
      * @param generator a function accepting an index and producing the desired
      * value for that position
@@ -4763,6 +4797,14 @@
      * <p>If the generator function throws an exception, it is relayed to
      * the caller and the array is left in an indeterminate state.
      *
+     * @apiNote
+     * Setting a subrange of an array, using a generator function to compute
+     * each element, can be written as follows:
+     * <pre>{@code
+     * IntStream.range(startInclusive, endExclusive)
+     *          .forEach(i -> array[i] = generator.applyAsLong(i));
+     * }</pre>
+     *
      * @param array array to be initialized
      * @param generator a function accepting an index and producing the desired
      *        value for that position
@@ -4783,6 +4825,15 @@
      * is thrown from {@code parallelSetAll} and the array is left in an
      * indeterminate state.
      *
+     * @apiNote
+     * Setting a subrange of an array, in parallel, using a generator function
+     * to compute each element, can be written as follows:
+     * <pre>{@code
+     * IntStream.range(startInclusive, endExclusive)
+     *          .parallel()
+     *          .forEach(i -> array[i] = generator.applyAsLong(i));
+     * }</pre>
+     *
      * @param array array to be initialized
      * @param generator a function accepting an index and producing the desired
      *        value for that position
@@ -4801,6 +4852,14 @@
      * <p>If the generator function throws an exception, it is relayed to
      * the caller and the array is left in an indeterminate state.
      *
+     * @apiNote
+     * Setting a subrange of an array, using a generator function to compute
+     * each element, can be written as follows:
+     * <pre>{@code
+     * IntStream.range(startInclusive, endExclusive)
+     *          .forEach(i -> array[i] = generator.applyAsDouble(i));
+     * }</pre>
+     *
      * @param array array to be initialized
      * @param generator a function accepting an index and producing the desired
      *        value for that position
@@ -4821,6 +4880,15 @@
      * is thrown from {@code parallelSetAll} and the array is left in an
      * indeterminate state.
      *
+     * @apiNote
+     * Setting a subrange of an array, in parallel, using a generator function
+     * to compute each element, can be written as follows:
+     * <pre>{@code
+     * IntStream.range(startInclusive, endExclusive)
+     *          .parallel()
+     *          .forEach(i -> array[i] = generator.applyAsDouble(i));
+     * }</pre>
+     *
      * @param array array to be initialized
      * @param generator a function accepting an index and producing the desired
      *        value for that position
--- a/jdk/src/java.base/share/classes/java/util/regex/Matcher.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/util/regex/Matcher.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,16 @@
 
 package java.util.regex;
 
+import java.util.ConcurrentModificationException;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
 import java.util.Objects;
+import java.util.Spliterator;
+import java.util.Spliterators;
+import java.util.function.Consumer;
+import java.util.function.Function;
+import java.util.stream.Stream;
+import java.util.stream.StreamSupport;
 
 /**
  * An engine that performs match operations on a {@linkplain java.lang.CharSequence
@@ -209,6 +218,11 @@
     boolean anchoringBounds = true;
 
     /**
+     * Number of times this matcher's state has been modified
+     */
+    int modCount;
+
+    /**
      * No default constructor.
      */
     Matcher() {
@@ -248,11 +262,76 @@
      * @since 1.5
      */
     public MatchResult toMatchResult() {
-        Matcher result = new Matcher(this.parentPattern, text.toString());
-        result.first = this.first;
-        result.last = this.last;
-        result.groups = this.groups.clone();
-        return result;
+        return toMatchResult(text.toString());
+    }
+
+    private MatchResult toMatchResult(String text) {
+        return new ImmutableMatchResult(this.first,
+                                        this.last,
+                                        groupCount(),
+                                        this.groups.clone(),
+                                        text);
+    }
+
+    private static class ImmutableMatchResult implements MatchResult {
+        private final int first;
+        private final int last;
+        private final int[] groups;
+        private final int groupCount;
+        private final String text;
+
+        ImmutableMatchResult(int first, int last, int groupCount,
+                             int groups[], String text)
+        {
+            this.first = first;
+            this.last = last;
+            this.groupCount = groupCount;
+            this.groups = groups;
+            this.text = text;
+        }
+
+        @Override
+        public int start() {
+            return first;
+        }
+
+        @Override
+        public int start(int group) {
+            if (group < 0 || group > groupCount)
+                throw new IndexOutOfBoundsException("No group " + group);
+            return groups[group * 2];
+        }
+
+        @Override
+        public int end() {
+            return last;
+        }
+
+        @Override
+        public int end(int group) {
+            if (group < 0 || group > groupCount)
+                throw new IndexOutOfBoundsException("No group " + group);
+            return groups[group * 2 + 1];
+        }
+
+        @Override
+        public int groupCount() {
+            return groupCount;
+        }
+
+        @Override
+        public String group() {
+            return group(0);
+        }
+
+        @Override
+        public String group(int group) {
+            if (group < 0 || group > groupCount)
+                throw new IndexOutOfBoundsException("No group " + group);
+            if ((groups[group*2] == -1) || (groups[group*2+1] == -1))
+                return null;
+            return text.subSequence(groups[group * 2], groups[group * 2 + 1]).toString();
+        }
     }
 
     /**
@@ -284,6 +363,7 @@
             groups[i] = -1;
         for (int i = 0; i < locals.length; i++)
             locals[i] = -1;
+        modCount++;
         return this;
     }
 
@@ -308,6 +388,7 @@
         lastAppendPosition = 0;
         from = 0;
         to = getTextLength();
+        modCount++;
         return this;
     }
 
@@ -803,6 +884,7 @@
         // Append the match substitution
         sb.append(result);
         lastAppendPosition = last;
+        modCount++;
         return this;
     }
 
@@ -892,6 +974,7 @@
         // Append the match substitution
         sb.append(result);
         lastAppendPosition = last;
+        modCount++;
         return this;
     }
 
@@ -1078,6 +1161,183 @@
     }
 
     /**
+     * Replaces every subsequence of the input sequence that matches the
+     * pattern with the result of applying the given replacer function to the
+     * match result of this matcher corresponding to that subsequence.
+     * Exceptions thrown by the function are relayed to the caller.
+     *
+     * <p> This method first resets this matcher.  It then scans the input
+     * sequence looking for matches of the pattern.  Characters that are not
+     * part of any match are appended directly to the result string; each match
+     * is replaced in the result by the applying the replacer function that
+     * returns a replacement string.  Each replacement string may contain
+     * references to captured subsequences as in the {@link #appendReplacement
+     * appendReplacement} method.
+     *
+     * <p> Note that backslashes (<tt>\</tt>) and dollar signs (<tt>$</tt>) in
+     * a replacement string may cause the results to be different than if it
+     * were being treated as a literal replacement string. Dollar signs may be
+     * treated as references to captured subsequences as described above, and
+     * backslashes are used to escape literal characters in the replacement
+     * string.
+     *
+     * <p> Given the regular expression <tt>dog</tt>, the input
+     * <tt>"zzzdogzzzdogzzz"</tt>, and the function
+     * <tt>mr -> mr.group().toUpperCase()</tt>, an invocation of this method on
+     * a matcher for that expression would yield the string
+     * <tt>"zzzDOGzzzDOGzzz"</tt>.
+     *
+     * <p> Invoking this method changes this matcher's state.  If the matcher
+     * is to be used in further matching operations then it should first be
+     * reset.  </p>
+     *
+     * <p> The replacer function should not modify this matcher's state during
+     * replacement.  This method will, on a best-effort basis, throw a
+     * {@link java.util.ConcurrentModificationException} if such modification is
+     * detected.
+     *
+     * <p> The state of each match result passed to the replacer function is
+     * guaranteed to be constant only for the duration of the replacer function
+     * call and only if the replacer function does not modify this matcher's
+     * state.
+     *
+     * @implNote
+     * This implementation applies the replacer function to this matcher, which
+     * is an instance of {@code MatchResult}.
+     *
+     * @param  replacer
+     *         The function to be applied to the match result of this matcher
+     *         that returns a replacement string.
+     * @return  The string constructed by replacing each matching subsequence
+     *          with the result of applying the replacer function to that
+     *          matched subsequence, substituting captured subsequences as
+     *          needed.
+     * @throws NullPointerException if the replacer function is null
+     * @throws ConcurrentModificationException if it is detected, on a
+     *         best-effort basis, that the replacer function modified this
+     *         matcher's state
+     * @since 1.9
+     */
+    public String replaceAll(Function<MatchResult, String> replacer) {
+        Objects.requireNonNull(replacer);
+        reset();
+        boolean result = find();
+        if (result) {
+            StringBuilder sb = new StringBuilder();
+            do {
+                int ec = modCount;
+                String replacement =  replacer.apply(this);
+                if (ec != modCount)
+                    throw new ConcurrentModificationException();
+                appendReplacement(sb, replacement);
+                result = find();
+            } while (result);
+            appendTail(sb);
+            return sb.toString();
+        }
+        return text.toString();
+    }
+
+    /**
+     * Returns a stream of match results for each subsequence of the input
+     * sequence that matches the pattern.  The match results occur in the
+     * same order as the matching subsequences in the input sequence.
+     *
+     * <p> Each match result is produced as if by {@link #toMatchResult()}.
+     *
+     * <p> This method does not reset this matcher.  Matching starts on
+     * initiation of the terminal stream operation either at the beginning of
+     * this matcher's region, or, if the matcher has not since been reset, at
+     * the first character not matched by a previous match.
+     *
+     * <p> If the matcher is to be used for further matching operations after
+     * the terminal stream operation completes then it should be first reset.
+     *
+     * <p> This matcher's state should not be modified during execution of the
+     * returned stream's pipeline.  The returned stream's source
+     * {@code Spliterator} is <em>fail-fast</em> and will, on a best-effort
+     * basis, throw a {@link java.util.ConcurrentModificationException} if such
+     * modification is detected.
+     *
+     * @return a sequential stream of match results.
+     * @since 1.9
+     */
+    public Stream<MatchResult> results() {
+        class MatchResultIterator implements Iterator<MatchResult> {
+            // -ve for call to find, 0 for not found, 1 for found
+            int state = -1;
+            // State for concurrent modification checking
+            // -1 for uninitialized
+            int expectedCount = -1;
+            // The input sequence as a string, set once only after first find
+            // Avoids repeated conversion from CharSequence for each match
+            String textAsString;
+
+            @Override
+            public MatchResult next() {
+                if (expectedCount >= 0 && expectedCount != modCount)
+                    throw new ConcurrentModificationException();
+
+                if (!hasNext())
+                    throw new NoSuchElementException();
+
+                state = -1;
+                return toMatchResult(textAsString);
+            }
+
+            @Override
+            public boolean hasNext() {
+                if (state >= 0)
+                    return state == 1;
+
+                // Defer throwing ConcurrentModificationException to when next
+                // or forEachRemaining is called.  The is consistent with other
+                // fail-fast implementations.
+                if (expectedCount >= 0 && expectedCount != modCount)
+                    return true;
+
+                boolean found = find();
+                // Capture the input sequence as a string on first find
+                if (found && state < 0)
+                    textAsString = text.toString();
+                state = found ? 1 : 0;
+                expectedCount = modCount;
+                return found;
+            }
+
+            @Override
+            public void forEachRemaining(Consumer<? super MatchResult> action) {
+                if (expectedCount >= 0 && expectedCount != modCount)
+                    throw new ConcurrentModificationException();
+
+                int s = state;
+                if (s == 0)
+                    return;
+
+                // Set state to report no more elements on further operations
+                state = 0;
+                expectedCount = -1;
+
+                // Perform a first find if required
+                if (s < 0 && !find())
+                    return;
+
+                // Capture the input sequence as a string on first find
+                textAsString = text.toString();
+
+                do {
+                    int ec = modCount;
+                    action.accept(toMatchResult(textAsString));
+                    if (ec != modCount)
+                        throw new ConcurrentModificationException();
+                } while (find());
+            }
+        }
+        return StreamSupport.stream(Spliterators.spliteratorUnknownSize(
+                new MatchResultIterator(), Spliterator.ORDERED | Spliterator.NONNULL), false);
+    }
+
+    /**
      * Replaces the first subsequence of the input sequence that matches the
      * pattern with the given replacement string.
      *
@@ -1123,6 +1383,79 @@
     }
 
     /**
+     * Replaces the first subsequence of the input sequence that matches the
+     * pattern with the result of applying the given replacer function to the
+     * match result of this matcher corresponding to that subsequence.
+     * Exceptions thrown by the replace function are relayed to the caller.
+     *
+     * <p> This method first resets this matcher.  It then scans the input
+     * sequence looking for a match of the pattern.  Characters that are not
+     * part of the match are appended directly to the result string; the match
+     * is replaced in the result by the applying the replacer function that
+     * returns a replacement string.  The replacement string may contain
+     * references to captured subsequences as in the {@link #appendReplacement
+     * appendReplacement} method.
+     *
+     * <p>Note that backslashes (<tt>\</tt>) and dollar signs (<tt>$</tt>) in
+     * the replacement string may cause the results to be different than if it
+     * were being treated as a literal replacement string. Dollar signs may be
+     * treated as references to captured subsequences as described above, and
+     * backslashes are used to escape literal characters in the replacement
+     * string.
+     *
+     * <p> Given the regular expression <tt>dog</tt>, the input
+     * <tt>"zzzdogzzzdogzzz"</tt>, and the function
+     * <tt>mr -> mr.group().toUpperCase()</tt>, an invocation of this method on
+     * a matcher for that expression would yield the string
+     * <tt>"zzzDOGzzzdogzzz"</tt>.
+     *
+     * <p> Invoking this method changes this matcher's state.  If the matcher
+     * is to be used in further matching operations then it should first be
+     * reset.
+     *
+     * <p> The replacer function should not modify this matcher's state during
+     * replacement.  This method will, on a best-effort basis, throw a
+     * {@link java.util.ConcurrentModificationException} if such modification is
+     * detected.
+     *
+     * <p> The state of the match result passed to the replacer function is
+     * guaranteed to be constant only for the duration of the replacer function
+     * call and only if the replacer function does not modify this matcher's
+     * state.
+     *
+     * @implNote
+     * This implementation applies the replacer function to this matcher, which
+     * is an instance of {@code MatchResult}.
+     *
+     * @param  replacer
+     *         The function to be applied to the match result of this matcher
+     *         that returns a replacement string.
+     * @return  The string constructed by replacing the first matching
+     *          subsequence with the result of applying the replacer function to
+     *          the matched subsequence, substituting captured subsequences as
+     *          needed.
+     * @throws NullPointerException if the replacer function is null
+     * @throws ConcurrentModificationException if it is detected, on a
+     *         best-effort basis, that the replacer function modified this
+     *         matcher's state
+     * @since 1.9
+     */
+    public String replaceFirst(Function<MatchResult, String> replacer) {
+        Objects.requireNonNull(replacer);
+        reset();
+        if (!find())
+            return text.toString();
+        StringBuilder sb = new StringBuilder();
+        int ec = modCount;
+        String replacement = replacer.apply(this);
+        if (ec != modCount)
+            throw new ConcurrentModificationException();
+        appendReplacement(sb, replacement);
+        appendTail(sb);
+        return sb.toString();
+    }
+
+    /**
      * Sets the limits of this matcher's region. The region is the part of the
      * input sequence that will be searched to find a match. Invoking this
      * method resets the matcher, and then sets the region to start at the
@@ -1365,6 +1698,7 @@
         if (!result)
             this.first = -1;
         this.oldLast = this.last;
+        this.modCount++;
         return result;
     }
 
@@ -1387,6 +1721,7 @@
         if (!result)
             this.first = -1;
         this.oldLast = this.last;
+        this.modCount++;
         return result;
     }
 
--- a/jdk/src/java.base/share/classes/java/util/stream/Collectors.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/util/stream/Collectors.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -404,6 +404,54 @@
     }
 
     /**
+     * Adapts a {@code Collector} accepting elements of type {@code U} to one
+     * accepting elements of type {@code T} by applying a flat mapping function
+     * to each input element before accumulation.  The flat mapping function
+     * maps an input element to a {@link Stream stream} covering zero or more
+     * output elements that are then accumulated downstream.  Each mapped stream
+     * is {@link java.util.stream.BaseStream#close() closed} after its contents
+     * have been placed downstream.  (If a mapped stream is {@code null}
+     * an empty stream is used, instead.)
+     *
+     * @apiNote
+     * The {@code flatMapping()} collectors are most useful when used in a
+     * multi-level reduction, such as downstream of a {@code groupingBy} or
+     * {@code partitioningBy}.  For example, given a stream of
+     * {@code Order}, to accumulate the set of line items for each customer:
+     * <pre>{@code
+     *     Map<String, Set<LineItem>> itemsByCustomerName
+     *         = orders.stream().collect(groupingBy(Order::getCustomerName,
+     *                                              flatMapping(order -> order.getLineItems().stream(), toSet())));
+     * }</pre>
+     *
+     * @param <T> the type of the input elements
+     * @param <U> type of elements accepted by downstream collector
+     * @param <A> intermediate accumulation type of the downstream collector
+     * @param <R> result type of collector
+     * @param mapper a function to be applied to the input elements, which
+     * returns a stream of results
+     * @param downstream a collector which will receive the elements of the
+     * stream returned by mapper
+     * @return a collector which applies the mapping function to the input
+     * elements and provides the flat mapped results to the downstream collector
+     * @since 1.9
+     */
+    public static <T, U, A, R>
+    Collector<T, ?, R> flatMapping(Function<? super T, ? extends Stream<? extends U>> mapper,
+                                   Collector<? super U, A, R> downstream) {
+        BiConsumer<A, ? super U> downstreamAccumulator = downstream.accumulator();
+        return new CollectorImpl<>(downstream.supplier(),
+                            (r, t) -> {
+                                try (Stream<? extends U> result = mapper.apply(t)) {
+                                    if (result != null)
+                                        result.sequential().forEach(u -> downstreamAccumulator.accept(r, u));
+                                }
+                            },
+                            downstream.combiner(), downstream.finisher(),
+                            downstream.characteristics());
+    }
+
+    /**
      * Adapts a {@code Collector} to perform an additional finishing
      * transformation.  For example, one could adapt the {@link #toList()}
      * collector to always produce an immutable list with:
--- a/jdk/src/java.base/share/classes/java/util/stream/DoubleStream.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/util/stream/DoubleStream.java	Tue Mar 03 08:49:13 2015 -0800
@@ -848,7 +848,7 @@
      * @implNote
      * Use caution when constructing streams from repeated concatenation.
      * Accessing an element of a deeply concatenated stream can result in deep
-     * call chains, or even {@code StackOverflowException}.
+     * call chains, or even {@code StackOverflowError}.
      *
      * @param a the first stream
      * @param b the second stream
--- a/jdk/src/java.base/share/classes/java/util/stream/IntStream.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/util/stream/IntStream.java	Tue Mar 03 08:49:13 2015 -0800
@@ -837,7 +837,7 @@
      * @implNote
      * Use caution when constructing streams from repeated concatenation.
      * Accessing an element of a deeply concatenated stream can result in deep
-     * call chains, or even {@code StackOverflowException}.
+     * call chains, or even {@code StackOverflowError}.
      *
      * @param a the first stream
      * @param b the second stream
--- a/jdk/src/java.base/share/classes/java/util/stream/LongStream.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/util/stream/LongStream.java	Tue Mar 03 08:49:13 2015 -0800
@@ -845,7 +845,7 @@
      * @implNote
      * Use caution when constructing streams from repeated concatenation.
      * Accessing an element of a deeply concatenated stream can result in deep
-     * call chains, or even {@code StackOverflowException}.
+     * call chains, or even {@code StackOverflowError}.
      *
      * @param a the first stream
      * @param b the second stream
--- a/jdk/src/java.base/share/classes/java/util/stream/Stream.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/util/stream/Stream.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1079,7 +1079,7 @@
      * @implNote
      * Use caution when constructing streams from repeated concatenation.
      * Accessing an element of a deeply concatenated stream can result in deep
-     * call chains, or even {@code StackOverflowException}.
+     * call chains, or even {@code StackOverflowError}.
      *
      * @param <T> The type of stream elements
      * @param a the first stream
--- a/jdk/src/java.base/share/classes/java/util/zip/ZipEntry.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/util/zip/ZipEntry.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,7 +41,9 @@
 class ZipEntry implements ZipConstants, Cloneable {
 
     String name;        // entry name
-    long time = -1;     // last modification time
+    long xdostime = -1; // last modification time (in extended DOS time,
+                        // where milliseconds lost in conversion might
+                        // be encoded into the upper half)
     FileTime mtime;     // last modification time, from extra field data
     FileTime atime;     // last access time, from extra field data
     FileTime ctime;     // creation time, from extra field data
@@ -64,6 +66,28 @@
     public static final int DEFLATED = 8;
 
     /**
+     * DOS time constant for representing timestamps before 1980.
+     */
+    static final long DOSTIME_BEFORE_1980 = (1 << 21) | (1 << 16);
+
+    /**
+     * Approximately 128 years, in milliseconds (ignoring leap years etc).
+     *
+     * This establish an approximate high-bound value for DOS times in
+     * milliseconds since epoch, used to enable an efficient but
+     * sufficient bounds check to avoid generating extended last modified
+     * time entries.
+     *
+     * Calculating the exact number is locale dependent, would require loading
+     * TimeZone data eagerly, and would make little practical sense. Since DOS
+     * times theoretically go to 2107 - with compatibility not guaranteed
+     * after 2099 - setting this to a time that is before but near 2099
+     * should be sufficient.
+     */
+    private static final long UPPER_DOSTIME_BOUND =
+            128L * 365 * 24 * 60 * 60 * 1000;
+
+    /**
      * Creates a new zip entry with the specified name.
      *
      * @param  name
@@ -93,7 +117,7 @@
     public ZipEntry(ZipEntry e) {
         Objects.requireNonNull(e, "entry");
         name = e.name;
-        time = e.time;
+        xdostime = e.xdostime;
         mtime = e.mtime;
         atime = e.atime;
         ctime = e.ctime;
@@ -137,8 +161,14 @@
      * @see #getLastModifiedTime()
      */
     public void setTime(long time) {
-        this.time = time;
-        this.mtime = null;
+        this.xdostime = javaToExtendedDosTime(time);
+        // Avoid setting the mtime field if time is in the valid
+        // range for a DOS time
+        if (xdostime != DOSTIME_BEFORE_1980 && time <= UPPER_DOSTIME_BOUND) {
+            this.mtime = null;
+        } else {
+            this.mtime = FileTime.from(time, TimeUnit.MILLISECONDS);
+        }
     }
 
     /**
@@ -158,7 +188,10 @@
      * @see #setLastModifiedTime(FileTime)
      */
     public long getTime() {
-        return time;
+        if (mtime != null) {
+            return mtime.toMillis();
+        }
+        return (xdostime != -1) ? extendedDosToJavaTime(xdostime) : -1;
     }
 
     /**
@@ -181,7 +214,7 @@
      */
     public ZipEntry setLastModifiedTime(FileTime time) {
         this.mtime = Objects.requireNonNull(time, "lastModifiedTime");
-        this.time = time.to(TimeUnit.MILLISECONDS);
+        this.xdostime = javaToExtendedDosTime(time.to(TimeUnit.MILLISECONDS));
         return this;
     }
 
@@ -204,9 +237,9 @@
     public FileTime getLastModifiedTime() {
         if (mtime != null)
             return mtime;
-        if (time == -1)
+        if (xdostime == -1)
             return null;
-        return FileTime.from(time, TimeUnit.MILLISECONDS);
+        return FileTime.from(getTime(), TimeUnit.MILLISECONDS);
     }
 
     /**
--- a/jdk/src/java.base/share/classes/java/util/zip/ZipFile.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/util/zip/ZipFile.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,7 +46,6 @@
 import java.util.stream.StreamSupport;
 
 import static java.util.zip.ZipConstants64.*;
-import static java.util.zip.ZipUtils.*;
 
 /**
  * This class is used to read entries from a zip file.
@@ -567,7 +566,7 @@
                 e.name = zc.toString(bname, bname.length);
             }
         }
-        e.time = dosToJavaTime(getEntryTime(jzentry));
+        e.xdostime = getEntryTime(jzentry);
         e.crc = getEntryCrc(jzentry);
         e.size = getEntrySize(jzentry);
         e.csize = getEntryCSize(jzentry);
--- a/jdk/src/java.base/share/classes/java/util/zip/ZipInputStream.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/util/zip/ZipInputStream.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -303,7 +303,7 @@
             throw new ZipException("encrypted ZIP entry not supported");
         }
         e.method = get16(tmpbuf, LOCHOW);
-        e.time = dosToJavaTime(get32(tmpbuf, LOCTIM));
+        e.xdostime = get32(tmpbuf, LOCTIM);
         if ((flag & 8) == 8) {
             /* "Data Descriptor" present */
             if (e.method != DEFLATED) {
--- a/jdk/src/java.base/share/classes/java/util/zip/ZipOutputStream.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/util/zip/ZipOutputStream.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -61,7 +61,6 @@
     private static class XEntry {
         final ZipEntry entry;
         final long offset;
-        long dostime;    // last modification time in msdos format
         public XEntry(ZipEntry entry, long offset) {
             this.entry = entry;
             this.offset = offset;
@@ -192,7 +191,7 @@
         if (current != null) {
             closeEntry();       // close previous entry
         }
-        if (e.time == -1) {
+        if (e.xdostime == -1) {
             // by default, do NOT use extended timestamps in extra
             // data, for now.
             e.setTime(System.currentTimeMillis());
@@ -389,18 +388,12 @@
         boolean hasZip64 = false;
         int elen = getExtraLen(e.extra);
 
-        // keep a copy of dostime for writeCEN(), otherwise the tz
-        // sensitive local time entries in loc and cen might be
-        // different if the default tz get changed during writeLOC()
-        // and writeCEN()
-        xentry.dostime = javaToDosTime(e.time);
-
         writeInt(LOCSIG);               // LOC header signature
         if ((flag & 8) == 8) {
             writeShort(version(e));     // version needed to extract
             writeShort(flag);           // general purpose bit flag
             writeShort(e.method);       // compression method
-            writeInt(xentry.dostime);   // last modification time
+            writeInt(e.xdostime);       // last modification time
             // store size, uncompressed size, and crc-32 in data descriptor
             // immediately following compressed entry data
             writeInt(0);
@@ -415,7 +408,7 @@
             }
             writeShort(flag);           // general purpose bit flag
             writeShort(e.method);       // compression method
-            writeInt(xentry.dostime);   // last modification time
+            writeInt(e.xdostime);       // last modification time
             writeInt(e.crc);            // crc-32
             if (hasZip64) {
                 writeInt(ZIP64_MAGICVAL);
@@ -522,9 +515,7 @@
         }
         writeShort(flag);           // general purpose bit flag
         writeShort(e.method);       // compression method
-        // use the copy in xentry, which has been converted
-        // from e.time in writeLOC()
-        writeInt(xentry.dostime);   // last modification time
+        writeInt(e.xdostime);       // last modification time
         writeInt(e.crc);            // crc-32
         writeInt(csize);            // compressed size
         writeInt(size);             // uncompressed size
--- a/jdk/src/java.base/share/classes/java/util/zip/ZipUtils.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/java/util/zip/ZipUtils.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,9 +29,6 @@
 import java.util.Date;
 import java.util.concurrent.TimeUnit;
 
-import static java.util.zip.ZipConstants.*;
-import static java.util.zip.ZipConstants64.*;
-
 class ZipUtils {
 
     // used to adjust values between Windows and java epoch
@@ -69,7 +66,7 @@
     /**
      * Converts DOS time to Java time (number of milliseconds since epoch).
      */
-    public static long dosToJavaTime(long dtime) {
+    private static long dosToJavaTime(long dtime) {
         @SuppressWarnings("deprecation") // Use of date constructor.
         Date d = new Date((int)(((dtime >> 25) & 0x7f) + 80),
                           (int)(((dtime >> 21) & 0x0f) - 1),
@@ -81,14 +78,26 @@
     }
 
     /**
+     * Converts extended DOS time to Java time, where up to 1999 milliseconds
+     * might be encoded into the upper half of the returned long.
+     *
+     * @param xdostime the extended DOS time value
+     * @return milliseconds since epoch
+     */
+    public static long extendedDosToJavaTime(long xdostime) {
+        long time = dosToJavaTime(xdostime);
+        return time + (xdostime >> 32);
+    }
+
+    /**
      * Converts Java time to DOS time.
      */
     @SuppressWarnings("deprecation") // Use of date methods
-    public static long javaToDosTime(long time) {
+    private static long javaToDosTime(long time) {
         Date d = new Date(time);
         int year = d.getYear() + 1900;
         if (year < 1980) {
-            return (1 << 21) | (1 << 16);
+            return ZipEntry.DOSTIME_BEFORE_1980;
         }
         return (year - 1980) << 25 | (d.getMonth() + 1) << 21 |
                d.getDate() << 16 | d.getHours() << 11 | d.getMinutes() << 5 |
@@ -96,6 +105,23 @@
     }
 
     /**
+     * Converts Java time to DOS time, encoding any milliseconds lost
+     * in the conversion into the upper half of the returned long.
+     *
+     * @param time milliseconds since epoch
+     * @return DOS time with 2s remainder encoded into upper half
+     */
+    public static long javaToExtendedDosTime(long time) {
+        if (time < 0) {
+            return ZipEntry.DOSTIME_BEFORE_1980;
+        }
+        long dostime = javaToDosTime(time);
+        return (dostime != ZipEntry.DOSTIME_BEFORE_1980)
+                ? dostime + ((time % 2000) << 32)
+                : ZipEntry.DOSTIME_BEFORE_1980;
+    }
+
+    /**
      * Fetches unsigned 16-bit value from byte array at specified offset.
      * The bytes are assumed to be in Intel (little-endian) byte order.
      */
--- a/jdk/src/java.base/share/classes/sun/nio/ch/SocketAdaptor.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/nio/ch/SocketAdaptor.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -321,12 +321,9 @@
     }
 
     public void sendUrgentData(int data) throws IOException {
-        synchronized (sc.blockingLock()) {
-            if (!sc.isBlocking())
-                throw new IllegalBlockingModeException();
-            int n = sc.sendOutOfBandData((byte)data);
-            assert n == 1;
-        }
+        int n = sc.sendOutOfBandData((byte) data);
+        if (n == 0)
+            throw new IOException("Socket buffer full");
     }
 
     public void setOOBInline(boolean on) throws SocketException {
--- a/jdk/src/java.base/share/classes/sun/security/acl/AclEntryImpl.java	Mon Feb 23 10:47:32 2015 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,181 +0,0 @@
-/*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.security.acl;
-
-import java.util.*;
-import java.security.Principal;
-import java.security.acl.*;
-
-/**
- * This is a class that describes one entry that associates users
- * or groups with permissions in the ACL.
- * The entry may be used as a way of granting or denying permissions.
- * @author      Satish Dharmaraj
- */
-public class AclEntryImpl implements AclEntry {
-    private Principal user = null;
-    private Vector<Permission> permissionSet = new Vector<>(10, 10);
-    private boolean negative = false;
-
-    /**
-     * Construct an ACL entry that associates a user with permissions
-     * in the ACL.
-     * @param user The user that is associated with this entry.
-     */
-    public AclEntryImpl(Principal user) {
-        this.user = user;
-    }
-
-    /**
-     * Construct a null ACL entry
-     */
-    public AclEntryImpl() {
-    }
-
-    /**
-     * Sets the principal in the entity. If a group or a
-     * principal had already been set, a false value is
-     * returned, otherwise a true value is returned.
-     * @param user The user that is associated with this entry.
-     * @return true if the principal is set, false if there is
-     * one already.
-     */
-    public boolean setPrincipal(Principal user) {
-        if (this.user != null)
-          return false;
-        this.user = user;
-        return true;
-    }
-
-    /**
-     * This method sets the ACL to have negative permissions.
-     * That is the user or group is denied the permission set
-     * specified in the entry.
-     */
-    public void setNegativePermissions() {
-        negative = true;
-    }
-
-    /**
-     * Returns true if this is a negative ACL.
-     */
-    public boolean isNegative() {
-        return negative;
-    }
-
-    /**
-     * A principal or a group can be associated with multiple
-     * permissions. This method adds a permission to the ACL entry.
-     * @param permission The permission to be associated with
-     * the principal or the group in the entry.
-     * @return true if the permission was added, false if the
-     * permission was already part of the permission set.
-     */
-    public boolean addPermission(Permission permission) {
-
-        if (permissionSet.contains(permission))
-          return false;
-
-        permissionSet.addElement(permission);
-
-        return true;
-    }
-
-    /**
-     * The method disassociates the permission from the Principal
-     * or the Group in this ACL entry.
-     * @param permission The permission to be disassociated with
-     * the principal or the group in the entry.
-     * @return true if the permission is removed, false if the
-     * permission is not part of the permission set.
-     */
-    public boolean removePermission(Permission permission) {
-        return permissionSet.removeElement(permission);
-    }
-
-    /**
-     * Checks if the passed permission is part of the allowed
-     * permission set in this entry.
-     * @param permission The permission that has to be part of
-     * the permission set in the entry.
-     * @return true if the permission passed is part of the
-     * permission set in the entry, false otherwise.
-     */
-    public boolean checkPermission(Permission permission) {
-        return permissionSet.contains(permission);
-    }
-
-    /**
-     * return an enumeration of the permissions in this ACL entry.
-     */
-    public Enumeration<Permission> permissions() {
-        return permissionSet.elements();
-    }
-
-    /**
-     * Return a string representation of  the contents of the ACL entry.
-     */
-    public String toString() {
-        StringBuffer s = new StringBuffer();
-        if (negative)
-          s.append("-");
-        else
-          s.append("+");
-        if (user instanceof Group)
-            s.append("Group.");
-        else
-            s.append("User.");
-        s.append(user + "=");
-        Enumeration<Permission> e = permissions();
-        while(e.hasMoreElements()) {
-            Permission p = e.nextElement();
-            s.append(p);
-            if (e.hasMoreElements())
-                s.append(",");
-        }
-        return new String(s);
-    }
-
-    /**
-     * Clones an AclEntry.
-     */
-    @SuppressWarnings("unchecked") // Safe casts assuming clone() works correctly
-    public synchronized Object clone() {
-        AclEntryImpl cloned;
-        cloned = new AclEntryImpl(user);
-        cloned.permissionSet = (Vector<Permission>) permissionSet.clone();
-        cloned.negative = negative;
-        return cloned;
-    }
-
-    /**
-     * Return the Principal associated in this ACL entry.
-     * The method returns null if the entry uses a group
-     * instead of a principal.
-     */
-    public Principal getPrincipal() {
-        return user;
-    }
-}
--- a/jdk/src/java.base/share/classes/sun/security/acl/AclImpl.java	Mon Feb 23 10:47:32 2015 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,408 +0,0 @@
-/*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.security.acl;
-
-import java.io.*;
-import java.util.*;
-import java.security.Principal;
-import java.security.acl.*;
-
-/**
- * An Access Control List (ACL) is encapsulated by this class.
- * @author      Satish Dharmaraj
- */
-public class AclImpl extends OwnerImpl implements Acl {
-    //
-    // Maintain four tables. one each for positive and negative
-    // ACLs. One each depending on whether the entity is a group
-    // or principal.
-    //
-    private Hashtable<Principal, AclEntry> allowedUsersTable =
-                                        new Hashtable<>(23);
-    private Hashtable<Principal, AclEntry> allowedGroupsTable =
-                                        new Hashtable<>(23);
-    private Hashtable<Principal, AclEntry> deniedUsersTable =
-                                        new Hashtable<>(23);
-    private Hashtable<Principal, AclEntry> deniedGroupsTable =
-                                        new Hashtable<>(23);
-    private String aclName = null;
-    private Vector<Permission> zeroSet = new Vector<>(1,1);
-
-
-    /**
-     * Constructor for creating an empty ACL.
-     */
-    public AclImpl(Principal owner, String name) {
-        super(owner);
-        try {
-            setName(owner, name);
-        } catch (Exception e) {}
-    }
-
-    /**
-     * Sets the name of the ACL.
-     * @param caller the principal who is invoking this method.
-     * @param name the name of the ACL.
-     * @exception NotOwnerException if the caller principal is
-     * not on the owners list of the Acl.
-     */
-    public void setName(Principal caller, String name)
-      throws NotOwnerException
-    {
-        if (!isOwner(caller))
-            throw new NotOwnerException();
-
-        aclName = name;
-    }
-
-    /**
-     * Returns the name of the ACL.
-     * @return the name of the ACL.
-     */
-    public String getName() {
-        return aclName;
-    }
-
-    /**
-     * Adds an ACL entry to this ACL. An entry associates a
-     * group or a principal with a set of permissions. Each
-     * user or group can have one positive ACL entry and one
-     * negative ACL entry. If there is one of the type (negative
-     * or positive) already in the table, a false value is returned.
-     * The caller principal must be a part of the owners list of
-     * the ACL in order to invoke this method.
-     * @param caller the principal who is invoking this method.
-     * @param entry the ACL entry that must be added to the ACL.
-     * @return true on success, false if the entry is already present.
-     * @exception NotOwnerException if the caller principal
-     * is not on the owners list of the Acl.
-     */
-    public synchronized boolean addEntry(Principal caller, AclEntry entry)
-      throws NotOwnerException
-    {
-        if (!isOwner(caller))
-            throw new NotOwnerException();
-
-        Hashtable<Principal, AclEntry> aclTable = findTable(entry);
-        Principal key = entry.getPrincipal();
-
-        if (aclTable.get(key) != null)
-            return false;
-
-        aclTable.put(key, entry);
-        return true;
-    }
-
-    /**
-     * Removes an ACL entry from this ACL.
-     * The caller principal must be a part of the owners list of the ACL
-     * in order to invoke this method.
-     * @param caller the principal who is invoking this method.
-     * @param entry the ACL entry that must be removed from the ACL.
-     * @return true on success, false if the entry is not part of the ACL.
-     * @exception NotOwnerException if the caller principal is not
-     * the owners list of the Acl.
-     */
-    public synchronized boolean removeEntry(Principal caller, AclEntry entry)
-      throws NotOwnerException
-    {
-        if (!isOwner(caller))
-            throw new NotOwnerException();
-
-        Hashtable<Principal, AclEntry> aclTable = findTable(entry);
-        Principal key = entry.getPrincipal();
-
-        AclEntry o = aclTable.remove(key);
-        return (o != null);
-    }
-
-    /**
-     * This method returns the set of allowed permissions for the
-     * specified principal. This set of allowed permissions is calculated
-     * as follows:
-     *
-     * If there is no entry for a group or a principal an empty permission
-     * set is assumed.
-     *
-     * The group positive permission set is the union of all
-     * the positive permissions of each group that the individual belongs to.
-     * The group negative permission set is the union of all
-     * the negative permissions of each group that the individual belongs to.
-     * If there is a specific permission that occurs in both
-     * the postive permission set and the negative permission set,
-     * it is removed from both. The group positive and negatoive permission
-     * sets are calculated.
-     *
-     * The individial positive permission set and the individual negative
-     * permission set is then calculated. Again abscence of an entry means
-     * the empty set.
-     *
-     * The set of permissions granted to the principal is then calculated using
-     * the simple rule: Individual permissions always override the Group permissions.
-     * Specifically, individual negative permission set (specific
-     * denial of permissions) overrides the group positive permission set.
-     * And the individual positive permission set override the group negative
-     * permission set.
-     *
-     * @param user the principal for which the ACL entry is returned.
-     * @return The resulting permission set that the principal is allowed.
-     */
-    public synchronized Enumeration<Permission> getPermissions(Principal user) {
-
-        Enumeration<Permission> individualPositive;
-        Enumeration<Permission> individualNegative;
-        Enumeration<Permission> groupPositive;
-        Enumeration<Permission> groupNegative;
-
-        //
-        // canonicalize the sets. That is remove common permissions from
-        // positive and negative sets.
-        //
-        groupPositive =
-            subtract(getGroupPositive(user), getGroupNegative(user));
-        groupNegative  =
-            subtract(getGroupNegative(user), getGroupPositive(user));
-        individualPositive =
-            subtract(getIndividualPositive(user), getIndividualNegative(user));
-        individualNegative =
-            subtract(getIndividualNegative(user), getIndividualPositive(user));
-
-        //
-        // net positive permissions is individual positive permissions
-        // plus (group positive - individual negative).
-        //
-        Enumeration<Permission> temp1 =
-            subtract(groupPositive, individualNegative);
-        Enumeration<Permission> netPositive =
-            union(individualPositive, temp1);
-
-        // recalculate the enumeration since we lost it in performing the
-        // subtraction
-        //
-        individualPositive =
-            subtract(getIndividualPositive(user), getIndividualNegative(user));
-        individualNegative =
-            subtract(getIndividualNegative(user), getIndividualPositive(user));
-
-        //
-        // net negative permissions is individual negative permissions
-        // plus (group negative - individual positive).
-        //
-        temp1 = subtract(groupNegative, individualPositive);
-        Enumeration<Permission> netNegative = union(individualNegative, temp1);
-
-        return subtract(netPositive, netNegative);
-    }
-
-    /**
-     * This method checks whether or not the specified principal
-     * has the required permission. If permission is denied
-     * permission false is returned, a true value is returned otherwise.
-     * This method does not authenticate the principal. It presumes that
-     * the principal is a valid authenticated principal.
-     * @param principal the name of the authenticated principal
-     * @param permission the permission that the principal must have.
-     * @return true of the principal has the permission desired, false
-     * otherwise.
-     */
-    public boolean checkPermission(Principal principal, Permission permission)
-    {
-        Enumeration<Permission> permSet = getPermissions(principal);
-        while (permSet.hasMoreElements()) {
-            Permission p = permSet.nextElement();
-            if (p.equals(permission))
-              return true;
-        }
-        return false;
-    }
-
-    /**
-     * returns an enumeration of the entries in this ACL.
-     */
-    public synchronized Enumeration<AclEntry> entries() {
-        return new AclEnumerator(this,
-                                 allowedUsersTable, allowedGroupsTable,
-                                 deniedUsersTable, deniedGroupsTable);
-    }
-
-    /**
-     * return a stringified version of the
-     * ACL.
-     */
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        Enumeration<AclEntry> entries = entries();
-        while (entries.hasMoreElements()) {
-            AclEntry entry = entries.nextElement();
-            sb.append(entry.toString().trim());
-            sb.append("\n");
-        }
-
-        return sb.toString();
-    }
-
-    //
-    // Find the table that this entry belongs to. There are 4
-    // tables that are maintained. One each for postive and
-    // negative ACLs and one each for groups and users.
-    // This method figures out which
-    // table is the one that this AclEntry belongs to.
-    //
-    private Hashtable<Principal, AclEntry> findTable(AclEntry entry) {
-        Hashtable<Principal, AclEntry> aclTable = null;
-
-        Principal p = entry.getPrincipal();
-        if (p instanceof Group) {
-            if (entry.isNegative())
-                aclTable = deniedGroupsTable;
-            else
-                aclTable = allowedGroupsTable;
-        } else {
-            if (entry.isNegative())
-                aclTable = deniedUsersTable;
-            else
-                aclTable = allowedUsersTable;
-        }
-        return aclTable;
-    }
-
-    //
-    // returns the set e1 U e2.
-    //
-    private static Enumeration<Permission> union(Enumeration<Permission> e1,
-                Enumeration<Permission> e2) {
-        Vector<Permission> v = new Vector<>(20, 20);
-
-        while (e1.hasMoreElements())
-            v.addElement(e1.nextElement());
-
-        while (e2.hasMoreElements()) {
-            Permission o = e2.nextElement();
-            if (!v.contains(o))
-                v.addElement(o);
-        }
-
-        return v.elements();
-    }
-
-    //
-    // returns the set e1 - e2.
-    //
-    private Enumeration<Permission> subtract(Enumeration<Permission> e1,
-                Enumeration<Permission> e2) {
-        Vector<Permission> v = new Vector<>(20, 20);
-
-        while (e1.hasMoreElements())
-            v.addElement(e1.nextElement());
-
-        while (e2.hasMoreElements()) {
-            Permission o = e2.nextElement();
-            if (v.contains(o))
-                v.removeElement(o);
-        }
-
-        return v.elements();
-    }
-
-    private Enumeration<Permission> getGroupPositive(Principal user) {
-        Enumeration<Permission> groupPositive = zeroSet.elements();
-        Enumeration<Principal> e = allowedGroupsTable.keys();
-        while (e.hasMoreElements()) {
-            Group g = (Group)e.nextElement();
-            if (g.isMember(user)) {
-                AclEntry ae = allowedGroupsTable.get(g);
-                groupPositive = union(ae.permissions(), groupPositive);
-            }
-        }
-        return groupPositive;
-    }
-
-    private Enumeration<Permission> getGroupNegative(Principal user) {
-        Enumeration<Permission> groupNegative = zeroSet.elements();
-        Enumeration<Principal> e = deniedGroupsTable.keys();
-        while (e.hasMoreElements()) {
-            Group g = (Group)e.nextElement();
-            if (g.isMember(user)) {
-                AclEntry ae = deniedGroupsTable.get(g);
-                groupNegative = union(ae.permissions(), groupNegative);
-            }
-        }
-        return groupNegative;
-    }
-
-    private Enumeration<Permission> getIndividualPositive(Principal user) {
-        Enumeration<Permission> individualPositive = zeroSet.elements();
-        AclEntry ae = allowedUsersTable.get(user);
-        if (ae != null)
-            individualPositive = ae.permissions();
-        return individualPositive;
-    }
-
-    private Enumeration<Permission> getIndividualNegative(Principal user) {
-        Enumeration<Permission> individualNegative = zeroSet.elements();
-        AclEntry ae  = deniedUsersTable.get(user);
-        if (ae != null)
-            individualNegative = ae.permissions();
-        return individualNegative;
-    }
-}
-
-final class AclEnumerator implements Enumeration<AclEntry> {
-    Acl acl;
-    Enumeration<AclEntry> u1, u2, g1, g2;
-
-    AclEnumerator(Acl acl, Hashtable<?,AclEntry> u1, Hashtable<?,AclEntry> g1,
-                  Hashtable<?,AclEntry> u2, Hashtable<?,AclEntry> g2) {
-        this.acl = acl;
-        this.u1 = u1.elements();
-        this.u2 = u2.elements();
-        this.g1 = g1.elements();
-        this.g2 = g2.elements();
-    }
-
-    public boolean hasMoreElements() {
-        return (u1.hasMoreElements() ||
-                u2.hasMoreElements() ||
-                g1.hasMoreElements() ||
-                g2.hasMoreElements());
-    }
-
-    public AclEntry nextElement()
-    {
-        AclEntry o;
-        synchronized (acl) {
-            if (u1.hasMoreElements())
-                return u1.nextElement();
-            if (u2.hasMoreElements())
-                return u2.nextElement();
-            if (g1.hasMoreElements())
-                return g1.nextElement();
-            if (g2.hasMoreElements())
-                return g2.nextElement();
-        }
-        throw new NoSuchElementException("Acl Enumerator");
-    }
-}
--- a/jdk/src/java.base/share/classes/sun/security/acl/AllPermissionsImpl.java	Mon Feb 23 10:47:32 2015 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 1996, 1997, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.security.acl;
-
-import java.security.Principal;
-import java.security.acl.*;
-
-/**
- * This class implements the principal interface for the set of all permissions.
- * @author Satish Dharmaraj
- */
-public class AllPermissionsImpl extends PermissionImpl {
-
-    public AllPermissionsImpl(String s) {
-        super(s);
-    }
-
-    /**
-     * This function returns true if the permission passed matches the permission represented in
-     * this interface.
-     * @param another The Permission object to compare with.
-     * @returns true always
-     */
-    public boolean equals(Permission another) {
-        return true;
-    }
-}
--- a/jdk/src/java.base/share/classes/sun/security/acl/GroupImpl.java	Mon Feb 23 10:47:32 2015 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,186 +0,0 @@
-/*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.security.acl;
-
-import java.util.*;
-import java.security.*;
-import java.security.acl.*;
-
-/**
- * This class implements a group of principals.
- * @author      Satish Dharmaraj
- */
-public class GroupImpl implements Group {
-    private Vector<Principal> groupMembers = new Vector<>(50, 100);
-    private String group;
-
-    /**
-     * Constructs a Group object with no members.
-     * @param groupName the name of the group
-     */
-    public GroupImpl(String groupName) {
-        this.group = groupName;
-    }
-
-    /**
-     * adds the specified member to the group.
-     * @param user The principal to add to the group.
-     * @return true if the member was added - false if the
-     * member could not be added.
-     */
-    public boolean addMember(Principal user) {
-        if (groupMembers.contains(user))
-          return false;
-
-        // do not allow groups to be added to itself.
-        if (group.equals(user.toString()))
-            throw new IllegalArgumentException();
-
-        groupMembers.addElement(user);
-        return true;
-    }
-
-    /**
-     * removes the specified member from the group.
-     * @param user The principal to remove from the group.
-     * @param true if the principal was removed false if
-     * the principal was not a member
-     */
-    public boolean removeMember(Principal user) {
-        return groupMembers.removeElement(user);
-    }
-
-    /**
-     * returns the enumeration of the members in the group.
-     */
-    public Enumeration<? extends Principal> members() {
-        return groupMembers.elements();
-    }
-
-    /**
-     * This function returns true if the group passed matches
-     * the group represented in this interface.
-     * @param another The group to compare this group to.
-     */
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj instanceof Group == false) {
-            return false;
-        }
-        Group another = (Group)obj;
-        return group.equals(another.toString());
-    }
-
-    // equals(Group) for compatibility
-    public boolean equals(Group another) {
-        return equals((Object)another);
-    }
-
-    /**
-     * Prints a stringified version of the group.
-     */
-    public String toString() {
-        return group;
-    }
-
-    /**
-     * return a hashcode for the principal.
-     */
-    public int hashCode() {
-        return group.hashCode();
-    }
-
-    /**
-     * returns true if the passed principal is a member of the group.
-     * @param member The principal whose membership must be checked for.
-     * @return true if the principal is a member of this group,
-     * false otherwise
-     */
-    public boolean isMember(Principal member) {
-
-        //
-        // if the member is part of the group (common case), return true.
-        // if not, recursively search depth first in the group looking for the
-        // principal.
-        //
-        if (groupMembers.contains(member)) {
-            return true;
-        } else {
-            Vector<Group> alreadySeen = new Vector<>(10);
-            return isMemberRecurse(member, alreadySeen);
-        }
-    }
-
-    /**
-     * return the name of the principal.
-     */
-    public String getName() {
-        return group;
-    }
-
-    //
-    // This function is the recursive search of groups for this
-    // implementation of the Group. The search proceeds building up
-    // a vector of already seen groups. Only new groups are considered,
-    // thereby avoiding loops.
-    //
-    boolean isMemberRecurse(Principal member, Vector<Group> alreadySeen) {
-        Enumeration<? extends Principal> e = members();
-        while (e.hasMoreElements()) {
-            boolean mem = false;
-            Principal p = (Principal) e.nextElement();
-
-            // if the member is in this collection, return true
-            if (p.equals(member)) {
-                return true;
-            } else if (p instanceof GroupImpl) {
-                //
-                // if not recurse if the group has not been checked already.
-                // Can call method in this package only if the object is an
-                // instance of this class. Otherwise call the method defined
-                // in the interface. (This can lead to a loop if a mixture of
-                // implementations form a loop, but we live with this improbable
-                // case rather than clutter the interface by forcing the
-                // implementation of this method.)
-                //
-                GroupImpl g = (GroupImpl) p;
-                alreadySeen.addElement(this);
-                if (!alreadySeen.contains(g))
-                  mem =  g.isMemberRecurse(member, alreadySeen);
-            } else if (p instanceof Group) {
-                Group g = (Group) p;
-                if (!alreadySeen.contains(g))
-                  mem = g.isMember(member);
-            }
-
-            if (mem)
-              return mem;
-        }
-        return false;
-    }
-}
--- a/jdk/src/java.base/share/classes/sun/security/acl/OwnerImpl.java	Mon Feb 23 10:47:32 2015 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.security.acl;
-
-import java.util.*;
-import java.security.*;
-import java.security.acl.*;
-
-/**
- * Class implementing the Owner interface. The
- * initial owner principal is configured as
- * part of the constructor.
- * @author      Satish Dharmaraj
- */
-public class OwnerImpl implements Owner {
-    private Group ownerGroup;
-
-    public OwnerImpl(Principal owner) {
-        ownerGroup = new GroupImpl("AclOwners");
-        ownerGroup.addMember(owner);
-    }
-
-    /**
-     * Adds an owner. Owners can modify ACL contents and can disassociate
-     * ACLs from the objects they protect in the AclConfig interface.
-     * The caller principal must be a part of the owners list of the ACL in
-     * order to invoke this method. The initial owner is configured
-     * at ACL construction time.
-     * @param caller the principal who is invoking this method.
-     * @param owner The owner that should be added to the owners list.
-     * @return true if success, false if already an owner.
-     * @exception NotOwnerException if the caller principal is not on
-     * the owners list of the Acl.
-     */
-    public synchronized boolean addOwner(Principal caller, Principal owner)
-      throws NotOwnerException
-    {
-        if (!isOwner(caller))
-            throw new NotOwnerException();
-
-        ownerGroup.addMember(owner);
-        return false;
-    }
-
-    /**
-     * Delete owner. If this is the last owner in the ACL, an exception is
-     * raised.
-     * The caller principal must be a part of the owners list of the ACL in
-     * order to invoke this method.
-     * @param caller the principal who is invoking this method.
-     * @param owner The owner to be removed from the owners list.
-     * @return true if the owner is removed, false if the owner is not part
-     * of the owners list.
-     * @exception NotOwnerException if the caller principal is not on
-     * the owners list of the Acl.
-     * @exception LastOwnerException if there is only one owner left in the group, then
-     * deleteOwner would leave the ACL owner-less. This exception is raised in such a case.
-     */
-    public synchronized boolean deleteOwner(Principal caller, Principal owner)
-      throws NotOwnerException, LastOwnerException
-    {
-        if (!isOwner(caller))
-            throw new NotOwnerException();
-
-        Enumeration<? extends Principal> e = ownerGroup.members();
-        //
-        // check if there is atleast 2 members left.
-        //
-        Object o = e.nextElement();
-        if (e.hasMoreElements())
-            return ownerGroup.removeMember(owner);
-        else
-            throw new LastOwnerException();
-
-    }
-
-    /**
-     * returns if the given principal belongs to the owner list.
-     * @param owner The owner to check if part of the owners list
-     * @return true if the passed principal is in the owner list, false if not.
-     */
-    public synchronized boolean isOwner(Principal owner) {
-        return ownerGroup.isMember(owner);
-    }
-}
--- a/jdk/src/java.base/share/classes/sun/security/acl/PermissionImpl.java	Mon Feb 23 10:47:32 2015 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.security.acl;
-
-import java.security.Principal;
-import java.security.acl.*;
-
-/**
- * The PermissionImpl class implements the permission
- * interface for permissions that are strings.
- * @author Satish Dharmaraj
- */
-public class PermissionImpl implements Permission {
-
-    private String permission;
-
-    /**
-     * Construct a permission object using a string.
-     * @param permission the stringified version of the permission.
-     */
-    public PermissionImpl(String permission) {
-        this.permission = permission;
-    }
-
-    /**
-     * This function returns true if the object passed matches the permission
-     * represented in this interface.
-     * @param another The Permission object to compare with.
-     * @return true if the Permission objects are equal, false otherwise
-     */
-    public boolean equals(Object another) {
-        if (another instanceof Permission) {
-            Permission p = (Permission) another;
-            return permission.equals(p.toString());
-        } else {
-            return false;
-        }
-    }
-
-    /**
-     * Prints a stringified version of the permission.
-     * @return the string representation of the Permission.
-     */
-    public String toString() {
-        return permission;
-    }
-
-    /**
-     * Returns a hashcode for this PermissionImpl.
-     *
-     * @return a hashcode for this PermissionImpl.
-     */
-    public int hashCode() {
-        return toString().hashCode();
-    }
-
-}
--- a/jdk/src/java.base/share/classes/sun/security/acl/PrincipalImpl.java	Mon Feb 23 10:47:32 2015 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 1996, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.security.acl;
-
-import java.security.*;
-
-/**
- * This class implements the principal interface.
- *
- * @author      Satish Dharmaraj
- */
-public class PrincipalImpl implements Principal {
-
-    private String user;
-
-    /**
-     * Construct a principal from a string user name.
-     * @param user The string form of the principal name.
-     */
-    public PrincipalImpl(String user) {
-        this.user = user;
-    }
-
-    /**
-     * This function returns true if the object passed matches
-     * the principal represented in this implementation
-     * @param another the Principal to compare with.
-     * @return true if the Principal passed is the same as that
-     * encapsulated in this object, false otherwise
-     */
-    public boolean equals(Object another) {
-        if (another instanceof PrincipalImpl) {
-            PrincipalImpl p = (PrincipalImpl) another;
-            return user.equals(p.toString());
-        } else
-          return false;
-    }
-
-    /**
-     * Prints a stringified version of the principal.
-     */
-    public String toString() {
-        return user;
-    }
-
-    /**
-     * return a hashcode for the principal.
-     */
-    public int hashCode() {
-        return user.hashCode();
-    }
-
-    /**
-     * return the name of the principal.
-     */
-    public String getName() {
-        return user;
-    }
-
-}
--- a/jdk/src/java.base/share/classes/sun/security/acl/WorldGroupImpl.java	Mon Feb 23 10:47:32 2015 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1996, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.security.acl;
-
-import java.security.*;
-
-/**
- * This class implements a group of principals.
- * @author Satish Dharmaraj
- */
-public class WorldGroupImpl extends GroupImpl {
-
-    public WorldGroupImpl(String s) {
-        super(s);
-    }
-
-    /**
-     * returns true for all passed principals
-     * @param member The principal whose membership must be checked in this Group.
-     * @return true always since this is the "world" group.
-     */
-    public boolean isMember(Principal member) {
-        return true;
-    }
-}
--- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java	Tue Mar 03 08:49:13 2015 -0800
@@ -3765,55 +3765,87 @@
         }
     }
 
+    // Add an extension into a CertificateExtensions, always using OID as key
+    private static void setExt(CertificateExtensions result, Extension ex)
+            throws IOException {
+        result.set(ex.getId(), ex);
+    }
+
     /**
      * Create X509v3 extensions from a string representation. Note that the
      * SubjectKeyIdentifierExtension will always be created non-critical besides
      * the extension requested in the <code>extstr</code> argument.
      *
-     * @param reqex the requested extensions, can be null, used for -gencert
-     * @param ext the original extensions, can be null, used for -selfcert
+     * @param requestedEx the requested extensions, can be null, used for -gencert
+     * @param existingEx the original extensions, can be null, used for -selfcert
      * @param extstrs -ext values, Read keytool doc
      * @param pkey the public key for the certificate
      * @param akey the public key for the authority (issuer)
      * @return the created CertificateExtensions
      */
     private CertificateExtensions createV3Extensions(
-            CertificateExtensions reqex,
-            CertificateExtensions ext,
+            CertificateExtensions requestedEx,
+            CertificateExtensions existingEx,
             List <String> extstrs,
             PublicKey pkey,
             PublicKey akey) throws Exception {
 
-        if (ext != null && reqex != null) {
+        // By design, inside a CertificateExtensions object, all known
+        // extensions uses name (say, "BasicConstraints") as key and
+        // a child Extension type (say, "BasicConstraintsExtension")
+        // as value, unknown extensions uses OID as key and bare
+        // Extension object as value. This works fine inside JDK.
+        //
+        // However, in keytool, there is no way to prevent people
+        // using OID in -ext, either as a new extension, or in a
+        // honored value. Thus here we (ab)use CertificateExtensions
+        // by always using OID as key and value can be of any type.
+
+        if (existingEx != null && requestedEx != null) {
             // This should not happen
             throw new Exception("One of request and original should be null.");
         }
-        if (ext == null) ext = new CertificateExtensions();
+        // A new extensions always using OID as key
+        CertificateExtensions result = new CertificateExtensions();
+        if (existingEx != null) {
+            for (Extension ex: existingEx.getAllExtensions()) {
+                setExt(result, ex);
+            }
+        }
         try {
             // name{:critical}{=value}
             // Honoring requested extensions
-            if (reqex != null) {
+            if (requestedEx != null) {
+                // The existing requestedEx might use names as keys,
+                // translate to all-OID first.
+                CertificateExtensions request2 = new CertificateExtensions();
+                for (sun.security.x509.Extension ex: requestedEx.getAllExtensions()) {
+                    request2.set(ex.getId(), ex);
+                }
                 for(String extstr: extstrs) {
                     if (extstr.toLowerCase(Locale.ENGLISH).startsWith("honored=")) {
                         List<String> list = Arrays.asList(
                                 extstr.toLowerCase(Locale.ENGLISH).substring(8).split(","));
                         // First check existence of "all"
                         if (list.contains("all")) {
-                            ext = reqex;    // we know ext was null
+                            for (Extension ex: request2.getAllExtensions()) {
+                                setExt(result, ex);
+                            }
                         }
                         // one by one for others
                         for (String item: list) {
                             if (item.equals("all")) continue;
 
                             // add or remove
-                            boolean add = true;
-                            // -1, unchanged, 0 crtical, 1 non-critical
+                            boolean add;
+                            // -1, unchanged, 0 critical, 1 non-critical
                             int action = -1;
                             String type = null;
                             if (item.startsWith("-")) {
                                 add = false;
                                 type = item.substring(1);
                             } else {
+                                add = true;
                                 int colonpos = item.indexOf(':');
                                 if (colonpos >= 0) {
                                     type = item.substring(0, colonpos);
@@ -3823,21 +3855,23 @@
                                         throw new Exception(rb.getString
                                             ("Illegal.value.") + item);
                                     }
+                                } else {
+                                    type = item;
                                 }
                             }
-                            String n = reqex.getNameByOid(findOidForExtName(type));
+                            String n = findOidForExtName(type).toString();
                             if (add) {
-                                Extension e = reqex.get(n);
+                                Extension e = request2.get(n);
                                 if (!e.isCritical() && action == 0
                                         || e.isCritical() && action == 1) {
                                     e = Extension.newExtension(
                                             e.getExtensionId(),
                                             !e.isCritical(),
                                             e.getExtensionValue());
-                                    ext.set(n, e);
                                 }
+                                setExt(result, e);
                             } else {
-                                ext.delete(n);
+                                result.delete(n);
                             }
                         }
                         break;
@@ -3899,8 +3933,7 @@
                                 }
                             }
                         }
-                        ext.set(BasicConstraintsExtension.NAME,
-                                new BasicConstraintsExtension(isCritical, isCA,
+                        setExt(result, new BasicConstraintsExtension(isCritical, isCA,
                                 pathLen));
                         break;
                     case 1:     // KU
@@ -3928,7 +3961,7 @@
                             KeyUsageExtension kue = new KeyUsageExtension(ok);
                             // The above KeyUsageExtension constructor does not
                             // allow isCritical value, so...
-                            ext.set(KeyUsageExtension.NAME, Extension.newExtension(
+                            setExt(result, Extension.newExtension(
                                     kue.getExtensionId(),
                                     isCritical,
                                     kue.getExtensionValue()));
@@ -3966,8 +3999,7 @@
                                     v.add(new ObjectIdentifier("1.3.6.1.5.5.7.3." + p));
                                 }
                             }
-                            ext.set(ExtendedKeyUsageExtension.NAME,
-                                    new ExtendedKeyUsageExtension(isCritical, v));
+                            setExt(result, new ExtendedKeyUsageExtension(isCritical, v));
                         } else {
                             throw new Exception(rb.getString
                                     ("Illegal.value.") + extstr);
@@ -3988,13 +4020,11 @@
                                 gnames.add(createGeneralName(t, v));
                             }
                             if (exttype == 3) {
-                                ext.set(SubjectAlternativeNameExtension.NAME,
-                                        new SubjectAlternativeNameExtension(
-                                            isCritical, gnames));
+                                setExt(result, new SubjectAlternativeNameExtension(
+                                        isCritical, gnames));
                             } else {
-                                ext.set(IssuerAlternativeNameExtension.NAME,
-                                        new IssuerAlternativeNameExtension(
-                                            isCritical, gnames));
+                                setExt(result, new IssuerAlternativeNameExtension(
+                                        isCritical, gnames));
                             }
                         } else {
                             throw new Exception(rb.getString
@@ -4044,11 +4074,9 @@
                                         oid, createGeneralName(t, v)));
                             }
                             if (exttype == 5) {
-                                ext.set(SubjectInfoAccessExtension.NAME,
-                                        new SubjectInfoAccessExtension(accessDescriptions));
+                                setExt(result, new SubjectInfoAccessExtension(accessDescriptions));
                             } else {
-                                ext.set(AuthorityInfoAccessExtension.NAME,
-                                        new AuthorityInfoAccessExtension(accessDescriptions));
+                                setExt(result, new AuthorityInfoAccessExtension(accessDescriptions));
                             }
                         } else {
                             throw new Exception(rb.getString
@@ -4068,10 +4096,9 @@
                                 String v = item.substring(colonpos+1);
                                 gnames.add(createGeneralName(t, v));
                             }
-                            ext.set(CRLDistributionPointsExtension.NAME,
-                                    new CRLDistributionPointsExtension(
-                                        isCritical, Collections.singletonList(
-                                        new DistributionPoint(gnames, null, null))));
+                            setExt(result, new CRLDistributionPointsExtension(
+                                    isCritical, Collections.singletonList(
+                                    new DistributionPoint(gnames, null, null))));
                         } else {
                             throw new Exception(rb.getString
                                     ("Illegal.value.") + extstr);
@@ -4109,7 +4136,7 @@
                         } else {
                             data = new byte[0];
                         }
-                        ext.set(oid.toString(), new Extension(oid, isCritical,
+                        setExt(result, new Extension(oid, isCritical,
                                 new DerValue(DerValue.tag_OctetString, data)
                                         .toByteArray()));
                         break;
@@ -4119,18 +4146,16 @@
                 }
             }
             // always non-critical
-            ext.set(SubjectKeyIdentifierExtension.NAME,
-                    new SubjectKeyIdentifierExtension(
-                        new KeyIdentifier(pkey).getIdentifier()));
+            setExt(result, new SubjectKeyIdentifierExtension(
+                    new KeyIdentifier(pkey).getIdentifier()));
             if (akey != null && !pkey.equals(akey)) {
-                ext.set(AuthorityKeyIdentifierExtension.NAME,
-                        new AuthorityKeyIdentifierExtension(
-                        new KeyIdentifier(akey), null, null));
+                setExt(result, new AuthorityKeyIdentifierExtension(
+                                new KeyIdentifier(akey), null, null));
             }
         } catch(IOException e) {
             throw new RuntimeException(e);
         }
-        return ext;
+        return result;
     }
 
     /**
--- a/jdk/src/java.base/share/classes/sun/security/util/Debug.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/util/Debug.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -80,11 +80,13 @@
         System.err.println("jar           jar verification");
         System.err.println("logincontext  login context results");
         System.err.println("jca           JCA engine class debugging");
+        System.err.println("keystore      KeyStore debugging");
         System.err.println("policy        loading and granting");
         System.err.println("provider      security provider debugging");
         System.err.println("pkcs11        PKCS11 session manager debugging");
         System.err.println("pkcs11keystore");
         System.err.println("              PKCS11 KeyStore debugging");
+        System.err.println("pkcs12        PKCS12 KeyStore debugging");
         System.err.println("sunpkcs11     SunPKCS11 provider debugging");
         System.err.println("scl           permissions SecureClassLoader assigns");
         System.err.println("ts            timestamping");
@@ -114,6 +116,10 @@
         System.err.println("              KeyPairGenerator, KeyStore, Mac,");
         System.err.println("              MessageDigest, SecureRandom, Signature.");
         System.err.println();
+        System.err.println("The following can be used with certpath:");
+        System.err.println();
+        System.err.println("ocsp          dump the OCSP protocol exchanges");
+        System.err.println();
         System.err.println("Note: Separate multiple options with a comma");
         System.exit(0);
     }
--- a/jdk/src/java.base/share/classes/sun/util/logging/LoggingSupport.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/util/logging/LoggingSupport.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
 import java.lang.reflect.Field;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.util.Date;
+import java.time.ZonedDateTime;
 
 /**
  * Internal API to support JRE implementation to detect if the java.util.logging
@@ -145,6 +145,11 @@
         return proxy.getLevelValue(level);
     }
 
+    // Since JDK 9, logging uses java.time to get more precise time stamps.
+    // It is possible to configure the simple format to print nano seconds (.%1$tN)
+    // by specifying:
+    // java.util.logging.SimpleFormatter.format=%1$tb %1$td, %1$tY %1$tl:%1$tM:%1$tS.%1$tN %1$Tp %2$s%n%4$s: %5$s%6$s%n
+    // in the logging configuration
     private static final String DEFAULT_FORMAT =
         "%1$tb %1$td, %1$tY %1$tl:%1$tM:%1$tS %1$Tp %2$s%n%4$s: %5$s%6$s%n";
 
@@ -171,7 +176,7 @@
         if (format != null) {
             try {
                 // validate the user-defined format string
-                String.format(format, new Date(), "", "", "", "", "");
+                String.format(format, ZonedDateTime.now(), "", "", "", "", "");
             } catch (IllegalArgumentException e) {
                 // illegal syntax; fall back to the default format
                 format = DEFAULT_FORMAT;
--- a/jdk/src/java.base/share/classes/sun/util/logging/PlatformLogger.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/classes/sun/util/logging/PlatformLogger.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,8 +32,11 @@
 import java.io.StringWriter;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import java.time.Clock;
+import java.time.Instant;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
 import java.util.Arrays;
-import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
 import sun.misc.JavaLangAccess;
@@ -514,11 +517,9 @@
 
         private static final String formatString =
             LoggingSupport.getSimpleFormat(false); // don't check logging.properties
-
-        // minimize memory allocation
-        private Date date = new Date();
+        private final ZoneId zoneId = ZoneId.systemDefault();
         private synchronized String format(Level level, String msg, Throwable thrown) {
-            date.setTime(System.currentTimeMillis());
+            ZonedDateTime zdt = ZonedDateTime.now(zoneId);
             String throwable = "";
             if (thrown != null) {
                 StringWriter sw = new StringWriter();
@@ -530,7 +531,7 @@
             }
 
             return String.format(formatString,
-                                 date,
+                                 zdt,
                                  getCallerInfo(),
                                  name,
                                  level.name(),
--- a/jdk/src/java.base/share/native/libjava/VM.c	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/native/libjava/VM.c	Tue Mar 03 08:49:13 2015 -0800
@@ -23,11 +23,8 @@
  * questions.
  */
 
-#include <string.h>
-
 #include "jni.h"
 #include "jni_util.h"
-#include "jlong.h"
 #include "jvm.h"
 #include "jdk_util.h"
 
@@ -43,12 +40,8 @@
     return JVM_LatestUserDefinedLoader(env);
 }
 
-typedef void (JNICALL *GetJvmVersionInfo_fp)(JNIEnv*, jvm_version_info*, size_t);
-
 JNIEXPORT void JNICALL
 Java_sun_misc_VM_initialize(JNIEnv *env, jclass cls) {
-    GetJvmVersionInfo_fp func_p;
-
     if (!JDK_InitJvmHandle()) {
         JNU_ThrowInternalError(env, "Handle for JVM not found for symbol lookup");
         return;
@@ -61,15 +54,4 @@
     // introducing a Java_sun_misc_VM_getNanoTimeAdjustment  wrapper
     (*env)->RegisterNatives(env, cls,
                             methods, sizeof(methods)/sizeof(methods[0]));
-
-    func_p = (GetJvmVersionInfo_fp) JDK_FindJvmEntry("JVM_GetVersionInfo");
-     if (func_p != NULL) {
-        jvm_version_info info;
-
-        memset(&info, 0, sizeof(info));
-
-        /* obtain the JVM version info */
-        (*func_p)(env, &info, sizeof(info));
-    }
 }
-
--- a/jdk/src/java.base/share/native/libjli/java.c	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/share/native/libjli/java.c	Tue Mar 03 08:49:13 2015 -0800
@@ -651,9 +651,26 @@
 SetJvmEnvironment(int argc, char **argv) {
 
     static const char*  NMT_Env_Name    = "NMT_LEVEL_";
-
     int i;
     for (i = 0; i < argc; i++) {
+        char *arg = argv[i];
+        /*
+         * Since this must be a VM flag we stop processing once we see
+         * an argument the launcher would not have processed beyond (such
+         * as -version or -h), or an argument that indicates the following
+         * arguments are for the application (i.e. the main class name, or
+         * the -jar argument).
+         */
+        if ((i > 0 && *arg != '-')
+                || JLI_StrCmp(arg, "-version") == 0
+                || JLI_StrCmp(arg, "-fullversion") == 0
+                || JLI_StrCmp(arg, "-help") == 0
+                || JLI_StrCmp(arg, "-?") == 0
+                || JLI_StrCmp(arg, "-jar") == 0
+                || JLI_StrCmp(arg, "-X") == 0
+                ) {
+            return;
+        }
         /*
          * The following case checks for "-XX:NativeMemoryTracking=value".
          * If value is non null, an environmental variable set to this value
@@ -661,7 +678,6 @@
          * The argument is passed to the JVM, which will check validity.
          * The JVM is responsible for removing the env variable.
          */
-        char *arg = argv[i];
         if (JLI_StrCCmp(arg, "-XX:NativeMemoryTracking=") == 0) {
             int retval;
             // get what follows this parameter, include "="
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/unix/conf/aarch64/jvm.cfg	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,35 @@
+# 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
+# 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.
+#
+# 
+# List of JVMs that can be used as an option to java, javac, etc.
+# Order is important -- first in this list is the default JVM.
+# NOTE that this both this file and its format are UNSUPPORTED and
+# WILL GO AWAY in a future release.
+#
+# You may also select a JVM in an arbitrary location with the
+# "-XXaltjvm=<jvm_dir>" option, but that too is unsupported
+# and may not be available in a future release.
+#
+-server KNOWN
+-client IGNORE
--- a/jdk/src/java.base/unix/native/libnet/ExtendedOptionsImpl.c	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/unix/native/libnet/ExtendedOptionsImpl.c	Tue Mar 03 08:49:13 2015 -0800
@@ -88,6 +88,7 @@
     /* SocketFlow fields */
 
     c = (*env)->FindClass(env, "jdk/net/SocketFlow");
+    CHECK_NULL(c);
 
     /* status */
 
--- a/jdk/src/java.base/unix/native/libnio/ch/DatagramChannelImpl.c	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/unix/native/libnio/ch/DatagramChannelImpl.c	Tue Mar 03 08:49:13 2015 -0800
@@ -201,7 +201,7 @@
     }
     if (senderAddr == NULL) {
         jobject isa = NULL;
-        int port;
+        int port = 0;
         jobject ia = NET_SockaddrToInetAddress(env, (struct sockaddr *)&sa, &port);
         if (ia != NULL) {
             isa = (*env)->NewObject(env, isa_class, isa_ctorID, ia, port);
--- a/jdk/src/java.base/unix/native/libnio/ch/ServerSocketChannelImpl.c	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/unix/native/libnio/ch/ServerSocketChannelImpl.c	Tue Mar 03 08:49:13 2015 -0800
@@ -84,7 +84,7 @@
     int alloc_len;
     jobject remote_ia = 0;
     jobject isa;
-    jint remote_port;
+    jint remote_port = 0;
 
     NET_AllocSockaddr(&sa, &alloc_len);
     if (sa == NULL) {
--- a/jdk/src/java.base/windows/native/libjava/TimeZone_md.c	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/windows/native/libjava/TimeZone_md.c	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -195,7 +195,7 @@
          * Vista uses the different key name.
          */
         if (ret != ERROR_SUCCESS) {
-          bufSize = sizeof(val);
+            bufSize = sizeof(val);
             ret = RegQueryValueExA(hKey, "DynamicDaylightTimeDisabled",
                                    NULL, &valueType, (LPBYTE) &val, &bufSize);
         }
@@ -510,18 +510,49 @@
         } else {
             std_timezone = matchJavaTZ(java_home_dir, result,
                                        winZoneName, winMapID);
+            if (std_timezone == NULL) {
+                std_timezone = getGMTOffsetID();
+            }
         }
     }
-
     return std_timezone;
 }
 
 /**
- * Returns a GMT-offset-based time zone ID. On Win32, it always return
- * NULL since the fall back is performed in getWinTimeZone().
+ * Returns a GMT-offset-based time zone ID.
  */
 char *
 getGMTOffsetID()
 {
-    return NULL;
+    LONG bias = 0;
+    LONG ret;
+    HANDLE hKey = NULL;
+    char zonename[32];
+
+    // Obtain the current GMT offset value of ActiveTimeBias.
+    ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_CURRENT_TZ_KEY, 0,
+                       KEY_READ, (PHKEY)&hKey);
+    if (ret == ERROR_SUCCESS) {
+        DWORD val;
+        DWORD bufSize = sizeof(val);
+        ULONG valueType = 0;
+        ret = RegQueryValueExA(hKey, "ActiveTimeBias",
+                               NULL, &valueType, (LPBYTE) &val, &bufSize);
+        if (ret == ERROR_SUCCESS) {
+            bias = (LONG) val;
+        }
+        (void) RegCloseKey(hKey);
+    }
+
+    // If we can't get the ActiveTimeBias value, use Bias of TimeZoneInformation.
+    // Note: Bias doesn't reflect current daylight saving.
+    if (ret != ERROR_SUCCESS) {
+        TIME_ZONE_INFORMATION tzi;
+        if (GetTimeZoneInformation(&tzi) != TIME_ZONE_ID_INVALID) {
+            bias = tzi.Bias;
+        }
+    }
+
+    customZoneName(bias, zonename);
+    return _strdup(zonename);
 }
--- a/jdk/src/java.base/windows/native/libjava/java_props_md.c	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/windows/native/libjava/java_props_md.c	Tue Mar 03 08:49:13 2015 -0800
@@ -188,6 +188,7 @@
             free(elems[index]);
         }
     } else {
+        free(ret);
         ret = NULL;
     }
 
--- a/jdk/src/java.base/windows/native/libnio/ch/FileDispatcherImpl.c	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.base/windows/native/libnio/ch/FileDispatcherImpl.c	Tue Mar 03 08:49:13 2015 -0800
@@ -325,17 +325,14 @@
 {
     BOOL result = 0;
     HANDLE h = (HANDLE)(handleval(env, fdo));
-    LARGE_INTEGER offset;
+    FILE_END_OF_FILE_INFO eofInfo;
 
-    offset.QuadPart = size;
-    result = SetFilePointerEx(h, offset, NULL, FILE_BEGIN);
-    if (result == 0) {
-        JNU_ThrowIOExceptionWithLastError(env, "Truncation failed");
-        return IOS_THROWN;
-    }
-
-    result = SetEndOfFile(h);
-    if (result == 0) {
+    eofInfo.EndOfFile.QuadPart = size;
+    result = SetFileInformationByHandle(h,
+                                        FileEndOfFileInfo,
+                                        &eofInfo,
+                                        sizeof(eofInfo));
+    if (result == FALSE) {
         JNU_ThrowIOExceptionWithLastError(env, "Truncation failed");
         return IOS_THROWN;
     }
--- a/jdk/src/java.desktop/share/native/libjsound/SoundDefs.h	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.desktop/share/native/libjsound/SoundDefs.h	Tue Mar 03 08:49:13 2015 -0800
@@ -34,6 +34,7 @@
 #define X_BSD           4
 #define X_MACOSX        5
 
+#define X_AARCH64       9
 // **********************************
 // Make sure you set X_PLATFORM defines correctly.
 // Everything depends upon this flag being setup correctly.
--- a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11CNS11643.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11CNS11643.java	Tue Mar 03 08:49:13 2015 -0800
@@ -28,7 +28,8 @@
 import java.nio.CharBuffer;
 import java.nio.ByteBuffer;
 import java.nio.charset.*;
-import sun.nio.cs.ext.EUC_TW;
+import sun.nio.cs.*;
+import sun.nio.cs.ext.*;
 
 public abstract class X11CNS11643 extends Charset {
     private final int plane;
--- a/jdk/src/java.logging/share/classes/java/util/logging/LogRecord.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.logging/share/classes/java/util/logging/LogRecord.java	Tue Mar 03 08:49:13 2015 -0800
@@ -24,10 +24,12 @@
  */
 
 package java.util.logging;
+import java.time.Instant;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
 import java.io.*;
+import java.time.Clock;
 
 import sun.misc.JavaLangAccess;
 import sun.misc.SharedSecrets;
@@ -88,55 +90,94 @@
     private static final ThreadLocal<Integer> threadIds = new ThreadLocal<>();
 
     /**
-     * @serial Logging message level
+     * Logging message level
      */
     private Level level;
 
     /**
-     * @serial Sequence number
+     * Sequence number
      */
     private long sequenceNumber;
 
     /**
-     * @serial Class that issued logging call
+     * Class that issued logging call
      */
     private String sourceClassName;
 
     /**
-     * @serial Method that issued logging call
+     * Method that issued logging call
      */
     private String sourceMethodName;
 
     /**
-     * @serial Non-localized raw message text
+     * Non-localized raw message text
      */
     private String message;
 
     /**
-     * @serial Thread ID for thread that issued logging call.
+     * Thread ID for thread that issued logging call.
      */
     private int threadID;
 
     /**
-     * @serial Event time in milliseconds since 1970
-     */
-    private long millis;
-
-    /**
-     * @serial The Throwable (if any) associated with log message
+     * The Throwable (if any) associated with log message
      */
     private Throwable thrown;
 
     /**
-     * @serial Name of the source Logger.
+     * Name of the source Logger.
      */
     private String loggerName;
 
     /**
-     * @serial Resource bundle name to localized log message.
+     * Resource bundle name to localized log message.
      */
     private String resourceBundleName;
 
+    /**
+     * Event time.
+     * @since 1.9
+     */
+    private Instant instant;
+
+    /**
+     * @serialField level Level Logging message level
+     * @serialField sequenceNumber long Sequence number
+     * @serialField sourceClassName String Class that issued logging call
+     * @serialField sourceMethodName String Method that issued logging call
+     * @serialField message String Non-localized raw message text
+     * @serialField threadID int Thread ID for thread that issued logging call
+     * @serialField millis long Truncated event time in milliseconds since 1970
+     *              - calculated as getInstant().toEpochMilli().
+     *               The event time instant can be reconstructed using
+     * <code>Instant.ofEpochSecond(millis/1000, (millis % 1000) * 1000_000 + nanoAdjustment)</code>
+     * @serialField nanoAdjustment int Nanoseconds adjustment to the millisecond of
+     *              event time - calculated as getInstant().getNano() % 1000_000
+     *               The event time instant can be reconstructed using
+     * <code>Instant.ofEpochSecond(millis/1000, (millis % 1000) * 1000_000 + nanoAdjustment)</code>
+     *              <p>
+     *              Since: 1.9
+     * @serialField thrown Throwable The Throwable (if any) associated with log
+     *              message
+     * @serialField loggerName String Name of the source Logger
+     * @serialField resourceBundleName String Resource bundle name to localized
+     *              log message
+     */
+    private static final ObjectStreamField[] serialPersistentFields =
+        new ObjectStreamField[] {
+            new ObjectStreamField("level", Level.class),
+            new ObjectStreamField("sequenceNumber", long.class),
+            new ObjectStreamField("sourceClassName", String.class),
+            new ObjectStreamField("sourceMethodName", String.class),
+            new ObjectStreamField("message", String.class),
+            new ObjectStreamField("threadID", int.class),
+            new ObjectStreamField("millis", long.class),
+            new ObjectStreamField("nanoAdjustment", int.class),
+            new ObjectStreamField("thrown", Throwable.class),
+            new ObjectStreamField("loggerName", String.class),
+            new ObjectStreamField("resourceBundleName", String.class),
+        };
+
     private transient boolean needToInferCaller;
     private transient Object parameters[];
     private transient ResourceBundle resourceBundle;
@@ -164,7 +205,10 @@
      * The sequence property will be initialized with a new unique value.
      * These sequence values are allocated in increasing order within a VM.
      * <p>
-     * The millis property will be initialized to the current time.
+     * Since JDK 1.9, the event time is represented by an {@link Instant}.
+     * The instant property will be initialized to the {@linkplain
+     * Instant#now() current instant}, using the best available
+     * {@linkplain Clock#systemUTC() clock} on the system.
      * <p>
      * The thread ID property will be initialized with a unique ID for
      * the current thread.
@@ -173,6 +217,7 @@
      *
      * @param level  a logging level value
      * @param msg  the raw non-localized logging message (may be null)
+     * @see java.time.Clock#systemUTC()
      */
     public LogRecord(Level level, String msg) {
         this.level = Objects.requireNonNull(level);
@@ -180,7 +225,7 @@
         // Assign a thread ID and a unique sequence number.
         sequenceNumber = globalSequenceNumber.getAndIncrement();
         threadID = defaultThreadID();
-        millis = System.currentTimeMillis();
+        instant = Instant.now();
         needToInferCaller = true;
    }
 
@@ -416,21 +461,63 @@
     }
 
     /**
-     * Get event time in milliseconds since 1970.
+     * Get truncated event time in milliseconds since 1970.
+     *
+     * @return truncated event time in millis since 1970
+     *
+     * @implSpec This is equivalent to calling
+     *      {@link #getInstant() getInstant().toEpochMilli()}.
      *
-     * @return event time in millis since 1970
+     * @deprecated To get the full nanosecond resolution event time,
+     *             use {@link #getInstant()}.
+     *
+     * @see #getInstant()
      */
+    @Deprecated
     public long getMillis() {
-        return millis;
+        return instant.toEpochMilli();
     }
 
     /**
      * Set event time.
      *
-     * @param millis event time in millis since 1970
+     * @param millis event time in millis since 1970.
+     *
+     * @implSpec This is equivalent to calling
+     *      {@link #setInstant(java.time.Instant)
+     *      setInstant(Instant.ofEpochMilli(millis))}.
+     *
+     * @deprecated To set event time with nanosecond resolution,
+     *             use {@link #setInstant(java.time.Instant)}.
+     *
+     * @see #setInstant(java.time.Instant)
      */
+    @Deprecated
     public void setMillis(long millis) {
-        this.millis = millis;
+        this.instant = Instant.ofEpochMilli(millis);
+    }
+
+    /**
+     * Gets the instant that the event occurred.
+     *
+     * @return the instant that the event occurred.
+     *
+     * @since 1.9
+     */
+    public Instant getInstant() {
+        return instant;
+    }
+
+    /**
+     * Sets the instant that the event occurred.
+     *
+     * @param instant the instant that the event occurred.
+     *
+     * @throws NullPointerException if {@code instant} is null.
+     * @since 1.9
+     */
+    public void setInstant(Instant instant) {
+        this.instant = Objects.requireNonNull(instant);
     }
 
     /**
@@ -457,7 +544,7 @@
     private static final long serialVersionUID = 5372048053134512534L;
 
     /**
-     * @serialData Default fields, followed by a two byte version number
+     * @serialData Serialized fields, followed by a two byte version number
      * (major byte, followed by minor byte), followed by information on
      * the log record parameter array.  If there is no parameter array,
      * then -1 is written.  If there is a parameter array (possible of zero
@@ -467,8 +554,20 @@
      * is written.
      */
     private void writeObject(ObjectOutputStream out) throws IOException {
-        // We have to call defaultWriteObject first.
-        out.defaultWriteObject();
+        // We have to write serialized fields first.
+        ObjectOutputStream.PutField pf = out.putFields();
+        pf.put("level", level);
+        pf.put("sequenceNumber", sequenceNumber);
+        pf.put("sourceClassName", sourceClassName);
+        pf.put("sourceMethodName", sourceMethodName);
+        pf.put("message", message);
+        pf.put("threadID", threadID);
+        pf.put("millis", instant.toEpochMilli());
+        pf.put("nanoAdjustment", instant.getNano() % 1000_000);
+        pf.put("thrown", thrown);
+        pf.put("loggerName", loggerName);
+        pf.put("resourceBundleName", resourceBundleName);
+        out.writeFields();
 
         // Write our version number.
         out.writeByte(1);
@@ -486,8 +585,21 @@
 
     private void readObject(ObjectInputStream in)
                         throws IOException, ClassNotFoundException {
-        // We have to call defaultReadObject first.
-        in.defaultReadObject();
+        // We have to read serialized fields first.
+        ObjectInputStream.GetField gf = in.readFields();
+        level = (Level) gf.get("level", null);
+        sequenceNumber = gf.get("sequenceNumber", 0L);
+        sourceClassName = (String) gf.get("sourceClassName", null);
+        sourceMethodName = (String) gf.get("sourceMethodName", null);
+        message = (String) gf.get("message", null);
+        threadID = gf.get("threadID", 0);
+        long millis = gf.get("millis", 0L);
+        int nanoOfMilli = gf.get("nanoAdjustment", 0);
+        instant = Instant.ofEpochSecond(
+            millis / 1000L, (millis % 1000L) * 1000_000L + nanoOfMilli);
+        thrown = (Throwable) gf.get("thrown", null);
+        loggerName = (String) gf.get("loggerName", null);
+        resourceBundleName = (String) gf.get("resourceBundleName", null);
 
         // Read version number.
         byte major = in.readByte();
--- a/jdk/src/java.logging/share/classes/java/util/logging/SimpleFormatter.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.logging/share/classes/java/util/logging/SimpleFormatter.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,8 +27,9 @@
 package java.util.logging;
 
 import java.io.*;
-import java.text.*;
-import java.util.Date;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
 import sun.util.logging.LoggingSupport;
 
 /**
@@ -59,8 +60,8 @@
 public class SimpleFormatter extends Formatter {
 
     // format string for printing the log record
-    private static final String format = LoggingSupport.getSimpleFormat();
-    private final Date dat = new Date();
+    private final String format = LoggingSupport.getSimpleFormat();
+    private final ZoneId zoneId = ZoneId.systemDefault();
 
     /**
      * Format the given LogRecord.
@@ -79,8 +80,9 @@
      *     java.util.Formatter} format string specified in the
      *     {@code java.util.logging.SimpleFormatter.format} property
      *     or the default format.</li>
-     * <li>{@code date} - a {@link Date} object representing
-     *     {@linkplain LogRecord#getMillis event time} of the log record.</li>
+     * <li>{@code date} - a {@link ZonedDateTime} object representing
+     *     {@linkplain LogRecord#getInstant() event time} of the log record
+     *      in the {@link ZoneId#systemDefault()} system time zone.</li>
      * <li>{@code source} - a string representing the caller, if available;
      *     otherwise, the logger's name.</li>
      * <li>{@code logger} - the logger's name.</li>
@@ -129,6 +131,16 @@
      *     Mar 22, 2011 1:11:31 PM MyClass fatal
      *     SEVERE: several message with an exception
      *     </pre></li>
+     * <li> {@code java.util.logging.SimpleFormatter.format="%1$tb %1$td, %1$tY %1$tl:%1$tM:%1$tS.%1$tN %1$Tp %2$s%n%4$s: %5$s%6$s%n"}
+     *      <p>Since JDK 1.9, {@code java.util.logging} uses {@link
+     *         java.time.Clock#systemUTC() java.time} to create more precise time
+     *         stamps.
+     *         The format above can be used to add a {@code .%1$tN} to the
+     *         date/time formatting so that nanoseconds will also be printed:
+     *     <pre>
+     *     Feb 06, 2015 5:33:10.279216000 PM example.Main main
+     *     INFO: This is a test
+     *     </pre></li>
      * </ul>
      * <p>This method can also be overridden in a subclass.
      * It is recommended to use the {@link Formatter#formatMessage}
@@ -137,8 +149,10 @@
      * @param record the log record to be formatted.
      * @return a formatted log record
      */
+    @Override
     public synchronized String format(LogRecord record) {
-        dat.setTime(record.getMillis());
+        ZonedDateTime zdt = ZonedDateTime.ofInstant(
+                record.getInstant(), zoneId);
         String source;
         if (record.getSourceClassName() != null) {
             source = record.getSourceClassName();
@@ -159,7 +173,7 @@
             throwable = sw.toString();
         }
         return String.format(format,
-                             dat,
+                             zdt,
                              source,
                              record.getLoggerName(),
                              record.getLevel().getLocalizedLevelName(),
--- a/jdk/src/java.logging/share/classes/java/util/logging/XMLFormatter.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.logging/share/classes/java/util/logging/XMLFormatter.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,8 +26,9 @@
 
 package java.util.logging;
 
-import java.io.*;
 import java.nio.charset.Charset;
+import java.time.Instant;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 
 /**
@@ -40,11 +41,70 @@
  * but it is recommended that it normally be used with UTF-8.  The
  * character encoding can be set on the output Handler.
  *
+ * @implSpec Since JDK 1.9, instances of {@linkplain LogRecord} contain
+ * an {@link LogRecord#getInstant() Instant} which can have nanoseconds below
+ * the millisecond resolution.
+ * The DTD specification has been updated to allow for an optional
+ * {@code <nanos>} element. By default, the XMLFormatter will compute the
+ * nanosecond adjustment below the millisecond resolution (using
+ * {@code LogRecord.getInstant().getNano() % 1000_000}) - and if this is not 0,
+ * this adjustment value will be printed in the new {@code <nanos>} element.
+ * The event instant can then be reconstructed using
+ * {@code Instant.ofEpochSecond(millis/1000L, (millis % 1000L) * 1000_000L + nanos)}
+ * where {@code millis} and {@code nanos} represent the numbers serialized in
+ * the {@code <millis>} and {@code <nanos>} elements, respectively.
+ * <br>
+ * The {@code <date>} element will now contain the whole instant as formatted
+ * by the {@link DateTimeFormatter#ISO_INSTANT DateTimeFormatter.ISO_INSTANT}
+ * formatter.
+ * <p>
+ * For compatibility with old parsers, XMLFormatters can
+ * be configured to revert to the old format by specifying a
+ * {@code <xml-formatter-fully-qualified-class-name>.useInstant = false}
+ * {@linkplain LogManager#getProperty(java.lang.String) property} in the
+ * logging configuration. When {@code useInstant} is {@code false}, the old
+ * formatting will be preserved. When {@code useInstant} is {@code true}
+ * (the default), the {@code <nanos>} element will be printed and the
+ * {@code <date>} element will contain the {@linkplain
+ * DateTimeFormatter#ISO_INSTANT formatted} instant.
+ * <p>
+ * For instance, in order to configure plain instances of XMLFormatter to omit
+ * the new {@code <nano>} element,
+ * {@code java.util.logging.XMLFormatter.useInstant = false} can be specified
+ * in the logging configuration.
+ *
  * @since 1.4
  */
 
 public class XMLFormatter extends Formatter {
-    private LogManager manager = LogManager.getLogManager();
+    private final LogManager manager = LogManager.getLogManager();
+    private final boolean useInstant;
+
+    /**
+     * Creates a new instance of XMLFormatter.
+     *
+     * @implSpec
+     *    Since JDK 1.9, the XMLFormatter will print out the record {@linkplain
+     *    LogRecord#getInstant() event time} as an Instant. This instant
+     *    has the best resolution available on the system. The {@code <date>}
+     *    element will contain the instant as formatted by the {@link
+     *    DateTimeFormatter#ISO_INSTANT}.
+     *    In addition, an optional {@code <nanos>} element containing a
+     *    nanosecond adjustment will be printed if the instant contains some
+     *    nanoseconds below the millisecond resolution.
+     *    <p>
+     *    This new behavior can be turned off, and the old formatting restored,
+     *    by specifying a property in the {@linkplain
+     *    LogManager#getProperty(java.lang.String) logging configuration}.
+     *    If {@code LogManager.getLogManager().getProperty(
+     *    this.getClass().getName()+".useInstant")} is {@code "false"} or
+     *    {@code "0"}, the old formatting will be restored.
+     */
+    public XMLFormatter() {
+        useInstant = (manager == null)
+            || manager.getBooleanProperty(
+                    this.getClass().getName()+".useInstant", true);
+    }
 
     // Append a two digit number.
     private void a2(StringBuilder sb, int x) {
@@ -102,18 +162,35 @@
      * @param record the log record to be formatted.
      * @return a formatted log record
      */
+    @Override
     public String format(LogRecord record) {
         StringBuilder sb = new StringBuilder(500);
         sb.append("<record>\n");
 
+        final Instant instant = record.getInstant();
+
         sb.append("  <date>");
-        appendISO8601(sb, record.getMillis());
+        if (useInstant) {
+            // If useInstant is true - we will print the instant in the
+            // date field, using the ISO_INSTANT formatter.
+            DateTimeFormatter.ISO_INSTANT.formatTo(instant, sb);
+        } else {
+            // If useInstant is false - we will keep the 'old' formating
+            appendISO8601(sb, instant.toEpochMilli());
+        }
         sb.append("</date>\n");
 
         sb.append("  <millis>");
-        sb.append(record.getMillis());
+        sb.append(instant.toEpochMilli());
         sb.append("</millis>\n");
 
+        final int nanoAdjustment = instant.getNano() % 1000_000;
+        if (useInstant && nanoAdjustment != 0) {
+            sb.append("  <nanos>");
+            sb.append(nanoAdjustment);
+            sb.append("</nanos>\n");
+        }
+
         sb.append("  <sequence>");
         sb.append(record.getSequenceNumber());
         sb.append("</sequence>\n");
@@ -223,6 +300,7 @@
      * @param   h  The target handler (can be null)
      * @return  a valid XML string
      */
+    @Override
     public String getHead(Handler h) {
         StringBuilder sb = new StringBuilder();
         String encoding;
@@ -251,6 +329,7 @@
         sb.append(encoding);
         sb.append("\"");
         sb.append(" standalone=\"no\"?>\n");
+
         sb.append("<!DOCTYPE log SYSTEM \"logger.dtd\">\n");
         sb.append("<log>\n");
         return sb.toString();
@@ -262,6 +341,7 @@
      * @param   h  The target handler (can be null)
      * @return  a valid XML string
      */
+    @Override
     public String getTail(Handler h) {
         return "</log>\n";
     }
--- a/jdk/src/java.management/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.management/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java	Tue Mar 03 08:49:13 2015 -0800
@@ -45,7 +45,7 @@
  * All methods throw a {@code NullPointerException} if any input argument is
  * {@code null} unless it's stated otherwise.
  *
- * @see ManagementFactory#getPlatformMXBeans(Class)
+ * @see java.lang.management.ManagementFactory#getPlatformMXBeans(Class)
  */
 @jdk.Exported
 public interface HotSpotDiagnosticMXBean extends PlatformManagedObject {
--- a/jdk/src/java.management/share/classes/java/lang/management/ThreadInfo.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.management/share/classes/java/lang/management/ThreadInfo.java	Tue Mar 03 08:49:13 2015 -0800
@@ -31,12 +31,13 @@
 import static java.lang.Thread.State.*;
 
 /**
- * Thread information. <tt>ThreadInfo</tt> contains the information
+ * Thread information. {@code ThreadInfo} contains the information
  * about a thread including:
  * <h3>General thread information</h3>
  * <ul>
  *   <li>Thread ID.</li>
  *   <li>Name of the thread.</li>
+ *   <li>Whether a thread is a daemon thread</li>
  * </ul>
  *
  * <h3>Execution information</h3>
@@ -57,6 +58,7 @@
  *   <li>List of object monitors locked by the thread.</li>
  *   <li>List of <a href="LockInfo.html#OwnableSynchronizer">
  *       ownable synchronizers</a> locked by the thread.</li>
+ *   <li>Thread priority</li>
  * </ul>
  *
  * <h4><a name="SyncStats">Synchronization Statistics</a></h4>
@@ -78,7 +80,7 @@
  * the system, not for synchronization control.
  *
  * <h4>MXBean Mapping</h4>
- * <tt>ThreadInfo</tt> is mapped to a {@link CompositeData CompositeData}
+ * {@code ThreadInfo} is mapped to a {@link CompositeData CompositeData}
  * with attributes as specified in
  * the {@link #from from} method.
  *
@@ -100,9 +102,11 @@
     private String       lockName;
     private long         lockOwnerId;
     private String       lockOwnerName;
+    private boolean      daemon;
     private boolean      inNative;
     private boolean      suspended;
     private Thread.State threadState;
+    private int          priority;
     private StackTraceElement[] stackTrace;
     private MonitorInfo[]       lockedMonitors;
     private LockInfo[]          lockedSynchronizers;
@@ -229,6 +233,8 @@
         this.blockedTime = blockedTime;
         this.waitedCount = waitedCount;
         this.waitedTime = waitedTime;
+        this.daemon = t.isDaemon();
+        this.priority = t.getPriority();
 
         if (lockObj == null) {
             this.lock = null;
@@ -256,7 +262,7 @@
     }
 
     /*
-     * Constructs a <tt>ThreadInfo</tt> object from a
+     * Constructs a {@code ThreadInfo} object from a
      * {@link CompositeData CompositeData}.
      */
     private ThreadInfo(CompositeData cd) {
@@ -277,7 +283,7 @@
         stackTrace = ticd.stackTrace();
 
         // 6.0 attributes
-        if (ticd.isCurrentVersion()) {
+        if (ticd.hasV6()) {
             lock = ticd.lockInfo();
             lockedMonitors = ticd.lockedMonitors();
             lockedSynchronizers = ticd.lockedSynchronizers();
@@ -300,10 +306,20 @@
             lockedMonitors = EMPTY_MONITORS;
             lockedSynchronizers = EMPTY_SYNCS;
         }
+
+        // 9.0 attributes
+        if (ticd.isCurrentVersion()) {
+            daemon = ticd.isDaemon();
+            priority = ticd.getPriority();
+        } else {
+            // Not ideal, but unclear what else we can do.
+            daemon = false;
+            priority = Thread.NORM_PRIORITY;
+        }
     }
 
     /**
-     * Returns the ID of the thread associated with this <tt>ThreadInfo</tt>.
+     * Returns the ID of the thread associated with this {@code ThreadInfo}.
      *
      * @return the ID of the associated thread.
      */
@@ -312,7 +328,7 @@
     }
 
     /**
-     * Returns the name of the thread associated with this <tt>ThreadInfo</tt>.
+     * Returns the name of the thread associated with this {@code ThreadInfo}.
      *
      * @return the name of the associated thread.
      */
@@ -321,9 +337,9 @@
     }
 
     /**
-     * Returns the state of the thread associated with this <tt>ThreadInfo</tt>.
+     * Returns the state of the thread associated with this {@code ThreadInfo}.
      *
-     * @return <tt>Thread.State</tt> of the associated thread.
+     * @return {@code Thread.State} of the associated thread.
      */
     public Thread.State getThreadState() {
          return threadState;
@@ -331,13 +347,13 @@
 
     /**
      * Returns the approximate accumulated elapsed time (in milliseconds)
-     * that the thread associated with this <tt>ThreadInfo</tt>
+     * that the thread associated with this {@code ThreadInfo}
      * has blocked to enter or reenter a monitor
      * since thread contention monitoring is enabled.
      * I.e. the total accumulated time the thread has been in the
      * {@link java.lang.Thread.State#BLOCKED BLOCKED} state since thread
      * contention monitoring was last enabled.
-     * This method returns <tt>-1</tt> if thread contention monitoring
+     * This method returns {@code -1} if thread contention monitoring
      * is disabled.
      *
      * <p>The Java virtual machine may measure the time with a high
@@ -345,8 +361,8 @@
      * the thread contention monitoring is reenabled.
      *
      * @return the approximate accumulated elapsed time in milliseconds
-     * that a thread entered the <tt>BLOCKED</tt> state;
-     * <tt>-1</tt> if thread contention monitoring is disabled.
+     * that a thread entered the {@code BLOCKED} state;
+     * {@code -1} if thread contention monitoring is disabled.
      *
      * @throws java.lang.UnsupportedOperationException if the Java
      * virtual machine does not support this operation.
@@ -360,13 +376,13 @@
 
     /**
      * Returns the total number of times that
-     * the thread associated with this <tt>ThreadInfo</tt>
+     * the thread associated with this {@code ThreadInfo}
      * blocked to enter or reenter a monitor.
      * I.e. the number of times a thread has been in the
      * {@link java.lang.Thread.State#BLOCKED BLOCKED} state.
      *
      * @return the total number of times that the thread
-     * entered the <tt>BLOCKED</tt> state.
+     * entered the {@code BLOCKED} state.
      */
     public long getBlockedCount() {
         return blockedCount;
@@ -374,14 +390,14 @@
 
     /**
      * Returns the approximate accumulated elapsed time (in milliseconds)
-     * that the thread associated with this <tt>ThreadInfo</tt>
+     * that the thread associated with this {@code ThreadInfo}
      * has waited for notification
      * since thread contention monitoring is enabled.
      * I.e. the total accumulated time the thread has been in the
      * {@link java.lang.Thread.State#WAITING WAITING}
      * or {@link java.lang.Thread.State#TIMED_WAITING TIMED_WAITING} state
      * since thread contention monitoring is enabled.
-     * This method returns <tt>-1</tt> if thread contention monitoring
+     * This method returns {@code -1} if thread contention monitoring
      * is disabled.
      *
      * <p>The Java virtual machine may measure the time with a high
@@ -389,9 +405,9 @@
      * the thread contention monitoring is reenabled.
      *
      * @return the approximate accumulated elapsed time in milliseconds
-     * that a thread has been in the <tt>WAITING</tt> or
-     * <tt>TIMED_WAITING</tt> state;
-     * <tt>-1</tt> if thread contention monitoring is disabled.
+     * that a thread has been in the {@code WAITING} or
+     * {@code TIMED_WAITING} state;
+     * {@code -1} if thread contention monitoring is disabled.
      *
      * @throws java.lang.UnsupportedOperationException if the Java
      * virtual machine does not support this operation.
@@ -405,29 +421,29 @@
 
     /**
      * Returns the total number of times that
-     * the thread associated with this <tt>ThreadInfo</tt>
+     * the thread associated with this {@code ThreadInfo}
      * waited for notification.
      * I.e. the number of times that a thread has been
      * in the {@link java.lang.Thread.State#WAITING WAITING}
      * or {@link java.lang.Thread.State#TIMED_WAITING TIMED_WAITING} state.
      *
      * @return the total number of times that the thread
-     * was in the <tt>WAITING</tt> or <tt>TIMED_WAITING</tt> state.
+     * was in the {@code WAITING} or {@code TIMED_WAITING} state.
      */
     public long getWaitedCount() {
         return waitedCount;
     }
 
     /**
-     * Returns the <tt>LockInfo</tt> of an object for which
-     * the thread associated with this <tt>ThreadInfo</tt>
+     * Returns the {@code LockInfo} of an object for which
+     * the thread associated with this {@code ThreadInfo}
      * is blocked waiting.
      * A thread can be blocked waiting for one of the following:
      * <ul>
      * <li>an object monitor to be acquired for entering or reentering
      *     a synchronization block/method.
      *     <br>The thread is in the {@link java.lang.Thread.State#BLOCKED BLOCKED}
-     *     state waiting to enter the <tt>synchronized</tt> statement
+     *     state waiting to enter the {@code synchronized} statement
      *     or method.
      *     </li>
      * <li>an object monitor to be notified by another thread.
@@ -448,11 +464,11 @@
      *     or a {@link java.util.concurrent.locks.Condition Condition}.</li>
      * </ul>
      *
-     * <p>This method returns <tt>null</tt> if the thread is not in any of
+     * <p>This method returns {@code null} if the thread is not in any of
      * the above conditions.
      *
-     * @return <tt>LockInfo</tt> of an object for which the thread
-     *         is blocked waiting if any; <tt>null</tt> otherwise.
+     * @return {@code LockInfo} of an object for which the thread
+     *         is blocked waiting if any; {@code null} otherwise.
      * @since 1.6
      */
     public LockInfo getLockInfo() {
@@ -462,19 +478,19 @@
     /**
      * Returns the {@link LockInfo#toString string representation}
      * of an object for which the thread associated with this
-     * <tt>ThreadInfo</tt> is blocked waiting.
+     * {@code ThreadInfo} is blocked waiting.
      * This method is equivalent to calling:
      * <blockquote>
      * <pre>
      * getLockInfo().toString()
      * </pre></blockquote>
      *
-     * <p>This method will return <tt>null</tt> if this thread is not blocked
+     * <p>This method will return {@code null} if this thread is not blocked
      * waiting for any object or if the object is not owned by any thread.
      *
      * @return the string representation of the object on which
      * the thread is blocked if any;
-     * <tt>null</tt> otherwise.
+     * {@code null} otherwise.
      *
      * @see #getLockInfo
      */
@@ -484,14 +500,14 @@
 
     /**
      * Returns the ID of the thread which owns the object
-     * for which the thread associated with this <tt>ThreadInfo</tt>
+     * for which the thread associated with this {@code ThreadInfo}
      * is blocked waiting.
-     * This method will return <tt>-1</tt> if this thread is not blocked
+     * This method will return {@code -1} if this thread is not blocked
      * waiting for any object or if the object is not owned by any thread.
      *
      * @return the thread ID of the owner thread of the object
      * this thread is blocked on;
-     * <tt>-1</tt> if this thread is not blocked
+     * {@code -1} if this thread is not blocked
      * or if the object is not owned by any thread.
      *
      * @see #getLockInfo
@@ -502,14 +518,14 @@
 
     /**
      * Returns the name of the thread which owns the object
-     * for which the thread associated with this <tt>ThreadInfo</tt>
+     * for which the thread associated with this {@code ThreadInfo}
      * is blocked waiting.
-     * This method will return <tt>null</tt> if this thread is not blocked
+     * This method will return {@code null} if this thread is not blocked
      * waiting for any object or if the object is not owned by any thread.
      *
      * @return the name of the thread that owns the object
      * this thread is blocked on;
-     * <tt>null</tt> if this thread is not blocked
+     * {@code null} if this thread is not blocked
      * or if the object is not owned by any thread.
      *
      * @see #getLockInfo
@@ -520,7 +536,7 @@
 
     /**
      * Returns the stack trace of the thread
-     * associated with this <tt>ThreadInfo</tt>.
+     * associated with this {@code ThreadInfo}.
      * If no stack trace was requested for this thread info, this method
      * will return a zero-length array.
      * If the returned array is of non-zero length then the first element of
@@ -532,42 +548,67 @@
      * <p>Some Java virtual machines may, under some circumstances, omit one
      * or more stack frames from the stack trace.  In the extreme case,
      * a virtual machine that has no stack trace information concerning
-     * the thread associated with this <tt>ThreadInfo</tt>
+     * the thread associated with this {@code ThreadInfo}
      * is permitted to return a zero-length array from this method.
      *
-     * @return an array of <tt>StackTraceElement</tt> objects of the thread.
+     * @return an array of {@code StackTraceElement} objects of the thread.
      */
     public StackTraceElement[] getStackTrace() {
         return stackTrace;
     }
 
     /**
-     * Tests if the thread associated with this <tt>ThreadInfo</tt>
-     * is suspended.  This method returns <tt>true</tt> if
+     * Tests if the thread associated with this {@code ThreadInfo}
+     * is suspended.  This method returns {@code true} if
      * {@link Thread#suspend} has been called.
      *
-     * @return <tt>true</tt> if the thread is suspended;
-     *         <tt>false</tt> otherwise.
+     * @return {@code true} if the thread is suspended;
+     *         {@code false} otherwise.
      */
     public boolean isSuspended() {
          return suspended;
     }
 
     /**
-     * Tests if the thread associated with this <tt>ThreadInfo</tt>
+     * Tests if the thread associated with this {@code ThreadInfo}
      * is executing native code via the Java Native Interface (JNI).
      * The JNI native code does not include
      * the virtual machine support code or the compiled native
      * code generated by the virtual machine.
      *
-     * @return <tt>true</tt> if the thread is executing native code;
-     *         <tt>false</tt> otherwise.
+     * @return {@code true} if the thread is executing native code;
+     *         {@code false} otherwise.
      */
     public boolean isInNative() {
          return inNative;
     }
 
     /**
+     * Tests if the thread associated with this {@code ThreadInfo} is
+     * a {@linkplain Thread#isDaemon daemon thread}.
+     *
+     * @return {@code true} if the thread is a daemon thread,
+     *         {@code false} otherwise.
+     * @see Thread#isDaemon
+     * @since 1.9
+     */
+    public boolean isDaemon() {
+         return daemon;
+    }
+
+    /**
+     * Returns the {@linkplain Thread#getPriority() thread priority} of the
+     * thread associated with this {@code ThreadInfo}.
+     *
+     * @return The priority of the thread associated with this
+     *         {@code ThreadInfo}.
+     * @since 1.9
+     */
+    public int getPriority() {
+         return priority;
+    }
+
+    /**
      * Returns a string representation of this thread info.
      * The format of this string depends on the implementation.
      * The returned string will typically include
@@ -580,6 +621,8 @@
      */
     public String toString() {
         StringBuilder sb = new StringBuilder("\"" + getThreadName() + "\"" +
+                                             (daemon ? " daemon" : "") +
+                                             " prio=" + priority +
                                              " Id=" + getThreadId() + " " +
                                              getThreadState());
         if (getLockName() != null) {
@@ -647,9 +690,9 @@
     private static final int MAX_FRAMES = 8;
 
     /**
-     * Returns a <tt>ThreadInfo</tt> object represented by the
-     * given <tt>CompositeData</tt>.
-     * The given <tt>CompositeData</tt> must contain the following attributes
+     * Returns a {@code ThreadInfo} object represented by the
+     * given {@code CompositeData}.
+     * The given {@code CompositeData} must contain the following attributes
      * unless otherwise specified below:
      * <blockquote>
      * <table border summary="The attributes and their types the given CompositeData contains">
@@ -659,67 +702,67 @@
      * </tr>
      * <tr>
      *   <td>threadId</td>
-     *   <td><tt>java.lang.Long</tt></td>
+     *   <td>{@code java.lang.Long}</td>
      * </tr>
      * <tr>
      *   <td>threadName</td>
-     *   <td><tt>java.lang.String</tt></td>
+     *   <td>{@code java.lang.String}</td>
      * </tr>
      * <tr>
      *   <td>threadState</td>
-     *   <td><tt>java.lang.String</tt></td>
+     *   <td>{@code java.lang.String}</td>
      * </tr>
      * <tr>
      *   <td>suspended</td>
-     *   <td><tt>java.lang.Boolean</tt></td>
+     *   <td>{@code java.lang.Boolean}</td>
      * </tr>
      * <tr>
      *   <td>inNative</td>
-     *   <td><tt>java.lang.Boolean</tt></td>
+     *   <td>{@code java.lang.Boolean}</td>
      * </tr>
      * <tr>
      *   <td>blockedCount</td>
-     *   <td><tt>java.lang.Long</tt></td>
+     *   <td>{@code java.lang.Long}</td>
      * </tr>
      * <tr>
      *   <td>blockedTime</td>
-     *   <td><tt>java.lang.Long</tt></td>
+     *   <td>{@code java.lang.Long}</td>
      * </tr>
      * <tr>
      *   <td>waitedCount</td>
-     *   <td><tt>java.lang.Long</tt></td>
+     *   <td>{@code java.lang.Long}</td>
      * </tr>
      * <tr>
      *   <td>waitedTime</td>
-     *   <td><tt>java.lang.Long</tt></td>
+     *   <td>{@code java.lang.Long}</td>
      * </tr>
      * <tr>
      *   <td>lockInfo</td>
-     *   <td><tt>javax.management.openmbean.CompositeData</tt>
+     *   <td>{@code javax.management.openmbean.CompositeData}
      *       - the mapped type for {@link LockInfo} as specified in the
      *         {@link LockInfo#from} method.
      *       <p>
-     *       If <tt>cd</tt> does not contain this attribute,
-     *       the <tt>LockInfo</tt> object will be constructed from
-     *       the value of the <tt>lockName</tt> attribute. </td>
+     *       If {@code cd} does not contain this attribute,
+     *       the {@code LockInfo} object will be constructed from
+     *       the value of the {@code lockName} attribute. </td>
      * </tr>
      * <tr>
      *   <td>lockName</td>
-     *   <td><tt>java.lang.String</tt></td>
+     *   <td>{@code java.lang.String}</td>
      * </tr>
      * <tr>
      *   <td>lockOwnerId</td>
-     *   <td><tt>java.lang.Long</tt></td>
+     *   <td>{@code java.lang.Long}</td>
      * </tr>
      * <tr>
      *   <td>lockOwnerName</td>
-     *   <td><tt>java.lang.String</tt></td>
+     *   <td>{@code java.lang.String}</td>
      * </tr>
      * <tr>
      *   <td><a name="StackTrace">stackTrace</a></td>
-     *   <td><tt>javax.management.openmbean.CompositeData[]</tt>
+     *   <td>{@code javax.management.openmbean.CompositeData[]}
      *       <p>
-     *       Each element is a <tt>CompositeData</tt> representing
+     *       Each element is a {@code CompositeData} representing
      *       StackTraceElement containing the following attributes:
      *       <blockquote>
      *       <table cellspacing=1 cellpadding=0 summary="The attributes and their types the given CompositeData contains">
@@ -729,23 +772,23 @@
      *       </tr>
      *       <tr>
      *         <td>className</td>
-     *         <td><tt>java.lang.String</tt></td>
+     *         <td>{@code java.lang.String}</td>
      *       </tr>
      *       <tr>
      *         <td>methodName</td>
-     *         <td><tt>java.lang.String</tt></td>
+     *         <td>{@code java.lang.String}</td>
      *       </tr>
      *       <tr>
      *         <td>fileName</td>
-     *         <td><tt>java.lang.String</tt></td>
+     *         <td>{@code java.lang.String}</td>
      *       </tr>
      *       <tr>
      *         <td>lineNumber</td>
-     *         <td><tt>java.lang.Integer</tt></td>
+     *         <td>{@code java.lang.Integer}</td>
      *       </tr>
      *       <tr>
      *         <td>nativeMethod</td>
-     *         <td><tt>java.lang.Boolean</tt></td>
+     *         <td>{@code java.lang.Boolean}</td>
      *       </tr>
      *       </table>
      *       </blockquote>
@@ -753,35 +796,43 @@
      * </tr>
      * <tr>
      *   <td>lockedMonitors</td>
-     *   <td><tt>javax.management.openmbean.CompositeData[]</tt>
+     *   <td>{@code javax.management.openmbean.CompositeData[]}
      *       whose element type is the mapped type for
      *       {@link MonitorInfo} as specified in the
      *       {@link MonitorInfo#from Monitor.from} method.
      *       <p>
-     *       If <tt>cd</tt> does not contain this attribute,
+     *       If {@code cd} does not contain this attribute,
      *       this attribute will be set to an empty array. </td>
      * </tr>
      * <tr>
      *   <td>lockedSynchronizers</td>
-     *   <td><tt>javax.management.openmbean.CompositeData[]</tt>
+     *   <td>{@code javax.management.openmbean.CompositeData[]}
      *       whose element type is the mapped type for
      *       {@link LockInfo} as specified in the {@link LockInfo#from} method.
      *       <p>
-     *       If <tt>cd</tt> does not contain this attribute,
+     *       If {@code cd} does not contain this attribute,
      *       this attribute will be set to an empty array. </td>
      * </tr>
+     * <tr>
+     *   <td>daemon</td>
+     *   <td>{@code java.lang.Boolean}</td>
+     * </tr>
+     * <tr>
+     *   <td>priority</td>
+     *   <td>{@code java.lang.Integer}</td>
+     * </tr>
      * </table>
      * </blockquote>
      *
-     * @param cd <tt>CompositeData</tt> representing a <tt>ThreadInfo</tt>
+     * @param cd {@code CompositeData} representing a {@code ThreadInfo}
      *
-     * @throws IllegalArgumentException if <tt>cd</tt> does not
-     *   represent a <tt>ThreadInfo</tt> with the attributes described
+     * @throws IllegalArgumentException if {@code cd} does not
+     *   represent a {@code ThreadInfo} with the attributes described
      *   above.
      *
-     * @return a <tt>ThreadInfo</tt> object represented
-     *         by <tt>cd</tt> if <tt>cd</tt> is not <tt>null</tt>;
-     *         <tt>null</tt> otherwise.
+     * @return a {@code ThreadInfo} object represented
+     *         by {@code cd} if {@code cd} is not {@code null};
+     *         {@code null} otherwise.
      */
     public static ThreadInfo from(CompositeData cd) {
         if (cd == null) {
@@ -798,12 +849,12 @@
     /**
      * Returns an array of {@link MonitorInfo} objects, each of which
      * represents an object monitor currently locked by the thread
-     * associated with this <tt>ThreadInfo</tt>.
+     * associated with this {@code ThreadInfo}.
      * If no locked monitor was requested for this thread info or
      * no monitor is locked by the thread, this method
      * will return a zero-length array.
      *
-     * @return an array of <tt>MonitorInfo</tt> objects representing
+     * @return an array of {@code MonitorInfo} objects representing
      *         the object monitors locked by the thread.
      *
      * @since 1.6
@@ -816,11 +867,11 @@
      * Returns an array of {@link LockInfo} objects, each of which
      * represents an <a href="LockInfo.html#OwnableSynchronizer">ownable
      * synchronizer</a> currently locked by the thread associated with
-     * this <tt>ThreadInfo</tt>.  If no locked synchronizer was
+     * this {@code ThreadInfo}.  If no locked synchronizer was
      * requested for this thread info or no synchronizer is locked by
      * the thread, this method will return a zero-length array.
      *
-     * @return an array of <tt>LockInfo</tt> objects representing
+     * @return an array of {@code LockInfo} objects representing
      *         the ownable synchronizers locked by the thread.
      *
      * @since 1.6
--- a/jdk/src/java.management/share/classes/sun/management/ThreadInfoCompositeData.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/java.management/share/classes/sun/management/ThreadInfoCompositeData.java	Tue Mar 03 08:49:13 2015 -0800
@@ -43,23 +43,30 @@
     private final ThreadInfo threadInfo;
     private final CompositeData cdata;
     private final boolean currentVersion;
+    private final boolean hasV6;
 
     private ThreadInfoCompositeData(ThreadInfo ti) {
         this.threadInfo = ti;
         this.currentVersion = true;
         this.cdata = null;
+        this.hasV6 = true;
     }
 
     private ThreadInfoCompositeData(CompositeData cd) {
         this.threadInfo = null;
         this.currentVersion = ThreadInfoCompositeData.isCurrentVersion(cd);
         this.cdata = cd;
+        this.hasV6 = ThreadInfoCompositeData.hasV6(cd);
     }
 
     public ThreadInfo getThreadInfo() {
         return threadInfo;
     }
 
+    public boolean hasV6() {
+        return hasV6;
+    }
+
     public boolean isCurrentVersion() {
         return currentVersion;
     }
@@ -124,6 +131,8 @@
                 threadInfo.isInNative(),
             lockedMonitorsData,
             lockedSyncsData,
+            threadInfo.isDaemon(),
+            threadInfo.getPriority(),
         };
 
         try {
@@ -151,6 +160,8 @@
     private static final String STACK_TRACE     = "stackTrace";
     private static final String SUSPENDED       = "suspended";
     private static final String IN_NATIVE       = "inNative";
+    private static final String DAEMON          = "daemon";
+    private static final String PRIORITY        = "priority";
     private static final String LOCKED_MONITORS = "lockedMonitors";
     private static final String LOCKED_SYNCS    = "lockedSynchronizers";
 
@@ -171,6 +182,8 @@
         IN_NATIVE,
         LOCKED_MONITORS,
         LOCKED_SYNCS,
+        DAEMON,
+        PRIORITY,
     };
 
     // New attributes added in 6.0 ThreadInfo
@@ -180,9 +193,16 @@
         LOCKED_SYNCS,
     };
 
+    private static final String[] threadInfoV9Attributes = {
+        DAEMON,
+        PRIORITY,
+    };
+
     // Current version of ThreadInfo
     private static final CompositeType threadInfoCompositeType;
     // Previous version of ThreadInfo
+    private static final CompositeType threadInfoV6CompositeType;
+    // Previous-previous version of ThreadInfo
     private static final CompositeType threadInfoV5CompositeType;
     private static final CompositeType lockInfoCompositeType;
     static {
@@ -193,7 +213,7 @@
             String[] itemNames =
                 threadInfoCompositeType.keySet().toArray(new String[0]);
             int numV5Attributes = threadInfoItemNames.length -
-                                      threadInfoV6Attributes.length;
+                threadInfoV6Attributes.length - threadInfoV9Attributes.length;
             String[] v5ItemNames = new String[numV5Attributes];
             String[] v5ItemDescs = new String[numV5Attributes];
             OpenType<?>[] v5ItemTypes = new OpenType<?>[numV5Attributes];
@@ -213,6 +233,31 @@
                                   v5ItemNames,
                                   v5ItemDescs,
                                   v5ItemTypes);
+
+
+            // Form a CompositeType for JDK 6.0 ThreadInfo version
+            int numV6Attributes = threadInfoItemNames.length -
+                                      threadInfoV9Attributes.length;
+            String[] v6ItemNames = new String[numV6Attributes];
+            String[] v6ItemDescs = new String[numV6Attributes];
+            OpenType<?>[] v6ItemTypes = new OpenType<?>[numV6Attributes];
+            i = 0;
+            for (String n : itemNames) {
+                if (isV5Attribute(n) || isV6Attribute(n)) {
+                    v6ItemNames[i] = n;
+                    v6ItemDescs[i] = threadInfoCompositeType.getDescription(n);
+                    v6ItemTypes[i] = threadInfoCompositeType.getType(n);
+                    i++;
+                }
+            }
+
+            threadInfoV6CompositeType =
+                new CompositeType("java.lang.management.ThreadInfo",
+                                  "Java SE 6 java.lang.management.ThreadInfo",
+                                  v6ItemNames,
+                                  v6ItemDescs,
+                                  v6ItemTypes);
+
         } catch (OpenDataException e) {
             // Should never reach here
             throw new AssertionError(e);
@@ -236,6 +281,20 @@
                 return false;
             }
         }
+        for (String n : threadInfoV9Attributes) {
+            if (itemName.equals(n)) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    private static boolean isV6Attribute(String itemName) {
+        for (String n : threadInfoV9Attributes) {
+            if (itemName.equals(n)) {
+                return false;
+            }
+        }
         return true;
     }
 
@@ -247,6 +306,15 @@
         return isTypeMatched(threadInfoCompositeType, cd.getCompositeType());
     }
 
+    private static boolean hasV6(CompositeData cd) {
+        if (cd == null) {
+            throw new NullPointerException("Null CompositeData");
+        }
+
+        return isTypeMatched(threadInfoCompositeType, cd.getCompositeType()) ||
+               isTypeMatched(threadInfoV6CompositeType, cd.getCompositeType());
+     }
+
     public long threadId() {
         return getLong(cdata, THREAD_ID);
     }
@@ -304,6 +372,14 @@
         return getBoolean(cdata, IN_NATIVE);
     }
 
+    public boolean isDaemon() {
+        return getBoolean(cdata, DAEMON);
+    }
+
+    public int getPriority(){
+        return getInt(cdata, PRIORITY);
+    }
+
     public StackTraceElement[] stackTrace() {
         CompositeData[] stackTraceData =
             (CompositeData[]) cdata.get(STACK_TRACE);
@@ -368,9 +444,10 @@
         if (!isTypeMatched(threadInfoCompositeType, type)) {
             currentVersion = false;
             // check if cd is an older version
-            if (!isTypeMatched(threadInfoV5CompositeType, type)) {
-                throw new IllegalArgumentException(
-                    "Unexpected composite type for ThreadInfo");
+            if (!isTypeMatched(threadInfoV5CompositeType, type) &&
+                !isTypeMatched(threadInfoV6CompositeType, type)) {
+              throw new IllegalArgumentException(
+                  "Unexpected composite type for ThreadInfo");
             }
         }
 
--- a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AttachOperationFailedException.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AttachOperationFailedException.java	Tue Mar 03 08:49:13 2015 -0800
@@ -46,7 +46,7 @@
      * Constructs an <code>AttachOperationFailedException</code> with
      * the specified detail message.
      *
-     * @param   s   the detail message.
+     * @param message the detail message.
      */
     public AttachOperationFailedException(String message) {
         super(message);
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_TW.java	Mon Feb 23 10:47:32 2015 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,546 +0,0 @@
-/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.nio.cs.ext;
-
-import java.io.*;
-import java.nio.CharBuffer;
-import java.nio.ByteBuffer;
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CharsetEncoder;
-import java.nio.charset.CoderResult;
-import java.util.Arrays;
-import sun.nio.cs.HistoricallyNamedCharset;
-import static sun.nio.cs.CharsetMapping.*;
-
-public class EUC_TW extends Charset implements HistoricallyNamedCharset
-{
-    private static final int SS2 = 0x8E;
-
-    /*
-       (1) EUC_TW
-       Second byte of EUC_TW for cs2 is in range of
-       0xA1-0xB0 for plane 1-16. According to CJKV /163,
-       plane1 is coded in both cs1 and cs2. This impl
-       however does not decode the codepoints of plane1
-       in cs2, so only p2-p7 and p15 are supported in cs2.
-
-       Plane2  0xA2;
-       Plane3  0xA3;
-       Plane4  0xA4;
-       Plane5  0xA5;
-       Plane6  0xA6;
-       Plane7  0xA7;
-       Plane15 0xAF;
-
-       (2) Mapping
-       The fact that all supplementary characters encoded in EUC_TW are
-       in 0x2xxxx range gives us the room to optimize the data tables.
-
-       Decoding:
-       (1) save the lower 16-bit value of all codepoints of b->c mapping
-           in a String array table  String[plane] b2c.
-       (2) save "codepoint is supplementary" info (one bit) in a
-           byte[] b2cIsSupp, so 8 codepoints (same codepoint value, different
-           plane No) share one byte.
-
-       Encoding:
-       (1)c->b mappings are stored in
-          char[]c2b/char[]c2bIndex
-          char[]c2bSupp/char[]c2bIndexsupp  (indexed by lower 16-bit
-       (2)byte[] c2bPlane stores the "plane info" of each euc-tw codepoints,
-          BMP and Supp share the low/high 4 bits of one byte.
-
-       Mapping tables are stored separated in EUC_TWMapping, which
-       is generated by tool.
-     */
-
-    public EUC_TW() {
-        super("x-EUC-TW", ExtendedCharsets.aliasesFor("x-EUC-TW"));
-    }
-
-    public String historicalName() {
-        return "EUC_TW";
-    }
-
-    public boolean contains(Charset cs) {
-        return ((cs.name().equals("US-ASCII"))
-                || (cs instanceof EUC_TW));
-    }
-
-    public CharsetDecoder newDecoder() {
-        return new Decoder(this);
-    }
-
-    public CharsetEncoder newEncoder() {
-        return new Encoder(this);
-    }
-
-    public static class Decoder extends CharsetDecoder {
-        public Decoder(Charset cs) {
-            super(cs, 2.0f, 2.0f);
-        }
-
-        char[] c1 = new char[1];
-        char[] c2 = new char[2];
-        public char[] toUnicode(int b1, int b2, int p) {
-            return decode(b1, b2, p, c1, c2);
-        }
-
-        static final String[] b2c =  EUC_TWMapping.b2c;
-        static final int b1Min    =  EUC_TWMapping.b1Min;
-        static final int b1Max    =  EUC_TWMapping.b1Max;
-        static final int b2Min    =  EUC_TWMapping.b2Min;
-        static final int b2Max    =  EUC_TWMapping.b2Max;
-        static final int dbSegSize = b2Max - b2Min + 1;
-        static final byte[] b2cIsSupp;
-
-        // adjust from cns planeNo to the plane index of b2c
-        static final byte[] cnspToIndex = new byte[0x100];
-        static {
-            Arrays.fill(cnspToIndex, (byte)-1);
-            cnspToIndex[0xa2] = 1; cnspToIndex[0xa3] = 2; cnspToIndex[0xa4] = 3;
-            cnspToIndex[0xa5] = 4; cnspToIndex[0xa6] = 5; cnspToIndex[0xa7] = 6;
-            cnspToIndex[0xaf] = 7;
-        }
-
-        //static final BitSet b2cIsSupp;
-        static {
-            String b2cIsSuppStr = EUC_TWMapping.b2cIsSuppStr;
-            // work on a local copy is much faster than operate
-            // directly on b2cIsSupp
-            byte[] flag = new byte[b2cIsSuppStr.length() << 1];
-            int off = 0;
-            for (int i = 0; i < b2cIsSuppStr.length(); i++) {
-                char c = b2cIsSuppStr.charAt(i);
-                flag[off++] = (byte)(c >> 8);
-                flag[off++] = (byte)(c & 0xff);
-            }
-            b2cIsSupp = flag;
-        }
-
-        static boolean isLegalDB(int b) {
-           return b >= b1Min && b <= b1Max;
-        }
-
-        static char[] decode(int b1, int b2, int p, char[] c1, char[] c2)
-        {
-            if (b1 < b1Min || b1 > b1Max || b2 < b2Min || b2 > b2Max)
-                return null;
-            int index = (b1 - b1Min) * dbSegSize + b2 - b2Min;
-            char c = b2c[p].charAt(index);
-            if (c == UNMAPPABLE_DECODING)
-                return null;
-            if ((b2cIsSupp[index] & (1 << p)) == 0) {
-                c1[0] = c;
-                return c1;
-            } else {
-                c2[0] = Character.highSurrogate(0x20000 + c);
-                c2[1] = Character.lowSurrogate(0x20000 + c);
-                return c2;
-            }
-        }
-
-        private CoderResult decodeArrayLoop(ByteBuffer src,
-                                            CharBuffer dst)
-        {
-            byte[] sa = src.array();
-            int sp = src.arrayOffset() + src.position();
-            int sl = src.arrayOffset() + src.limit();
-
-            char[] da = dst.array();
-            int dp = dst.arrayOffset() + dst.position();
-            int dl = dst.arrayOffset() + dst.limit();
-            try {
-                while (sp < sl) {
-                    int byte1 = sa[sp] & 0xff;
-                    if (byte1 == SS2) { // Codeset 2  G2
-                        if ( sl - sp < 4)
-                            return CoderResult.UNDERFLOW;
-                        int cnsPlane = cnspToIndex[sa[sp + 1] & 0xff];
-                        if (cnsPlane < 0)
-                            return CoderResult.malformedForLength(2);
-                        byte1 = sa[sp + 2] & 0xff;
-                        int byte2 = sa[sp + 3] & 0xff;
-                        char[] cc = toUnicode(byte1, byte2, cnsPlane);
-                        if (cc == null) {
-                            if (!isLegalDB(byte1) || !isLegalDB(byte2))
-                                return CoderResult.malformedForLength(4);
-                            return CoderResult.unmappableForLength(4);
-                        }
-                        if (dl - dp < cc.length)
-                            return CoderResult.OVERFLOW;
-                        if (cc.length == 1) {
-                            da[dp++] = cc[0];
-                        } else {
-                            da[dp++] = cc[0];
-                            da[dp++] = cc[1];
-                        }
-                        sp += 4;
-                    } else if (byte1 < 0x80) {  // ASCII      G0
-                        if (dl - dp < 1)
-                           return CoderResult.OVERFLOW;
-                        da[dp++] = (char) byte1;
-                        sp++;
-                    } else {                    // Codeset 1  G1
-                        if ( sl - sp < 2)
-                            return CoderResult.UNDERFLOW;
-                        int byte2 = sa[sp + 1] & 0xff;
-                        char[] cc = toUnicode(byte1, byte2, 0);
-                        if (cc == null) {
-                            if (!isLegalDB(byte1) || !isLegalDB(byte2))
-                                return CoderResult.malformedForLength(1);
-                            return CoderResult.unmappableForLength(2);
-                        }
-                        if (dl - dp < 1)
-                            return CoderResult.OVERFLOW;
-                        da[dp++] = cc[0];
-                        sp += 2;
-                    }
-                }
-                return CoderResult.UNDERFLOW;
-            } finally {
-                src.position(sp - src.arrayOffset());
-                dst.position(dp - dst.arrayOffset());
-            }
-        }
-
-        private CoderResult decodeBufferLoop(ByteBuffer src,
-                                             CharBuffer dst)
-        {
-            int mark = src.position();
-            try {
-                while (src.hasRemaining()) {
-                    int byte1 = src.get() & 0xff;
-                    if (byte1 == SS2) {            // Codeset 2  G2
-                        if ( src.remaining() < 3)
-                            return CoderResult.UNDERFLOW;
-                        int cnsPlane = cnspToIndex[src.get() & 0xff];
-                        if (cnsPlane < 0)
-                            return CoderResult.malformedForLength(2);
-                        byte1 = src.get() & 0xff;
-                        int byte2 = src.get() & 0xff;
-                        char[] cc = toUnicode(byte1, byte2, cnsPlane);
-                        if (cc == null) {
-                            if (!isLegalDB(byte1) || !isLegalDB(byte2))
-                                return CoderResult.malformedForLength(4);
-                            return CoderResult.unmappableForLength(4);
-                        }
-                        if (dst.remaining() < cc.length)
-                            return CoderResult.OVERFLOW;
-                        if (cc.length == 1) {
-                            dst.put(cc[0]);
-                        } else {
-                            dst.put(cc[0]);
-                            dst.put(cc[1]);
-                        }
-                        mark += 4;
-                    } else if (byte1 < 0x80) {        // ASCII      G0
-                        if (!dst.hasRemaining())
-                           return CoderResult.OVERFLOW;
-                        dst.put((char) byte1);
-                        mark++;
-                    } else {                          // Codeset 1  G1
-                        if (!src.hasRemaining())
-                            return CoderResult.UNDERFLOW;
-                        int byte2 = src.get() & 0xff;
-                        char[] cc = toUnicode(byte1, byte2, 0);
-                        if (cc == null) {
-                            if (!isLegalDB(byte1) || !isLegalDB(byte2))
-                                return CoderResult.malformedForLength(1);
-                            return CoderResult.unmappableForLength(2);
-                        }
-                        if (!dst.hasRemaining())
-                            return CoderResult.OVERFLOW;
-                        dst.put(cc[0]);
-                        mark +=2;
-                    }
-               }
-               return CoderResult.UNDERFLOW;
-            } finally {
-                src.position(mark);
-            }
-        }
-
-        protected CoderResult decodeLoop(ByteBuffer src, CharBuffer dst)
-        {
-            if (src.hasArray() && dst.hasArray())
-                return decodeArrayLoop(src, dst);
-            else
-                return decodeBufferLoop(src, dst);
-        }
-    }
-
-    public static class Encoder extends CharsetEncoder {
-        private byte[] bb = new byte[4];
-
-        public Encoder(Charset cs) {
-            super(cs, 4.0f, 4.0f);
-        }
-
-        public boolean canEncode(char c) {
-            return (c <= '\u007f' || toEUC(c, bb) != -1);
-        }
-
-        public boolean canEncode(CharSequence cs) {
-            int i = 0;
-            while (i < cs.length()) {
-                char c = cs.charAt(i++);
-                if (Character.isHighSurrogate(c)) {
-                    if (i == cs.length())
-                        return false;
-                    char low = cs.charAt(i++);
-                    if (!Character.isLowSurrogate(low) || toEUC(c, low, bb) == -1)
-                        return false;
-                } else if (!canEncode(c)) {
-                    return false;
-                }
-            }
-            return true;
-        }
-
-        public int toEUC(char hi, char low, byte[] bb) {
-            return encode(hi, low, bb);
-        }
-
-        public int toEUC(char c, byte[] bb) {
-            return encode(c, bb);
-        }
-
-        private CoderResult encodeArrayLoop(CharBuffer src,
-                                            ByteBuffer dst)
-        {
-            char[] sa = src.array();
-            int sp = src.arrayOffset() + src.position();
-            int sl = src.arrayOffset() + src.limit();
-
-            byte[] da = dst.array();
-            int dp = dst.arrayOffset() + dst.position();
-            int dl = dst.arrayOffset() + dst.limit();
-
-            int inSize;
-            int outSize;
-
-            try {
-                while (sp < sl) {
-                    char c = sa[sp];
-                    inSize = 1;
-                    if (c < 0x80) {  // ASCII
-                        bb[0] = (byte)c;
-                        outSize = 1;
-                    } else {
-                        outSize = toEUC(c, bb);
-                        if (outSize == -1) {
-                            // to check surrogates only after BMP failed
-                            // has the benefit of improving the BMP encoding
-                            // 10% faster, with the price of the slowdown of
-                            // supplementary character encoding. given the use
-                            // of supplementary characters is really rare, this
-                            // is something worth doing.
-                            if (Character.isHighSurrogate(c)) {
-                                if ((sp + 1) == sl)
-                                    return CoderResult.UNDERFLOW;
-                                if (!Character.isLowSurrogate(sa[sp + 1]))
-                                    return CoderResult.malformedForLength(1);
-                                outSize = toEUC(c, sa[sp+1], bb);
-                                    inSize = 2;
-                            } else if (Character.isLowSurrogate(c)) {
-                                return CoderResult.malformedForLength(1);
-                            }
-                        }
-                    }
-                    if (outSize == -1)
-                        return CoderResult.unmappableForLength(inSize);
-                    if ( dl - dp < outSize)
-                        return CoderResult.OVERFLOW;
-                    for (int i = 0; i < outSize; i++)
-                        da[dp++] = bb[i];
-                    sp  += inSize;
-                }
-                return CoderResult.UNDERFLOW;
-            } finally {
-                src.position(sp - src.arrayOffset());
-                dst.position(dp - dst.arrayOffset());
-            }
-        }
-
-        private CoderResult encodeBufferLoop(CharBuffer src,
-                                             ByteBuffer dst)
-        {
-            int outSize;
-            int inSize;
-            int mark = src.position();
-
-            try {
-                while (src.hasRemaining()) {
-                    inSize = 1;
-                    char c = src.get();
-                    if (c < 0x80) {   // ASCII
-                        outSize = 1;
-                        bb[0] = (byte)c;
-                    } else {
-                        outSize = toEUC(c, bb);
-                        if (outSize == -1) {
-                            if (Character.isHighSurrogate(c)) {
-                                if (!src.hasRemaining())
-                                    return CoderResult.UNDERFLOW;
-                                char c2 = src.get();
-                                if (!Character.isLowSurrogate(c2))
-                                    return CoderResult.malformedForLength(1);
-                                outSize = toEUC(c, c2, bb);
-                                inSize = 2;
-                            } else if (Character.isLowSurrogate(c)) {
-                                return CoderResult.malformedForLength(1);
-                            }
-                        }
-                    }
-                    if (outSize == -1)
-                        return CoderResult.unmappableForLength(inSize);
-                    if (dst.remaining() < outSize)
-                        return CoderResult.OVERFLOW;
-                    for (int i = 0; i < outSize; i++)
-                        dst.put(bb[i]);
-                    mark += inSize;
-                }
-                return CoderResult.UNDERFLOW;
-            } finally {
-                src.position(mark);
-            }
-        }
-
-        protected CoderResult encodeLoop(CharBuffer src, ByteBuffer dst)
-        {
-            if (src.hasArray() && dst.hasArray())
-                return encodeArrayLoop(src, dst);
-            else
-                return encodeBufferLoop(src, dst);
-        }
-
-        static int encode(char hi, char low, byte[] bb) {
-            int c = Character.toCodePoint(hi, low);
-            if ((c & 0xf0000) != 0x20000)
-                return -1;
-            c -= 0x20000;
-            int index = c2bSuppIndex[c >> 8];
-            if (index  == UNMAPPABLE_ENCODING)
-                return -1;
-            index = index + (c & 0xff);
-            int db = c2bSupp[index];
-            if (db == UNMAPPABLE_ENCODING)
-                return -1;
-            int p = (c2bPlane[index] >> 4) & 0xf;
-            bb[0] = (byte)SS2;
-            bb[1] = (byte)(0xa0 | p);
-            bb[2] = (byte)(db >> 8);
-            bb[3] = (byte)db;
-            return 4;
-        }
-
-        static int encode(char c, byte[] bb) {
-            int index = c2bIndex[c >> 8];
-            if (index  == UNMAPPABLE_ENCODING)
-                return -1;
-            index = index + (c & 0xff);
-            int db = c2b[index];
-            if (db == UNMAPPABLE_ENCODING)
-                return -1;
-            int p = c2bPlane[index] & 0xf;
-            if (p == 0) {
-                bb[0] = (byte)(db >> 8);
-                bb[1] = (byte)db;
-                return 2;
-            } else {
-                bb[0] = (byte)SS2;
-                bb[1] = (byte)(0xa0 | p);
-                bb[2] = (byte)(db >> 8);
-                bb[3] = (byte)db;
-                return 4;
-            }
-        }
-
-        static final char[] c2b;
-        static final char[] c2bIndex;
-        static final char[] c2bSupp;
-        static final char[] c2bSuppIndex;
-        static final byte[] c2bPlane;
-        static {
-            int b1Min    =  Decoder.b1Min;
-            int b1Max    =  Decoder.b1Max;
-            int b2Min    =  Decoder.b2Min;
-            int b2Max    =  Decoder.b2Max;
-            int dbSegSize = Decoder.dbSegSize;
-            String[] b2c = Decoder.b2c;
-            byte[] b2cIsSupp = Decoder.b2cIsSupp;
-
-            c2bIndex = EUC_TWMapping.c2bIndex;
-            c2bSuppIndex = EUC_TWMapping.c2bSuppIndex;
-            char[] c2b0 = new char[EUC_TWMapping.C2BSIZE];
-            char[] c2bSupp0 = new char[EUC_TWMapping.C2BSUPPSIZE];
-            byte[] c2bPlane0 = new byte[Math.max(EUC_TWMapping.C2BSIZE,
-                                                 EUC_TWMapping.C2BSUPPSIZE)];
-
-            Arrays.fill(c2b0, (char)UNMAPPABLE_ENCODING);
-            Arrays.fill(c2bSupp0, (char)UNMAPPABLE_ENCODING);
-
-            for (int p = 0; p < b2c.length; p++) {
-                String db = b2c[p];
-                /*
-                   adjust the "plane" from 0..7 to 0, 2, 3, 4, 5, 6, 7, 0xf,
-                   which helps balance between footprint (to save the plane
-                   info in 4 bits) and runtime performance (to require only
-                   one operation "0xa0 | plane" to encode the plane byte)
-                */
-                int plane = p;
-                if (plane == 7)
-                    plane = 0xf;
-                else if (plane != 0)
-                    plane = p + 1;
-
-                int off = 0;
-                for (int b1 = b1Min; b1 <= b1Max; b1++) {
-                    for (int b2 = b2Min; b2 <= b2Max; b2++) {
-                        char c = db.charAt(off);
-                        if (c != UNMAPPABLE_DECODING) {
-                            if ((b2cIsSupp[off] & (1 << p)) != 0) {
-                                int index = c2bSuppIndex[c >> 8] + (c&0xff);
-                                c2bSupp0[index] = (char)((b1 << 8) + b2);
-                                c2bPlane0[index] |= (byte)(plane << 4);
-                            } else {
-                                int index = c2bIndex[c >> 8] + (c&0xff);
-                                c2b0[index] = (char)((b1 << 8) + b2);
-                                c2bPlane0[index] |= (byte)plane;
-                            }
-                        }
-                        off++;
-                    }
-                }
-            }
-            c2b = c2b0;
-            c2bSupp = c2bSupp0;
-            c2bPlane = c2bPlane0;
-        }
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_TW.java.template	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,546 @@
+/*
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package $PACKAGE$;
+
+import java.io.*;
+import java.nio.CharBuffer;
+import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetDecoder;
+import java.nio.charset.CharsetEncoder;
+import java.nio.charset.CoderResult;
+import java.util.Arrays;
+import sun.nio.cs.HistoricallyNamedCharset;
+import static sun.nio.cs.CharsetMapping.*;
+
+public class EUC_TW extends Charset implements HistoricallyNamedCharset
+{
+    private static final int SS2 = 0x8E;
+
+    /*
+       (1) EUC_TW
+       Second byte of EUC_TW for cs2 is in range of
+       0xA1-0xB0 for plane 1-16. According to CJKV /163,
+       plane1 is coded in both cs1 and cs2. This impl
+       however does not decode the codepoints of plane1
+       in cs2, so only p2-p7 and p15 are supported in cs2.
+
+       Plane2  0xA2;
+       Plane3  0xA3;
+       Plane4  0xA4;
+       Plane5  0xA5;
+       Plane6  0xA6;
+       Plane7  0xA7;
+       Plane15 0xAF;
+
+       (2) Mapping
+       The fact that all supplementary characters encoded in EUC_TW are
+       in 0x2xxxx range gives us the room to optimize the data tables.
+
+       Decoding:
+       (1) save the lower 16-bit value of all codepoints of b->c mapping
+           in a String array table  String[plane] b2c.
+       (2) save "codepoint is supplementary" info (one bit) in a
+           byte[] b2cIsSupp, so 8 codepoints (same codepoint value, different
+           plane No) share one byte.
+
+       Encoding:
+       (1)c->b mappings are stored in
+          char[]c2b/char[]c2bIndex
+          char[]c2bSupp/char[]c2bIndexsupp  (indexed by lower 16-bit
+       (2)byte[] c2bPlane stores the "plane info" of each euc-tw codepoints,
+          BMP and Supp share the low/high 4 bits of one byte.
+
+       Mapping tables are stored separated in EUC_TWMapping, which
+       is generated by tool.
+     */
+
+    public EUC_TW() {
+        super("x-EUC-TW", $ALIASES$);
+    }
+
+    public String historicalName() {
+        return "EUC_TW";
+    }
+
+    public boolean contains(Charset cs) {
+        return ((cs.name().equals("US-ASCII"))
+                || (cs instanceof EUC_TW));
+    }
+
+    public CharsetDecoder newDecoder() {
+        return new Decoder(this);
+    }
+
+    public CharsetEncoder newEncoder() {
+        return new Encoder(this);
+    }
+
+    public static class Decoder extends CharsetDecoder {
+        public Decoder(Charset cs) {
+            super(cs, 2.0f, 2.0f);
+        }
+
+        char[] c1 = new char[1];
+        char[] c2 = new char[2];
+        public char[] toUnicode(int b1, int b2, int p) {
+            return decode(b1, b2, p, c1, c2);
+        }
+
+        static final String[] b2c =  EUC_TWMapping.b2c;
+        static final int b1Min    =  EUC_TWMapping.b1Min;
+        static final int b1Max    =  EUC_TWMapping.b1Max;
+        static final int b2Min    =  EUC_TWMapping.b2Min;
+        static final int b2Max    =  EUC_TWMapping.b2Max;
+        static final int dbSegSize = b2Max - b2Min + 1;
+        static final byte[] b2cIsSupp;
+
+        // adjust from cns planeNo to the plane index of b2c
+        static final byte[] cnspToIndex = new byte[0x100];
+        static {
+            Arrays.fill(cnspToIndex, (byte)-1);
+            cnspToIndex[0xa2] = 1; cnspToIndex[0xa3] = 2; cnspToIndex[0xa4] = 3;
+            cnspToIndex[0xa5] = 4; cnspToIndex[0xa6] = 5; cnspToIndex[0xa7] = 6;
+            cnspToIndex[0xaf] = 7;
+        }
+
+        //static final BitSet b2cIsSupp;
+        static {
+            String b2cIsSuppStr = EUC_TWMapping.b2cIsSuppStr;
+            // work on a local copy is much faster than operate
+            // directly on b2cIsSupp
+            byte[] flag = new byte[b2cIsSuppStr.length() << 1];
+            int off = 0;
+            for (int i = 0; i < b2cIsSuppStr.length(); i++) {
+                char c = b2cIsSuppStr.charAt(i);
+                flag[off++] = (byte)(c >> 8);
+                flag[off++] = (byte)(c & 0xff);
+            }
+            b2cIsSupp = flag;
+        }
+
+        static boolean isLegalDB(int b) {
+           return b >= b1Min && b <= b1Max;
+        }
+
+        static char[] decode(int b1, int b2, int p, char[] c1, char[] c2)
+        {
+            if (b1 < b1Min || b1 > b1Max || b2 < b2Min || b2 > b2Max)
+                return null;
+            int index = (b1 - b1Min) * dbSegSize + b2 - b2Min;
+            char c = b2c[p].charAt(index);
+            if (c == UNMAPPABLE_DECODING)
+                return null;
+            if ((b2cIsSupp[index] & (1 << p)) == 0) {
+                c1[0] = c;
+                return c1;
+            } else {
+                c2[0] = Character.highSurrogate(0x20000 + c);
+                c2[1] = Character.lowSurrogate(0x20000 + c);
+                return c2;
+            }
+        }
+
+        private CoderResult decodeArrayLoop(ByteBuffer src,
+                                            CharBuffer dst)
+        {
+            byte[] sa = src.array();
+            int sp = src.arrayOffset() + src.position();
+            int sl = src.arrayOffset() + src.limit();
+
+            char[] da = dst.array();
+            int dp = dst.arrayOffset() + dst.position();
+            int dl = dst.arrayOffset() + dst.limit();
+            try {
+                while (sp < sl) {
+                    int byte1 = sa[sp] & 0xff;
+                    if (byte1 == SS2) { // Codeset 2  G2
+                        if ( sl - sp < 4)
+                            return CoderResult.UNDERFLOW;
+                        int cnsPlane = cnspToIndex[sa[sp + 1] & 0xff];
+                        if (cnsPlane < 0)
+                            return CoderResult.malformedForLength(2);
+                        byte1 = sa[sp + 2] & 0xff;
+                        int byte2 = sa[sp + 3] & 0xff;
+                        char[] cc = toUnicode(byte1, byte2, cnsPlane);
+                        if (cc == null) {
+                            if (!isLegalDB(byte1) || !isLegalDB(byte2))
+                                return CoderResult.malformedForLength(4);
+                            return CoderResult.unmappableForLength(4);
+                        }
+                        if (dl - dp < cc.length)
+                            return CoderResult.OVERFLOW;
+                        if (cc.length == 1) {
+                            da[dp++] = cc[0];
+                        } else {
+                            da[dp++] = cc[0];
+                            da[dp++] = cc[1];
+                        }
+                        sp += 4;
+                    } else if (byte1 < 0x80) {  // ASCII      G0
+                        if (dl - dp < 1)
+                           return CoderResult.OVERFLOW;
+                        da[dp++] = (char) byte1;
+                        sp++;
+                    } else {                    // Codeset 1  G1
+                        if ( sl - sp < 2)
+                            return CoderResult.UNDERFLOW;
+                        int byte2 = sa[sp + 1] & 0xff;
+                        char[] cc = toUnicode(byte1, byte2, 0);
+                        if (cc == null) {
+                            if (!isLegalDB(byte1) || !isLegalDB(byte2))
+                                return CoderResult.malformedForLength(1);
+                            return CoderResult.unmappableForLength(2);
+                        }
+                        if (dl - dp < 1)
+                            return CoderResult.OVERFLOW;
+                        da[dp++] = cc[0];
+                        sp += 2;
+                    }
+                }
+                return CoderResult.UNDERFLOW;
+            } finally {
+                src.position(sp - src.arrayOffset());
+                dst.position(dp - dst.arrayOffset());
+            }
+        }
+
+        private CoderResult decodeBufferLoop(ByteBuffer src,
+                                             CharBuffer dst)
+        {
+            int mark = src.position();
+            try {
+                while (src.hasRemaining()) {
+                    int byte1 = src.get() & 0xff;
+                    if (byte1 == SS2) {            // Codeset 2  G2
+                        if ( src.remaining() < 3)
+                            return CoderResult.UNDERFLOW;
+                        int cnsPlane = cnspToIndex[src.get() & 0xff];
+                        if (cnsPlane < 0)
+                            return CoderResult.malformedForLength(2);
+                        byte1 = src.get() & 0xff;
+                        int byte2 = src.get() & 0xff;
+                        char[] cc = toUnicode(byte1, byte2, cnsPlane);
+                        if (cc == null) {
+                            if (!isLegalDB(byte1) || !isLegalDB(byte2))
+                                return CoderResult.malformedForLength(4);
+                            return CoderResult.unmappableForLength(4);
+                        }
+                        if (dst.remaining() < cc.length)
+                            return CoderResult.OVERFLOW;
+                        if (cc.length == 1) {
+                            dst.put(cc[0]);
+                        } else {
+                            dst.put(cc[0]);
+                            dst.put(cc[1]);
+                        }
+                        mark += 4;
+                    } else if (byte1 < 0x80) {        // ASCII      G0
+                        if (!dst.hasRemaining())
+                           return CoderResult.OVERFLOW;
+                        dst.put((char) byte1);
+                        mark++;
+                    } else {                          // Codeset 1  G1
+                        if (!src.hasRemaining())
+                            return CoderResult.UNDERFLOW;
+                        int byte2 = src.get() & 0xff;
+                        char[] cc = toUnicode(byte1, byte2, 0);
+                        if (cc == null) {
+                            if (!isLegalDB(byte1) || !isLegalDB(byte2))
+                                return CoderResult.malformedForLength(1);
+                            return CoderResult.unmappableForLength(2);
+                        }
+                        if (!dst.hasRemaining())
+                            return CoderResult.OVERFLOW;
+                        dst.put(cc[0]);
+                        mark +=2;
+                    }
+               }
+               return CoderResult.UNDERFLOW;
+            } finally {
+                src.position(mark);
+            }
+        }
+
+        protected CoderResult decodeLoop(ByteBuffer src, CharBuffer dst)
+        {
+            if (src.hasArray() && dst.hasArray())
+                return decodeArrayLoop(src, dst);
+            else
+                return decodeBufferLoop(src, dst);
+        }
+    }
+
+    public static class Encoder extends CharsetEncoder {
+        private byte[] bb = new byte[4];
+
+        public Encoder(Charset cs) {
+            super(cs, 4.0f, 4.0f);
+        }
+
+        public boolean canEncode(char c) {
+            return (c <= '\u007f' || toEUC(c, bb) != -1);
+        }
+
+        public boolean canEncode(CharSequence cs) {
+            int i = 0;
+            while (i < cs.length()) {
+                char c = cs.charAt(i++);
+                if (Character.isHighSurrogate(c)) {
+                    if (i == cs.length())
+                        return false;
+                    char low = cs.charAt(i++);
+                    if (!Character.isLowSurrogate(low) || toEUC(c, low, bb) == -1)
+                        return false;
+                } else if (!canEncode(c)) {
+                    return false;
+                }
+            }
+            return true;
+        }
+
+        public int toEUC(char hi, char low, byte[] bb) {
+            return encode(hi, low, bb);
+        }
+
+        public int toEUC(char c, byte[] bb) {
+            return encode(c, bb);
+        }
+
+        private CoderResult encodeArrayLoop(CharBuffer src,
+                                            ByteBuffer dst)
+        {
+            char[] sa = src.array();
+            int sp = src.arrayOffset() + src.position();
+            int sl = src.arrayOffset() + src.limit();
+
+            byte[] da = dst.array();
+            int dp = dst.arrayOffset() + dst.position();
+            int dl = dst.arrayOffset() + dst.limit();
+
+            int inSize;
+            int outSize;
+
+            try {
+                while (sp < sl) {
+                    char c = sa[sp];
+                    inSize = 1;
+                    if (c < 0x80) {  // ASCII
+                        bb[0] = (byte)c;
+                        outSize = 1;
+                    } else {
+                        outSize = toEUC(c, bb);
+                        if (outSize == -1) {
+                            // to check surrogates only after BMP failed
+                            // has the benefit of improving the BMP encoding
+                            // 10% faster, with the price of the slowdown of
+                            // supplementary character encoding. given the use
+                            // of supplementary characters is really rare, this
+                            // is something worth doing.
+                            if (Character.isHighSurrogate(c)) {
+                                if ((sp + 1) == sl)
+                                    return CoderResult.UNDERFLOW;
+                                if (!Character.isLowSurrogate(sa[sp + 1]))
+                                    return CoderResult.malformedForLength(1);
+                                outSize = toEUC(c, sa[sp+1], bb);
+                                    inSize = 2;
+                            } else if (Character.isLowSurrogate(c)) {
+                                return CoderResult.malformedForLength(1);
+                            }
+                        }
+                    }
+                    if (outSize == -1)
+                        return CoderResult.unmappableForLength(inSize);
+                    if ( dl - dp < outSize)
+                        return CoderResult.OVERFLOW;
+                    for (int i = 0; i < outSize; i++)
+                        da[dp++] = bb[i];
+                    sp  += inSize;
+                }
+                return CoderResult.UNDERFLOW;
+            } finally {
+                src.position(sp - src.arrayOffset());
+                dst.position(dp - dst.arrayOffset());
+            }
+        }
+
+        private CoderResult encodeBufferLoop(CharBuffer src,
+                                             ByteBuffer dst)
+        {
+            int outSize;
+            int inSize;
+            int mark = src.position();
+
+            try {
+                while (src.hasRemaining()) {
+                    inSize = 1;
+                    char c = src.get();
+                    if (c < 0x80) {   // ASCII
+                        outSize = 1;
+                        bb[0] = (byte)c;
+                    } else {
+                        outSize = toEUC(c, bb);
+                        if (outSize == -1) {
+                            if (Character.isHighSurrogate(c)) {
+                                if (!src.hasRemaining())
+                                    return CoderResult.UNDERFLOW;
+                                char c2 = src.get();
+                                if (!Character.isLowSurrogate(c2))
+                                    return CoderResult.malformedForLength(1);
+                                outSize = toEUC(c, c2, bb);
+                                inSize = 2;
+                            } else if (Character.isLowSurrogate(c)) {
+                                return CoderResult.malformedForLength(1);
+                            }
+                        }
+                    }
+                    if (outSize == -1)
+                        return CoderResult.unmappableForLength(inSize);
+                    if (dst.remaining() < outSize)
+                        return CoderResult.OVERFLOW;
+                    for (int i = 0; i < outSize; i++)
+                        dst.put(bb[i]);
+                    mark += inSize;
+                }
+                return CoderResult.UNDERFLOW;
+            } finally {
+                src.position(mark);
+            }
+        }
+
+        protected CoderResult encodeLoop(CharBuffer src, ByteBuffer dst)
+        {
+            if (src.hasArray() && dst.hasArray())
+                return encodeArrayLoop(src, dst);
+            else
+                return encodeBufferLoop(src, dst);
+        }
+
+        static int encode(char hi, char low, byte[] bb) {
+            int c = Character.toCodePoint(hi, low);
+            if ((c & 0xf0000) != 0x20000)
+                return -1;
+            c -= 0x20000;
+            int index = c2bSuppIndex[c >> 8];
+            if (index  == UNMAPPABLE_ENCODING)
+                return -1;
+            index = index + (c & 0xff);
+            int db = c2bSupp[index];
+            if (db == UNMAPPABLE_ENCODING)
+                return -1;
+            int p = (c2bPlane[index] >> 4) & 0xf;
+            bb[0] = (byte)SS2;
+            bb[1] = (byte)(0xa0 | p);
+            bb[2] = (byte)(db >> 8);
+            bb[3] = (byte)db;
+            return 4;
+        }
+
+        static int encode(char c, byte[] bb) {
+            int index = c2bIndex[c >> 8];
+            if (index  == UNMAPPABLE_ENCODING)
+                return -1;
+            index = index + (c & 0xff);
+            int db = c2b[index];
+            if (db == UNMAPPABLE_ENCODING)
+                return -1;
+            int p = c2bPlane[index] & 0xf;
+            if (p == 0) {
+                bb[0] = (byte)(db >> 8);
+                bb[1] = (byte)db;
+                return 2;
+            } else {
+                bb[0] = (byte)SS2;
+                bb[1] = (byte)(0xa0 | p);
+                bb[2] = (byte)(db >> 8);
+                bb[3] = (byte)db;
+                return 4;
+            }
+        }
+
+        static final char[] c2b;
+        static final char[] c2bIndex;
+        static final char[] c2bSupp;
+        static final char[] c2bSuppIndex;
+        static final byte[] c2bPlane;
+        static {
+            int b1Min    =  Decoder.b1Min;
+            int b1Max    =  Decoder.b1Max;
+            int b2Min    =  Decoder.b2Min;
+            int b2Max    =  Decoder.b2Max;
+            int dbSegSize = Decoder.dbSegSize;
+            String[] b2c = Decoder.b2c;
+            byte[] b2cIsSupp = Decoder.b2cIsSupp;
+
+            c2bIndex = EUC_TWMapping.c2bIndex;
+            c2bSuppIndex = EUC_TWMapping.c2bSuppIndex;
+            char[] c2b0 = new char[EUC_TWMapping.C2BSIZE];
+            char[] c2bSupp0 = new char[EUC_TWMapping.C2BSUPPSIZE];
+            byte[] c2bPlane0 = new byte[Math.max(EUC_TWMapping.C2BSIZE,
+                                                 EUC_TWMapping.C2BSUPPSIZE)];
+
+            Arrays.fill(c2b0, (char)UNMAPPABLE_ENCODING);
+            Arrays.fill(c2bSupp0, (char)UNMAPPABLE_ENCODING);
+
+            for (int p = 0; p < b2c.length; p++) {
+                String db = b2c[p];
+                /*
+                   adjust the "plane" from 0..7 to 0, 2, 3, 4, 5, 6, 7, 0xf,
+                   which helps balance between footprint (to save the plane
+                   info in 4 bits) and runtime performance (to require only
+                   one operation "0xa0 | plane" to encode the plane byte)
+                */
+                int plane = p;
+                if (plane == 7)
+                    plane = 0xf;
+                else if (plane != 0)
+                    plane = p + 1;
+
+                int off = 0;
+                for (int b1 = b1Min; b1 <= b1Max; b1++) {
+                    for (int b2 = b2Min; b2 <= b2Max; b2++) {
+                        char c = db.charAt(off);
+                        if (c != UNMAPPABLE_DECODING) {
+                            if ((b2cIsSupp[off] & (1 << p)) != 0) {
+                                int index = c2bSuppIndex[c >> 8] + (c&0xff);
+                                c2bSupp0[index] = (char)((b1 << 8) + b2);
+                                c2bPlane0[index] |= (byte)(plane << 4);
+                            } else {
+                                int index = c2bIndex[c >> 8] + (c&0xff);
+                                c2b0[index] = (char)((b1 << 8) + b2);
+                                c2bPlane0[index] |= (byte)plane;
+                            }
+                        }
+                        off++;
+                    }
+                }
+            }
+            c2b = c2b0;
+            c2bSupp = c2bSupp0;
+            c2bPlane = c2bPlane0;
+        }
+    }
+}
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ExtendedCharsets.java.template	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ExtendedCharsets.java.template	Tue Mar 03 08:49:13 2015 -0800
@@ -222,16 +222,6 @@
 
             }
         }
-        String osName = getProperty("os.name");
-        if ("SunOS".equals(osName) || "Linux".equals(osName) || "AIX".equals(osName)
-               || osName.contains("OS X")) {
-            charset("x-COMPOUND_TEXT", "COMPOUND_TEXT",
-                    new String[] {
-                        "COMPOUND_TEXT",        // JDK historical
-                        "x11-compound_text",
-                        "x-compound-text"
-                    });
-        }
         initialized = true;
     }
 
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_CN_CNS.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_CN_CNS.java	Tue Mar 03 08:49:13 2015 -0800
@@ -35,6 +35,7 @@
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CoderResult;
 import sun.nio.cs.HistoricallyNamedCharset;
+import sun.nio.cs.*;
 
 public class ISO2022_CN_CNS extends ISO2022 implements HistoricallyNamedCharset
 {
--- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java	Tue Mar 03 08:49:13 2015 -0800
@@ -31,7 +31,6 @@
 import java.net.*;
 import javax.net.ssl.*;
 import java.util.*;
-import sun.net.www.MessageHeader;
 
 /**
  * This class encapsulates a HTTP request received and a
--- a/jdk/src/jdk.httpserver/share/classes/sun/net/httpserver/AuthFilter.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/jdk.httpserver/share/classes/sun/net/httpserver/AuthFilter.java	Tue Mar 03 08:49:13 2015 -0800
@@ -29,7 +29,6 @@
 import java.io.*;
 import java.nio.*;
 import java.nio.channels.*;
-import sun.net.www.MessageHeader;
 import java.util.*;
 import javax.security.auth.*;
 import javax.security.auth.callback.*;
--- a/jdk/src/jdk.httpserver/share/classes/sun/net/httpserver/HttpExchangeImpl.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/jdk.httpserver/share/classes/sun/net/httpserver/HttpExchangeImpl.java	Tue Mar 03 08:49:13 2015 -0800
@@ -31,7 +31,6 @@
 import java.net.*;
 import javax.net.ssl.*;
 import java.util.*;
-import sun.net.www.MessageHeader;
 import com.sun.net.httpserver.*;
 import com.sun.net.httpserver.spi.*;
 
--- a/jdk/src/jdk.httpserver/share/classes/sun/net/httpserver/HttpsExchangeImpl.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/jdk.httpserver/share/classes/sun/net/httpserver/HttpsExchangeImpl.java	Tue Mar 03 08:49:13 2015 -0800
@@ -31,7 +31,6 @@
 import java.net.*;
 import javax.net.ssl.*;
 import java.util.*;
-import sun.net.www.MessageHeader;
 import com.sun.net.httpserver.*;
 import com.sun.net.httpserver.spi.*;
 
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InterfaceType.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InterfaceType.java	Tue Mar 03 08:49:13 2015 -0800
@@ -145,7 +145,7 @@
      * not be done from the client's event handler thread.
      * <p>
      * The resumption of other threads during the invocation can be prevented
-     * by specifying the {@link #INVOKE_SINGLE_THREADED}
+     * by specifying the {@link ClassType#INVOKE_SINGLE_THREADED}
      * bit flag in the <code>options</code> argument; however,
      * there is no protection against or recovery from the deadlocks
      * described above, so this option should be used with great caution.
--- a/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/ObjectReferenceImpl.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/ObjectReferenceImpl.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -282,6 +282,7 @@
          * implemented interface
          */
         ReferenceTypeImpl declType = (ReferenceTypeImpl)method.declaringType();
+
         if (!declType.isAssignableFrom(this)) {
             throw new IllegalArgumentException("Invalid method");
         }
@@ -311,7 +312,7 @@
         /*
          * For nonvirtual invokes, method must have a body
          */
-        if ((options & INVOKE_NONVIRTUAL) != 0) {
+        if (isNonVirtual(options)) {
             if (method.isAbstract()) {
                 throw new IllegalArgumentException("Abstract method");
             }
@@ -323,7 +324,7 @@
          * method argument types.
          */
         ClassTypeImpl invokedClass;
-        if ((options & INVOKE_NONVIRTUAL) != 0) {
+        if (isNonVirtual(options)) {
             // No overrides in non-virtual invokes
             invokedClass = clazz;
         } else {
@@ -348,7 +349,7 @@
         /*
          * Only default methods allowed for nonvirtual invokes
          */
-        if (!method.isDefault()) {
+        if (isNonVirtual(options) && !method.isDefault()) {
             throw new IllegalArgumentException("Not a default method");
         }
     }
@@ -383,6 +384,7 @@
                                      IncompatibleThreadStateException,
                                      InvocationException,
                                      ClassNotLoadedException {
+
         validateMirror(threadIntf);
         validateMirror(methodIntf);
         validateMirrorsOrNulls(origArguments);
@@ -624,4 +626,8 @@
     byte typeValueKey() {
         return JDWP.Tag.OBJECT;
     }
+
+    private static boolean isNonVirtual(int options) {
+        return (options & INVOKE_NONVIRTUAL) != 0;
+    }
 }
--- a/jdk/src/jdk.sctp/unix/native/libsctp/SctpNet.c	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/src/jdk.sctp/unix/native/libsctp/SctpNet.c	Tue Mar 03 08:49:13 2015 -0800
@@ -431,7 +431,7 @@
     paddr = addr_buf;
     for (i=0; i<addrCount; i++) {
         jobject ia, isa = NULL;
-        int port;
+        int port = 0;
         sap = (struct sockaddr*)addr_buf;
         ia = NET_SockaddrToInetAddress(env, sap, &port);
         if (ia != NULL)
@@ -543,6 +543,7 @@
     void *arg;
     int arglen;
 
+    memset((char *) &linger, 0, sizeof(linger));
     if (mapSocketOption(opt, &klevel, &kopt) < 0) {
         JNU_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
                                      "Unsupported socket option");
@@ -600,7 +601,7 @@
   (JNIEnv *env, jclass klass, jint fd, jint assocId, jobject iaObj, jint port) {
     struct sctp_setprim prim;
     struct sockaddr* sap = (struct sockaddr*)&prim.ssp_addr;
-    int sap_len;
+    int sap_len = sizeof(sap);
 
     if (NET_InetAddressToSockaddr(env, iaObj, port, sap,
                                   &sap_len, JNI_TRUE) != 0) {
@@ -625,7 +626,7 @@
    jobject iaObj, jint port, jboolean preferIPv6) {
     struct sctp_setpeerprim prim;
     struct sockaddr* sap = (struct sockaddr*)&prim.sspp_addr;
-    int sap_len;
+    int sap_len = sizeof(sap);
 
     if (NET_InetAddressToSockaddr(env, iaObj, port, sap,
                                   &sap_len, preferIPv6) != 0) {
--- a/jdk/test/Makefile	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/test/Makefile	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -112,6 +112,19 @@
   JAVA_VM_ARGS = $(JPRT_PRODUCT_VM_ARGS)
 endif
 
+# jtreg -nativepath <dir>
+#
+# Local make tests will be TEST_IMAGE_DIR and JPRT with jprt.use.reg.test.bundle=true
+# should be JPRT_TESTNATIVE_PATH
+ifdef TEST_IMAGE_DIR
+  TESTNATIVE_DIR = $(TEST_IMAGE_DIR)
+else ifdef JPRT_TESTNATIVE_PATH
+  TESTNATIVE_DIR = $(JPRT_TESTNATIVE_PATH)
+endif
+ifdef TESTNATIVE_DIR
+  JTREG_NATIVE_PATH = -nativepath:$(shell $(GETMIXEDPATH) "$(TESTNATIVE_DIR)/jdk/jtreg/native")
+endif
+
 # Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
 ifdef JPRT_ARCHIVE_BUNDLE
   ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE)
@@ -313,6 +326,7 @@
               -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport")  \
               -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTwork")    \
               -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)")                \
+              $(JTREG_NATIVE_PATH)                                           \
               $(JTREG_EXCLUSIONS)                                            \
               $(JTREG_TEST_OPTIONS)                                          \
               $(TEST_SELECTION)                                                    \
--- a/jdk/test/TEST.groups	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/test/TEST.groups	Tue Mar 03 08:49:13 2015 -0800
@@ -1,4 +1,4 @@
-#  Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+#  Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
 #  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 #  This code is free software; you can redistribute it and/or modify it
@@ -168,6 +168,9 @@
 jdk_jdi = \
     com/sun/jdi
 
+jdk_native_sanity = \
+    native_sanity
+
 # java launcher specific tests, Note: do not include this group into any groups
 # that potentially could be included into a jprt test rule, as the complementary
 # closed  group includes awt SplashScreen and these tests may not run 
@@ -567,7 +570,6 @@
   javax/smartcardio \
   javax/sql/rowset \
   javax/xml/crypto \
-  sun/security/acl \
   sun/security/jgss \
   sun/security/krb5 \
   java/lang/annotation/AnnotationType/AnnotationTypeDeadlockTest.java \
--- a/jdk/test/com/sun/jdi/InterfaceMethodsTest.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/test/com/sun/jdi/InterfaceMethodsTest.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
 /**
  *  @test
  *  @bug 8031195
+ *  @bug 8071657
  *  @summary  JDI: Add support for static and default methods in interfaces
  *
  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
@@ -38,6 +39,7 @@
     private static final int RESULT_A = 1;
     private static final int RESULT_B = 1;
     private static final int RESULT_TARGET = 1;
+
     static interface InterfaceA {
         static int staticMethodA() {
             System.out.println("-InterfaceA: static interface method A-");
@@ -202,6 +204,9 @@
 
         // try to invoke static method B on the instance
         testInvokePos(ifaceClass, ref, "staticMethodB", "()I", vm().mirrorOf(RESULT_A));
+
+        // try to invoke a virtual method
+        testInvokePos(ifaceClass, ref, "implementedMethod", "()I", vm().mirrorOf(RESULT_A), true);
     }
 
     private void testInterfaceB(ObjectReference ref) {
@@ -302,9 +307,14 @@
 
     private void testInvokePos(ReferenceType targetClass, ObjectReference ref, String methodName,
                                String methodSig, Value value) {
+        testInvokePos(targetClass, ref, methodName, methodSig, value, false);
+    }
+
+    private void testInvokePos(ReferenceType targetClass, ObjectReference ref, String methodName,
+                               String methodSig, Value value, boolean virtual) {
         logInvocation(ref, methodName, methodSig, targetClass);
         try {
-            invoke(targetClass, ref, methodName, methodSig, value);
+            invoke(targetClass, ref, methodName, methodSig, value, virtual);
             System.err.println("--- PASSED");
         } catch (Exception e) {
             System.err.println("--- FAILED");
@@ -314,9 +324,14 @@
 
     private void testInvokeNeg(ReferenceType targetClass, ObjectReference ref, String methodName,
                                String methodSig, Value value, String msg) {
+        testInvokeNeg(targetClass, ref, methodName, methodSig, value, msg, false);
+    }
+
+    private void testInvokeNeg(ReferenceType targetClass, ObjectReference ref, String methodName,
+                               String methodSig, Value value, String msg, boolean virtual) {
         logInvocation(ref, methodName, methodSig, targetClass);
         try {
-            invoke(targetClass, ref, methodName, methodSig, value);
+            invoke(targetClass, ref, methodName, methodSig, value, virtual);
             System.err.println("--- FAILED");
             failure("FAILED: " + msg);
         } catch (Exception e) {
@@ -326,7 +341,7 @@
     }
 
     private void invoke(ReferenceType targetClass, ObjectReference ref, String methodName,
-                        String methodSig, Value value)
+                        String methodSig, Value value, boolean virtual)
     throws Exception {
         Method method = getMethod(targetClass, methodName, methodSig);
         if (method == null) {
@@ -334,10 +349,15 @@
         }
 
         println("Invoking " + (method.isAbstract() ? "abstract " : " ") + "method: " + method);
+        println(method.declaringType().toString());
 
         Value returnValue = null;
         if (ref != null) {
-            returnValue = invokeInstance(ref, method);
+            if (virtual) {
+                returnValue = invokeVirtual(ref, method);
+            } else {
+                returnValue = invokeInstance(ref, method);
+            }
         } else {
             returnValue = invokeStatic(targetClass, method);
         }
@@ -362,6 +382,10 @@
         return ref.invokeMethod(mainThread, method, Collections.emptyList(), ObjectReference.INVOKE_NONVIRTUAL);
     }
 
+    private Value invokeVirtual(ObjectReference ref, Method method) throws Exception {
+        return ref.invokeMethod(mainThread, method, Collections.emptyList(), 0);
+    }
+
     private Value invokeStatic(ReferenceType refType, Method method) throws Exception {
         if (refType instanceof ClassType) {
             return ((ClassType)refType).invokeMethod(mainThread, method, Collections.emptyList(), ObjectReference.INVOKE_NONVIRTUAL);
--- a/jdk/test/com/sun/management/OperatingSystemMXBean/GetTotalSwapSpaceSize.java	Mon Feb 23 10:47:32 2015 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 2003, 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.
- *
- * 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.
- */
-
-/*
- *
- *
- * @bug     4858522
- * @summary Basic unit test of OperatingSystemMXBean.getTotalSwapSpaceSize()
- * @author  Steve Bohne
- */
-
-/*
- * This test tests the actual swap size on linux and solaris.
- * The correct value should be checked manually:
- * Solaris:
- *   1. In a shell, enter the command: "swap -l"
- *   2. The value (reported in blocks) is in the "blocks" column.
- * Linux:
- *   1. In a shell, enter the command: "cat /proc/meminfo"
- *   2. The value (reported in bytes) is in "Swap" entry, "total" column.
- * Windows NT/XP/2000:
- *   1. Run Start->Accessories->System Tools->System Information.
- *   2. The value (reported in Kbytes) is in the "Page File Space" entry
- * Windows 98/ME:
- *   Unknown.
- *
- * Usage: GetTotalSwapSpaceSize <expected swap size | "sanity-only"> [trace]
- */
-
-import com.sun.management.OperatingSystemMXBean;
-import java.lang.management.*;
-
-public class GetTotalSwapSpaceSize {
-
-    private static OperatingSystemMXBean mbean =
-        (com.sun.management.OperatingSystemMXBean)
-        ManagementFactory.getOperatingSystemMXBean();
-
-    // Careful with these values.
-    // Min size for pass dynamically determined below.
-    // zero if no swap space is configured.
-    private static long       min_size_for_pass = 0;
-    private static final long MAX_SIZE_FOR_PASS = Long.MAX_VALUE;
-
-    private static boolean trace = false;
-
-    public static void main(String args[]) throws Exception {
-        if (args.length > 1 && args[1].equals("trace")) {
-            trace = true;
-        }
-
-        long expected_swap_size = 0;
-
-        if (args.length < 1 || args.length > 2) {
-           throw new IllegalArgumentException("Unexpected number of args " + args.length);
-        }
-
-
-        long min_size = mbean.getFreeSwapSpaceSize();
-        if (min_size > 0) {
-            min_size_for_pass = min_size;
-        }
-
-        long size = mbean.getTotalSwapSpaceSize();
-
-        if (trace) {
-            System.out.println("Total swap space size in bytes: " + size);
-        }
-
-        if (!args[0].matches("sanity-only")) {
-            expected_swap_size = Long.parseLong(args[0]);
-            if (size != expected_swap_size) {
-                throw new RuntimeException("Expected total swap size      : " +
-                                           expected_swap_size +
-                                           " but getTotalSwapSpaceSize returned: " +
-                                           size);
-            }
-        }
-
-        if (size < min_size_for_pass || size > MAX_SIZE_FOR_PASS) {
-            throw new RuntimeException("Total swap space size " +
-                                       "illegal value: " + size + " bytes " +
-                                       "(MIN = " + min_size_for_pass + "; " +
-                                       "MAX = " + MAX_SIZE_FOR_PASS + ")");
-        }
-
-        System.out.println("Test passed.");
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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     4858522
+ * @summary Basic unit test of OperatingSystemMXBean.getTotalSwapSpaceSize()
+ *
+ * @library /lib/testlibrary
+ * @build TestTotalSwap jdk.testlibrary.*
+ * @run main TestTotalSwap
+ *
+ * @author  Steve Bohne
+ * @author  Jaroslav Bachorik
+ */
+
+/*
+ * This test tests the actual swap size on linux and solaris.
+ * The correct value should be checked manually:
+ * Solaris:
+ *   1. In a shell, enter the command: "swap -l"
+ *   2. The value (reported in blocks) is in the "blocks" column.
+ * Linux:
+ *   1. In a shell, enter the command: "cat /proc/meminfo"
+ *   2. The value (reported in bytes) is in "Swap" entry, "total" column.
+ * Windows NT/XP/2000:
+ *   1. Run Start->Accessories->System Tools->System Information.
+ *   2. The value (reported in Kbytes) is in the "Page File Space" entry
+ * Windows 98/ME:
+ *   Unknown.
+ *
+ * Usage: GetTotalSwapSpaceSize <expected swap size | "sanity-only"> [trace]
+ */
+
+import com.sun.management.OperatingSystemMXBean;
+import java.lang.management.*;
+
+import jdk.testlibrary.OSInfo;
+import jdk.testlibrary.ProcessTools;
+import jdk.testlibrary.OutputAnalyzer;
+
+public class TestTotalSwap {
+
+    private static final OperatingSystemMXBean mbean =
+        (com.sun.management.OperatingSystemMXBean)
+        ManagementFactory.getOperatingSystemMXBean();
+
+    // Careful with these values.
+    // Min size for pass dynamically determined below.
+    // zero if no swap space is configured.
+    private static long       min_size_for_pass = 0;
+    private static final long MAX_SIZE_FOR_PASS = Long.MAX_VALUE;
+
+    public static void main(String args[]) throws Throwable {
+
+        long expected_swap_size = getSwapSizeFromOs();
+
+        long min_size = mbean.getFreeSwapSpaceSize();
+        if (min_size > 0) {
+            min_size_for_pass = min_size;
+        }
+
+        long size = mbean.getTotalSwapSpaceSize();
+
+        System.out.println("Total swap space size in bytes: " + size);
+
+        if (expected_swap_size > -1) {
+            if (size != expected_swap_size) {
+                throw new RuntimeException("Expected total swap size      : " +
+                                           expected_swap_size +
+                                           " but getTotalSwapSpaceSize returned: " +
+                                           size);
+            }
+        }
+
+        // sanity check
+        if (size < min_size_for_pass || size > MAX_SIZE_FOR_PASS) {
+            throw new RuntimeException("Total swap space size " +
+                                       "illegal value: " + size + " bytes " +
+                                       "(MIN = " + min_size_for_pass + "; " +
+                                       "MAX = " + MAX_SIZE_FOR_PASS + ")");
+        }
+
+        System.out.println("Test passed.");
+    }
+
+    private static long getSwapSizeFromOs() throws Throwable {
+        OSInfo.OSType os = OSInfo.getOSType();
+
+        switch (os) {
+            // total       used       free     shared    buffers     cached
+            // Mem:    16533540864 13638467584 2895073280  534040576 1630248960 6236909568
+            // -/+ buffers/cache: 5771309056 10762231808
+            // Swap:   15999168512          0 15999168512
+
+            case LINUX: {
+                String swapSizeStr = ProcessTools.executeCommand("free", "-b")
+                                        .firstMatch("Swap:\\s+([0-9]+)\\s+.*", 1);
+                return Long.parseLong(swapSizeStr);
+            }
+            case SOLARIS: {
+                // swapfile             dev   swaplo blocks   free
+                // /dev/dsk/c0t0d0s1   136,1      16 1638608 1600528
+                OutputAnalyzer out= ProcessTools.executeCommand(
+                    "/usr/sbin/swap",
+                    "-l"
+                );
+
+                long swapSize = 0;
+
+                for (String line : out.asLines()) {
+                    if (line.contains("swapfile")) continue;
+
+                    String[] vals = line.split("\\s+");
+                    if (vals.length == 5) {
+                        swapSize += Long.parseLong(vals[3]) * 512; // size is reported in 512b blocks
+                    }
+                }
+
+                return swapSize;
+            }
+            case MACOSX: {
+                // total = 8192.00M used = 7471.11M free = 720.89M (encrypted)
+                String swapSizeStr = ProcessTools.executeCommand(
+                    "/usr/sbin/sysctl",
+                    "-n",
+                    "vm.swapusage"
+                ).firstMatch("total\\s+=\\s+([0-9]+(\\.[0-9]+)?[Mm]?).*", 1);
+                if (swapSizeStr.toLowerCase().endsWith("m")) {
+                    swapSizeStr = swapSizeStr.substring(0, swapSizeStr.length() - 1);
+                    return (long)(Double.parseDouble(swapSizeStr) * 1024 * 1024); // size in MB
+                }
+                return (long)(Double.parseDouble(swapSizeStr) * 1024 * 1024);
+            }
+            default: {
+                System.err.println("Unsupported operating system: " + os);
+            }
+        }
+
+        return -1;
+    }
+}
--- a/jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh	Mon Feb 23 10:47:32 2015 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-#
-# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# 
-# @test
-# @summary  Tests MM getTotalSwapSpaceSize() api.
-# @author   Swamy V
-# @bug      6252770
-#
-# @run build GetTotalSwapSpaceSize
-# @run shell TestTotalSwap.sh
-#
-
-#
-# This test tests the actual swap size on linux and solaris.
-# On windows this is just a sanity check and correct size should
-# be checked manually:
-#
-# Windows NT/XP/2000:
-#   1. Run Start->Accessories->System Tools->System Information.
-#   2. The value (reported in Kbytes) is in the "Page File Space" entry
-# Windows 98/ME:
-#   Unknown.
-#
-
-
-#set -x
-
-#Set appropriate jdk
-#
-
-if [ ! -z "${TESTJAVA}" ] ; then
-     jdk="$TESTJAVA"
-else
-     echo "--Error: TESTJAVA must be defined as the pathname of a jdk to test."
-     exit 1
-fi
-
-runOne()
-{
-   echo "runOne $@"
-   $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@  || exit 3
-}
-
-solaris_swap_size()
-{
-   total_swap=0
-   for i in `/usr/sbin/swap -l |  awk  '{print $4}' | grep -v blocks`
-   do
-      # swap -l returns size in blocks of 512 bytes.
-      total_swap=`expr $i \* 512 + $total_swap`
-   done
-}
-
-# Test GetTotalSwapSpaceSize if we are running on Unix
-total_swap=0
-case `uname -s` in
-     SunOS )
-       solaris_swap_size
-       runOne GetTotalSwapSpaceSize $total_swap 
-       ;;
-     Linux )
-       total_swap=`free -b | grep -i swap | awk '{print $2}'`
-       runOne GetTotalSwapSpaceSize $total_swap 
-       ;;
-     Darwin )
-       # $ sysctl -n vm.swapusage 
-       # total = 8192.00M  used = 7471.11M  free = 720.89M  (encrypted)
-       swap=`/usr/sbin/sysctl -n vm.swapusage | awk '{ print $3 }' | awk -F . '{ print $1 }'` || exit 2
-       total_swap=`expr $swap \* 1024 \* 1024` || exit 2
-       runOne GetTotalSwapSpaceSize $total_swap
-       ;;
-    * )
-       runOne GetTotalSwapSpaceSize "sanity-only"
-       ;;
-esac
-
-exit 0
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/Class/getEnclosingConstructor/EnclosingConstructorWithSecurityManager.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 8014678
+ * @run main EnclosingConstructorWithSecurityManager
+ * @run main/othervm EnclosingConstructorWithSecurityManager "WithSecurityManager"
+ */
+
+public class EnclosingConstructorWithSecurityManager {
+    public static void main(String[] args) {
+        if (args.length == 1) {
+            System.setSecurityManager(new SecurityManager());
+        }
+
+        new Inner();
+        Inner.theInner.getEnclosingConstructor();
+    }
+
+    public static class Inner {
+        public static Class<?> theInner;
+
+        public Inner() {
+            Object o = new Object() {
+            };
+            Inner.theInner = o.getClass();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/Class/getEnclosingMethod/EnclosingMethodWithSecurityManager.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 8014678
+ * @run main EnclosingMethodWithSecurityManager
+ * @run main/othervm EnclosingMethodWithSecurityManager "WithSecurityManager"
+ */
+
+public class EnclosingMethodWithSecurityManager {
+    public static void main(String[] args) {
+        if (args.length == 1) {
+            System.setSecurityManager(new SecurityManager());
+        }
+
+        new Inner().setTheInner();
+        Inner.theInner.getEnclosingMethod();
+    }
+
+    public static class Inner {
+        public static Class<?> theInner;
+
+        public void setTheInner() {
+            Object o = new Object() {
+            };
+            Inner.theInner = o.getClass();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/invoke/CustomizedLambdaFormTest.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 java.lang.invoke;
+
+/* @test
+ * @summary Assertion in LambdaFormEditor.bindArgumentType is too strong
+ *
+ * @run main/bootclasspath -esa java.lang.invoke.CustomizedLambdaFormTest
+ */
+public class CustomizedLambdaFormTest {
+
+    static void testExtendCustomizedBMH() throws Exception {
+        // Construct BMH
+        MethodHandle mh = MethodHandles.Lookup.IMPL_LOOKUP.findVirtual(String.class, "concat",
+                MethodType.methodType(String.class, String.class))
+                .bindTo("a");
+        mh.customize();
+        mh.bindTo("b"); // Try to extend customized BMH
+    }
+
+    public static void main(String[] args) throws Throwable {
+        testExtendCustomizedBMH();
+    }
+}
--- a/jdk/test/java/lang/invoke/lambda/LogGeneratedClassesTest.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/test/java/lang/invoke/lambda/LogGeneratedClassesTest.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.function.Predicate;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -235,8 +236,23 @@
                                   .filter(s -> s.startsWith("WARNING: Exception"))
                                   .count(),
                      2, "show error each capture");
-        // dumpLong/com/example/nosense/nosense
-        assertEquals(Files.walk(Paths.get("dumpLong")).count(), 5, "Two lambda captured failed to log");
+        // dumpLong/com/example/nonsense/nonsense
+        Path dumpPath = Paths.get("dumpLong/com/example/nonsense");
+        Predicate<Path> filter = p -> p.getParent() == null || dumpPath.startsWith(p) || p.startsWith(dumpPath);
+        boolean debug = true;
+        if (debug) {
+           Files.walk(Paths.get("dumpLong"))
+                .forEachOrdered(p -> {
+                    if (filter.test(p)) {
+                        System.out.println("accepted: " + p.toString());
+                    } else {
+                        System.out.println("filetered out: " + p.toString());
+                    }
+                 });
+        }
+        assertEquals(Files.walk(Paths.get("dumpLong"))
+                .filter(filter)
+                .count(), 5, "Two lambda captured failed to log");
         tr.assertZero("Should still return 0");
     }
 }
--- a/jdk/test/java/lang/management/CompositeData/ThreadInfoCompositeData.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/test/java/lang/management/CompositeData/ThreadInfoCompositeData.java	Tue Mar 03 08:49:13 2015 -0800
@@ -147,6 +147,11 @@
                info.getLockOwnerName() + " expected = " +
                values[LOCK_OWNER_NAME]);
         }
+        if (!values[DAEMON].equals(info.isDaemon())) {
+            throw new RuntimeException("Daemon = " +
+               info.isDaemon() + " expected = " +
+               values[DAEMON]);
+        }
 
         checkStackTrace(info.getStackTrace());
 
@@ -258,8 +263,11 @@
     private static final int SUSPENDED       = 11;
     private static final int IN_NATIVE       = 12;
     private static final int NUM_V5_ATTS     = 13;
-    // JDK 6.0 ThreadInfo attribtues
+    // JDK 6.0 ThreadInfo attributes
     private static final int LOCK_INFO       = 13;
+    // JDK 9.0 ThreadInfo attributes
+    private static final int DAEMON          = 14;
+    private static final int PRIORITY        = 15;
 
     private static final String[] validItemNames = {
         "threadId",
@@ -276,6 +284,8 @@
         "suspended",
         "inNative",
         "lockInfo",
+        "daemon",
+        "priority",
     };
 
     private static OpenType[] validItemTypes = {
@@ -293,6 +303,8 @@
         SimpleType.BOOLEAN,
         SimpleType.BOOLEAN,
         null,  // CompositeType for LockInfo
+        SimpleType.BOOLEAN,
+        SimpleType.INTEGER,
     };
 
     private static Object[] values = {
@@ -310,6 +322,8 @@
         new Boolean(false),
         new Boolean(false),
         null, // To be initialized to lockInfoCD
+        new Boolean(false),
+        Thread.NORM_PRIORITY,
     };
 
     private static final String[] steItemNames = {
@@ -381,6 +395,8 @@
         "suspended",
         "inNative",
         "lockInfo",
+        "daemon",
+        "priority",
     };
     private static final OpenType[] badItemTypes = {
         SimpleType.LONG,
@@ -397,6 +413,8 @@
         SimpleType.BOOLEAN,
         SimpleType.BOOLEAN,
         SimpleType.LONG,  // bad type
+        SimpleType.BOOLEAN,
+        SimpleType.INTEGER,
     };
 
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadDaemonTest.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.lang.management.*;
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
+
+/*
+ * @test
+ * @bug     6588467
+ * @summary Basic test of ThreadInfo.isDaemon
+ * @author  Jeremy Manson
+ */
+public class ThreadDaemonTest {
+
+    public static void main(String[] args) throws Exception {
+        final int NUM_THREADS = 20;
+        final String THREAD_PREFIX = "ThreadDaemonTest-";
+
+        final CountDownLatch started = new CountDownLatch(NUM_THREADS);
+        final CountDownLatch finished = new CountDownLatch(1);
+        final AtomicReference<Exception> fail = new AtomicReference<>(null);
+
+        Thread[] allThreads = new Thread[NUM_THREADS];
+        ThreadMXBean mbean = ManagementFactory.getThreadMXBean();
+        Random rand = new Random();
+
+        for (int i = 0; i < NUM_THREADS; i++) {
+            allThreads[i] = new Thread(new Runnable() {
+                    public void run() {
+                        try {
+                            started.countDown();
+                            finished.await();
+                        } catch (InterruptedException e) {
+                            fail.set(new Exception(
+                                "Unexpected InterruptedException"));
+                        }
+                    }
+                }, THREAD_PREFIX + i);
+            allThreads[i].setDaemon(rand.nextBoolean());
+            allThreads[i].start();
+        }
+
+        started.await();
+        try {
+            ThreadInfo[] allThreadInfos = mbean.dumpAllThreads(false, false);
+            int count = 0;
+            for (int i = 0; i < allThreadInfos.length; i++) {
+                String threadName = allThreadInfos[i].getThreadName();
+                if (threadName.startsWith(THREAD_PREFIX)) {
+                    count++;
+                    String[] nameAndNumber = threadName.split("-");
+                    int threadNum = Integer.parseInt(nameAndNumber[1]);
+                    if (allThreads[threadNum].isDaemon() !=
+                        allThreadInfos[i].isDaemon()) {
+                        throw new RuntimeException(
+                            allThreads[threadNum] + " is not like " +
+                            allThreadInfos[i] + ". TEST FAILED.");
+                    }
+                }
+            }
+            if (count != NUM_THREADS) {
+                throw new RuntimeException("Wrong number of threads examined");
+            }
+        }
+        finally { finished.countDown(); }
+
+        for (int i = 0; i < NUM_THREADS; i++) {
+            allThreads[i].join();
+        }
+        if (fail.get() != null) {
+            throw fail.get();
+        }
+    }
+}
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadDump.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadDump.java	Tue Mar 03 08:49:13 2015 -0800
@@ -34,6 +34,7 @@
 
     public static void printThreadInfo(ThreadInfo ti) {
         StringBuilder sb = new StringBuilder("\"" + ti.getThreadName() + "\"" +
+                                             (ti.isDaemon() ? " daemon" : "") +
                                              " Id=" + ti.getThreadId() +
                                              " in " + ti.getThreadState());
         if (ti.getLockName() != null) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/net/Socks/BadProxySelector.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 7178362
+ * @run main/othervm BadProxySelector
+ */
+
+import java.net.InetSocketAddress;
+import java.net.Proxy;
+import java.net.ProxySelector;
+import java.net.Socket;
+import java.net.SocketAddress;
+import java.net.ServerSocket;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+import java.io.*;
+
+public class BadProxySelector {
+    public static void main(String[] args) throws Exception {
+        ProxySelector.setDefault(new HTTPProxySelector());
+        try (ServerSocket ss = new ServerSocket(0);
+             Socket s1 = new Socket(ss.getInetAddress(), ss.getLocalPort());
+             Socket s2 = ss.accept()) {
+        }
+
+       ProxySelector.setDefault(new NullHTTPProxySelector());
+        try (ServerSocket ss = new ServerSocket(0);
+             Socket s1 = new Socket(ss.getInetAddress(), ss.getLocalPort());
+             Socket s2 = ss.accept()) {
+        }
+    }
+
+    // always returns bogus HTTP proxies
+    private static class HTTPProxySelector extends ProxySelector {
+        @Override
+        public void connectFailed(URI uri, SocketAddress sa, IOException ioe) {}
+
+        @Override
+        public List<Proxy> select(URI uri) {
+            List<Proxy> proxies = new ArrayList<>();
+            proxies.add(new Proxy(Proxy.Type.HTTP,
+                                  new InetSocketAddress("localhost", 0)));
+            proxies.add(new Proxy(Proxy.Type.HTTP,
+                                  new InetSocketAddress("localhost", 0)));
+            return proxies;
+        }
+    }
+
+    private static class NullHTTPProxySelector extends ProxySelector {
+        @Override
+        public void connectFailed(URI uri, SocketAddress sa, IOException ioe) {}
+
+        @Override
+        public List<Proxy> select(URI uri) {
+            List<Proxy> proxies = new ArrayList<>();
+            proxies.add(null);
+            proxies.add(new Proxy(Proxy.Type.HTTP,
+                                  new InetSocketAddress("localhost", 0)));
+            return proxies;
+        }
+    }
+}
--- a/jdk/test/java/nio/channels/SocketChannel/OutOfBand.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/test/java/nio/channels/SocketChannel/OutOfBand.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,8 +58,6 @@
             test1(sc1, sc2);
             test2(sc1, sc2);
             test3(sc1, sc2);
-            test4(sc1);
-
         } finally {
             if (sc1 != null) sc1.close();
             if (sc2 != null) sc2.close();
@@ -175,17 +173,4 @@
 
         thr.join();
     }
-
-    static void test4(SocketChannel sc) throws IOException {
-        boolean blocking = sc.isBlocking();
-        sc.configureBlocking(false);
-        try {
-            sc.socket().sendUrgentData(0);
-            throw new RuntimeException("IllegalBlockingModeException expected");
-        } catch (IllegalBlockingModeException x) {
-            // expected
-        } finally {
-            sc.configureBlocking(blocking);
-        }
-    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/nio/channels/SocketChannel/SendUrgentData.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,205 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 8071599
+ * @run main/othervm SendUrgentData
+ * @run main/othervm SendUrgentData -inline
+ * @summary Test sending of urgent data.
+ */
+
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.net.SocketException;
+import java.nio.ByteBuffer;
+import java.nio.channels.ServerSocketChannel;
+import java.nio.channels.SocketChannel;
+
+public class SendUrgentData {
+
+    /**
+     * The arguments may be one of the following:
+     * <ol>
+     * <li>-server</li>
+     * <li>-client host port [-inline]</li>
+     * <li>[-inline]</li>
+     * </ol>
+     * The first option creates a standalone server, the second a standalone
+     * client, and the third a self-contained server-client pair on the
+     * local host.
+     *
+     * @param args
+     * @throws Exception
+     */
+    public static void main(String[] args) throws Exception {
+
+        ServerSocketChannelThread serverThread
+                = new ServerSocketChannelThread("SendUrgentDataServer");
+        serverThread.start();
+        boolean b = serverThread.isAlive();
+
+        String host = null;
+        int port = 0;
+        boolean inline = false;
+        if (args.length > 0 && args[0].equals("-server")) {
+            System.out.println(serverThread.getAddress());
+            Thread.currentThread().suspend();
+        } else {
+            if (args.length > 0 && args[0].equals("-client")) {
+                host = args[1];
+                port = Integer.parseInt(args[2]);
+                if (args.length > 3) {
+                    inline = args[2].equals("-inline");
+                }
+            } else {
+                host = "localhost";
+                port = serverThread.getAddress().getPort();
+                if (args.length > 0) {
+                    inline = args[0].equals("-inline");
+                }
+            }
+        }
+
+        System.out.println("OOB Inline : "+inline);
+
+        SocketAddress sa = new InetSocketAddress(host, port);
+
+        try (SocketChannel sc = SocketChannel.open(sa)) {
+            sc.configureBlocking(false);
+            sc.socket().setOOBInline(inline);
+
+            sc.socket().sendUrgentData(0);
+            System.out.println("wrote 1 OOB byte");
+
+            ByteBuffer bb = ByteBuffer.wrap(new byte[100 * 1000]);
+
+            int blocked = 0;
+            long total = 0;
+
+            int n;
+            do {
+                n = sc.write(bb);
+                if (n == 0) {
+                    System.out.println("blocked, wrote " + total + " so far");
+                    if (++blocked == 10) {
+                        break;
+                    }
+                    Thread.sleep(100);
+                } else {
+                    total += n;
+                    bb.rewind();
+                }
+            } while (n > 0);
+
+            long attempted = 0;
+            while (attempted < total) {
+                bb.rewind();
+                n = sc.write(bb);
+                System.out.println("wrote " + n + " normal bytes");
+                attempted += bb.capacity();
+
+                String osName = System.getProperty("os.name").toLowerCase();
+
+                try {
+                    sc.socket().sendUrgentData(0);
+                } catch (IOException ex) {
+                    if (osName.contains("linux")) {
+                        if (!ex.getMessage().contains("Socket buffer full")) {
+                            throw new RuntimeException("Unexpected message", ex);
+                        }
+                    } else if (osName.contains("os x") || osName.contains("mac")) {
+                        if (!ex.getMessage().equals("No buffer space available")) {
+                            throw new RuntimeException("Unexpected message", ex);
+                        }
+                    } else if (osName.contains("windows")) {
+                        if (!(ex instanceof SocketException)) {
+                            throw new RuntimeException("Unexpected exception", ex);
+                        } else if (!ex.getMessage().contains("Resource temporarily unavailable")) {
+                            throw new RuntimeException("Unexpected message", ex);
+                        }
+                    } else {
+                        throw new RuntimeException("Unexpected IOException", ex);
+                    }
+                }
+
+                try {
+                    Thread.sleep(100);
+                } catch (InterruptedException ex) {
+                    // don't want to fail on this so just print trace and break
+                    ex.printStackTrace();
+                    break;
+                }
+            }
+        } finally {
+            serverThread.close();
+        }
+    }
+
+    static class ServerSocketChannelThread extends Thread {
+
+        private ServerSocketChannel ssc;
+
+        private ServerSocketChannelThread(String name) {
+            super(name);
+            try {
+                ssc = ServerSocketChannel.open();
+                ssc.bind(new InetSocketAddress((0)));
+            } catch (IOException ex) {
+                throw new RuntimeException(ex);
+            }
+        }
+
+        public void run() {
+            while (ssc.isOpen()) {
+                try {
+                    Thread.sleep(100);
+                } catch (InterruptedException ex) {
+                    throw new RuntimeException(ex);
+                }
+            }
+            try {
+                ssc.close();
+            } catch (IOException ex) {
+                throw new RuntimeException(ex);
+            }
+            System.out.println("ServerSocketChannelThread exiting ...");
+        }
+
+        public InetSocketAddress getAddress() throws IOException {
+            if (ssc == null) {
+                throw new IllegalStateException("ServerSocketChannel not created");
+            }
+
+            return (InetSocketAddress) ssc.getLocalAddress();
+        }
+
+        public void close() {
+            try {
+                ssc.close();
+            } catch (IOException ex) {
+                throw new RuntimeException(ex);
+            }
+        }
+    }
+}
--- a/jdk/test/java/nio/charset/Charset/NIOCharsetAvailabilityTest.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/test/java/nio/charset/Charset/NIOCharsetAvailabilityTest.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,41 +23,63 @@
 
 /*
  * @test
- * @bug 4777124 6920545 6911753
+ * @bug 4777124 6920545 6911753 8073924
  * @summary Verify that all Charset subclasses are available through the API
  */
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
+import java.net.URI;
 import java.nio.charset.Charset;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Collection;
+import java.nio.file.FileSystem;
+import java.nio.file.FileSystems;
+import java.nio.file.Files;
+import java.nio.file.Path;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Set;
-import java.util.Vector;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 public class NIOCharsetAvailabilityTest {
 
     public static void main(String[] args) throws Exception {
+
         // build the set of all Charset subclasses in the
         // two known charset implementation packages
-        Set charsets = new HashSet();
-        addCharsets(charsets, "sun.nio.cs");
-        addCharsets(charsets, "sun.nio.cs.ext");
-
+        FileSystem fs = FileSystems.getFileSystem(URI.create("jrt:/"));
+        Set<Class> charsets =
+            Stream.concat(Files.walk(fs.getPath("/java.base/sun/nio/cs/")),
+                          Files.walk(fs.getPath("/jdk.charsets/sun/nio/cs/ext/")))
+                 .map( p -> p.subpath(1, p.getNameCount()).toString())
+                 .filter( s ->  s.indexOf("$") == -1 && s.endsWith(".class"))
+                 .map( s -> {
+                     try {
+                         return Class.forName(s.substring(0, s.length() - 6)
+                                               .replace('/', '.'));
+                     } catch (Exception x) {
+                         throw new RuntimeException(x);
+                     }
+                  })
+                 .filter( clz -> {
+                     Class superclazz = clz.getSuperclass();
+                     while (superclazz != null && !superclazz.equals(Object.class)) {
+                         if (superclazz.equals(Charset.class)) {
+                             return true;
+                         } else {
+                             superclazz = superclazz.getSuperclass();
+                         }
+                     }
+                     return false;
+                  })
+                 .collect(Collectors.toCollection(HashSet::new));
         // remove the charsets that the API says are available
-        Collection availableCharsets = Charset.availableCharsets().values();
-        Iterator iter = availableCharsets.iterator();
-        while (iter.hasNext()) {
-            charsets.remove(((Charset) iter.next()).getClass());
-        }
+        Charset.availableCharsets()
+               .values()
+               .stream()
+               .forEach(cs -> {
+                   if (!charsets.contains(cs.getClass())) {
+                       System.out.println(" missing -> " + cs.getClass());
+                   }
+                   charsets.remove(cs.getClass());
+                });
 
         // remove the known pseudo-charsets that serve only to implement
         // other charsets, but shouldn't be known to the public
@@ -76,146 +98,12 @@
             charsets.remove(Class.forName("sun.nio.cs.JIS_X_0208_Solaris"));
             charsets.remove(Class.forName("sun.nio.cs.JIS_X_0212_Solaris"));
         }
-
         // report the charsets that are implemented but not available
-        iter = charsets.iterator();
-        while (iter.hasNext()) {
-            System.out.println("Unused Charset subclass: " + ((Class) iter.next()).getName());
-        }
         if (charsets.size() > 0) {
+            charsets.stream()
+                    .forEach( clz ->
+                        System.out.println("Unused Charset subclass: " + clz));
             throw new RuntimeException();
         }
     }
-
-    private static Vector classPathSegments = new Vector();
-
-    private static void addCharsets(Set charsets, final String packageName)
-            throws Exception {
-
-        String classPath = AccessController.doPrivileged(
-             (PrivilegedAction<String>)() -> System.getProperty("sun.boot.class.path"));
-        String s = AccessController.doPrivileged(
-             (PrivilegedAction<String>)() -> System.getProperty("java.class.path"));
-
-        // Search combined system and application class path
-        if (s != null && s.length() != 0) {
-            classPath += File.pathSeparator + s;
-        }
-        while (classPath != null && classPath.length() != 0) {
-            int i = classPath.lastIndexOf(java.io.File.pathSeparatorChar);
-            String dir = classPath.substring(i + 1);
-            if (i == -1) {
-                classPath = null;
-            } else {
-                classPath = classPath.substring(0, i);
-            }
-            classPathSegments.insertElementAt(dir, 0);
-        }
-
-        String[] classList = (String[])
-            java.security.AccessController.doPrivileged(
-                                    new java.security.PrivilegedAction() {
-                public Object run() {
-                    return getClassList(packageName, "");
-                }
-            });
-
-        for (int i = 0; i < classList.length; i++) {
-            try {
-                Class clazz = Class.forName(packageName + "." + classList[i]);
-                Class superclazz = clazz.getSuperclass();
-                while (superclazz != null && !superclazz.equals(Object.class)) {
-                    if (superclazz.equals(Charset.class)) {
-                        charsets.add(clazz);
-                        break;
-                    } else {
-                        superclazz = superclazz.getSuperclass();
-                    }
-                }
-            } catch (ClassNotFoundException e) {
-            }
-        }
-    }
-
-    private static final char ZIPSEPARATOR = '/';
-
-    /**
-     * Walk through CLASSPATH and find class list from a package.
-     * The class names start with prefix string
-     * @param package name, class name prefix
-     * @return class list in an array of String
-     */
-    private static String[] getClassList(String pkgName, String prefix) {
-        Vector listBuffer = new Vector();
-        String packagePath = pkgName.replace('.', File.separatorChar)
-            + File.separatorChar;
-        String zipPackagePath = pkgName.replace('.', ZIPSEPARATOR)
-            + ZIPSEPARATOR;
-        for (int i = 0; i < classPathSegments.size(); i++){
-            String onePath = (String) classPathSegments.elementAt(i);
-            File f = new File(onePath);
-            if (!f.exists())
-                continue;
-            if (f.isFile())
-                scanFile(f, zipPackagePath, listBuffer, prefix);
-            else if (f.isDirectory()) {
-                String fullPath;
-                if (onePath.endsWith(File.separator))
-                    fullPath = onePath + packagePath;
-                else
-                    fullPath = onePath + File.separatorChar + packagePath;
-                File dir = new File(fullPath);
-                if (dir.exists() && dir.isDirectory())
-                    scanDir(dir, listBuffer, prefix);
-            }
-        }
-        String[] classNames = new String[listBuffer.size()];
-        listBuffer.copyInto(classNames);
-        return classNames;
-    }
-
-    private static void addClass (String className, Vector listBuffer, String prefix) {
-        if (className != null && className.startsWith(prefix)
-                    && !listBuffer.contains(className))
-            listBuffer.addElement(className);
-    }
-
-    private static String midString(String str, String pre, String suf) {
-        String midStr;
-        if (str.startsWith(pre) && str.endsWith(suf))
-            midStr = str.substring(pre.length(), str.length() - suf.length());
-        else
-            midStr = null;
-        return midStr;
-    }
-
-    private static void scanDir(File dir, Vector listBuffer, String prefix) {
-        String[] fileList = dir.list();
-        for (int i = 0; i < fileList.length; i++) {
-            addClass(midString(fileList[i], "", ".class"), listBuffer, prefix);
-        }
-    }
-
-    private static void scanFile(File f, String packagePath, Vector listBuffer,
-                String prefix) {
-        try {
-            ZipInputStream zipFile = new ZipInputStream(new FileInputStream(f));
-            ZipEntry entry;
-            while ((entry = zipFile.getNextEntry()) != null) {
-                String eName = entry.getName();
-                if (eName.startsWith(packagePath)) {
-                    if (eName.endsWith(".class")) {
-                        addClass(midString(eName, packagePath, ".class"),
-                                listBuffer, prefix);
-                    }
-                }
-            }
-        } catch (FileNotFoundException e) {
-            System.out.println("file not found:" + e);
-        } catch (IOException e) {
-            System.out.println("file IO Exception:" + e);
-        } catch (Exception e) {
-            System.out.println("Exception:" + e);
-        }
-    }
 }
--- a/jdk/test/java/nio/charset/Charset/RegisteredCharsets.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/test/java/nio/charset/Charset/RegisteredCharsets.java	Tue Mar 03 08:49:13 2015 -0800
@@ -22,7 +22,8 @@
  */
 
 /* @test
- * @bug 4473201 4696726 4652234 4482298 4784385 4966197 4267354 5015668 6911753
+ * @bug 4473201 4696726 4652234 4482298 4784385 4966197 4267354 5015668
+        6911753 8071447
  * @summary Check that registered charsets are actually registered
  */
 
@@ -135,6 +136,7 @@
                             "x-IBM1122",
                             "x-IBM1123",
                             "x-IBM1124",
+                            "x-IBM1166",
                             "x-IBM875",
                             "x-IBM921",
                             "x-IBM922",
@@ -863,6 +865,14 @@
                     "1124"
                 } );
 
+        aliasCheck("x-IBM1166" ,
+                new String[] {
+                    "cp1166", // JDK historical
+                    "ibm1166",
+                    "ibm-1166",
+                    "1166"
+                } );
+
         aliasCheck("IBM273" ,
                 new String[] {
                     "cp273", // JDK historical
--- a/jdk/test/java/nio/charset/RemovingSunIO/SunioAlias.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/test/java/nio/charset/RemovingSunIO/SunioAlias.java	Tue Mar 03 08:49:13 2015 -0800
@@ -675,6 +675,12 @@
         aliasTable.put("1124",                  "Cp1124");
 
         // MIBenum: ????
+        aliasTable.put("ibm1166",               "Cp1166");
+        aliasTable.put("ibm-1166",              "Cp1166");
+        aliasTable.put("cp1166",                "Cp1166");
+        aliasTable.put("1166",                  "Cp1166");
+
+        // MIBenum: ????
         aliasTable.put("ibm1381",               "Cp1381");        /* MDA */
         aliasTable.put("ibm-1381",              "Cp1381");        /* MDA */
         aliasTable.put("cp1381",                "Cp1381");        /* MDA */
--- a/jdk/test/java/time/test/java/time/TestClock_System.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/test/java/time/test/java/time/TestClock_System.java	Tue Mar 03 08:49:13 2015 -0800
@@ -66,8 +66,10 @@
 import java.time.Clock;
 import java.time.Instant;
 import java.time.ZoneId;
+import java.time.ZoneOffset;
 
 import org.testng.annotations.Test;
+import org.testng.annotations.DataProvider;
 
 /**
  * Test system clock.
@@ -76,6 +78,7 @@
 public class TestClock_System {
 
     private static final ZoneId PARIS = ZoneId.of("Europe/Paris");
+    private static final Clock systemUTC = Clock.systemUTC();
 
     public void test_withZone_same() {
         Clock test = Clock.system(PARIS);
@@ -90,6 +93,32 @@
     }
 
     //-----------------------------------------------------------------------
+    @DataProvider(name="sampleSystemUTC")
+    Object[][] provider_sampleSystemUTC() {
+        return new Object[][] {
+            {"Clock.systemUTC()#1",  Clock.systemUTC()},
+            {"Clock.systemUTC()#2",  Clock.systemUTC()},
+            {"Clock.system(ZoneOffset.UTC)#1",  Clock.system(ZoneOffset.UTC)},
+            {"Clock.system(ZoneOffset.UTC)#2",  Clock.system(ZoneOffset.UTC)}
+        };
+    }
+
+    // Test for 8073394
+    @Test(dataProvider="sampleSystemUTC")
+    public void test_systemUTC(String s, Clock clock) {
+        if (clock != systemUTC) {
+            throw new RuntimeException("Unexpected clock instance for " + s + ": "
+                + "\n\texpected: " + toString(systemUTC)
+                + "\n\tactual:   " + toString(clock));
+        }
+    }
+
+    private static String toString(Clock c) {
+        return c == null ? null :
+               c + " " + c.getClass().getName() + "@" + System.identityHashCode(c);
+    }
+
+    //-----------------------------------------------------------------------
 
     private static String formatTime(String prefix, Instant time) {
         return prefix + ": " + time + " - seconds: "
--- a/jdk/test/java/time/test/java/time/TestInstant.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/test/java/time/test/java/time/TestInstant.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -62,6 +62,8 @@
 import java.time.Instant;
 
 import org.testng.annotations.Test;
+import org.testng.annotations.DataProvider;
+import static org.testng.Assert.assertEquals;
 
 /**
  * Test Instant.
@@ -74,4 +76,24 @@
         assertImmutable(Instant.class);
     }
 
+    @DataProvider(name="sampleEpochMillis")
+    private Object[][] provider_sampleEpochMillis() {
+        return new Object[][] {
+            {"Long.MAX_VALUE", Long.MAX_VALUE},
+            {"Long.MAX_VALUE-1", Long.MAX_VALUE - 1},
+            {"1", 1L},
+            {"0", 0L},
+            {"-1", -1L},
+            {"Long.MIN_VALUE+1", Long.MIN_VALUE + 1},
+            {"Long.MIN_VALUE", Long.MIN_VALUE}
+        };
+    }
+
+    @Test(dataProvider="sampleEpochMillis")
+    public void test_epochMillis(String name, long millis) {
+        Instant t1 = Instant.ofEpochMilli(millis);
+        long m = t1.toEpochMilli();
+        assertEquals(millis, m, name);
+    }
+
 }
--- a/jdk/test/java/util/Arrays/TimSortStackSize2.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/test/java/util/Arrays/TimSortStackSize2.java	Tue Mar 03 08:49:13 2015 -0800
@@ -24,63 +24,59 @@
 /*
  * @test
  * @bug 8072909
- * @run main/othervm -Xmx385m TimSortStackSize2 67108864
- * not for regular execution on all platforms:
+ * @run main/othervm -Xms385m TimSortStackSize2 67108864
+ * @summary Test TimSort stack size on big arrays
+ * big tests not for regular execution on all platforms:
  * run main/othervm -Xmx8g TimSortStackSize2 1073741824
  * run main/othervm -Xmx16g TimSortStackSize2 2147483644
- * @summary Test TimSort stack size on big arrays
  */
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Comparator;
 import java.util.List;
+import java.util.function.Consumer;
 
 public class TimSortStackSize2 {
 
     public static void main(String[] args) {
         int lengthOfTest = Integer.parseInt(args[0]);
-        boolean passed = true;
-        try {
-            Integer [] a = new TimSortStackSize2(lengthOfTest).createArray();
-            long begin = System.nanoTime();
-            Arrays.sort(a, new Comparator<Object>() {
-                    @SuppressWarnings("unchecked")
-                    public int compare(Object first, Object second) {
-                        return ((Comparable<Object>)first).compareTo(second);
-                    }
-                });
-            long end = System.nanoTime();
-            System.out.println("TimSort: " + (end - begin));
-            a = null;
-        } catch (ArrayIndexOutOfBoundsException e){
-            System.out.println("TimSort broken:");
-            e.printStackTrace();
-            passed = false;
-        }
-
-        try {
-            Integer [] a = new TimSortStackSize2(lengthOfTest).createArray();
-            long begin = System.nanoTime();
-            Arrays.sort(a);
-            long end = System.nanoTime();
-            System.out.println("ComparableTimSort: " + (end - begin));
-            a = null;
-        } catch (ArrayIndexOutOfBoundsException e){
-            System.out.println("ComparableTimSort broken:");
-            e.printStackTrace();
-            passed = false;
-        }
+        boolean passed = doTest("TimSort", lengthOfTest,
+            (Integer [] a) -> Arrays.sort(a));
+        passed = doTest("ComparableTimSort", lengthOfTest, (Integer [] a) ->
+            Arrays.sort(a, (Object first, Object second) -> {
+                return ((Comparable<Object>)first).compareTo(second);
+            }))
+            && passed;
         if ( !passed ){
             throw new RuntimeException();
         }
     }
 
+    private static boolean doTest(final String msg, final int lengthOfTest,
+                                  final  Consumer<Integer[]> c){
+        Integer [] a = null;
+        try {
+            a = new TimSortStackSize2(lengthOfTest).createArray();
+            long begin = System.nanoTime();
+            c.accept(a);
+            long end = System.nanoTime();
+            System.out.println(msg + " OK. Time: " + (end - begin) + "ns");
+        } catch (ArrayIndexOutOfBoundsException e){
+            System.out.println(msg + " broken:");
+            e.printStackTrace();
+            return false;
+        } finally {
+            a = null;
+        }
+        return true;
+    }
+
     private static final int MIN_MERGE = 32;
     private final int minRun;
     private final int length;
     private final List<Long> runs = new ArrayList<Long>();
 
-    public TimSortStackSize2(int len) {
+    public TimSortStackSize2(final int len) {
         this.length = len;
         minRun = minRunLength(len);
         fillRunsJDKWorstCase();
@@ -106,24 +102,24 @@
      * @param X  The sum of the sequence that should be added to runs.
      */
     private void generateJDKWrongElem(long X) {
-        for(long newTotal; X >= 2*minRun+1; X = newTotal) {
+        for(long newTotal; X >= 2 * minRun + 1; X = newTotal) {
             //Default strategy
-            newTotal = X/2 + 1;
+            newTotal = X / 2 + 1;
             //Specialized strategies
-            if(3*minRun+3 <= X && X <= 4*minRun+1) {
+            if(3 * minRun + 3 <= X && X <= 4*minRun+1) {
                 // add x_1=MIN+1, x_2=MIN, x_3=X-newTotal  to runs
-                newTotal = 2*minRun+1;
-            } else if(5*minRun+5 <= X && X <= 6*minRun+5) {
+                newTotal = 2 * minRun + 1;
+            } else if (5 * minRun + 5 <= X && X <= 6 * minRun + 5) {
                 // add x_1=MIN+1, x_2=MIN, x_3=MIN+2, x_4=X-newTotal  to runs
-                newTotal = 3*minRun+3;
-            } else if(8*minRun+9 <= X && X <= 10*minRun+9) {
+                newTotal = 3 * minRun + 3;
+            } else if (8 * minRun + 9 <= X && X <= 10 * minRun + 9) {
                 // add x_1=MIN+1, x_2=MIN, x_3=MIN+2, x_4=2MIN+2, x_5=X-newTotal  to runs
-                newTotal = 5*minRun+5;
-            } else if(13*minRun+15 <= X && X <= 16*minRun+17) {
+                newTotal = 5 * minRun + 5;
+            } else if (13 * minRun + 15 <= X && X <= 16 * minRun + 17) {
                 // add x_1=MIN+1, x_2=MIN, x_3=MIN+2, x_4=2MIN+2, x_5=3MIN+4, x_6=X-newTotal  to runs
-                newTotal = 8*minRun+9;
+                newTotal = 8 * minRun + 9;
             }
-            runs.add(0, X-newTotal);
+            runs.add(0, X - newTotal);
         }
         runs.add(0, X);
     }
@@ -144,10 +140,10 @@
         long Y = minRun + 4;
         long X = minRun;
 
-        while(runningTotal+Y+X <= length) {
+        while (runningTotal + Y + X <= length) {
             runningTotal += X + Y;
             generateJDKWrongElem(X);
-            runs.add(0,Y);
+            runs.add(0, Y);
 
             // X_{i+1} = Y_i + x_{i,1} + 1, since runs.get(1) = x_{i,1}
             X = Y + runs.get(1) + 1;
@@ -156,21 +152,22 @@
             Y += X + 1;
         }
 
-        if(runningTotal + X <= length) {
+        if (runningTotal + X <= length) {
             runningTotal += X;
             generateJDKWrongElem(X);
         }
 
-        runs.add(length-runningTotal);
+        runs.add(length - runningTotal);
     }
 
-    private Integer[] createArray() {
-        Integer[] a = new Integer[length];
+    private Integer [] createArray() {
+        Integer [] a = new Integer[length];
         Arrays.fill(a, 0);
         int endRun = -1;
-        for(long len : runs)
-            a[endRun+=len] = 1;
-        a[length-1]=0;
+        for (long len : runs) {
+            a[endRun += len] = 1;
+        }
+        a[length - 1] = 0;
         return a;
     }
 
--- a/jdk/test/java/util/logging/FileHandlerLongLimit.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/test/java/util/logging/FileHandlerLongLimit.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -346,26 +346,29 @@
             assertEquals(0, getWritten(metered), "written");
 
             // now we're going to publish a series of log records
+            // we're using the same log record over and over to make
+            // sure we get the same amount of bytes.
             String msg = "this is at least 10 chars long";
-            fh.publish(new LogRecord(Level.SEVERE, msg));
+            LogRecord record = new LogRecord(Level.SEVERE, msg);
+            fh.publish(record);
             fh.flush();
             long w = getWritten(metered);
             long offset = getWritten(metered);
             System.out.println("first offset is:  " + offset);
 
-            fh.publish(new LogRecord(Level.SEVERE, msg));
+            fh.publish(record);
             fh.flush();
             offset = getWritten(metered) - w;
             w = getWritten(metered);
             System.out.println("second offset is: " + offset);
 
-            fh.publish(new LogRecord(Level.SEVERE, msg));
+            fh.publish(record);
             fh.flush();
             offset = getWritten(metered) - w;
             w = getWritten(metered);
             System.out.println("third offset is:  " + offset);
 
-            fh.publish(new LogRecord(Level.SEVERE, msg));
+            fh.publish(record);
             fh.flush();
             offset = getWritten(metered) - w;
             System.out.println("fourth offset is: " + offset);
@@ -377,7 +380,7 @@
 
             // publish one more log record. we should still be just beneath
             // the limit
-            fh.publish(new LogRecord(Level.SEVERE, msg));
+            fh.publish(record);
             fh.flush();
             assertEquals(w+offset, getWritten(metered), "written");
 
@@ -392,9 +395,9 @@
             // writing the first log record or just before writing the next
             // one. We publich two - so we're sure that the log must have
             // rotated.
-            fh.publish(new LogRecord(Level.SEVERE, msg));
+            fh.publish(record);
             fh.flush();
-            fh.publish(new LogRecord(Level.SEVERE, msg));
+            fh.publish(record);
             fh.flush();
 
             // Check that fh.meter is a different instance of MeteredStream.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/logging/HigherResolutionTimeStamps/LogRecordWithNanos.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.logging.Level;
+import java.util.logging.LogRecord;
+import java.util.logging.SimpleFormatter;
+
+/**
+ * @test
+ * @bug 8072645
+ * @summary tests that LogRecord has nanos...
+ * @run main LogRecordWithNanos
+ * @author danielfuchs
+ */
+public class LogRecordWithNanos {
+
+    static final int MILLIS_IN_SECOND = 1000;
+    static final int NANOS_IN_MILLI = 1000_000;
+    static final int NANOS_IN_SECOND = 1000_000_000;
+
+    static final boolean verbose = false;
+
+    static final class TestAssertException extends RuntimeException {
+        TestAssertException(String msg) { super(msg); }
+    }
+
+    private static void assertEquals(long expected, long received, String msg) {
+        if (expected != received) {
+            throw new TestAssertException("Unexpected result for " + msg
+                    + ".\n\texpected: " + expected
+                    +  "\n\tactual:   " + received);
+        } else if (verbose) {
+            System.out.println("Got expected " + msg + ": " + received);
+        }
+    }
+
+    /**
+     * Serializes a log record, then deserializes it and check that both
+     * records match.
+     * @param record the log record to serialize & deserialize.
+     * @throws IOException Unexpected.
+     * @throws ClassNotFoundException  Unexpected.
+     */
+    public static void test(LogRecord record)
+            throws IOException, ClassNotFoundException {
+
+        // Format the given logRecord using the SimpleFormatter
+        SimpleFormatter formatter = new SimpleFormatter();
+        String str = formatter.format(record);
+
+        // Serialize the given LogRecord
+        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        final ObjectOutputStream oos = new ObjectOutputStream(baos);
+        oos.writeObject(record);
+        oos.flush();
+        oos.close();
+
+        // First checks that the log record can be deserialized
+        final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+        final ObjectInputStream ois = new ObjectInputStream(bais);
+        final LogRecord record2 = (LogRecord)ois.readObject();
+
+        assertEquals(record.getMillis(), record2.getMillis(), "getMillis()");
+        assertEquals(record.getInstant().getEpochSecond(),
+                record2.getInstant().getEpochSecond(),
+                "getInstant().getEpochSecond()");
+        assertEquals(record.getInstant().getNano(),
+                record2.getInstant().getNano(),
+                "getInstant().getNano()");
+        assertEquals(record.getInstant().toEpochMilli(),
+                record2.getInstant().toEpochMilli(),
+                "getInstant().toEpochMilli()");
+        assertEquals(record.getMillis(),
+                record.getInstant().toEpochMilli(),
+                "getMillis()/getInstant().toEpochMilli()");
+        assertEquals(record2.getMillis(),
+                record2.getInstant().toEpochMilli(),
+                "getMillis()/getInstant().toEpochMilli()");
+        assertEquals((record.getMillis()%MILLIS_IN_SECOND)*NANOS_IN_MILLI
+                + (record.getInstant().getNano() % NANOS_IN_MILLI),
+                record.getInstant().getNano(),
+                "record.getMillis()%1000)*1000_000"
+                + " + record.getInstant().getNano()%1000_000 / getInstant().getNano()");
+        assertEquals((record2.getMillis()%MILLIS_IN_SECOND)*NANOS_IN_MILLI
+                + (record2.getInstant().getNano() % NANOS_IN_MILLI),
+                record2.getInstant().getNano(),
+                "record2.getMillis()%1000)*1000_000"
+                + " + record2.getInstant().getNano()%1000_000 / getInstant().getNano()");
+
+        // Format the deserialized LogRecord using the SimpleFormatter, and
+        // check that the string representation obtained matches the string
+        // representation of the original LogRecord
+        String str2 = formatter.format(record2);
+        if (!str.equals(str2))
+            throw new RuntimeException("Unexpected values in deserialized object:"
+                + "\n\tExpected:  " + str
+                + "\n\tRetrieved: "+str);
+
+    }
+
+
+    public static void main(String[] args) throws Exception {
+        int count=0;
+        for (int i=0; i<1000; i++) {
+            LogRecord record = new LogRecord(Level.INFO, "Java Version: {0}");
+            record.setLoggerName("test");
+            record.setParameters(new Object[] {System.getProperty("java.version")});
+            if (record.getInstant().getNano() % 1000_000 != 0) {
+                count++;
+            }
+            test(record);
+        }
+        if (count == 0) {
+            throw new RuntimeException("Expected at least one record to have nanos");
+        }
+        System.out.println(count + "/1000 records had nano adjustment.");
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/logging/HigherResolutionTimeStamps/LogRecordWithNanosAPI.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,308 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.time.Instant;
+import java.util.Objects;
+import java.util.logging.Level;
+import java.util.logging.LogRecord;
+import java.util.logging.SimpleFormatter;
+
+/**
+ * @test
+ * @bug 8072645
+ * @summary tests the new methods added to LogRecord.
+ * @run main LogRecordWithNanosAPI
+ * @author danielfuchs
+ */
+public class LogRecordWithNanosAPI {
+
+    static final int MILLIS_IN_SECOND = 1000;
+    static final int NANOS_IN_MILLI = 1000_000;
+    static final int NANOS_IN_SECOND = 1000_000_000;
+
+    static final boolean verbose = true;
+
+    static final class TestAssertException extends RuntimeException {
+        TestAssertException(String msg) { super(msg); }
+    }
+
+    private static void assertEquals(long expected, long received, String msg) {
+        if (expected != received) {
+            throw new TestAssertException("Unexpected result for " + msg
+                    + ".\n\texpected: " + expected
+                    +  "\n\tactual:   " + received);
+        } else if (verbose) {
+            System.out.println("Got expected " + msg + ": " + received);
+        }
+    }
+
+    private static void assertEquals(Object expected, Object received, String msg) {
+        if (!Objects.equals(expected, received)) {
+            throw new TestAssertException("Unexpected result for " + msg
+                    + ".\n\texpected: " + expected
+                    +  "\n\tactual:   " + received);
+        } else if (verbose) {
+            System.out.println("Got expected " + msg + ": " + received);
+        }
+    }
+
+    // The nano second fractional part of a second, contained in a time expressed
+    // as a number of millisecond from the epoch.
+    private static long nanoInSecondFromEpochMilli(long millis) {
+        return (((millis%MILLIS_IN_SECOND) + MILLIS_IN_SECOND)%MILLIS_IN_SECOND)*NANOS_IN_MILLI;
+    }
+
+    /**
+     * Serializes a log record, then deserializes it and check that both
+     * records match.
+     * @param record the log record to serialize & deserialize.
+     * @param hasExceedingNanos whether the record has a nano adjustment whose
+     *            value exceeds 1ms.
+     * @throws IOException Unexpected.
+     * @throws ClassNotFoundException  Unexpected.
+     */
+    public static void test(LogRecord record, boolean hasExceedingNanos)
+            throws IOException, ClassNotFoundException {
+
+        // Format the given logRecord using the SimpleFormatter
+        SimpleFormatter formatter = new SimpleFormatter();
+        String str = formatter.format(record);
+
+        // Serialize the given LogRecord
+        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        final ObjectOutputStream oos = new ObjectOutputStream(baos);
+        oos.writeObject(record);
+        oos.flush();
+        oos.close();
+
+        // First checks that the log record can be deserialized
+        final ByteArrayInputStream bais =
+                new ByteArrayInputStream(baos.toByteArray());
+        final ObjectInputStream ois = new ObjectInputStream(bais);
+        final LogRecord record2 = (LogRecord)ois.readObject();
+
+        assertEquals(record.getMillis(), record2.getMillis(), "getMillis()");
+        assertEquals(record.getInstant().getEpochSecond(),
+                record2.getInstant().getEpochSecond(),
+                "getInstant().getEpochSecond()");
+        assertEquals(record.getInstant().getNano(),
+                record2.getInstant().getNano(),
+                "getInstant().getNano()");
+        assertEquals(record.getInstant().toEpochMilli(),
+                record2.getInstant().toEpochMilli(),
+                "getInstant().toEpochMilli()");
+        long millis = record.getMillis();
+        millis = hasExceedingNanos
+                ? Instant.ofEpochSecond(millis/MILLIS_IN_SECOND,
+                        (millis%MILLIS_IN_SECOND)*NANOS_IN_MILLI
+                        + record.getInstant().getNano() % NANOS_IN_MILLI).toEpochMilli()
+                : millis;
+        assertEquals(millis, record.getInstant().toEpochMilli(),
+                "getMillis()/getInstant().toEpochMilli()");
+        millis = record2.getMillis();
+        millis = hasExceedingNanos
+                ? Instant.ofEpochSecond(millis/MILLIS_IN_SECOND,
+                        (millis%MILLIS_IN_SECOND)*NANOS_IN_MILLI
+                        + record2.getInstant().getNano() % NANOS_IN_MILLI).toEpochMilli()
+                : millis;
+        assertEquals(millis, record2.getInstant().toEpochMilli(),
+                "getMillis()/getInstant().toEpochMilli()");
+        long nanos = nanoInSecondFromEpochMilli(record.getMillis())
+                + record.getInstant().getNano() % NANOS_IN_MILLI;
+        assertEquals(nanos, record.getInstant().getNano(),
+                "nanoInSecondFromEpochMilli(record.getMillis())"
+                + " + record.getInstant().getNano() % NANOS_IN_MILLI /getInstant().getNano()");
+        nanos = nanoInSecondFromEpochMilli(record2.getMillis())
+                + record2.getInstant().getNano() % NANOS_IN_MILLI;
+        assertEquals(nanos, record2.getInstant().getNano(),
+                "nanoInSecondFromEpochMilli(record2.getMillis())"
+                + " + record2.getInstant().getNano() % NANOS_IN_MILLI /getInstant().getNano()");
+
+        // Format the deserialized LogRecord using the SimpleFormatter, and
+        // check that the string representation obtained matches the string
+        // representation of the original LogRecord
+        String str2 = formatter.format(record2);
+        if (!str.equals(str2))
+            throw new RuntimeException("Unexpected values in deserialized object:"
+                + "\n\tExpected:  " + str
+                + "\n\tRetrieved: "+str);
+
+    }
+
+
+    public static void main(String[] args) throws Exception {
+        int count=0;
+        LogRecord record = new LogRecord(Level.INFO, "Java Version: {0}");
+        record.setLoggerName("test");
+        record.setParameters(new Object[] {System.getProperty("java.version")});
+        final int nanos = record.getInstant().getNano() % NANOS_IN_MILLI;
+        final long millis = record.getMillis();
+        final Instant instant = record.getInstant();
+        if (millis != instant.toEpochMilli()) {
+            throw new RuntimeException("Unexpected millis: "
+                    + record.getMillis());
+        }
+        test(record, false);
+
+        // nano adjustment < 1ms (canonical case)
+        int newNanos = (nanos + 111111) % NANOS_IN_MILLI;
+        record.setInstant(Instant.ofEpochSecond(millis/MILLIS_IN_SECOND,
+                (millis % MILLIS_IN_SECOND) * NANOS_IN_MILLI + newNanos));
+        assertEquals(newNanos, record.getInstant().getNano() % NANOS_IN_MILLI,
+                "record.getInstant().getNano() % NANOS_IN_MILLI");
+        assertEquals(millis, record.getMillis(), "record.getMillis()");
+        assertEquals(Instant.ofEpochSecond(millis/MILLIS_IN_SECOND,
+                (millis%MILLIS_IN_SECOND)*NANOS_IN_MILLI + newNanos),
+                record.getInstant(), "record.getInstant()");
+        test(record, false);
+        assertEquals(newNanos, record.getInstant().getNano() % NANOS_IN_MILLI,
+                "record.getInstant().getNano() % NANOS_IN_MILLI");
+        assertEquals(millis, record.getMillis(), "record.getMillis()");
+        assertEquals(Instant.ofEpochSecond(millis/MILLIS_IN_SECOND,
+                (millis%MILLIS_IN_SECOND)*NANOS_IN_MILLI + newNanos),
+                record.getInstant(), "record.getInstant()");
+
+        // nano adjustment > 1ms - non canonical - should still work
+        int newExceedingNanos = 2111_111;
+        record.setInstant(Instant.ofEpochSecond(millis/MILLIS_IN_SECOND,
+                (millis % MILLIS_IN_SECOND) * NANOS_IN_MILLI + newExceedingNanos));
+        assertEquals(newExceedingNanos % NANOS_IN_MILLI,
+                record.getInstant().getNano() % NANOS_IN_MILLI,
+                "record.getInstant().getNano() % NANOS_IN_MILLI");
+        assertEquals(millis + newExceedingNanos / NANOS_IN_MILLI,
+                record.getMillis(), "record.getMillis()");
+        assertEquals(Instant.ofEpochSecond(millis/MILLIS_IN_SECOND,
+                (millis%MILLIS_IN_SECOND)*NANOS_IN_MILLI + newExceedingNanos),
+                record.getInstant(), "record.getInstant()");
+        test(record, true);
+        assertEquals(newExceedingNanos % NANOS_IN_MILLI,
+                record.getInstant().getNano() % NANOS_IN_MILLI,
+                "record.getInstant().getNano() % NANOS_IN_MILLI");
+        assertEquals(millis  + newExceedingNanos / NANOS_IN_MILLI,
+                record.getMillis(), "record.getMillis()");
+        assertEquals(Instant.ofEpochSecond(millis/MILLIS_IN_SECOND,
+                (millis%MILLIS_IN_SECOND)*NANOS_IN_MILLI + newExceedingNanos),
+                record.getInstant(), "record.getInstant()");
+
+        // nano adjustement > 1s - non canonical - should still work
+        newExceedingNanos = 1111_111_111;
+        record.setInstant(Instant.ofEpochSecond(millis/MILLIS_IN_SECOND,
+                (millis % MILLIS_IN_SECOND) * NANOS_IN_MILLI + newExceedingNanos));
+        assertEquals(newExceedingNanos % NANOS_IN_MILLI,
+                record.getInstant().getNano() % NANOS_IN_MILLI,
+                "record.getInstant().getNano() % NANOS_IN_MILLI");
+        assertEquals(millis  + newExceedingNanos / NANOS_IN_MILLI,
+                record.getMillis(), "record.getMillis()");
+        assertEquals(Instant.ofEpochSecond(millis/MILLIS_IN_SECOND,
+                (millis%MILLIS_IN_SECOND)*NANOS_IN_MILLI + newExceedingNanos),
+                record.getInstant(), "record.getInstant()");
+        test(record, true);
+        assertEquals(newExceedingNanos % NANOS_IN_MILLI,
+                record.getInstant().getNano() % NANOS_IN_MILLI,
+                "record.getInstant().getNano() % NANOS_IN_MILLI");
+        assertEquals(millis  + newExceedingNanos / NANOS_IN_MILLI,
+                record.getMillis(), "record.getMillis()");
+        assertEquals(Instant.ofEpochSecond(millis/MILLIS_IN_SECOND,
+                (millis%MILLIS_IN_SECOND)*NANOS_IN_MILLI + newExceedingNanos),
+                record.getInstant(), "record.getInstant()");
+
+        // nano adjustement < 0 - non canonical - should still work
+        newExceedingNanos = -1;
+        record.setInstant(Instant.ofEpochSecond(millis/MILLIS_IN_SECOND,
+                (millis % MILLIS_IN_SECOND) * NANOS_IN_MILLI + newExceedingNanos));
+        assertEquals(newExceedingNanos + NANOS_IN_MILLI,
+                record.getInstant().getNano() % NANOS_IN_MILLI,
+                "record.getInstant().getNano() % NANOS_IN_MILLI");
+        assertEquals(millis -1, record.getMillis(), "record.getMillis()");
+        assertEquals(Instant.ofEpochSecond(millis/MILLIS_IN_SECOND,
+                (millis%MILLIS_IN_SECOND)*NANOS_IN_MILLI + newExceedingNanos),
+                record.getInstant(), "record.getInstant()");
+        test(record, true);
+        record.setInstant(Instant.ofEpochSecond(millis/MILLIS_IN_SECOND,
+                (millis % MILLIS_IN_SECOND) * NANOS_IN_MILLI + newExceedingNanos));
+        assertEquals(millis -1, record.getMillis(), "record.getMillis()");
+        assertEquals(Instant.ofEpochSecond(millis/MILLIS_IN_SECOND,
+                (millis%MILLIS_IN_SECOND)*NANOS_IN_MILLI + newExceedingNanos),
+                record.getInstant(), "record.getInstant()");
+
+        // setMillis
+        record.setMillis(millis-1);
+        assertEquals(millis-1, record.getInstant().toEpochMilli(),
+                "record.getInstant().toEpochMilli()");
+        assertEquals(millis-1, record.getMillis(),
+                "record.getMillis()");
+        assertEquals(0, record.getInstant().getNano() % NANOS_IN_MILLI,
+                "record.getInstant().getNano() % NANOS_IN_MILLI");
+        test(record, false);
+        assertEquals(millis-1, record.getInstant().toEpochMilli(),
+                "record.getInstant().toEpochMilli()");
+        assertEquals(millis-1, record.getMillis(),
+                "record.getMillis()");
+        assertEquals(0, record.getInstant().getNano() % NANOS_IN_MILLI,
+                "record.getInstant().getNano() % NANOS_IN_MILLI");
+
+        // setMillis to 0
+        record.setMillis(0);
+        assertEquals(0, record.getInstant().toEpochMilli(),
+                "record.getInstant().toEpochMilli()");
+        assertEquals(0, record.getMillis(),
+                "record.getMillis()");
+        assertEquals(0, record.getInstant().getNano() % NANOS_IN_MILLI,
+                "record.getInstant().getNano() % NANOS_IN_MILLI");
+        test(record, false);
+        assertEquals(0, record.getInstant().toEpochMilli(),
+                "record.getInstant().toEpochMilli()");
+        assertEquals(0, record.getMillis(),
+                "record.getMillis()");
+        assertEquals(0, record.getInstant().getNano() % NANOS_IN_MILLI,
+                "record.getInstant().getNano() % NANOS_IN_MILLI");
+
+        // setMillis to -1
+        record.setMillis(-1);
+        assertEquals(-1, record.getInstant().toEpochMilli(),
+                "record.getInstant().toEpochMilli()");
+        assertEquals(-1, record.getMillis(),
+                "record.getMillis()");
+        assertEquals(0, record.getInstant().getNano() % NANOS_IN_MILLI,
+                "record.getInstant().getNano() % NANOS_IN_MILLI");
+        test(record, false);
+        assertEquals(-1, record.getInstant().toEpochMilli(),
+                "record.getInstant().toEpochMilli()");
+        assertEquals(-1, record.getMillis(),
+                "record.getMillis()");
+        assertEquals(0, record.getInstant().getNano() % NANOS_IN_MILLI,
+                "record.getInstant().getNano() % NANOS_IN_MILLI");
+
+        try {
+            record.setInstant(null);
+        } catch (NullPointerException x) {
+            System.out.println("Got expected NPE when trying to call record.setInstant(null): " + x);
+        }
+
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/logging/HigherResolutionTimeStamps/SerializeLogRecord.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,363 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.time.ZoneId;
+import java.util.Base64;
+import java.util.Locale;
+import java.util.TimeZone;
+import java.util.logging.Level;
+import java.util.logging.LogRecord;
+import java.util.logging.SimpleFormatter;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Stream;
+
+/**
+ * @test
+ * @bug 8072645
+ * @summary tests the compatibility of LogRecord serial form between
+ *          JDK 8 and JDK 9. Ideally this test should be run on both platforms.
+ *          (It is designed to run on both).
+ * @run main/othervm SerializeLogRecord
+ * @author danielfuchs
+ */
+public class SerializeLogRecord {
+
+    /**
+     * Serializes a log record, encode the serialized bytes in base 64, and
+     * prints pseudo java code that can be cut and pasted into this test.
+     * @param record the log record to serialize, encode in base 64, and for
+     *               which test data will be generated.
+     * @return A string containing the generated pseudo java code.
+     * @throws IOException Unexpected.
+     * @throws ClassNotFoundException  Unexpected.
+     */
+    public static String generate(LogRecord record) throws IOException, ClassNotFoundException {
+
+        // Format the given logRecord using the SimpleFormatter
+        SimpleFormatter formatter = new SimpleFormatter();
+        String str = formatter.format(record);
+
+        // Serialize the given LogRecord
+        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        final ObjectOutputStream oos = new ObjectOutputStream(baos);
+        oos.writeObject(record);
+        oos.flush();
+        oos.close();
+
+        // Now we're going to perform a number of smoke tests before
+        // generating the Java pseudo code.
+        //
+        // First checks that the log record can be deserialized
+        final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+        final ObjectInputStream ois = new ObjectInputStream(bais);
+        final LogRecord record2 = (LogRecord)ois.readObject();
+
+        // Format the deserialized LogRecord using the SimpleFormatter, and
+        // check that the string representation obtained matches the string
+        // representation of the original LogRecord
+        String str2 = formatter.format(record2);
+        if (!str.equals(str2)) throw new RuntimeException("Unexpected values in deserialized object:"
+                + "\n\tExpected:  " + str
+                + "\n\tRetrieved: "+str);
+
+        // Now get a Base64 string representation of the serialized bytes.
+        final String base64 = Base64.getEncoder().encodeToString(baos.toByteArray());
+
+        // Check that we can deserialize a log record from the Base64 string
+        // representation we just computed.
+        final ByteArrayInputStream bais2 = new ByteArrayInputStream(Base64.getDecoder().decode(base64));
+        final ObjectInputStream ois2 = new ObjectInputStream(bais2);
+        final LogRecord record3 = (LogRecord)ois2.readObject();
+
+        // Format the new deserialized LogRecord using the SimpleFormatter, and
+        // check that the string representation obtained matches the string
+        // representation of the original LogRecord
+        String str3 = formatter.format(record3);
+        if (!str.equals(str3)) throw new RuntimeException("Unexpected values in deserialized object:"
+                + "\n\tExpected:  " + str
+                + "\n\tRetrieved: "+str);
+        //System.out.println(base64);
+        //System.out.println();
+
+        // Generates the Java Pseudo code that can be cut & pasted into
+        // this test (see Jdk8SerializedLog and Jdk9SerializedLog below)
+        final StringBuilder sb = new StringBuilder();
+        sb.append("    /**").append('\n');
+        sb.append("     * Base64 encoded string for LogRecord object.").append('\n');
+        sb.append("     * Java version: ").append(System.getProperty("java.version")).append('\n');
+        sb.append("     **/").append('\n');
+        sb.append("    final String base64 = ").append("\n          ");
+        final int last = base64.length() - 1;
+        for (int i=0; i<base64.length();i++) {
+            if (i%64 == 0) sb.append("\"");
+            sb.append(base64.charAt(i));
+            if (i%64 == 63 || i == last) {
+                sb.append("\"");
+                if (i == last) sb.append(";\n");
+                else sb.append("\n        + ");
+            }
+        }
+        sb.append('\n');
+        sb.append("    /**").append('\n');
+        sb.append("     * SimpleFormatter output for LogRecord object.").append('\n');
+        sb.append("     * Java version: ").append(System.getProperty("java.version")).append('\n');
+        sb.append("     **/").append('\n');
+        sb.append("    final String str = ").append("\n          ");
+        sb.append("\"").append(str.replace("\n", "\\n")).append("\";\n");
+        return sb.toString();
+    }
+
+    /**
+     * An abstract class to test that a log record previously serialized on a
+     * different java version can be deserialized in the current java version.
+     * (see Jdk8SerializedLog and Jdk9SerializedLog below)
+     */
+    public static abstract class SerializedLog {
+        public abstract String getBase64();
+        public abstract String getString();
+
+        /**
+         * Deserializes the Base64 encoded string returned by {@link
+         * #getBase64()}, format the obtained LogRecord using a
+         * SimpleFormatter, and checks that the string representation obtained
+         * matches the original string representation returned by {@link
+         * #getString()}.
+         */
+        protected void dotest() {
+            try {
+                final String base64 = getBase64();
+                final ByteArrayInputStream bais =
+                        new ByteArrayInputStream(Base64.getDecoder().decode(base64));
+                final ObjectInputStream ois = new ObjectInputStream(bais);
+                final LogRecord record = (LogRecord)ois.readObject();
+                final SimpleFormatter formatter = new SimpleFormatter();
+                String expected = getString();
+                String str2 = formatter.format(record);
+                check(expected, str2);
+                System.out.println(str2);
+                System.out.println("PASSED: "+this.getClass().getName()+"\n");
+            } catch (IOException | ClassNotFoundException x) {
+                throw new RuntimeException(x);
+            }
+        }
+        /**
+         * Check that the actual String representation obtained matches the
+         * expected String representation.
+         * @param expected Expected String representation, as returned by
+         *                 {@link #getString()}.
+         * @param actual   Actual String representation obtained by formatting
+         *                 the LogRecord obtained by the deserialization of the
+         *                 bytes encoded in {@link #getBase64()}.
+         */
+        protected void check(String expected, String actual) {
+            if (!expected.equals(actual)) {
+                throw new RuntimeException(this.getClass().getName()
+                    + " - Unexpected values in deserialized object:"
+                    + "\n\tExpected:  " + expected
+                    + "\n\tRetrieved: "+ actual);
+            }
+        }
+    }
+
+    public static class Jdk8SerializedLog extends SerializedLog {
+
+        // Generated by generate() on JDK 8.
+        // --------------------------------
+        // BEGIN
+
+        /**
+         * Base64 encoded string for LogRecord object.
+         * Java version: 1.8.0_11
+         **/
+        final String base64 =
+              "rO0ABXNyABtqYXZhLnV0aWwubG9nZ2luZy5Mb2dSZWNvcmRKjVk982lRlgMACkoA"
+            + "Bm1pbGxpc0oADnNlcXVlbmNlTnVtYmVySQAIdGhyZWFkSURMAAVsZXZlbHQAGUxq"
+            + "YXZhL3V0aWwvbG9nZ2luZy9MZXZlbDtMAApsb2dnZXJOYW1ldAASTGphdmEvbGFu"
+            + "Zy9TdHJpbmc7TAAHbWVzc2FnZXEAfgACTAAScmVzb3VyY2VCdW5kbGVOYW1lcQB+"
+            + "AAJMAA9zb3VyY2VDbGFzc05hbWVxAH4AAkwAEHNvdXJjZU1ldGhvZE5hbWVxAH4A"
+            + "AkwABnRocm93bnQAFUxqYXZhL2xhbmcvVGhyb3dhYmxlO3hwAAABSjUCgo0AAAAA"
+            + "AAAAAAAAAAFzcgAXamF2YS51dGlsLmxvZ2dpbmcuTGV2ZWyOiHETUXM2kgIAA0kA"
+            + "BXZhbHVlTAAEbmFtZXEAfgACTAAScmVzb3VyY2VCdW5kbGVOYW1lcQB+AAJ4cAAA"
+            + "AyB0AARJTkZPdAAic3VuLnV0aWwubG9nZ2luZy5yZXNvdXJjZXMubG9nZ2luZ3QA"
+            + "BHRlc3R0ABFKYXZhIFZlcnNpb246IHswfXBwcHB3BgEAAAAAAXQACDEuOC4wXzEx"
+            + "eA==";
+
+        /**
+         * SimpleFormatter output for LogRecord object.
+         * Java version: 1.8.0_11
+         **/
+        final String str =
+              "Dec 10, 2014 4:22:44.621000000 PM test - INFO: Java Version: 1.8.0_11";
+              //                    ^^^
+              // Notice the milli second resolution above...
+
+        // END
+        // --------------------------------
+
+        @Override
+        public String getBase64() {
+            return base64;
+        }
+
+        @Override
+        public String getString() {
+            return str;
+        }
+
+        public static void test() {
+            new Jdk8SerializedLog().dotest();
+        }
+    }
+
+    public static class Jdk9SerializedLog extends SerializedLog {
+
+        // Generated by generate() on JDK 9.
+        // --------------------------------
+        // BEGIN
+
+        /**
+         * Base64 encoded string for LogRecord object.
+         * Java version: 1.9.0-internal
+         **/
+        final String base64 =
+              "rO0ABXNyABtqYXZhLnV0aWwubG9nZ2luZy5Mb2dSZWNvcmRKjVk982lRlgMAC0oA"
+            + "Bm1pbGxpc0kADm5hbm9BZGp1c3RtZW50SgAOc2VxdWVuY2VOdW1iZXJJAAh0aHJl"
+            + "YWRJREwABWxldmVsdAAZTGphdmEvdXRpbC9sb2dnaW5nL0xldmVsO0wACmxvZ2dl"
+            + "ck5hbWV0ABJMamF2YS9sYW5nL1N0cmluZztMAAdtZXNzYWdlcQB+AAJMABJyZXNv"
+            + "dXJjZUJ1bmRsZU5hbWVxAH4AAkwAD3NvdXJjZUNsYXNzTmFtZXEAfgACTAAQc291"
+            + "cmNlTWV0aG9kTmFtZXEAfgACTAAGdGhyb3dudAAVTGphdmEvbGFuZy9UaHJvd2Fi"
+            + "bGU7eHAAAAFLl3u6OAAOU/gAAAAAAAAAAAAAAAFzcgAXamF2YS51dGlsLmxvZ2dp"
+            + "bmcuTGV2ZWyOiHETUXM2kgIAA0kABXZhbHVlTAAEbmFtZXEAfgACTAAScmVzb3Vy"
+            + "Y2VCdW5kbGVOYW1lcQB+AAJ4cAAAAyB0AARJTkZPdAAic3VuLnV0aWwubG9nZ2lu"
+            + "Zy5yZXNvdXJjZXMubG9nZ2luZ3QABHRlc3R0ABFKYXZhIFZlcnNpb246IHswfXBw"
+            + "cHB3BgEAAAAAAXQADjEuOS4wLWludGVybmFseA==";
+
+        /**
+         * SimpleFormatter output for LogRecord object.
+         * Java version: 1.9.0-internal
+         **/
+        final String str =
+              "Feb 17, 2015 12:20:43.192939000 PM test - INFO: Java Version: 1.9.0-internal";
+              //                       ^^^
+              // Notice the micro second resolution above...
+
+        // END
+        // --------------------------------
+
+        @Override
+        public String getBase64() {
+            return base64;
+        }
+
+        @Override
+        public String getString() {
+            return str;
+        }
+
+        @Override
+        protected void check(String expected, String actual) {
+            if (System.getProperty("java.version").startsWith("1.8")) {
+                // If we are in JDK 8 and print a log record serialized in JDK 9,
+                // then we won't be able to print anything below the millisecond
+                // precision, since that hasn't been implemented in JDK 8.
+                // Therefore - we need to replace anything below millseconds by
+                // zeroes in the expected string (which was generated on JDK 9).
+                Pattern pattern = Pattern.compile("^"
+                        + "(.*\\.[0-9][0-9][0-9])" // group1: everything up to milliseconds
+                        + "([0-9][0-9][0-9][0-9][0-9][0-9])" // group 2: micros and nanos
+                        + "(.* - .*)$"); // group three: all the rest...
+                Matcher matcher = pattern.matcher(expected);
+                if (matcher.matches()) {
+                    expected = matcher.group(1) + "000000" + matcher.group(3);
+                }
+            }
+            super.check(expected, actual);
+        }
+
+        public static void test() {
+            new Jdk9SerializedLog().dotest();
+        }
+    }
+
+    public static void generate() {
+        try {
+            LogRecord record = new LogRecord(Level.INFO, "Java Version: {0}");
+            record.setLoggerName("test");
+            record.setParameters(new Object[] {System.getProperty("java.version")});
+            System.out.println(generate(record));
+        } catch (IOException | ClassNotFoundException x) {
+            throw new RuntimeException(x);
+        }
+    }
+
+    static enum TestCase { GENERATE, TESTJDK8, TESTJDK9 };
+
+    public static void main(String[] args) {
+        // Set the locale and time zone to make sure we won't depend on the
+        // test env - in particular we don't want to depend on the
+        // time zone in which the test machine might be located.
+        // So we're gong to use Locale English and Time Zone UTC for this test.
+        // (Maybe that should be Locale.ROOT?)
+        Locale.setDefault(Locale.ENGLISH);
+        TimeZone.setDefault(TimeZone.getTimeZone(ZoneId.of("UTC")));
+
+        // Set the format property to make sure we always have the nanos, and
+        // to make sure it's the same format than what we used when
+        // computing the formatted string for Jdk8SerializedLog and
+        // Jdk9SerializedLog above.
+        //
+        // If you change the formatting, then you will need to regenerate
+        // the data for Jdk8SerializedLog and Jdk9SerializedLog.
+        //
+        // To do that - just run this test on JDK 8, and cut & paste the
+        // pseudo code printed by generate() into Jdk8SerializedLog.
+        // Then run this test again on JDK 9, and cut & paste the
+        // pseudo code printed by generate() into Jdk9SerializedLog.
+        // [Note: you can pass GENERATE as single arg to main() to avoid
+        //        running the actual test]
+        // Finally run the test again to check that it still passes after
+        // your modifications.
+        //
+        System.setProperty("java.util.logging.SimpleFormatter.format",
+                "%1$tb %1$td, %1$tY %1$tl:%1$tM:%1$tS.%1$tN %1$Tp %2$s - %4$s: %5$s%6$s");
+
+        // If no args, then run everything....
+        if (args == null || args.length == 0) {
+            args = new String[] { "GENERATE", "TESTJDK8", "TESTJDK9" };
+        }
+
+        // Run the specified test case(s)
+        Stream.of(args).map(x -> TestCase.valueOf(x)).forEach((x) -> {
+            switch(x) {
+                case GENERATE: generate(); break;
+                case TESTJDK8: Jdk8SerializedLog.test(); break;
+                case TESTJDK9: Jdk9SerializedLog.test(); break;
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/logging/HigherResolutionTimeStamps/SimpleFormatterNanos.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.time.Instant;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
+import java.util.Locale;
+import java.util.logging.Level;
+import java.util.logging.LogRecord;
+import java.util.logging.SimpleFormatter;
+
+/**
+ * @test
+ * @bug 8072645
+ * @summary tests that SimpleFormatter can print out dates with the new
+ *                nanosecond precision.
+ * @run main/othervm SimpleFormatterNanos
+ * @author danielfuchs
+ */
+public class SimpleFormatterNanos {
+
+    static final int MILLIS_IN_SECOND = 1000;
+    static final int NANOS_IN_MILLI = 1000_000;
+    static final int NANOS_IN_MICRO = 1000;
+    static final int NANOS_IN_SECOND = 1000_000_000;
+
+    static final boolean verbose = true;
+
+    static final class TestAssertException extends RuntimeException {
+        TestAssertException(String msg) { super(msg); }
+    }
+
+    private static void assertEquals(long expected, long received, String msg) {
+        if (expected != received) {
+            throw new TestAssertException("Unexpected result for " + msg
+                    + ".\n\texpected: " + expected
+                    +  "\n\tactual:   " + received);
+        } else if (verbose) {
+            System.out.println("Got expected " + msg + ": " + received);
+        }
+    }
+
+    static int getNanoAdjustment(LogRecord record) {
+        return record.getInstant().getNano() % NANOS_IN_MILLI;
+    }
+    static void setNanoAdjustment(LogRecord record, int nanos) {
+        record.setInstant(Instant.ofEpochSecond(record.getInstant().getEpochSecond(),
+                (record.getInstant().getNano() / NANOS_IN_MILLI) * NANOS_IN_MILLI + nanos));
+    }
+
+    public static void main(String[] args) throws Exception {
+
+        Locale.setDefault(Locale.ENGLISH);
+        LogRecord record = new LogRecord(Level.INFO, "Java Version: {0}");
+        record.setLoggerName("test");
+        record.setParameters(new Object[] {System.getProperty("java.version")});
+        int nanos = getNanoAdjustment(record);
+        long millis = record.getMillis();
+        // make sure we don't have leading zeros when printing below
+        // the second precision
+        if (millis % MILLIS_IN_SECOND < 100) millis = millis + 100;
+        // make sure we have some nanos
+        if (nanos % NANOS_IN_MICRO == 0) nanos = nanos + 999;
+        record.setMillis(millis);
+        setNanoAdjustment(record, nanos);
+        final Instant instant = record.getInstant();
+        if (nanos < 0) {
+            throw new RuntimeException("Unexpected negative nano adjustment: "
+                    + getNanoAdjustment(record));
+        }
+        if (nanos >= NANOS_IN_MILLI) {
+            throw new RuntimeException("Nano adjustment exceeds 1ms: "
+                    + getNanoAdjustment(record));
+        }
+        if (millis != record.getMillis()) {
+            throw new RuntimeException("Unexpected millis: " + millis + " != "
+                    + record.getMillis());
+        }
+        if (millis != record.getInstant().toEpochMilli()) {
+            throw new RuntimeException("Unexpected millis: "
+                    + record.getInstant().toEpochMilli());
+        }
+        ZonedDateTime zdt = ZonedDateTime.ofInstant(instant, ZoneId.systemDefault());
+        int zdtNanos = zdt.getNano();
+        long expectedNanos = (millis % MILLIS_IN_SECOND) * NANOS_IN_MILLI + nanos;
+        assertEquals(expectedNanos, instant.getNano(), "Instant.getNano()");
+        assertEquals(expectedNanos, zdtNanos, "ZonedDateTime.getNano()");
+        String match = "."+expectedNanos+" ";
+
+        System.out.println("Testing with default format...");
+
+        SimpleFormatter formatter = new SimpleFormatter();
+        String str = formatter.format(record);
+        if (str.contains(match)) {
+            throw new RuntimeException("SimpleFormatter.format()"
+                    + " string contains unexpected nanos: "
+                    + "\n\tdid not expect match for: '" + match + "'"
+                    + "\n\tin: " + str);
+        }
+
+        System.out.println("Nanos omitted as expected: no '"+match+"' in "+str);
+
+
+        System.out.println("Changing format to print nanos...");
+        System.setProperty("java.util.logging.SimpleFormatter.format",
+                "%1$tb %1$td, %1$tY %1$tl:%1$tM:%1$tS.%1$tN %1$Tp %2$s%n%4$s: %5$s%6$s%n");
+
+        SimpleFormatter formatter2 = new SimpleFormatter();
+        str = formatter2.format(record);
+        if (!str.contains(match)) {
+            throw new RuntimeException("SimpleFormatter.format()"
+                    + " string does not contain expected nanos: "
+                    + "\n\texpected match for: '" + match + "'"
+                    + "\n\tin: " + str);
+        }
+        System.out.println("Found expected match for '"+match+"' in "+str);
+
+
+        System.out.println("Changing format to omit nanos...");
+        System.setProperty("java.util.logging.SimpleFormatter.format",
+                "%1$tb %1$td, %1$tY %1$tl:%1$tM:%1$tS %1$Tp %2$s%n%4$s: %5$s%6$s%n");
+
+        SimpleFormatter formatter3 = new SimpleFormatter();
+        str = formatter3.format(record);
+        String notMatch = match;
+        if (str.contains(notMatch)) {
+            throw new RuntimeException("SimpleFormatter.format()"
+                    + " string contains unexpected nanos: "
+                    + "\n\tdid not expect match for: '" + notMatch + "'"
+                    + "\n\tin: " + str);
+        }
+        System.out.println("Nanos omitted as expected: no '"+notMatch+"' in "+str);
+
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/logging/HigherResolutionTimeStamps/XmlFormatterNanos.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,274 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.time.Instant;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
+import java.time.temporal.ChronoUnit;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Locale;
+import java.util.Objects;
+import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.LogManager;
+import java.util.logging.LogRecord;
+import java.util.logging.XMLFormatter;
+
+/**
+ * @test
+ * @bug 8072645
+ * @summary tests that XmlFormatter will print out dates with the new
+ *                nanosecond precision.
+ * @run main/othervm XmlFormatterNanos
+ * @author danielfuchs
+ */
+public class XmlFormatterNanos {
+
+    static final int MILLIS_IN_SECOND = 1000;
+    static final int NANOS_IN_MILLI = 1000_000;
+    static final int NANOS_IN_MICRO = 1000;
+    static final int NANOS_IN_SECOND = 1000_000_000;
+
+    static final boolean verbose = true;
+
+    static final class TestAssertException extends RuntimeException {
+        TestAssertException(String msg) { super(msg); }
+    }
+
+    private static void assertEquals(long expected, long received, String msg) {
+        if (expected != received) {
+            throw new TestAssertException("Unexpected result for " + msg
+                    + ".\n\texpected: " + expected
+                    +  "\n\tactual:   " + received);
+        } else if (verbose) {
+            System.out.println("Got expected " + msg + ": " + received);
+        }
+    }
+
+    private static void assertEquals(Object expected, Object received, String msg) {
+        if (!Objects.equals(expected, received)) {
+            throw new TestAssertException("Unexpected result for " + msg
+                    + ".\n\texpected: " + expected
+                    +  "\n\tactual:   " + received);
+        } else if (verbose) {
+            System.out.println("Got expected " + msg + ": " + received);
+        }
+    }
+
+    static class CustomXMLFormatter extends XMLFormatter {}
+
+    static class Configuration {
+        final Properties propertyFile;
+        private Configuration(Properties properties) {
+            propertyFile = properties;
+        }
+        public Configuration apply() {
+            try {
+                ByteArrayOutputStream bytes = new ByteArrayOutputStream();
+                propertyFile.store(bytes, testName());
+                ByteArrayInputStream bais = new ByteArrayInputStream(bytes.toByteArray());
+                LogManager.getLogManager().readConfiguration(bais);
+            } catch (IOException ex) {
+                throw new RuntimeException(ex);
+            }
+            return this;
+        }
+
+        public static String useInstantProperty(Class<?> type) {
+            return type.getName()+".useInstant";
+        }
+
+        public boolean useInstant(XMLFormatter formatter) {
+            return Boolean.parseBoolean(propertyFile.getProperty(
+                    formatter.getClass().getName()+".useInstant", "true"));
+        }
+
+        public String testName() {
+            return propertyFile.getProperty("test.name", "????");
+        }
+
+        public static Configuration of(Properties props) {
+            return new Configuration(props);
+        }
+
+        public static Configuration apply(Properties props) {
+            return of(props).apply();
+        }
+    }
+
+    final static List<Properties> properties;
+    static {
+        Properties props1 = new Properties();
+        props1.setProperty("test.name", "with XML nano element (default)");
+        Properties props2 = new Properties();
+        props2.setProperty("test.name", "with XML nano element (standard=true, custom=false)");
+        props2.setProperty(Configuration.useInstantProperty(XMLFormatter.class), "true");
+        props2.setProperty(Configuration.useInstantProperty(CustomXMLFormatter.class), "false");
+        Properties props3 = new Properties();
+        props3.setProperty("test.name", "with XML nano element (standard=false, custom=true)");
+        props3.setProperty(Configuration.useInstantProperty(XMLFormatter.class), "false");
+        props3.setProperty(Configuration.useInstantProperty(CustomXMLFormatter.class), "true");
+
+        properties = Collections.unmodifiableList(Arrays.asList(
+                    props1,
+                    props2));
+    }
+
+    public static void main(String[] args) throws Exception {
+        Locale.setDefault(Locale.ENGLISH);
+        properties.stream().forEach(XmlFormatterNanos::test);
+    }
+
+    static int getNanoAdjustment(LogRecord record) {
+        return record.getInstant().getNano() % NANOS_IN_MILLI;
+    }
+    static void setNanoAdjustment(LogRecord record, int nanos) {
+        record.setInstant(Instant.ofEpochSecond(record.getInstant().getEpochSecond(),
+                (record.getInstant().getNano() / NANOS_IN_MILLI) * NANOS_IN_MILLI + nanos));
+    }
+
+    public static void test(Properties props) {
+        Configuration conf = Configuration.apply(props);
+
+        LogRecord record = new LogRecord(Level.INFO, "Test Name: {0}");
+        record.setLoggerName("test");
+        record.setParameters(new Object[] {conf.testName()});
+        int nanos = record.getInstant().getNano() % NANOS_IN_MILLI;
+        long millis = record.getMillis();
+        // make sure we don't have leading zeros when printing below
+        // the second precision
+        if (millis % MILLIS_IN_SECOND < 100) millis = millis + 100;
+        // make sure we some nanos - and make sure we don't have
+        // trailing zeros
+        if (nanos % 10 == 0) nanos = nanos + 7;
+
+        record.setMillis(millis);
+        setNanoAdjustment(record, nanos);
+        final Instant instant = record.getInstant();
+        if (nanos < 0) {
+            throw new RuntimeException("Unexpected negative nano adjustment: "
+                    + getNanoAdjustment(record));
+        }
+        if (nanos >= NANOS_IN_MILLI) {
+            throw new RuntimeException("Nano adjustment exceeds 1ms: "
+                    + getNanoAdjustment(record));
+        }
+        if (millis != record.getMillis()) {
+            throw new RuntimeException("Unexpected millis: " + millis + " != "
+                    + record.getMillis());
+        }
+        if (millis != record.getInstant().toEpochMilli()) {
+            throw new RuntimeException("Unexpected millis: "
+                    + record.getInstant().toEpochMilli());
+        }
+        long expectedNanos = (millis % MILLIS_IN_SECOND) * NANOS_IN_MILLI + nanos;
+        assertEquals(expectedNanos, instant.getNano(), "Instant.getNano()");
+
+        XMLFormatter formatter = new XMLFormatter();
+        testMatching(formatter, record, instant, expectedNanos, conf.useInstant(formatter));
+
+        XMLFormatter custom = new CustomXMLFormatter();
+        testMatching(custom, record, instant, expectedNanos, conf.useInstant(custom));
+    }
+
+    private static void testMatching(XMLFormatter formatter,
+            LogRecord record,  Instant instant, long expectedNanos,
+            boolean useInstant) {
+
+        ZonedDateTime zdt = ZonedDateTime.ofInstant(instant, ZoneId.systemDefault());
+        int zdtNanos = zdt.getNano();
+        assertEquals(expectedNanos, zdtNanos, "ZonedDateTime.getNano()");
+
+        String str = formatter.format(record);
+
+        String match = "."+expectedNanos;
+        if (str.contains(match) != useInstant) {
+            throw new RuntimeException(formatter.getClass().getSimpleName()
+                    + ".format()"
+                    + " string does not contain expected nanos: "
+                    + "\n\texpected match for: '" + match + "'"
+                    + "\n\tin: \n" + str);
+        }
+        System.out.println("Found expected match for '"+match+"' in \n"+str);
+
+        match = "<millis>"+instant.toEpochMilli()+"</millis>";
+        if (!str.contains(match)) {
+            throw new RuntimeException(formatter.getClass().getSimpleName()
+                    + ".format()"
+                    + " string does not contain expected millis: "
+                    + "\n\texpected match for: '" + match + "'"
+                    + "\n\tin: \n" + str);
+        }
+        System.out.println("Found expected match for '"+match+"' in \n"+str);
+
+        match = "<nanos>";
+        if (str.contains(match) != useInstant) {
+            throw new RuntimeException(formatter.getClass().getSimpleName()
+                    + ".format()"
+                    + " string "
+                    + (useInstant
+                            ? "does not contain expected nanos: "
+                            : "contains unexpected nanos: ")
+                    + "\n\t" + (useInstant ? "expected" : "unexpected")
+                    + " match for: '" + match + "'"
+                    + "\n\tin: \n" + str);
+        }
+        match = "<nanos>"+getNanoAdjustment(record)+"</nanos>";
+        if (str.contains(match) != useInstant) {
+            throw new RuntimeException(formatter.getClass().getSimpleName()
+                    + ".format()"
+                    + " string "
+                    + (useInstant
+                            ? "does not contain expected nanos: "
+                            : "contains unexpected nanos: ")
+                    + "\n\t" + (useInstant ? "expected" : "unexpected")
+                    + " match for: '" + match + "'"
+                    + "\n\tin: \n" + str);
+        }
+        if (useInstant) {
+            System.out.println("Found expected match for '"+match+"' in \n"+str);
+        } else {
+            System.out.println("As expected '"+match+"' is not present in \n"+str);
+        }
+
+        match = useInstant ? DateTimeFormatter.ISO_INSTANT.format(instant)
+                : zdt.truncatedTo(ChronoUnit.SECONDS)
+                        .format(DateTimeFormatter.ISO_LOCAL_DATE_TIME);
+        match = "<date>"+match+"</date>";
+        if (!str.contains(match)) {
+            throw new RuntimeException(formatter.getClass().getSimpleName()
+                    + ".format()"
+                    + " string does not contain expected date: "
+                    + "\n\texpected match for: '" + match + "'"
+                    + "\n\tin: \n" + str);
+        }
+        System.out.println("Found expected match for '"+match+"' in \n"+str);
+
+    }
+
+}
--- a/jdk/test/java/util/regex/PatternStreamTest.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/test/java/util/regex/PatternStreamTest.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved.
  * 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,8 +23,8 @@
 
 /**
  * @test
- * @bug 8016846 8024341
- * @summary Unit tests for wrapping classes should delegate to default methods
+ * @bug 8016846 8024341 8071479
+ * @summary Unit tests stream and lambda-based methods on Pattern and Matcher
  * @library ../stream/bootlib
  * @build java.util.stream.OpTestCase
  * @run testng/othervm PatternStreamTest
@@ -34,158 +34,283 @@
 import org.testng.annotations.Test;
 
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.ConcurrentModificationException;
 import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
 import java.util.function.Supplier;
+import java.util.regex.MatchResult;
+import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.LambdaTestHelpers;
 import java.util.stream.OpTestCase;
 import java.util.stream.Stream;
 import java.util.stream.TestData;
 
+import static org.testng.Assert.*;
+
 @Test
 public class PatternStreamTest extends OpTestCase {
 
-    @DataProvider(name = "Stream<String>")
+    @DataProvider(name = "Patterns")
     public static Object[][] makeStreamTestData() {
+        // Each item must match the type signature of the consumer of this data
+        // String, String, Pattern
         List<Object[]> data = new ArrayList<>();
 
-        String description = "";
-        String input = "awgqwefg1fefw4vssv1vvv1";
-        Pattern pattern = Pattern.compile("4");
-        List<String> expected = new ArrayList<>();
-        expected.add("awgqwefg1fefw");
-        expected.add("vssv1vvv1");
+        String description = "All matches";
+        String input = "XXXXXX";
+        Pattern pattern = Pattern.compile("X");
+        data.add(new Object[]{description, input, pattern});
+
+        description = "Bounded every other match";
+        input = "XYXYXYYXYX";
+        pattern = Pattern.compile("X");
+        data.add(new Object[]{description, input, pattern});
 
-        // Must match the type signature of the consumer of this data, testStrings
-        // String, String, Pattern, List<String>
-        data.add(new Object[]{description, input, pattern, expected});
+        description = "Every other match";
+        input = "YXYXYXYYXYXY";
+        pattern = Pattern.compile("X");
+        data.add(new Object[]{description, input, pattern});
+
+        description = "";
+        input = "awgqwefg1fefw4vssv1vvv1";
+        pattern = Pattern.compile("4");
+        data.add(new Object[]{description, input, pattern});
 
         input = "afbfq\u00a3abgwgb\u00a3awngnwggw\u00a3a\u00a3ahjrnhneerh";
         pattern = Pattern.compile("\u00a3a");
-        expected = new ArrayList<>();
-        expected.add("afbfq");
-        expected.add("bgwgb");
-        expected.add("wngnwggw");
-        expected.add("");
-        expected.add("hjrnhneerh");
-
-        data.add(new Object[]{description, input, pattern, expected});
-
+        data.add(new Object[]{description, input, pattern});
 
         input = "awgqwefg1fefw4vssv1vvv1";
         pattern = Pattern.compile("1");
-        expected = new ArrayList<>();
-        expected.add("awgqwefg");
-        expected.add("fefw4vssv");
-        expected.add("vvv");
-
-        data.add(new Object[]{description, input, pattern, expected});
-
+        data.add(new Object[]{description, input, pattern});
 
         input = "a\u4ebafg1fefw\u4eba4\u9f9cvssv\u9f9c1v\u672c\u672cvv";
         pattern = Pattern.compile("1");
-        expected = new ArrayList<>();
-        expected.add("a\u4ebafg");
-        expected.add("fefw\u4eba4\u9f9cvssv\u9f9c");
-        expected.add("v\u672c\u672cvv");
-
-        data.add(new Object[]{description, input, pattern, expected});
-
+        data.add(new Object[]{description, input, pattern});
 
         input = "1\u56da23\u56da456\u56da7890";
         pattern = Pattern.compile("\u56da");
-        expected = new ArrayList<>();
-        expected.add("1");
-        expected.add("23");
-        expected.add("456");
-        expected.add("7890");
-
-        data.add(new Object[]{description, input, pattern, expected});
-
+        data.add(new Object[]{description, input, pattern});
 
         input = "1\u56da23\u9f9c\u672c\u672c\u56da456\u56da\u9f9c\u672c7890";
         pattern = Pattern.compile("\u56da");
-        expected = new ArrayList<>();
-        expected.add("1");
-        expected.add("23\u9f9c\u672c\u672c");
-        expected.add("456");
-        expected.add("\u9f9c\u672c7890");
-
-        data.add(new Object[]{description, input, pattern, expected});
-
+        data.add(new Object[]{description, input, pattern});
 
         description = "Empty input";
         input = "";
         pattern = Pattern.compile("\u56da");
-        expected = new ArrayList<>();
-        expected.add("");
-
-        data.add(new Object[]{description, input, pattern, expected});
-
+        data.add(new Object[]{description, input, pattern});
 
         description = "Empty input with empty pattern";
         input = "";
         pattern = Pattern.compile("");
-        expected = new ArrayList<>();
-        expected.add("");
-
-        data.add(new Object[]{description, input, pattern, expected});
-
+        data.add(new Object[]{description, input, pattern});
 
         description = "Multiple separators";
         input = "This is,testing: with\tdifferent separators.";
         pattern = Pattern.compile("[ \t,:.]");
-        expected = new ArrayList<>();
-        expected.add("This");
-        expected.add("is");
-        expected.add("testing");
-        expected.add("");
-        expected.add("with");
-        expected.add("different");
-        expected.add("separators");
-
+        data.add(new Object[]{description, input, pattern});
 
         description = "Repeated separators within and at end";
         input = "boo:and:foo";
         pattern = Pattern.compile("o");
-        expected = new ArrayList<>();
-        expected.add("b");
-        expected.add("");
-        expected.add(":and:f");
-
+        data.add(new Object[]{description, input, pattern});
 
         description = "Many repeated separators within and at end";
         input = "booooo:and:fooooo";
         pattern = Pattern.compile("o");
-        expected = new ArrayList<>();
-        expected.add("b");
-        expected.add("");
-        expected.add("");
-        expected.add("");
-        expected.add("");
-        expected.add(":and:f");
+        data.add(new Object[]{description, input, pattern});
 
         description = "Many repeated separators before last match";
         input = "fooooo:";
         pattern = Pattern.compile("o");
-        expected = new ArrayList<>();
-        expected.add("f");
-        expected.add("");
-        expected.add("");
-        expected.add("");
-        expected.add("");
-        expected.add(":");
+        data.add(new Object[] {description, input, pattern});
 
-        data.add(new Object[] {description, input, pattern, expected});
         return data.toArray(new Object[0][]);
     }
 
-    @Test(dataProvider = "Stream<String>")
-    public void testStrings(String description, String input, Pattern pattern, List<String> expected) {
+    @Test(dataProvider = "Patterns")
+    public void testPatternSplitAsStream(String description, String input, Pattern pattern) {
+        // Derive expected result from pattern.split
+        List<String> expected = Arrays.asList(pattern.split(input));
+
         Supplier<Stream<String>> ss =  () -> pattern.splitAsStream(input);
         withData(TestData.Factory.ofSupplier(description, ss))
                 .stream(LambdaTestHelpers.identity())
                 .expectedResult(expected)
                 .exercise();
     }
+
+    @Test(dataProvider = "Patterns")
+    public void testReplaceFirst(String description, String input, Pattern pattern) {
+        // Derive expected result from Matcher.replaceFirst(String )
+        String expected = pattern.matcher(input).replaceFirst("R");
+        String actual = pattern.matcher(input).replaceFirst(r -> "R");
+        assertEquals(actual, expected);
+    }
+
+    @Test(dataProvider = "Patterns")
+    public void testReplaceAll(String description, String input, Pattern pattern) {
+        // Derive expected result from Matcher.replaceAll(String )
+        String expected = pattern.matcher(input).replaceAll("R");
+        String actual = pattern.matcher(input).replaceAll(r -> "R");
+        assertEquals(actual, expected);
+
+        // Derive expected result from Matcher.find
+        Matcher m = pattern.matcher(input);
+        int expectedMatches = 0;
+        while (m.find()) {
+            expectedMatches++;
+        }
+        AtomicInteger actualMatches = new AtomicInteger();
+        pattern.matcher(input).replaceAll(r -> "R" + actualMatches.incrementAndGet());
+        assertEquals(expectedMatches, actualMatches.get());
+    }
+
+    @Test(dataProvider = "Patterns")
+    public void testMatchResults(String description, String input, Pattern pattern) {
+        // Derive expected result from Matcher.find
+        Matcher m = pattern.matcher(input);
+        List<MatchResultHolder> expected = new ArrayList<>();
+        while (m.find()) {
+            expected.add(new MatchResultHolder(m));
+        }
+
+        Supplier<Stream<MatchResult>> ss =  () -> pattern.matcher(input).results();
+        withData(TestData.Factory.ofSupplier(description, ss))
+                .stream(s -> s.map(MatchResultHolder::new))
+                .expectedResult(expected)
+                .exercise();
+    }
+
+    public void testFailfastMatchResults() {
+        Pattern p = Pattern.compile("X");
+        Matcher m = p.matcher("XX");
+
+        Stream<MatchResult> s = m.results();
+        m.find();
+        // Should start on the second match
+        assertEquals(s.count(), 1);
+
+        // Fail fast without short-circuit
+        // Exercises Iterator.forEachRemaining
+        m.reset();
+        try {
+            m.results().peek(mr -> m.reset()).count();
+            fail();
+        } catch (ConcurrentModificationException e) {
+            // Should reach here
+        }
+
+        m.reset();
+        try {
+            m.results().peek(mr -> m.find()).count();
+            fail();
+        } catch (ConcurrentModificationException e) {
+            // Should reach here
+        }
+
+        // Fail fast with short-circuit
+        // Exercises Iterator.hasNext/next
+        m.reset();
+        try {
+            m.results().peek(mr -> m.reset()).limit(2).count();
+            fail();
+        } catch (ConcurrentModificationException e) {
+            // Should reach here
+        }
+
+        m.reset();
+        try {
+            m.results().peek(mr -> m.find()).limit(2).count();
+            fail();
+        } catch (ConcurrentModificationException e) {
+            // Should reach here
+        }
+    }
+
+    public void testFailfastReplace() {
+        Pattern p = Pattern.compile("X");
+        Matcher m = p.matcher("XX");
+
+        // Fail fast without short-circuit
+        // Exercises Iterator.forEachRemaining
+        m.reset();
+        try {
+            m.replaceFirst(mr -> { m.reset(); return "Y"; });
+            fail();
+        } catch (ConcurrentModificationException e) {
+            // Should reach here
+        }
+
+        m.reset();
+        try {
+            m.replaceAll(mr -> { m.reset(); return "Y"; });
+            fail();
+        } catch (ConcurrentModificationException e) {
+            // Should reach here
+        }
+    }
+
+    // A holder of MatchResult that can compare
+    static class MatchResultHolder implements Comparable<MatchResultHolder> {
+        final MatchResult mr;
+
+        MatchResultHolder(Matcher m) {
+            this(m.toMatchResult());
+        }
+
+        MatchResultHolder(MatchResult mr) {
+            this.mr = mr;
+        }
+
+        @Override
+        public int compareTo(MatchResultHolder that) {
+            int c = that.mr.group().compareTo(this.mr.group());
+            if (c != 0)
+                return c;
+
+            c = Integer.compare(that.mr.start(), this.mr.start());
+            if (c != 0)
+                return c;
+
+            c = Integer.compare(that.mr.end(), this.mr.end());
+            if (c != 0)
+                return c;
+
+            c = Integer.compare(that.mr.groupCount(), this.mr.groupCount());
+            if (c != 0)
+                return c;
+
+            for (int g = 0; g < this.mr.groupCount(); g++) {
+                c = that.mr.group(g).compareTo(this.mr.group(g));
+                if (c != 0)
+                    return c;
+
+                c = Integer.compare(that.mr.start(g), this.mr.start(g));
+                if (c != 0)
+                    return c;
+
+                c = Integer.compare(that.mr.end(g), this.mr.end(g));
+                if (c != 0)
+                    return c;
+            }
+            return 0;
+        }
+
+        @Override
+        public boolean equals(Object that) {
+            if (this == that) return true;
+            if (that == null || getClass() != that.getClass()) return false;
+
+            return this.compareTo((MatchResultHolder) that) == 0;
+        }
+
+        @Override
+        public int hashCode() {
+            return mr.group().hashCode();
+        }
+    }
 }
--- a/jdk/test/java/util/regex/RegExTest.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/test/java/util/regex/RegExTest.java	Tue Mar 03 08:49:13 2015 -0800
@@ -35,6 +35,7 @@
  * 8027645 8035076 8039124 8035975
  */
 
+import java.util.function.Function;
 import java.util.regex.*;
 import java.util.Random;
 import java.io.*;
@@ -291,24 +292,26 @@
     }
 
     private static void nullArgumentTest() {
-        check(new Runnable() { public void run() { Pattern.compile(null); }});
-        check(new Runnable() { public void run() { Pattern.matches(null, null); }});
-        check(new Runnable() { public void run() { Pattern.matches("xyz", null);}});
-        check(new Runnable() { public void run() { Pattern.quote(null);}});
-        check(new Runnable() { public void run() { Pattern.compile("xyz").split(null);}});
-        check(new Runnable() { public void run() { Pattern.compile("xyz").matcher(null);}});
+        check(() -> Pattern.compile(null));
+        check(() -> Pattern.matches(null, null));
+        check(() -> Pattern.matches("xyz", null));
+        check(() -> Pattern.quote(null));
+        check(() -> Pattern.compile("xyz").split(null));
+        check(() -> Pattern.compile("xyz").matcher(null));
 
         final Matcher m = Pattern.compile("xyz").matcher("xyz");
         m.matches();
-        check(new Runnable() { public void run() { m.appendTail((StringBuffer)null);}});
-        check(new Runnable() { public void run() { m.appendTail((StringBuilder)null);}});
-        check(new Runnable() { public void run() { m.replaceAll(null);}});
-        check(new Runnable() { public void run() { m.replaceFirst(null);}});
-        check(new Runnable() { public void run() { m.appendReplacement((StringBuffer)null, null);}});
-        check(new Runnable() { public void run() { m.appendReplacement((StringBuilder)null, null);}});
-        check(new Runnable() { public void run() { m.reset(null);}});
-        check(new Runnable() { public void run() { Matcher.quoteReplacement(null);}});
-        //check(new Runnable() { public void run() { m.usePattern(null);}});
+        check(() -> m.appendTail((StringBuffer) null));
+        check(() -> m.appendTail((StringBuilder)null));
+        check(() -> m.replaceAll((String) null));
+        check(() -> m.replaceAll((Function<MatchResult, String>)null));
+        check(() -> m.replaceFirst((String)null));
+        check(() -> m.replaceFirst((Function<MatchResult, String>) null));
+        check(() -> m.appendReplacement((StringBuffer)null, null));
+        check(() -> m.appendReplacement((StringBuilder)null, null));
+        check(() -> m.reset(null));
+        check(() -> Matcher.quoteReplacement(null));
+        //check(() -> m.usePattern(null));
 
         report("Null Argument");
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/CollectorsTest.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,701 @@
+/*
+ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 org.openjdk.tests.java.util.stream;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.StringJoiner;
+import java.util.TreeMap;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentSkipListMap;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.BinaryOperator;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+import java.util.stream.Collector;
+import java.util.stream.Collectors;
+import java.util.stream.LambdaTestHelpers;
+import java.util.stream.OpTestCase;
+import java.util.stream.Stream;
+import java.util.stream.StreamOpFlagTestHelper;
+import java.util.stream.StreamTestDataProvider;
+import java.util.stream.TestData;
+
+import org.testng.annotations.Test;
+
+import static java.util.stream.Collectors.collectingAndThen;
+import static java.util.stream.Collectors.flatMapping;
+import static java.util.stream.Collectors.groupingBy;
+import static java.util.stream.Collectors.groupingByConcurrent;
+import static java.util.stream.Collectors.mapping;
+import static java.util.stream.Collectors.partitioningBy;
+import static java.util.stream.Collectors.reducing;
+import static java.util.stream.Collectors.toCollection;
+import static java.util.stream.Collectors.toConcurrentMap;
+import static java.util.stream.Collectors.toList;
+import static java.util.stream.Collectors.toMap;
+import static java.util.stream.Collectors.toSet;
+import static java.util.stream.LambdaTestHelpers.assertContents;
+import static java.util.stream.LambdaTestHelpers.assertContentsUnordered;
+import static java.util.stream.LambdaTestHelpers.mDoubler;
+
+/*
+ * @test
+ * @bug 8071600
+ * @summary Test for collectors.
+ */
+public class CollectorsTest extends OpTestCase {
+
+    private static abstract class CollectorAssertion<T, U> {
+        abstract void assertValue(U value,
+                                  Supplier<Stream<T>> source,
+                                  boolean ordered) throws ReflectiveOperationException;
+    }
+
+    static class MappingAssertion<T, V, R> extends CollectorAssertion<T, R> {
+        private final Function<T, V> mapper;
+        private final CollectorAssertion<V, R> downstream;
+
+        MappingAssertion(Function<T, V> mapper, CollectorAssertion<V, R> downstream) {
+            this.mapper = mapper;
+            this.downstream = downstream;
+        }
+
+        @Override
+        void assertValue(R value, Supplier<Stream<T>> source, boolean ordered) throws ReflectiveOperationException {
+            downstream.assertValue(value,
+                                   () -> source.get().map(mapper::apply),
+                                   ordered);
+        }
+    }
+
+    static class FlatMappingAssertion<T, V, R> extends CollectorAssertion<T, R> {
+        private final Function<T, Stream<V>> mapper;
+        private final CollectorAssertion<V, R> downstream;
+
+        FlatMappingAssertion(Function<T, Stream<V>> mapper,
+                             CollectorAssertion<V, R> downstream) {
+            this.mapper = mapper;
+            this.downstream = downstream;
+        }
+
+        @Override
+        void assertValue(R value, Supplier<Stream<T>> source, boolean ordered) throws ReflectiveOperationException {
+            downstream.assertValue(value,
+                                   () -> source.get().flatMap(mapper::apply),
+                                   ordered);
+        }
+    }
+
+    static class GroupingByAssertion<T, K, V, M extends Map<K, ? extends V>> extends CollectorAssertion<T, M> {
+        private final Class<? extends Map> clazz;
+        private final Function<T, K> classifier;
+        private final CollectorAssertion<T,V> downstream;
+
+        GroupingByAssertion(Function<T, K> classifier, Class<? extends Map> clazz,
+                            CollectorAssertion<T, V> downstream) {
+            this.clazz = clazz;
+            this.classifier = classifier;
+            this.downstream = downstream;
+        }
+
+        @Override
+        void assertValue(M map,
+                         Supplier<Stream<T>> source,
+                         boolean ordered) throws ReflectiveOperationException {
+            if (!clazz.isAssignableFrom(map.getClass()))
+                fail(String.format("Class mismatch in GroupingByAssertion: %s, %s", clazz, map.getClass()));
+            assertContentsUnordered(map.keySet(), source.get().map(classifier).collect(toSet()));
+            for (Map.Entry<K, ? extends V> entry : map.entrySet()) {
+                K key = entry.getKey();
+                downstream.assertValue(entry.getValue(),
+                                       () -> source.get().filter(e -> classifier.apply(e).equals(key)),
+                                       ordered);
+            }
+        }
+    }
+
+    static class ToMapAssertion<T, K, V, M extends Map<K,V>> extends CollectorAssertion<T, M> {
+        private final Class<? extends Map> clazz;
+        private final Function<T, K> keyFn;
+        private final Function<T, V> valueFn;
+        private final BinaryOperator<V> mergeFn;
+
+        ToMapAssertion(Function<T, K> keyFn,
+                       Function<T, V> valueFn,
+                       BinaryOperator<V> mergeFn,
+                       Class<? extends Map> clazz) {
+            this.clazz = clazz;
+            this.keyFn = keyFn;
+            this.valueFn = valueFn;
+            this.mergeFn = mergeFn;
+        }
+
+        @Override
+        void assertValue(M map, Supplier<Stream<T>> source, boolean ordered) throws ReflectiveOperationException {
+            if (!clazz.isAssignableFrom(map.getClass()))
+                fail(String.format("Class mismatch in ToMapAssertion: %s, %s", clazz, map.getClass()));
+            Set<K> uniqueKeys = source.get().map(keyFn).collect(toSet());
+            assertEquals(uniqueKeys, map.keySet());
+            source.get().forEach(t -> {
+                K key = keyFn.apply(t);
+                V v = source.get()
+                            .filter(e -> key.equals(keyFn.apply(e)))
+                            .map(valueFn)
+                            .reduce(mergeFn)
+                            .get();
+                assertEquals(map.get(key), v);
+            });
+        }
+    }
+
+    static class PartitioningByAssertion<T, D> extends CollectorAssertion<T, Map<Boolean,D>> {
+        private final Predicate<T> predicate;
+        private final CollectorAssertion<T,D> downstream;
+
+        PartitioningByAssertion(Predicate<T> predicate, CollectorAssertion<T, D> downstream) {
+            this.predicate = predicate;
+            this.downstream = downstream;
+        }
+
+        @Override
+        void assertValue(Map<Boolean, D> map,
+                         Supplier<Stream<T>> source,
+                         boolean ordered) throws ReflectiveOperationException {
+            if (!Map.class.isAssignableFrom(map.getClass()))
+                fail(String.format("Class mismatch in PartitioningByAssertion: %s", map.getClass()));
+            assertEquals(2, map.size());
+            downstream.assertValue(map.get(true), () -> source.get().filter(predicate), ordered);
+            downstream.assertValue(map.get(false), () -> source.get().filter(predicate.negate()), ordered);
+        }
+    }
+
+    static class ToListAssertion<T> extends CollectorAssertion<T, List<T>> {
+        @Override
+        void assertValue(List<T> value, Supplier<Stream<T>> source, boolean ordered)
+                throws ReflectiveOperationException {
+            if (!List.class.isAssignableFrom(value.getClass()))
+                fail(String.format("Class mismatch in ToListAssertion: %s", value.getClass()));
+            Stream<T> stream = source.get();
+            List<T> result = new ArrayList<>();
+            for (Iterator<T> it = stream.iterator(); it.hasNext(); ) // avoid capturing result::add
+                result.add(it.next());
+            if (StreamOpFlagTestHelper.isStreamOrdered(stream) && ordered)
+                assertContents(value, result);
+            else
+                assertContentsUnordered(value, result);
+        }
+    }
+
+    static class ToCollectionAssertion<T> extends CollectorAssertion<T, Collection<T>> {
+        private final Class<? extends Collection> clazz;
+        private final boolean targetOrdered;
+
+        ToCollectionAssertion(Class<? extends Collection> clazz, boolean targetOrdered) {
+            this.clazz = clazz;
+            this.targetOrdered = targetOrdered;
+        }
+
+        @Override
+        void assertValue(Collection<T> value, Supplier<Stream<T>> source, boolean ordered)
+                throws ReflectiveOperationException {
+            if (!clazz.isAssignableFrom(value.getClass()))
+                fail(String.format("Class mismatch in ToCollectionAssertion: %s, %s", clazz, value.getClass()));
+            Stream<T> stream = source.get();
+            Collection<T> result = clazz.newInstance();
+            for (Iterator<T> it = stream.iterator(); it.hasNext(); ) // avoid capturing result::add
+                result.add(it.next());
+            if (StreamOpFlagTestHelper.isStreamOrdered(stream) && targetOrdered && ordered)
+                assertContents(value, result);
+            else
+                assertContentsUnordered(value, result);
+        }
+    }
+
+    static class ReducingAssertion<T, U> extends CollectorAssertion<T, U> {
+        private final U identity;
+        private final Function<T, U> mapper;
+        private final BinaryOperator<U> reducer;
+
+        ReducingAssertion(U identity, Function<T, U> mapper, BinaryOperator<U> reducer) {
+            this.identity = identity;
+            this.mapper = mapper;
+            this.reducer = reducer;
+        }
+
+        @Override
+        void assertValue(U value, Supplier<Stream<T>> source, boolean ordered)
+                throws ReflectiveOperationException {
+            Optional<U> reduced = source.get().map(mapper).reduce(reducer);
+            if (value == null)
+                assertTrue(!reduced.isPresent());
+            else if (!reduced.isPresent()) {
+                assertEquals(value, identity);
+            }
+            else {
+                assertEquals(value, reduced.get());
+            }
+        }
+    }
+
+    private <T> ResultAsserter<T> mapTabulationAsserter(boolean ordered) {
+        return (act, exp, ord, par) -> {
+            if (par && (!ordered || !ord)) {
+                CollectorsTest.nestedMapEqualityAssertion(act, exp);
+            }
+            else {
+                LambdaTestHelpers.assertContentsEqual(act, exp);
+            }
+        };
+    }
+
+    private<T, M extends Map>
+    void exerciseMapCollection(TestData<T, Stream<T>> data,
+                               Collector<T, ?, ? extends M> collector,
+                               CollectorAssertion<T, M> assertion)
+            throws ReflectiveOperationException {
+        boolean ordered = !collector.characteristics().contains(Collector.Characteristics.UNORDERED);
+
+        M m = withData(data)
+                .terminal(s -> s.collect(collector))
+                .resultAsserter(mapTabulationAsserter(ordered))
+                .exercise();
+        assertion.assertValue(m, () -> data.stream(), ordered);
+
+        m = withData(data)
+                .terminal(s -> s.unordered().collect(collector))
+                .resultAsserter(mapTabulationAsserter(ordered))
+                .exercise();
+        assertion.assertValue(m, () -> data.stream(), false);
+    }
+
+    private static void nestedMapEqualityAssertion(Object o1, Object o2) {
+        if (o1 instanceof Map) {
+            Map m1 = (Map) o1;
+            Map m2 = (Map) o2;
+            assertContentsUnordered(m1.keySet(), m2.keySet());
+            for (Object k : m1.keySet())
+                nestedMapEqualityAssertion(m1.get(k), m2.get(k));
+        }
+        else if (o1 instanceof Collection) {
+            assertContentsUnordered(((Collection) o1), ((Collection) o2));
+        }
+        else
+            assertEquals(o1, o2);
+    }
+
+    private<T, R> void assertCollect(TestData.OfRef<T> data,
+                                     Collector<T, ?, R> collector,
+                                     Function<Stream<T>, R> streamReduction) {
+        R check = streamReduction.apply(data.stream());
+        withData(data).terminal(s -> s.collect(collector)).expectedResult(check).exercise();
+    }
+
+    @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
+    public void testReducing(String name, TestData.OfRef<Integer> data) throws ReflectiveOperationException {
+        assertCollect(data, Collectors.reducing(0, Integer::sum),
+                      s -> s.reduce(0, Integer::sum));
+        assertCollect(data, Collectors.reducing(Integer.MAX_VALUE, Integer::min),
+                      s -> s.min(Integer::compare).orElse(Integer.MAX_VALUE));
+        assertCollect(data, Collectors.reducing(Integer.MIN_VALUE, Integer::max),
+                      s -> s.max(Integer::compare).orElse(Integer.MIN_VALUE));
+
+        assertCollect(data, Collectors.reducing(Integer::sum),
+                      s -> s.reduce(Integer::sum));
+        assertCollect(data, Collectors.minBy(Comparator.naturalOrder()),
+                      s -> s.min(Integer::compare));
+        assertCollect(data, Collectors.maxBy(Comparator.naturalOrder()),
+                      s -> s.max(Integer::compare));
+
+        assertCollect(data, Collectors.reducing(0, x -> x*2, Integer::sum),
+                      s -> s.map(x -> x*2).reduce(0, Integer::sum));
+
+        assertCollect(data, Collectors.summingLong(x -> x * 2L),
+                      s -> s.map(x -> x*2L).reduce(0L, Long::sum));
+        assertCollect(data, Collectors.summingInt(x -> x * 2),
+                      s -> s.map(x -> x*2).reduce(0, Integer::sum));
+        assertCollect(data, Collectors.summingDouble(x -> x * 2.0d),
+                      s -> s.map(x -> x * 2.0d).reduce(0.0d, Double::sum));
+
+        assertCollect(data, Collectors.averagingInt(x -> x * 2),
+                      s -> s.mapToInt(x -> x * 2).average().orElse(0));
+        assertCollect(data, Collectors.averagingLong(x -> x * 2),
+                      s -> s.mapToLong(x -> x * 2).average().orElse(0));
+        assertCollect(data, Collectors.averagingDouble(x -> x * 2),
+                      s -> s.mapToDouble(x -> x * 2).average().orElse(0));
+
+        // Test explicit Collector.of
+        Collector<Integer, long[], Double> avg2xint = Collector.of(() -> new long[2],
+                                                                   (a, b) -> {
+                                                                       a[0] += b * 2;
+                                                                       a[1]++;
+                                                                   },
+                                                                   (a, b) -> {
+                                                                       a[0] += b[0];
+                                                                       a[1] += b[1];
+                                                                       return a;
+                                                                   },
+                                                                   a -> a[1] == 0 ? 0.0d : (double) a[0] / a[1]);
+        assertCollect(data, avg2xint,
+                      s -> s.mapToInt(x -> x * 2).average().orElse(0));
+    }
+
+    @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
+    public void testJoining(String name, TestData.OfRef<Integer> data) throws ReflectiveOperationException {
+        withData(data)
+                .terminal(s -> s.map(Object::toString).collect(Collectors.joining()))
+                .expectedResult(join(data, ""))
+                .exercise();
+
+        Collector<String, StringBuilder, String> likeJoining = Collector.of(StringBuilder::new, StringBuilder::append, (sb1, sb2) -> sb1.append(sb2.toString()), StringBuilder::toString);
+        withData(data)
+                .terminal(s -> s.map(Object::toString).collect(likeJoining))
+                .expectedResult(join(data, ""))
+                .exercise();
+
+        withData(data)
+                .terminal(s -> s.map(Object::toString).collect(Collectors.joining(",")))
+                .expectedResult(join(data, ","))
+                .exercise();
+
+        withData(data)
+                .terminal(s -> s.map(Object::toString).collect(Collectors.joining(",", "[", "]")))
+                .expectedResult("[" + join(data, ",") + "]")
+                .exercise();
+
+        withData(data)
+                .terminal(s -> s.map(Object::toString)
+                                .collect(StringBuilder::new, StringBuilder::append, StringBuilder::append)
+                                .toString())
+                .expectedResult(join(data, ""))
+                .exercise();
+
+        withData(data)
+                .terminal(s -> s.map(Object::toString)
+                                .collect(() -> new StringJoiner(","),
+                                         (sj, cs) -> sj.add(cs),
+                                         (j1, j2) -> j1.merge(j2))
+                                .toString())
+                .expectedResult(join(data, ","))
+                .exercise();
+
+        withData(data)
+                .terminal(s -> s.map(Object::toString)
+                                .collect(() -> new StringJoiner(",", "[", "]"),
+                                         (sj, cs) -> sj.add(cs),
+                                         (j1, j2) -> j1.merge(j2))
+                                .toString())
+                .expectedResult("[" + join(data, ",") + "]")
+                .exercise();
+    }
+
+    private<T> String join(TestData.OfRef<T> data, String delim) {
+        StringBuilder sb = new StringBuilder();
+        boolean first = true;
+        for (T i : data) {
+            if (!first)
+                sb.append(delim);
+            sb.append(i.toString());
+            first = false;
+        }
+        return sb.toString();
+    }
+
+    @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
+    public void testSimpleToMap(String name, TestData.OfRef<Integer> data) throws ReflectiveOperationException {
+        Function<Integer, Integer> keyFn = i -> i * 2;
+        Function<Integer, Integer> valueFn = i -> i * 4;
+
+        List<Integer> dataAsList = Arrays.asList(data.stream().toArray(Integer[]::new));
+        Set<Integer> dataAsSet = new HashSet<>(dataAsList);
+
+        BinaryOperator<Integer> sum = Integer::sum;
+        for (BinaryOperator<Integer> op : Arrays.asList((u, v) -> u,
+                                                        (u, v) -> v,
+                                                        sum)) {
+            try {
+                exerciseMapCollection(data, toMap(keyFn, valueFn),
+                                      new ToMapAssertion<>(keyFn, valueFn, op, HashMap.class));
+                if (dataAsList.size() != dataAsSet.size())
+                    fail("Expected ISE on input with duplicates");
+            }
+            catch (IllegalStateException e) {
+                if (dataAsList.size() == dataAsSet.size())
+                    fail("Expected no ISE on input without duplicates");
+            }
+
+            exerciseMapCollection(data, toMap(keyFn, valueFn, op),
+                                  new ToMapAssertion<>(keyFn, valueFn, op, HashMap.class));
+
+            exerciseMapCollection(data, toMap(keyFn, valueFn, op, TreeMap::new),
+                                  new ToMapAssertion<>(keyFn, valueFn, op, TreeMap.class));
+        }
+
+        // For concurrent maps, only use commutative merge functions
+        try {
+            exerciseMapCollection(data, toConcurrentMap(keyFn, valueFn),
+                                  new ToMapAssertion<>(keyFn, valueFn, sum, ConcurrentHashMap.class));
+            if (dataAsList.size() != dataAsSet.size())
+                fail("Expected ISE on input with duplicates");
+        }
+        catch (IllegalStateException e) {
+            if (dataAsList.size() == dataAsSet.size())
+                fail("Expected no ISE on input without duplicates");
+        }
+
+        exerciseMapCollection(data, toConcurrentMap(keyFn, valueFn, sum),
+                              new ToMapAssertion<>(keyFn, valueFn, sum, ConcurrentHashMap.class));
+
+        exerciseMapCollection(data, toConcurrentMap(keyFn, valueFn, sum, ConcurrentSkipListMap::new),
+                              new ToMapAssertion<>(keyFn, valueFn, sum, ConcurrentSkipListMap.class));
+    }
+
+    @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
+    public void testSimpleGroupingBy(String name, TestData.OfRef<Integer> data) throws ReflectiveOperationException {
+        Function<Integer, Integer> classifier = i -> i % 3;
+
+        // Single-level groupBy
+        exerciseMapCollection(data, groupingBy(classifier),
+                              new GroupingByAssertion<>(classifier, HashMap.class,
+                                                        new ToListAssertion<>()));
+        exerciseMapCollection(data, groupingByConcurrent(classifier),
+                              new GroupingByAssertion<>(classifier, ConcurrentHashMap.class,
+                                                        new ToListAssertion<>()));
+
+        // With explicit constructors
+        exerciseMapCollection(data,
+                              groupingBy(classifier, TreeMap::new, toCollection(HashSet::new)),
+                              new GroupingByAssertion<>(classifier, TreeMap.class,
+                                                        new ToCollectionAssertion<Integer>(HashSet.class, false)));
+        exerciseMapCollection(data,
+                              groupingByConcurrent(classifier, ConcurrentSkipListMap::new,
+                                                   toCollection(HashSet::new)),
+                              new GroupingByAssertion<>(classifier, ConcurrentSkipListMap.class,
+                                                        new ToCollectionAssertion<Integer>(HashSet.class, false)));
+    }
+
+    @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
+    public void testGroupingByWithMapping(String name, TestData.OfRef<Integer> data) throws ReflectiveOperationException {
+        Function<Integer, Integer> classifier = i -> i % 3;
+        Function<Integer, Integer> mapper = i -> i * 2;
+
+        exerciseMapCollection(data,
+                              groupingBy(classifier, mapping(mapper, toList())),
+                              new GroupingByAssertion<>(classifier, HashMap.class,
+                                                        new MappingAssertion<>(mapper,
+                                                                               new ToListAssertion<>())));
+    }
+
+    @Test
+    public void testFlatMappingClose() {
+        Function<Integer, Integer> classifier = i -> i;
+        AtomicInteger ai = new AtomicInteger();
+        Function<Integer, Stream<Integer>> flatMapper = i -> Stream.of(i, i).onClose(ai::getAndIncrement);
+        Map<Integer, List<Integer>> m = Stream.of(1, 2).collect(groupingBy(classifier, flatMapping(flatMapper, toList())));
+        assertEquals(m.size(), ai.get());
+    }
+
+    @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
+    public void testGroupingByWithFlatMapping(String name, TestData.OfRef<Integer> data) throws ReflectiveOperationException {
+        Function<Integer, Integer> classifier = i -> i % 3;
+        Function<Integer, Stream<Integer>> flatMapperByNull = i -> null;
+        Function<Integer, Stream<Integer>> flatMapperBy0 = i -> Stream.empty();
+        Function<Integer, Stream<Integer>> flatMapperBy2 = i -> Stream.of(i, i);
+
+        exerciseMapCollection(data,
+                              groupingBy(classifier, flatMapping(flatMapperByNull, toList())),
+                              new GroupingByAssertion<>(classifier, HashMap.class,
+                                                        new FlatMappingAssertion<>(flatMapperBy0,
+                                                                                   new ToListAssertion<>())));
+        exerciseMapCollection(data,
+                              groupingBy(classifier, flatMapping(flatMapperBy0, toList())),
+                              new GroupingByAssertion<>(classifier, HashMap.class,
+                                                        new FlatMappingAssertion<>(flatMapperBy0,
+                                                                                   new ToListAssertion<>())));
+        exerciseMapCollection(data,
+                              groupingBy(classifier, flatMapping(flatMapperBy2, toList())),
+                              new GroupingByAssertion<>(classifier, HashMap.class,
+                                                        new FlatMappingAssertion<>(flatMapperBy2,
+                                                                                   new ToListAssertion<>())));
+    }
+
+    @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
+    public void testTwoLevelGroupingBy(String name, TestData.OfRef<Integer> data) throws ReflectiveOperationException {
+        Function<Integer, Integer> classifier = i -> i % 6;
+        Function<Integer, Integer> classifier2 = i -> i % 23;
+
+        // Two-level groupBy
+        exerciseMapCollection(data,
+                              groupingBy(classifier, groupingBy(classifier2)),
+                              new GroupingByAssertion<>(classifier, HashMap.class,
+                                                        new GroupingByAssertion<>(classifier2, HashMap.class,
+                                                                                  new ToListAssertion<>())));
+        // with concurrent as upstream
+        exerciseMapCollection(data,
+                              groupingByConcurrent(classifier, groupingBy(classifier2)),
+                              new GroupingByAssertion<>(classifier, ConcurrentHashMap.class,
+                                                        new GroupingByAssertion<>(classifier2, HashMap.class,
+                                                                                  new ToListAssertion<>())));
+        // with concurrent as downstream
+        exerciseMapCollection(data,
+                              groupingBy(classifier, groupingByConcurrent(classifier2)),
+                              new GroupingByAssertion<>(classifier, HashMap.class,
+                                                        new GroupingByAssertion<>(classifier2, ConcurrentHashMap.class,
+                                                                                  new ToListAssertion<>())));
+        // with concurrent as upstream and downstream
+        exerciseMapCollection(data,
+                              groupingByConcurrent(classifier, groupingByConcurrent(classifier2)),
+                              new GroupingByAssertion<>(classifier, ConcurrentHashMap.class,
+                                                        new GroupingByAssertion<>(classifier2, ConcurrentHashMap.class,
+                                                                                  new ToListAssertion<>())));
+
+        // With explicit constructors
+        exerciseMapCollection(data,
+                              groupingBy(classifier, TreeMap::new, groupingBy(classifier2, TreeMap::new, toCollection(HashSet::new))),
+                              new GroupingByAssertion<>(classifier, TreeMap.class,
+                                                        new GroupingByAssertion<>(classifier2, TreeMap.class,
+                                                                                  new ToCollectionAssertion<Integer>(HashSet.class, false))));
+        // with concurrent as upstream
+        exerciseMapCollection(data,
+                              groupingByConcurrent(classifier, ConcurrentSkipListMap::new, groupingBy(classifier2, TreeMap::new, toList())),
+                              new GroupingByAssertion<>(classifier, ConcurrentSkipListMap.class,
+                                                        new GroupingByAssertion<>(classifier2, TreeMap.class,
+                                                                                  new ToListAssertion<>())));
+        // with concurrent as downstream
+        exerciseMapCollection(data,
+                              groupingBy(classifier, TreeMap::new, groupingByConcurrent(classifier2, ConcurrentSkipListMap::new, toList())),
+                              new GroupingByAssertion<>(classifier, TreeMap.class,
+                                                        new GroupingByAssertion<>(classifier2, ConcurrentSkipListMap.class,
+                                                                                  new ToListAssertion<>())));
+        // with concurrent as upstream and downstream
+        exerciseMapCollection(data,
+                              groupingByConcurrent(classifier, ConcurrentSkipListMap::new, groupingByConcurrent(classifier2, ConcurrentSkipListMap::new, toList())),
+                              new GroupingByAssertion<>(classifier, ConcurrentSkipListMap.class,
+                                                        new GroupingByAssertion<>(classifier2, ConcurrentSkipListMap.class,
+                                                                                  new ToListAssertion<>())));
+    }
+
+    @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
+    public void testGroupubgByWithReducing(String name, TestData.OfRef<Integer> data) throws ReflectiveOperationException {
+        Function<Integer, Integer> classifier = i -> i % 3;
+
+        // Single-level simple reduce
+        exerciseMapCollection(data,
+                              groupingBy(classifier, reducing(0, Integer::sum)),
+                              new GroupingByAssertion<>(classifier, HashMap.class,
+                                                        new ReducingAssertion<>(0, LambdaTestHelpers.identity(), Integer::sum)));
+        // with concurrent
+        exerciseMapCollection(data,
+                              groupingByConcurrent(classifier, reducing(0, Integer::sum)),
+                              new GroupingByAssertion<>(classifier, ConcurrentHashMap.class,
+                                                        new ReducingAssertion<>(0, LambdaTestHelpers.identity(), Integer::sum)));
+
+        // With explicit constructors
+        exerciseMapCollection(data,
+                              groupingBy(classifier, TreeMap::new, reducing(0, Integer::sum)),
+                              new GroupingByAssertion<>(classifier, TreeMap.class,
+                                                        new ReducingAssertion<>(0, LambdaTestHelpers.identity(), Integer::sum)));
+        // with concurrent
+        exerciseMapCollection(data,
+                              groupingByConcurrent(classifier, ConcurrentSkipListMap::new, reducing(0, Integer::sum)),
+                              new GroupingByAssertion<>(classifier, ConcurrentSkipListMap.class,
+                                                        new ReducingAssertion<>(0, LambdaTestHelpers.identity(), Integer::sum)));
+
+        // Single-level map-reduce
+        exerciseMapCollection(data,
+                              groupingBy(classifier, reducing(0, mDoubler, Integer::sum)),
+                              new GroupingByAssertion<>(classifier, HashMap.class,
+                                                        new ReducingAssertion<>(0, mDoubler, Integer::sum)));
+        // with concurrent
+        exerciseMapCollection(data,
+                              groupingByConcurrent(classifier, reducing(0, mDoubler, Integer::sum)),
+                              new GroupingByAssertion<>(classifier, ConcurrentHashMap.class,
+                                                        new ReducingAssertion<>(0, mDoubler, Integer::sum)));
+
+        // With explicit constructors
+        exerciseMapCollection(data,
+                              groupingBy(classifier, TreeMap::new, reducing(0, mDoubler, Integer::sum)),
+                              new GroupingByAssertion<>(classifier, TreeMap.class,
+                                                        new ReducingAssertion<>(0, mDoubler, Integer::sum)));
+        // with concurrent
+        exerciseMapCollection(data,
+                              groupingByConcurrent(classifier, ConcurrentSkipListMap::new, reducing(0, mDoubler, Integer::sum)),
+                              new GroupingByAssertion<>(classifier, ConcurrentSkipListMap.class,
+                                                        new ReducingAssertion<>(0, mDoubler, Integer::sum)));
+    }
+
+    @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
+    public void testSimplePartitioningBy(String name, TestData.OfRef<Integer> data) throws ReflectiveOperationException {
+        Predicate<Integer> classifier = i -> i % 3 == 0;
+
+        // Single-level partition to downstream List
+        exerciseMapCollection(data,
+                              partitioningBy(classifier),
+                              new PartitioningByAssertion<>(classifier, new ToListAssertion<>()));
+        exerciseMapCollection(data,
+                              partitioningBy(classifier, toList()),
+                              new PartitioningByAssertion<>(classifier, new ToListAssertion<>()));
+    }
+
+    @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
+    public void testTwoLevelPartitioningBy(String name, TestData.OfRef<Integer> data) throws ReflectiveOperationException {
+        Predicate<Integer> classifier = i -> i % 3 == 0;
+        Predicate<Integer> classifier2 = i -> i % 7 == 0;
+
+        // Two level partition
+        exerciseMapCollection(data,
+                              partitioningBy(classifier, partitioningBy(classifier2)),
+                              new PartitioningByAssertion<>(classifier,
+                                                            new PartitioningByAssertion(classifier2, new ToListAssertion<>())));
+
+        // Two level partition with reduce
+        exerciseMapCollection(data,
+                              partitioningBy(classifier, reducing(0, Integer::sum)),
+                              new PartitioningByAssertion<>(classifier,
+                                                            new ReducingAssertion<>(0, LambdaTestHelpers.identity(), Integer::sum)));
+    }
+
+    @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
+    public void testComposeFinisher(String name, TestData.OfRef<Integer> data) throws ReflectiveOperationException {
+        List<Integer> asList = exerciseTerminalOps(data, s -> s.collect(toList()));
+        List<Integer> asImmutableList = exerciseTerminalOps(data, s -> s.collect(collectingAndThen(toList(), Collections::unmodifiableList)));
+        assertEquals(asList, asImmutableList);
+        try {
+            asImmutableList.add(0);
+            fail("Expecting immutable result");
+        }
+        catch (UnsupportedOperationException ignored) { }
+    }
+
+}
--- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/FlatMapOpTest.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/FlatMapOpTest.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,19 @@
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.concurrent.atomic.AtomicInteger;
 import java.util.function.Function;
-import java.util.stream.*;
+import java.util.function.Supplier;
+import java.util.stream.DoubleStream;
+import java.util.stream.DoubleStreamTestDataProvider;
+import java.util.stream.IntStream;
+import java.util.stream.IntStreamTestDataProvider;
+import java.util.stream.LongStream;
+import java.util.stream.LongStreamTestDataProvider;
+import java.util.stream.OpTestCase;
+import java.util.stream.Stream;
+import java.util.stream.StreamTestDataProvider;
+import java.util.stream.TestData;
 
 import static java.util.stream.LambdaTestHelpers.*;
 import static java.util.stream.ThowableHelper.checkNPE;
@@ -66,6 +77,59 @@
         exerciseOps(TestData.Factory.ofArray("LONG_STRING", new String[] {LONG_STRING}), s -> s.flatMap(flattenChars));
     }
 
+    @Test
+    public void testClose() {
+        AtomicInteger before = new AtomicInteger();
+        AtomicInteger onClose = new AtomicInteger();
+
+        Supplier<Stream<Integer>> s = () -> {
+            before.set(0); onClose.set(0);
+            return Stream.of(1, 2).peek(e -> before.getAndIncrement());
+        };
+
+        s.get().flatMap(i -> Stream.of(i, i).onClose(onClose::getAndIncrement)).count();
+        assertEquals(before.get(), onClose.get());
+
+        s.get().flatMapToInt(i -> IntStream.of(i, i).onClose(onClose::getAndIncrement)).count();
+        assertEquals(before.get(), onClose.get());
+
+        s.get().flatMapToLong(i -> LongStream.of(i, i).onClose(onClose::getAndIncrement)).count();
+        assertEquals(before.get(), onClose.get());
+
+        s.get().flatMapToDouble(i -> DoubleStream.of(i, i).onClose(onClose::getAndIncrement)).count();
+        assertEquals(before.get(), onClose.get());
+    }
+
+    @Test
+    public void testIntClose() {
+        AtomicInteger before = new AtomicInteger();
+        AtomicInteger onClose = new AtomicInteger();
+
+        IntStream.of(1, 2).peek(e -> before.getAndIncrement()).
+                flatMap(i -> IntStream.of(i, i).onClose(onClose::getAndIncrement)).count();
+        assertEquals(before.get(), onClose.get());
+    }
+
+    @Test
+    public void testLongClose() {
+        AtomicInteger before = new AtomicInteger();
+        AtomicInteger onClose = new AtomicInteger();
+
+        LongStream.of(1, 2).peek(e -> before.getAndIncrement()).
+                flatMap(i -> LongStream.of(i, i).onClose(onClose::getAndIncrement)).count();
+        assertEquals(before.get(), onClose.get());
+    }
+
+    @Test
+    public void testDoubleClose() {
+        AtomicInteger before = new AtomicInteger();
+        AtomicInteger onClose = new AtomicInteger();
+
+        DoubleStream.of(1, 2).peek(e -> before.getAndIncrement()).
+                flatMap(i -> DoubleStream.of(i, i).onClose(onClose::getAndIncrement)).count();
+        assertEquals(before.get(), onClose.get());
+    }
+
     @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
     public void testOps(String name, TestData.OfRef<Integer> data) {
         Collection<Integer> result = exerciseOps(data, s -> s.flatMap(mfId));
--- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/TabulatorsTest.java	Mon Feb 23 10:47:32 2015 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,621 +0,0 @@
-/*
- * Copyright (c) 2012, 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.
- */
-package org.openjdk.tests.java.util.stream;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
-import java.util.StringJoiner;
-import java.util.TreeMap;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentSkipListMap;
-import java.util.function.BinaryOperator;
-import java.util.function.Function;
-import java.util.function.Predicate;
-import java.util.function.Supplier;
-import java.util.stream.Collector;
-import java.util.stream.Collectors;
-import java.util.stream.LambdaTestHelpers;
-import java.util.stream.OpTestCase;
-import java.util.stream.Stream;
-import java.util.stream.StreamOpFlagTestHelper;
-import java.util.stream.StreamTestDataProvider;
-import java.util.stream.TestData;
-
-import org.testng.annotations.Test;
-
-import static java.util.stream.Collectors.collectingAndThen;
-import static java.util.stream.Collectors.groupingBy;
-import static java.util.stream.Collectors.groupingByConcurrent;
-import static java.util.stream.Collectors.partitioningBy;
-import static java.util.stream.Collectors.reducing;
-import static java.util.stream.Collectors.toCollection;
-import static java.util.stream.Collectors.toConcurrentMap;
-import static java.util.stream.Collectors.toList;
-import static java.util.stream.Collectors.toMap;
-import static java.util.stream.Collectors.toSet;
-import static java.util.stream.LambdaTestHelpers.assertContents;
-import static java.util.stream.LambdaTestHelpers.assertContentsUnordered;
-import static java.util.stream.LambdaTestHelpers.mDoubler;
-
-/**
- * TabulatorsTest
- *
- * @author Brian Goetz
- */
-@SuppressWarnings({"rawtypes", "unchecked"})
-public class TabulatorsTest extends OpTestCase {
-
-    private static abstract class TabulationAssertion<T, U> {
-        abstract void assertValue(U value,
-                                  Supplier<Stream<T>> source,
-                                  boolean ordered) throws ReflectiveOperationException;
-    }
-
-    @SuppressWarnings({"rawtypes", "unchecked"})
-    static class GroupedMapAssertion<T, K, V, M extends Map<K, ? extends V>> extends TabulationAssertion<T, M> {
-        private final Class<? extends Map> clazz;
-        private final Function<T, K> classifier;
-        private final TabulationAssertion<T,V> downstream;
-
-        protected GroupedMapAssertion(Function<T, K> classifier,
-                                      Class<? extends Map> clazz,
-                                      TabulationAssertion<T, V> downstream) {
-            this.clazz = clazz;
-            this.classifier = classifier;
-            this.downstream = downstream;
-        }
-
-        void assertValue(M map,
-                         Supplier<Stream<T>> source,
-                         boolean ordered) throws ReflectiveOperationException {
-            if (!clazz.isAssignableFrom(map.getClass()))
-                fail(String.format("Class mismatch in GroupedMapAssertion: %s, %s", clazz, map.getClass()));
-            assertContentsUnordered(map.keySet(), source.get().map(classifier).collect(toSet()));
-            for (Map.Entry<K, ? extends V> entry : map.entrySet()) {
-                K key = entry.getKey();
-                downstream.assertValue(entry.getValue(),
-                                       () -> source.get().filter(e -> classifier.apply(e).equals(key)),
-                                       ordered);
-            }
-        }
-    }
-
-    static class ToMapAssertion<T, K, V, M extends Map<K,V>> extends TabulationAssertion<T, M> {
-        private final Class<? extends Map> clazz;
-        private final Function<T, K> keyFn;
-        private final Function<T, V> valueFn;
-        private final BinaryOperator<V> mergeFn;
-
-        ToMapAssertion(Function<T, K> keyFn,
-                       Function<T, V> valueFn,
-                       BinaryOperator<V> mergeFn,
-                       Class<? extends Map> clazz) {
-            this.clazz = clazz;
-            this.keyFn = keyFn;
-            this.valueFn = valueFn;
-            this.mergeFn = mergeFn;
-        }
-
-        @Override
-        void assertValue(M map, Supplier<Stream<T>> source, boolean ordered) throws ReflectiveOperationException {
-            Set<K> uniqueKeys = source.get().map(keyFn).collect(toSet());
-            assertTrue(clazz.isAssignableFrom(map.getClass()));
-            assertEquals(uniqueKeys, map.keySet());
-            source.get().forEach(t -> {
-                K key = keyFn.apply(t);
-                V v = source.get()
-                            .filter(e -> key.equals(keyFn.apply(e)))
-                            .map(valueFn)
-                            .reduce(mergeFn)
-                            .get();
-                assertEquals(map.get(key), v);
-            });
-        }
-    }
-
-    static class PartitionAssertion<T, D> extends TabulationAssertion<T, Map<Boolean,D>> {
-        private final Predicate<T> predicate;
-        private final TabulationAssertion<T,D> downstream;
-
-        protected PartitionAssertion(Predicate<T> predicate,
-                                     TabulationAssertion<T, D> downstream) {
-            this.predicate = predicate;
-            this.downstream = downstream;
-        }
-
-        void assertValue(Map<Boolean, D> map,
-                         Supplier<Stream<T>> source,
-                         boolean ordered) throws ReflectiveOperationException {
-            if (!Map.class.isAssignableFrom(map.getClass()))
-                fail(String.format("Class mismatch in PartitionAssertion: %s", map.getClass()));
-            assertEquals(2, map.size());
-            downstream.assertValue(map.get(true), () -> source.get().filter(predicate), ordered);
-            downstream.assertValue(map.get(false), () -> source.get().filter(predicate.negate()), ordered);
-        }
-    }
-
-    @SuppressWarnings({"rawtypes", "unchecked"})
-    static class ListAssertion<T> extends TabulationAssertion<T, List<T>> {
-        @Override
-        void assertValue(List<T> value, Supplier<Stream<T>> source, boolean ordered)
-                throws ReflectiveOperationException {
-            if (!List.class.isAssignableFrom(value.getClass()))
-                fail(String.format("Class mismatch in ListAssertion: %s", value.getClass()));
-            Stream<T> stream = source.get();
-            List<T> result = new ArrayList<>();
-            for (Iterator<T> it = stream.iterator(); it.hasNext(); ) // avoid capturing result::add
-                result.add(it.next());
-            if (StreamOpFlagTestHelper.isStreamOrdered(stream) && ordered)
-                assertContents(value, result);
-            else
-                assertContentsUnordered(value, result);
-        }
-    }
-
-    @SuppressWarnings({"rawtypes", "unchecked"})
-    static class CollectionAssertion<T> extends TabulationAssertion<T, Collection<T>> {
-        private final Class<? extends Collection> clazz;
-        private final boolean targetOrdered;
-
-        protected CollectionAssertion(Class<? extends Collection> clazz, boolean targetOrdered) {
-            this.clazz = clazz;
-            this.targetOrdered = targetOrdered;
-        }
-
-        @Override
-        void assertValue(Collection<T> value, Supplier<Stream<T>> source, boolean ordered)
-                throws ReflectiveOperationException {
-            if (!clazz.isAssignableFrom(value.getClass()))
-                fail(String.format("Class mismatch in CollectionAssertion: %s, %s", clazz, value.getClass()));
-            Stream<T> stream = source.get();
-            Collection<T> result = clazz.newInstance();
-            for (Iterator<T> it = stream.iterator(); it.hasNext(); ) // avoid capturing result::add
-                result.add(it.next());
-            if (StreamOpFlagTestHelper.isStreamOrdered(stream) && targetOrdered && ordered)
-                assertContents(value, result);
-            else
-                assertContentsUnordered(value, result);
-        }
-    }
-
-    static class ReduceAssertion<T, U> extends TabulationAssertion<T, U> {
-        private final U identity;
-        private final Function<T, U> mapper;
-        private final BinaryOperator<U> reducer;
-
-        ReduceAssertion(U identity, Function<T, U> mapper, BinaryOperator<U> reducer) {
-            this.identity = identity;
-            this.mapper = mapper;
-            this.reducer = reducer;
-        }
-
-        @Override
-        void assertValue(U value, Supplier<Stream<T>> source, boolean ordered)
-                throws ReflectiveOperationException {
-            Optional<U> reduced = source.get().map(mapper).reduce(reducer);
-            if (value == null)
-                assertTrue(!reduced.isPresent());
-            else if (!reduced.isPresent()) {
-                assertEquals(value, identity);
-            }
-            else {
-                assertEquals(value, reduced.get());
-            }
-        }
-    }
-
-    private <T> ResultAsserter<T> mapTabulationAsserter(boolean ordered) {
-        return (act, exp, ord, par) -> {
-            if (par && (!ordered || !ord)) {
-                TabulatorsTest.nestedMapEqualityAssertion(act, exp);
-            }
-            else {
-                LambdaTestHelpers.assertContentsEqual(act, exp);
-            }
-        };
-    }
-
-    private<T, M extends Map>
-    void exerciseMapTabulation(TestData<T, Stream<T>> data,
-                               Collector<T, ?, ? extends M> collector,
-                               TabulationAssertion<T, M> assertion)
-            throws ReflectiveOperationException {
-        boolean ordered = !collector.characteristics().contains(Collector.Characteristics.UNORDERED);
-
-        M m = withData(data)
-                .terminal(s -> s.collect(collector))
-                .resultAsserter(mapTabulationAsserter(ordered))
-                .exercise();
-        assertion.assertValue(m, () -> data.stream(), ordered);
-
-        m = withData(data)
-                .terminal(s -> s.unordered().collect(collector))
-                .resultAsserter(mapTabulationAsserter(ordered))
-                .exercise();
-        assertion.assertValue(m, () -> data.stream(), false);
-    }
-
-    private static void nestedMapEqualityAssertion(Object o1, Object o2) {
-        if (o1 instanceof Map) {
-            Map m1 = (Map) o1;
-            Map m2 = (Map) o2;
-            assertContentsUnordered(m1.keySet(), m2.keySet());
-            for (Object k : m1.keySet())
-                nestedMapEqualityAssertion(m1.get(k), m2.get(k));
-        }
-        else if (o1 instanceof Collection) {
-            assertContentsUnordered(((Collection) o1), ((Collection) o2));
-        }
-        else
-            assertEquals(o1, o2);
-    }
-
-    private<T, R> void assertCollect(TestData.OfRef<T> data,
-                                     Collector<T, ?, R> collector,
-                                     Function<Stream<T>, R> streamReduction) {
-        R check = streamReduction.apply(data.stream());
-        withData(data).terminal(s -> s.collect(collector)).expectedResult(check).exercise();
-    }
-
-    @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
-    public void testReduce(String name, TestData.OfRef<Integer> data) throws ReflectiveOperationException {
-        assertCollect(data, Collectors.reducing(0, Integer::sum),
-                      s -> s.reduce(0, Integer::sum));
-        assertCollect(data, Collectors.reducing(Integer.MAX_VALUE, Integer::min),
-                      s -> s.min(Integer::compare).orElse(Integer.MAX_VALUE));
-        assertCollect(data, Collectors.reducing(Integer.MIN_VALUE, Integer::max),
-                      s -> s.max(Integer::compare).orElse(Integer.MIN_VALUE));
-
-        assertCollect(data, Collectors.reducing(Integer::sum),
-                      s -> s.reduce(Integer::sum));
-        assertCollect(data, Collectors.minBy(Comparator.naturalOrder()),
-                      s -> s.min(Integer::compare));
-        assertCollect(data, Collectors.maxBy(Comparator.naturalOrder()),
-                      s -> s.max(Integer::compare));
-
-        assertCollect(data, Collectors.reducing(0, x -> x*2, Integer::sum),
-                      s -> s.map(x -> x*2).reduce(0, Integer::sum));
-
-        assertCollect(data, Collectors.summingLong(x -> x * 2L),
-                      s -> s.map(x -> x*2L).reduce(0L, Long::sum));
-        assertCollect(data, Collectors.summingInt(x -> x * 2),
-                      s -> s.map(x -> x*2).reduce(0, Integer::sum));
-        assertCollect(data, Collectors.summingDouble(x -> x * 2.0d),
-                      s -> s.map(x -> x * 2.0d).reduce(0.0d, Double::sum));
-
-        assertCollect(data, Collectors.averagingInt(x -> x * 2),
-                      s -> s.mapToInt(x -> x * 2).average().orElse(0));
-        assertCollect(data, Collectors.averagingLong(x -> x * 2),
-                      s -> s.mapToLong(x -> x * 2).average().orElse(0));
-        assertCollect(data, Collectors.averagingDouble(x -> x * 2),
-                      s -> s.mapToDouble(x -> x * 2).average().orElse(0));
-
-        // Test explicit Collector.of
-        Collector<Integer, long[], Double> avg2xint = Collector.of(() -> new long[2],
-                                                                   (a, b) -> {
-                                                                       a[0] += b * 2;
-                                                                       a[1]++;
-                                                                   },
-                                                                   (a, b) -> {
-                                                                       a[0] += b[0];
-                                                                       a[1] += b[1];
-                                                                       return a;
-                                                                   },
-                                                                   a -> a[1] == 0 ? 0.0d : (double) a[0] / a[1]);
-        assertCollect(data, avg2xint,
-                      s -> s.mapToInt(x -> x * 2).average().orElse(0));
-    }
-
-    @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
-    public void testJoin(String name, TestData.OfRef<Integer> data) throws ReflectiveOperationException {
-        withData(data)
-                .terminal(s -> s.map(Object::toString).collect(Collectors.joining()))
-                .expectedResult(join(data, ""))
-                .exercise();
-
-        Collector<String, StringBuilder, String> likeJoining = Collector.of(StringBuilder::new, StringBuilder::append, (sb1, sb2) -> sb1.append(sb2.toString()), StringBuilder::toString);
-        withData(data)
-                .terminal(s -> s.map(Object::toString).collect(likeJoining))
-                .expectedResult(join(data, ""))
-                .exercise();
-
-        withData(data)
-                .terminal(s -> s.map(Object::toString).collect(Collectors.joining(",")))
-                .expectedResult(join(data, ","))
-                .exercise();
-
-        withData(data)
-                .terminal(s -> s.map(Object::toString).collect(Collectors.joining(",", "[", "]")))
-                .expectedResult("[" + join(data, ",") + "]")
-                .exercise();
-
-        withData(data)
-                .terminal(s -> s.map(Object::toString)
-                                .collect(StringBuilder::new, StringBuilder::append, StringBuilder::append)
-                                .toString())
-                .expectedResult(join(data, ""))
-                .exercise();
-
-        withData(data)
-                .terminal(s -> s.map(Object::toString)
-                                .collect(() -> new StringJoiner(","),
-                                         (sj, cs) -> sj.add(cs),
-                                         (j1, j2) -> j1.merge(j2))
-                                .toString())
-                .expectedResult(join(data, ","))
-                .exercise();
-
-        withData(data)
-                .terminal(s -> s.map(Object::toString)
-                                .collect(() -> new StringJoiner(",", "[", "]"),
-                                         (sj, cs) -> sj.add(cs),
-                                         (j1, j2) -> j1.merge(j2))
-                                .toString())
-                .expectedResult("[" + join(data, ",") + "]")
-                .exercise();
-    }
-
-    private<T> String join(TestData.OfRef<T> data, String delim) {
-        StringBuilder sb = new StringBuilder();
-        boolean first = true;
-        for (T i : data) {
-            if (!first)
-                sb.append(delim);
-            sb.append(i.toString());
-            first = false;
-        }
-        return sb.toString();
-    }
-
-    @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
-    public void testSimpleToMap(String name, TestData.OfRef<Integer> data) throws ReflectiveOperationException {
-        Function<Integer, Integer> keyFn = i -> i * 2;
-        Function<Integer, Integer> valueFn = i -> i * 4;
-
-        List<Integer> dataAsList = Arrays.asList(data.stream().toArray(Integer[]::new));
-        Set<Integer> dataAsSet = new HashSet<>(dataAsList);
-
-        BinaryOperator<Integer> sum = Integer::sum;
-        for (BinaryOperator<Integer> op : Arrays.asList((u, v) -> u,
-                                                        (u, v) -> v,
-                                                        sum)) {
-            try {
-                exerciseMapTabulation(data, toMap(keyFn, valueFn),
-                                      new ToMapAssertion<>(keyFn, valueFn, op, HashMap.class));
-                if (dataAsList.size() != dataAsSet.size())
-                    fail("Expected ISE on input with duplicates");
-            }
-            catch (IllegalStateException e) {
-                if (dataAsList.size() == dataAsSet.size())
-                    fail("Expected no ISE on input without duplicates");
-            }
-
-            exerciseMapTabulation(data, toMap(keyFn, valueFn, op),
-                                  new ToMapAssertion<>(keyFn, valueFn, op, HashMap.class));
-
-            exerciseMapTabulation(data, toMap(keyFn, valueFn, op, TreeMap::new),
-                                  new ToMapAssertion<>(keyFn, valueFn, op, TreeMap.class));
-        }
-
-        // For concurrent maps, only use commutative merge functions
-        try {
-            exerciseMapTabulation(data, toConcurrentMap(keyFn, valueFn),
-                                  new ToMapAssertion<>(keyFn, valueFn, sum, ConcurrentHashMap.class));
-            if (dataAsList.size() != dataAsSet.size())
-                fail("Expected ISE on input with duplicates");
-        }
-        catch (IllegalStateException e) {
-            if (dataAsList.size() == dataAsSet.size())
-                fail("Expected no ISE on input without duplicates");
-        }
-
-        exerciseMapTabulation(data, toConcurrentMap(keyFn, valueFn, sum),
-                              new ToMapAssertion<>(keyFn, valueFn, sum, ConcurrentHashMap.class));
-
-        exerciseMapTabulation(data, toConcurrentMap(keyFn, valueFn, sum, ConcurrentSkipListMap::new),
-                              new ToMapAssertion<>(keyFn, valueFn, sum, ConcurrentSkipListMap.class));
-    }
-
-    @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
-    public void testSimpleGroupBy(String name, TestData.OfRef<Integer> data) throws ReflectiveOperationException {
-        Function<Integer, Integer> classifier = i -> i % 3;
-
-        // Single-level groupBy
-        exerciseMapTabulation(data, groupingBy(classifier),
-                              new GroupedMapAssertion<>(classifier, HashMap.class,
-                                                        new ListAssertion<>()));
-        exerciseMapTabulation(data, groupingByConcurrent(classifier),
-                              new GroupedMapAssertion<>(classifier, ConcurrentHashMap.class,
-                                                        new ListAssertion<>()));
-
-        // With explicit constructors
-        exerciseMapTabulation(data,
-                              groupingBy(classifier, TreeMap::new, toCollection(HashSet::new)),
-                              new GroupedMapAssertion<>(classifier, TreeMap.class,
-                                                        new CollectionAssertion<Integer>(HashSet.class, false)));
-        exerciseMapTabulation(data,
-                              groupingByConcurrent(classifier, ConcurrentSkipListMap::new,
-                                                   toCollection(HashSet::new)),
-                              new GroupedMapAssertion<>(classifier, ConcurrentSkipListMap.class,
-                                                        new CollectionAssertion<Integer>(HashSet.class, false)));
-    }
-
-    @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
-    public void testTwoLevelGroupBy(String name, TestData.OfRef<Integer> data) throws ReflectiveOperationException {
-        Function<Integer, Integer> classifier = i -> i % 6;
-        Function<Integer, Integer> classifier2 = i -> i % 23;
-
-        // Two-level groupBy
-        exerciseMapTabulation(data,
-                              groupingBy(classifier, groupingBy(classifier2)),
-                              new GroupedMapAssertion<>(classifier, HashMap.class,
-                                                        new GroupedMapAssertion<>(classifier2, HashMap.class,
-                                                                                  new ListAssertion<>())));
-        // with concurrent as upstream
-        exerciseMapTabulation(data,
-                              groupingByConcurrent(classifier, groupingBy(classifier2)),
-                              new GroupedMapAssertion<>(classifier, ConcurrentHashMap.class,
-                                                        new GroupedMapAssertion<>(classifier2, HashMap.class,
-                                                                                  new ListAssertion<>())));
-        // with concurrent as downstream
-        exerciseMapTabulation(data,
-                              groupingBy(classifier, groupingByConcurrent(classifier2)),
-                              new GroupedMapAssertion<>(classifier, HashMap.class,
-                                                        new GroupedMapAssertion<>(classifier2, ConcurrentHashMap.class,
-                                                                                  new ListAssertion<>())));
-        // with concurrent as upstream and downstream
-        exerciseMapTabulation(data,
-                              groupingByConcurrent(classifier, groupingByConcurrent(classifier2)),
-                              new GroupedMapAssertion<>(classifier, ConcurrentHashMap.class,
-                                                        new GroupedMapAssertion<>(classifier2, ConcurrentHashMap.class,
-                                                                                  new ListAssertion<>())));
-
-        // With explicit constructors
-        exerciseMapTabulation(data,
-                              groupingBy(classifier, TreeMap::new, groupingBy(classifier2, TreeMap::new, toCollection(HashSet::new))),
-                              new GroupedMapAssertion<>(classifier, TreeMap.class,
-                                                        new GroupedMapAssertion<>(classifier2, TreeMap.class,
-                                                                                  new CollectionAssertion<Integer>(HashSet.class, false))));
-        // with concurrent as upstream
-        exerciseMapTabulation(data,
-                              groupingByConcurrent(classifier, ConcurrentSkipListMap::new, groupingBy(classifier2, TreeMap::new, toList())),
-                              new GroupedMapAssertion<>(classifier, ConcurrentSkipListMap.class,
-                                                        new GroupedMapAssertion<>(classifier2, TreeMap.class,
-                                                                                  new ListAssertion<>())));
-        // with concurrent as downstream
-        exerciseMapTabulation(data,
-                              groupingBy(classifier, TreeMap::new, groupingByConcurrent(classifier2, ConcurrentSkipListMap::new, toList())),
-                              new GroupedMapAssertion<>(classifier, TreeMap.class,
-                                                        new GroupedMapAssertion<>(classifier2, ConcurrentSkipListMap.class,
-                                                                                  new ListAssertion<>())));
-        // with concurrent as upstream and downstream
-        exerciseMapTabulation(data,
-                              groupingByConcurrent(classifier, ConcurrentSkipListMap::new, groupingByConcurrent(classifier2, ConcurrentSkipListMap::new, toList())),
-                              new GroupedMapAssertion<>(classifier, ConcurrentSkipListMap.class,
-                                                        new GroupedMapAssertion<>(classifier2, ConcurrentSkipListMap.class,
-                                                                                  new ListAssertion<>())));
-    }
-
-    @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
-    public void testGroupedReduce(String name, TestData.OfRef<Integer> data) throws ReflectiveOperationException {
-        Function<Integer, Integer> classifier = i -> i % 3;
-
-        // Single-level simple reduce
-        exerciseMapTabulation(data,
-                              groupingBy(classifier, reducing(0, Integer::sum)),
-                              new GroupedMapAssertion<>(classifier, HashMap.class,
-                                                        new ReduceAssertion<>(0, LambdaTestHelpers.identity(), Integer::sum)));
-        // with concurrent
-        exerciseMapTabulation(data,
-                              groupingByConcurrent(classifier, reducing(0, Integer::sum)),
-                              new GroupedMapAssertion<>(classifier, ConcurrentHashMap.class,
-                                                        new ReduceAssertion<>(0, LambdaTestHelpers.identity(), Integer::sum)));
-
-        // With explicit constructors
-        exerciseMapTabulation(data,
-                              groupingBy(classifier, TreeMap::new, reducing(0, Integer::sum)),
-                              new GroupedMapAssertion<>(classifier, TreeMap.class,
-                                                        new ReduceAssertion<>(0, LambdaTestHelpers.identity(), Integer::sum)));
-        // with concurrent
-        exerciseMapTabulation(data,
-                              groupingByConcurrent(classifier, ConcurrentSkipListMap::new, reducing(0, Integer::sum)),
-                              new GroupedMapAssertion<>(classifier, ConcurrentSkipListMap.class,
-                                                        new ReduceAssertion<>(0, LambdaTestHelpers.identity(), Integer::sum)));
-
-        // Single-level map-reduce
-        exerciseMapTabulation(data,
-                              groupingBy(classifier, reducing(0, mDoubler, Integer::sum)),
-                              new GroupedMapAssertion<>(classifier, HashMap.class,
-                                                        new ReduceAssertion<>(0, mDoubler, Integer::sum)));
-        // with concurrent
-        exerciseMapTabulation(data,
-                              groupingByConcurrent(classifier, reducing(0, mDoubler, Integer::sum)),
-                              new GroupedMapAssertion<>(classifier, ConcurrentHashMap.class,
-                                                        new ReduceAssertion<>(0, mDoubler, Integer::sum)));
-
-        // With explicit constructors
-        exerciseMapTabulation(data,
-                              groupingBy(classifier, TreeMap::new, reducing(0, mDoubler, Integer::sum)),
-                              new GroupedMapAssertion<>(classifier, TreeMap.class,
-                                                        new ReduceAssertion<>(0, mDoubler, Integer::sum)));
-        // with concurrent
-        exerciseMapTabulation(data,
-                              groupingByConcurrent(classifier, ConcurrentSkipListMap::new, reducing(0, mDoubler, Integer::sum)),
-                              new GroupedMapAssertion<>(classifier, ConcurrentSkipListMap.class,
-                                                        new ReduceAssertion<>(0, mDoubler, Integer::sum)));
-    }
-
-    @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
-    public void testSimplePartition(String name, TestData.OfRef<Integer> data) throws ReflectiveOperationException {
-        Predicate<Integer> classifier = i -> i % 3 == 0;
-
-        // Single-level partition to downstream List
-        exerciseMapTabulation(data,
-                              partitioningBy(classifier),
-                              new PartitionAssertion<>(classifier, new ListAssertion<>()));
-        exerciseMapTabulation(data,
-                              partitioningBy(classifier, toList()),
-                              new PartitionAssertion<>(classifier, new ListAssertion<>()));
-    }
-
-    @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
-    public void testTwoLevelPartition(String name, TestData.OfRef<Integer> data) throws ReflectiveOperationException {
-        Predicate<Integer> classifier = i -> i % 3 == 0;
-        Predicate<Integer> classifier2 = i -> i % 7 == 0;
-
-        // Two level partition
-        exerciseMapTabulation(data,
-                              partitioningBy(classifier, partitioningBy(classifier2)),
-                              new PartitionAssertion<>(classifier,
-                                                       new PartitionAssertion(classifier2, new ListAssertion<>())));
-
-        // Two level partition with reduce
-        exerciseMapTabulation(data,
-                              partitioningBy(classifier, reducing(0, Integer::sum)),
-                              new PartitionAssertion<>(classifier,
-                                                       new ReduceAssertion<>(0, LambdaTestHelpers.identity(), Integer::sum)));
-    }
-
-    @Test(dataProvider = "StreamTestData<Integer>", dataProviderClass = StreamTestDataProvider.class)
-    public void testComposeFinisher(String name, TestData.OfRef<Integer> data) throws ReflectiveOperationException {
-        List<Integer> asList = exerciseTerminalOps(data, s -> s.collect(toList()));
-        List<Integer> asImmutableList = exerciseTerminalOps(data, s -> s.collect(collectingAndThen(toList(), Collections::unmodifiableList)));
-        assertEquals(asList, asImmutableList);
-        try {
-            asImmutableList.add(0);
-            fail("Expecting immutable result");
-        }
-        catch (UnsupportedOperationException ignored) { }
-    }
-
-}
--- a/jdk/test/java/util/zip/TestExtraTime.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/test/java/util/zip/TestExtraTime.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -71,6 +71,7 @@
         }
 
         testNullHandling();
+        testTimeConversions();
     }
 
     static void test(FileTime mtime, FileTime atime, FileTime ctime,
@@ -178,4 +179,33 @@
             // pass
         }
     }
+
+    // verify that setting and getting any time is possible as per the intent
+    // of 4759491
+    static void testTimeConversions() {
+        // Sample across the entire range
+        long step = Long.MAX_VALUE / 100L;
+        testTimeConversions(Long.MIN_VALUE, Long.MAX_VALUE - step, step);
+
+        // Samples through the near future
+        long currentTime = System.currentTimeMillis();
+        testTimeConversions(currentTime, currentTime + 1_000_000, 10_000);
+    }
+
+    static void testTimeConversions(long from, long to, long step) {
+        ZipEntry ze = new ZipEntry("TestExtraTime.java");
+        for (long time = from; time <= to; time += step) {
+            ze.setTime(time);
+            FileTime lastModifiedTime = ze.getLastModifiedTime();
+            if (lastModifiedTime.toMillis() != time) {
+                throw new RuntimeException("setTime should make getLastModifiedTime " +
+                        "return the specified instant: " + time +
+                        " got: " + lastModifiedTime.toMillis());
+            }
+            if (ze.getTime() != time) {
+                throw new RuntimeException("getTime after setTime, expected: " +
+                        time + " got: " + ze.getTime());
+            }
+        }
+    }
 }
--- a/jdk/test/jdk/lambda/separate/Compiler.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/test/jdk/lambda/separate/Compiler.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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 @@
     private static final AtomicInteger counter = new AtomicInteger();
     private static final String targetDir =
         System.getProperty("lambda.separate.targetDirectory",
-            System.getProperty("java.io.tmpdir") + File.separator + "gen-separate");
+            "." + File.separator + "gen-separate");
     private static final File root = new File(targetDir);
     private static ConcurrentHashMap<String,File> cache =
             new ConcurrentHashMap<>();
@@ -189,7 +189,7 @@
                 StandardLocation.CLASS_OUTPUT, Arrays.asList(destDir));
         } catch (IOException e) {
             throw new RuntimeException(
-                "IOException encountered during compilation");
+                "IOException encountered during compilation: " + e.getMessage(), e);
         }
         Boolean result = ct.call();
         if (result == Boolean.FALSE) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/native_sanity/simplenativelauncher/ProgramTest.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.OutputAnalyzer
+ * @build ProgramTest
+ * @run main/native ProgramTest
+ */
+
+import jdk.testlibrary.OutputAnalyzer;
+import jdk.testlibrary.ProcessTools;
+
+public class ProgramTest {
+    public static void main(String... args) throws Exception {
+        String lib = System.getProperty("test.nativepath");
+        ProcessBuilder pb = new ProcessBuilder(lib + "/sanity_SimpleNativeLauncher");
+        OutputAnalyzer output = ProcessTools.executeProcess(pb);
+        output.shouldHaveExitValue(0);
+        output.stdoutShouldContain("Hello");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/native_sanity/simplenativelauncher/exesanity_SimpleNativeLauncher.c	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+ #include <stdio.h>
+
+int
+main(int argc, char** argv)
+{
+    printf("Hello\n");
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/native_sanity/simplenativelib/NativeLib.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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
+ * @run main/native NativeLib
+ */
+
+public class NativeLib {
+    public static void main(String... args) throws Exception {
+        System.loadLibrary("sanity_SimpleNativeLib");
+
+        int res = nativeFunc();
+        if (res != 4711) {
+            throw new Exception("Wrong value returned from native code: " + res);
+        }
+    }
+
+    static native int nativeFunc();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/native_sanity/simplenativelib/libsanity_SimpleNativeLib.c	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+ #include <jni.h>
+
+JNIEXPORT jint JNICALL
+Java_NativeLib_nativeFunc(JNIEnv *env, jclass dummy)
+{
+    return 4711;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/native_sanity/simplenativelib2/NativeLib.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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
+ * @run main/native NativeLib
+ */
+
+public class NativeLib {
+    public static void main(String... args) throws Exception {
+        System.loadLibrary("sanity_SimpleNativeLib2");
+
+        int res = nativeFunc();
+        if (res != 4712) {
+            throw new Exception("Wrong value returned from native code: " + res);
+        }
+    }
+
+    static native int nativeFunc();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/native_sanity/simplenativelib2/libsanity_SimpleNativeLib2.c	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+ #include <jni.h>
+
+JNIEXPORT jint JNICALL
+Java_NativeLib_nativeFunc(JNIEnv *env, jclass dummy)
+{
+    return 4712;
+}
--- a/jdk/test/sun/nio/cs/CheckHistoricalNames.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/test/sun/nio/cs/CheckHistoricalNames.java	Tue Mar 03 08:49:13 2015 -0800
@@ -196,6 +196,7 @@
         checkMappedName("IBM1122", "Cp1122");
         checkMappedName("IBM1123", "Cp1123");
         checkMappedName("IBM1124", "Cp1124");
+        checkMappedName("IBM1166", "Cp1166");
         checkMappedName("IBM01140", "Cp1140");
         checkMappedName("IBM01141", "Cp1141");
         checkMappedName("IBM01142", "Cp1142");
--- a/jdk/test/sun/nio/cs/X11CNS11643.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/test/sun/nio/cs/X11CNS11643.java	Tue Mar 03 08:49:13 2015 -0800
@@ -24,7 +24,8 @@
 import java.nio.CharBuffer;
 import java.nio.ByteBuffer;
 import java.nio.charset.*;
-import sun.nio.cs.ext.EUC_TW;
+import sun.nio.cs.*;
+import sun.nio.cs.ext.*;
 
 public abstract class X11CNS11643 extends Charset {
     private final int plane;
--- a/jdk/test/sun/security/acl/PermissionImpl/PermissionEqualsHashCode.java	Mon Feb 23 10:47:32 2015 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
- * 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
- * @author Gary Ellison
- * @bug 4170635
- * @summary Verify equals()/hashCode() contract honored
- */
-
-import java.io.*;
-
-import sun.security.acl.*;
-
-
-public class PermissionEqualsHashCode {
-
-    public static void main(String[] args) throws Exception {
-
-        PermissionImpl p1 = new PermissionImpl("permissionPermission");
-        PermissionImpl p2 = new PermissionImpl("permissionPermission");
-
-
-        // the test
-        if ( (p1.equals(p2)) == (p1.hashCode()==p2.hashCode()) )
-            System.out.println("PASSED");
-        else
-            throw new Exception("Failed equals()/hashCode() contract");
-
-    }
-}
--- a/jdk/test/sun/security/tools/keytool/KeyToolTest.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/test/sun/security/tools/keytool/KeyToolTest.java	Tue Mar 03 08:49:13 2015 -0800
@@ -42,7 +42,8 @@
  *       echo | java -Dsolaris KeyToolTest
  *
  * ATTENTION:
- * Exception in thread "main" java.security.ProviderException: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_KEY_SIZE_RANGE
+ * Exception in thread "main" java.security.ProviderException:
+ *   sun.security.pkcs11.wrapper.PKCS11Exception: CKR_KEY_SIZE_RANGE
  *       at sun.security.pkcs11.P11Signature.engineSign(P11Signature.java:420)
  *       ...
  * Caused by: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_KEY_SIZE_RANGE
@@ -78,15 +79,26 @@
         System.getProperty("debug") != null;
 
     static final String NSS_P11_ARG =
-            "-keystore NONE -storetype PKCS11 -providerName SunPKCS11-nss -providerClass sun.security.pkcs11.SunPKCS11 -providerArg p11-nss.txt ";
+            "-keystore NONE -storetype PKCS11 -providerName SunPKCS11-nss " +
+            "-providerClass sun.security.pkcs11.SunPKCS11 " +
+            "-providerArg p11-nss.txt ";
     static final String NSS_SRC_P11_ARG =
-            "-srckeystore NONE -srcstoretype PKCS11 -srcproviderName SunPKCS11-nss -providerClass sun.security.pkcs11.SunPKCS11 -providerArg p11-nss.txt ";
+            "-srckeystore NONE -srcstoretype PKCS11 " +
+            "-srcproviderName SunPKCS11-nss " +
+            "-providerClass sun.security.pkcs11.SunPKCS11 " +
+            "-providerArg p11-nss.txt ";
     static final String NZZ_P11_ARG =
-            "-keystore NONE -storetype PKCS11 -providerName SunPKCS11-nzz -providerClass sun.security.pkcs11.SunPKCS11 -providerArg p11-nzz.txt ";
+            "-keystore NONE -storetype PKCS11 -providerName SunPKCS11-nzz " +
+            "-providerClass sun.security.pkcs11.SunPKCS11 " +
+            "-providerArg p11-nzz.txt ";
     static final String NZZ_SRC_P11_ARG =
-            "-srckeystore NONE -srcstoretype PKCS11 -srcproviderName SunPKCS11-nzz -providerClass sun.security.pkcs11.SunPKCS11 -providerArg p11-nzz.txt ";
+            "-srckeystore NONE -srcstoretype PKCS11 " +
+            "-srcproviderName SunPKCS11-nzz " +
+            "-providerClass sun.security.pkcs11.SunPKCS11 " +
+            "-providerArg p11-nzz.txt ";
     static final String SUN_P11_ARG = "-keystore NONE -storetype PKCS11 ";
-    static final String SUN_SRC_P11_ARG = "-srckeystore NONE -srcstoretype PKCS11 ";
+    static final String SUN_SRC_P11_ARG =
+            "-srckeystore NONE -srcstoretype PKCS11 ";
 
     String p11Arg, srcP11Arg;
 
@@ -328,15 +340,22 @@
         // name changes: genkeypair, importcert, exportcert
         remove("x.jks");
         remove("x.jks.p1.cert");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -alias p1 -dname CN=olala");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -exportcert -alias p1 -file x.jks.p1.cert");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -alias p1 -dname CN=olala");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-exportcert -alias p1 -file x.jks.p1.cert");
         ks = loadStore("x.jks", "changeit", "JKS");
         assertTrue(ks.getKey("p1", "changeit".toCharArray()) != null,
             "key not DSA");
         assertTrue(new File("x.jks.p1.cert").exists(), "p1 export err");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -delete -alias p1");
-        testOK("y\n", "-keystore x.jks -storetype JKS -storepass changeit -importcert -alias c1 -file x.jks.p1.cert");  // importcert, prompt for Yes/No
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -importcert -alias c2 -file x.jks.p1.cert -noprompt"); // importcert, -noprompt
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-delete -alias p1");
+        // importcert, prompt for Yes/No
+        testOK("y\n", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-importcert -alias c1 -file x.jks.p1.cert");
+        // importcert, -noprompt
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-importcert -alias c2 -file x.jks.p1.cert -noprompt");
         ks = loadStore("x.jks", "changeit", "JKS");
         assertTrue(ks.getCertificate("c1") != null, "import c1 err");
 
@@ -346,10 +365,15 @@
         assertTrue(certImpl.getVersion() == 3, "Version is not 3");
 
         // changealias and keyclone
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -alias p1 -dname CN=olala");
-        testOK("changeit\n", "-keystore x.jks -storetype JKS -changealias -alias p1 -destalias p11");
-        testOK("changeit\n", "-keystore x.jks -storetype JKS -changealias -alias c1 -destalias c11");
-        testOK("changeit\n\n", "-keystore x.jks -storetype JKS -keyclone -alias p11 -destalias p111"); // press ENTER when prompt for p111's keypass
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -alias p1 -dname CN=olala");
+        testOK("changeit\n", "-keystore x.jks -storetype JKS " +
+                "-changealias -alias p1 -destalias p11");
+        testOK("changeit\n", "-keystore x.jks -storetype JKS " +
+                "-changealias -alias c1 -destalias c11");
+        // press ENTER when prompt for p111's keypass
+        testOK("changeit\n\n", "-keystore x.jks -storetype JKS " +
+                "-keyclone -alias p11 -destalias p111");
         ks = loadStore("x.jks", "changeit", "JKS");
         assertTrue(!ks.containsAlias("p1"), "there is no p1");
         assertTrue(!ks.containsAlias("c1"), "there is no c1");
@@ -359,148 +383,283 @@
 
         // genSecKey
         remove("x.jceks");
-        testOK("changeit\nchangeit\n\n", "-keystore x.jceks -storetype JCEKS -genseckey -alias s1"); // DES, no need keysize
-        testFail("changeit\n\n", "-keystore x.jceks -storetype JCEKS -genseckey -alias s11 -keysize 128"); // DES, keysize cannot be 128
-        testOK("changeit\n\n", "-keystore x.jceks -storetype JCEKS -genseckey -keyalg DESede -alias s2"); // DESede. no need keysize
-        testFail("changeit\n\n", "-keystore x.jceks -storetype AES -genseckey -keyalg Rijndael -alias s3"); // AES, need keysize
-        testOK("changeit\n\n", "-keystore x.jceks -storetype JCEKS -genseckey -keyalg AES -alias s3 -keysize 128");
-                // about keypass
-        testOK("\n", "-keystore x.jceks -storetype JCEKS -storepass changeit -genseckey -alias s4"); // can accept storepass
-        testOK("keypass\nkeypass\n", "-keystore x.jceks -storetype JCEKS -storepass changeit -genseckey -alias s5"); // or a new one
-        testOK("bad\n\bad\nkeypass\nkeypass\n", "-keystore x.jceks -storetype JCEKS -storepass changeit -genseckey -alias s6"); // keypass must be valid (prompt 3 times)
-        testFail("bad\n\bad\nbad\n", "-keystore x.jceks -storetype JCEKS -storepass changeit -genseckey -alias s7"); // keypass must be valid (prompt 3 times)
-        testFail("bad\n\bad\nbad\nkeypass\n", "-keystore x.jceks -storetype JCEKS -storepass changeit -genseckey -alias s7"); // keypass must be valid (prompt 3 times)
+        // DES, no need keysize
+        testOK("changeit\nchangeit\n\n", "-keystore x.jceks -storetype JCEKS " +
+                "-genseckey -alias s1");
+        // DES, keysize cannot be 128
+        testFail("changeit\n\n", "-keystore x.jceks -storetype JCEKS " +
+                "-genseckey -alias s11 -keysize 128");
+        // DESede. no need keysize
+        testOK("changeit\n\n", "-keystore x.jceks -storetype JCEKS " +
+                "-genseckey -keyalg DESede -alias s2");
+        // AES, need keysize
+        testFail("changeit\n\n", "-keystore x.jceks -storetype AES " +
+                "-genseckey -keyalg Rijndael -alias s3");
+        testOK("changeit\n\n", "-keystore x.jceks -storetype JCEKS " +
+                "-genseckey -keyalg AES -alias s3 -keysize 128");
+        // about keypass
+        // can accept storepass
+        testOK("\n", "-keystore x.jceks -storetype JCEKS -storepass changeit " +
+                "-genseckey -alias s4");
+        // or a new one
+        testOK("keypass\nkeypass\n", "-keystore x.jceks -storetype JCEKS " +
+                "-storepass changeit -genseckey -alias s5");
+        // keypass must be valid (prompt 3 times)
+        testOK("bad\n\bad\nkeypass\nkeypass\n", "-keystore x.jceks " +
+                "-storetype JCEKS -storepass changeit -genseckey -alias s6");
+        // keypass must be valid (prompt 3 times)
+        testFail("bad\n\bad\nbad\n", "-keystore x.jceks -storetype JCEKS " +
+                "-storepass changeit -genseckey -alias s7");
+        // keypass must be valid (prompt 3 times)
+        testFail("bad\n\bad\nbad\nkeypass\n", "-keystore x.jceks " +
+                "-storetype JCEKS -storepass changeit -genseckey -alias s7");
         ks = loadStore("x.jceks", "changeit", "JCEKS");
-        assertTrue(ks.getKey("s1", "changeit".toCharArray()).getAlgorithm().equalsIgnoreCase("DES"), "s1 is DES");
-        assertTrue(ks.getKey("s1", "changeit".toCharArray()).getEncoded().length == 8,  "DES is 56");
-        assertTrue(ks.getKey("s2", "changeit".toCharArray()).getEncoded().length == 24,  "DESede is 168");
-        assertTrue(ks.getKey("s2", "changeit".toCharArray()).getAlgorithm().equalsIgnoreCase("DESede"), "s2 is DESede");
-        assertTrue(ks.getKey("s3", "changeit".toCharArray()).getAlgorithm().equalsIgnoreCase("AES"), "s3 is AES");
-        assertTrue(ks.getKey("s4", "changeit".toCharArray()).getAlgorithm().equalsIgnoreCase("DES"), "s4 is DES");
-        assertTrue(ks.getKey("s5", "keypass".toCharArray()).getAlgorithm().equalsIgnoreCase("DES"), "s5 is DES");
-        assertTrue(ks.getKey("s6", "keypass".toCharArray()).getAlgorithm().equalsIgnoreCase("DES"), "s6 is DES");
+        assertTrue(ks.getKey("s1", "changeit".toCharArray())
+                .getAlgorithm().equalsIgnoreCase("DES"), "s1 is DES");
+        assertTrue(ks.getKey("s1", "changeit".toCharArray())
+                .getEncoded().length == 8,  "DES is 56");
+        assertTrue(ks.getKey("s2", "changeit".toCharArray())
+                .getEncoded().length == 24,  "DESede is 168");
+        assertTrue(ks.getKey("s2", "changeit".toCharArray())
+                .getAlgorithm().equalsIgnoreCase("DESede"), "s2 is DESede");
+        assertTrue(ks.getKey("s3", "changeit".toCharArray())
+                .getAlgorithm().equalsIgnoreCase("AES"), "s3 is AES");
+        assertTrue(ks.getKey("s4", "changeit".toCharArray())
+                .getAlgorithm().equalsIgnoreCase("DES"), "s4 is DES");
+        assertTrue(ks.getKey("s5", "keypass".toCharArray())
+                .getAlgorithm().equalsIgnoreCase("DES"), "s5 is DES");
+        assertTrue(ks.getKey("s6", "keypass".toCharArray())
+                .getAlgorithm().equalsIgnoreCase("DES"), "s6 is DES");
         assertTrue(!ks.containsAlias("s7"), "s7 not created");
 
         // maybe we needn't test this, one day JKS will support SecretKey
-        //testFail("changeit\nchangeit\n", "-keystore x.jks -storetype JKS -genseckey -keyalg AES -alias s3 -keysize 128");
+        //testFail("changeit\nchangeit\n", "-keystore x.jks -storetype JKS " +
+        //        "-genseckey -keyalg AES -alias s3 -keysize 128");
 
         // importKeyStore
         remove("x.jks");
         remove("x.jceks");
-        testOK("changeit\nchangeit\n\n", "-keystore x.jceks -storetype JCEKS -genkeypair -alias p1 -dname CN=Olala"); // create 2 entries...
-        testOK("", "-keystore x.jceks -storetype JCEKS -storepass changeit -importcert -alias c1 -file x.jks.p1.cert -noprompt"); // ...
+        // create 2 entries...
+        testOK("changeit\nchangeit\n\n", "-keystore x.jceks -storetype JCEKS " +
+                "-genkeypair -alias p1 -dname CN=Olala");
+        testOK("", "-keystore x.jceks -storetype JCEKS -storepass changeit " +
+                "-importcert -alias c1 -file x.jks.p1.cert -noprompt");
         ks = loadStore("x.jceks", "changeit", "JCEKS");
         assertTrue(ks.size() == 2, "2 entries in JCEKS");
-        // import, shouldn't mention destalias/srckeypass/destkeypass if srcalias is no given
-        testFail("changeit\nchangeit\n", "-importkeystore -srckeystore x.jceks -srcstoretype JCEKS -destkeystore x.jks -deststoretype JKS -destalias pp");
-        testFail("changeit\nchangeit\n", "-importkeystore -srckeystore x.jceks -srcstoretype JCEKS -destkeystore x.jks -deststoretype JKS -srckeypass changeit");
-        testFail("changeit\nchangeit\n", "-importkeystore -srckeystore x.jceks -srcstoretype JCEKS -destkeystore x.jks -deststoretype JKS -destkeypass changeit");
+        // import, shouldn't mention destalias/srckeypass/destkeypass
+        // if srcalias is no given
+        testFail("changeit\nchangeit\n", "-importkeystore " +
+                "-srckeystore x.jceks -srcstoretype JCEKS " +
+                "-destkeystore x.jks -deststoretype JKS -destalias pp");
+        testFail("changeit\nchangeit\n", "-importkeystore " +
+                "-srckeystore x.jceks -srcstoretype JCEKS " +
+                "-destkeystore x.jks -deststoretype JKS -srckeypass changeit");
+        testFail("changeit\nchangeit\n", "-importkeystore " +
+                "-srckeystore x.jceks -srcstoretype JCEKS " +
+                "-destkeystore x.jks -deststoretype JKS -destkeypass changeit");
         // normal import
-        testOK("changeit\nchangeit\nchangeit\n", "-importkeystore -srckeystore x.jceks -srcstoretype JCEKS -destkeystore x.jks -deststoretype JKS");
+        testOK("changeit\nchangeit\nchangeit\n", "-importkeystore " +
+                "-srckeystore x.jceks -srcstoretype JCEKS " +
+                "-destkeystore x.jks -deststoretype JKS");
         ks = loadStore("x.jks", "changeit", "JKS");
         assertTrue(ks.size() == 2, "2 entries in JKS");
         // import again, type yes to overwrite old entries
-        testOK("changeit\nchangeit\ny\ny\n", "-importkeystore -srckeystore x.jceks -srcstoretype JCEKS -destkeystore x.jks -deststoretype JKS");
+        testOK("changeit\nchangeit\ny\ny\n", "-importkeystore " +
+                "-srckeystore x.jceks -srcstoretype JCEKS " +
+                "-destkeystore x.jks -deststoretype JKS");
         ks = loadStore("x.jks", "changeit", "JKS");
         // import again, specify -nopromt
-        testOK("changeit\nchangeit\n", "-importkeystore -srckeystore x.jceks -srcstoretype JCEKS -destkeystore x.jks -deststoretype JKS -noprompt");
+        testOK("changeit\nchangeit\n", "-importkeystore " +
+                "-srckeystore x.jceks -srcstoretype JCEKS " +
+                "-destkeystore x.jks -deststoretype JKS -noprompt");
         assertTrue(err.indexOf("Warning") != -1, "noprompt will warn");
         ks = loadStore("x.jks", "changeit", "JKS");
         assertTrue(ks.size() == 2, "2 entries in JKS");
         // import again, type into new aliases when prompted
-        testOK("changeit\nchangeit\n\ns1\n\ns2\n", "-importkeystore -srckeystore x.jceks -srcstoretype JCEKS -destkeystore x.jks -deststoretype JKS");
+        testOK("changeit\nchangeit\n\ns1\n\ns2\n", "-importkeystore " +
+                "-srckeystore x.jceks -srcstoretype JCEKS " +
+                "-destkeystore x.jks -deststoretype JKS");
         ks = loadStore("x.jks", "changeit", "JKS");
         assertTrue(ks.size() == 4, "4 entries in JKS");
 
         // importkeystore single
+        // normal
         remove("x.jks");
-        testOK("changeit\nchangeit\nchangeit\n", "-importkeystore -srckeystore x.jceks -srcstoretype JCEKS -destkeystore x.jks -deststoretype JKS -srcalias p1"); // normal
+        testOK("changeit\nchangeit\nchangeit\n", "-importkeystore " +
+                "-srckeystore x.jceks -srcstoretype JCEKS " +
+                "-destkeystore x.jks -deststoretype JKS -srcalias p1");
         ks = loadStore("x.jks", "changeit", "JKS");
         assertTrue(ks.size() == 1, "1 entries in JKS");
-        testOK("changeit\nchangeit\ny\n", "-importkeystore -srckeystore x.jceks -srcstoretype JCEKS -destkeystore x.jks -deststoretype JKS -srcalias p1"); // overwrite
+        // overwrite
+        testOK("changeit\nchangeit\ny\n", "-importkeystore " +
+                "-srckeystore x.jceks -srcstoretype JCEKS " +
+                "-destkeystore x.jks -deststoretype JKS -srcalias p1");
         ks = loadStore("x.jks", "changeit", "JKS");
         assertTrue(ks.size() == 1, "1 entries in JKS");
-        testOK("changeit\nchangeit\n", "-importkeystore -srckeystore x.jceks -srcstoretype JCEKS -destkeystore x.jks -deststoretype JKS -srcalias p1 -noprompt"); // noprompt
+        // noprompt
+        testOK("changeit\nchangeit\n", "-importkeystore " +
+                "-srckeystore x.jceks -srcstoretype JCEKS " +
+                "-destkeystore x.jks -deststoretype JKS " +
+                "-srcalias p1 -noprompt");
         ks = loadStore("x.jks", "changeit", "JKS");
         assertTrue(ks.size() == 1, "1 entries in JKS");
-        testOK("changeit\nchangeit\n", "-importkeystore -srckeystore x.jceks -srcstoretype JCEKS -destkeystore x.jks -deststoretype JKS -srcalias p1 -destalias p2"); // rename
+        // rename
+        testOK("changeit\nchangeit\n", "-importkeystore " +
+                "-srckeystore x.jceks -srcstoretype JCEKS " +
+                "-destkeystore x.jks -deststoretype JKS " +
+                "-srcalias p1 -destalias p2");
         ks = loadStore("x.jks", "changeit", "JKS");
         assertTrue(ks.size() == 2, "2 entries in JKS");
-        testOK("changeit\nchangeit\n\nnewalias\n", "-importkeystore -srckeystore x.jceks -srcstoretype JCEKS -destkeystore x.jks -deststoretype JKS -srcalias p1"); // another rename
+        // another rename
+        testOK("changeit\nchangeit\n\nnewalias\n", "-importkeystore " +
+                "-srckeystore x.jceks -srcstoretype JCEKS " +
+                "-destkeystore x.jks -deststoretype JKS -srcalias p1");
         ks = loadStore("x.jks", "changeit", "JKS");
         assertTrue(ks.size() == 3, "3 entries in JKS");
 
         // importkeystore single, different keypass
         remove("x.jks");
-        testOK("changeit\nkeypass\nkeypass\n", "-keystore x.jceks -storetype JCEKS -genkeypair -alias p2 -dname CN=Olala"); // generate entry with different keypass
-        testOK("changeit\nchangeit\nchangeit\nkeypass\n", "-importkeystore -srckeystore x.jceks -srcstoretype JCEKS -destkeystore x.jks -deststoretype JKS -srcalias p2"); // prompt
+        // generate entry with different keypass
+        testOK("changeit\nkeypass\nkeypass\n", "-keystore x.jceks " +
+                "-storetype JCEKS -genkeypair -alias p2 -dname CN=Olala");
+        // prompt
+        testOK("changeit\nchangeit\nchangeit\nkeypass\n", "-importkeystore " +
+                "-srckeystore x.jceks -srcstoretype JCEKS " +
+                "-destkeystore x.jks -deststoretype JKS -srcalias p2");
         ks = loadStore("x.jks", "changeit", "JKS");
         assertTrue(ks.size() == 1, "1 entries in JKS");
-        testOK("changeit\nchangeit\nkeypass\n", "-importkeystore -srckeystore x.jceks -srcstoretype JCEKS -destkeystore x.jks -deststoretype JKS -srcalias p2 -destalias p3 -destkeypass keypass2"); // diff destkeypass
+        // diff destkeypass
+        testOK("changeit\nchangeit\nkeypass\n", "-importkeystore " +
+                "-srckeystore x.jceks -srcstoretype JCEKS " +
+                "-destkeystore x.jks -deststoretype JKS " +
+                "-srcalias p2 -destalias p3 -destkeypass keypass2");
         ks = loadStore("x.jks", "changeit", "JKS");
         assertTrue(ks.size() == 2, "2 entries in JKS");
-        assertTrue(ks.getKey("p2", "keypass".toCharArray()) != null, "p2 has old password");
-        assertTrue(ks.getKey("p3", "keypass2".toCharArray()) != null, "p3 has new password");
+        assertTrue(ks.getKey("p2", "keypass".toCharArray()) != null,
+                "p2 has old password");
+        assertTrue(ks.getKey("p3", "keypass2".toCharArray()) != null,
+                "p3 has new password");
 
         // importkeystore single, cert
         remove("x.jks");
-        testOK("changeit\nchangeit\nchangeit\n", "-importkeystore -srckeystore x.jceks -srcstoretype JCEKS -destkeystore x.jks -deststoretype JKS -srcalias c1"); // normal
-        testOK("changeit\n\n", "-importkeystore -srckeystore x.jceks -srcstoretype JCEKS -destkeystore x.jks -deststoretype JKS -srcalias c1 -destalias c2");   // in fact srcstorepass can be ignored
+        // normal
+        testOK("changeit\nchangeit\nchangeit\n", "-importkeystore " +
+                "-srckeystore x.jceks -srcstoretype JCEKS " +
+                "-destkeystore x.jks -deststoretype JKS -srcalias c1");
+        // in fact srcstorepass can be ignored
+        testOK("changeit\n\n", "-importkeystore " +
+                "-srckeystore x.jceks -srcstoretype JCEKS " +
+                "-destkeystore x.jks -deststoretype JKS " +
+                "-srcalias c1 -destalias c2");
         assertTrue(err.indexOf("WARNING") != -1, "But will warn");
-        testOK("changeit\n\ny\n", "-importkeystore -srckeystore x.jceks -srcstoretype JCEKS -destkeystore x.jks -deststoretype JKS -srcalias c1 -destalias c2");   // 2nd import, press y to overwrite ...
-        testOK("changeit\n\n\nc3\n", "-importkeystore -srckeystore x.jceks -srcstoretype JCEKS -destkeystore x.jks -deststoretype JKS -srcalias c1 -destalias c2");   // ... or rename
+        // 2nd import, press y to overwrite ...
+        testOK("changeit\n\ny\n", "-importkeystore " +
+                "-srckeystore x.jceks -srcstoretype JCEKS " +
+                "-destkeystore x.jks -deststoretype JKS " +
+                "-srcalias c1 -destalias c2");
+        // ... or rename
+        testOK("changeit\n\n\nc3\n", "-importkeystore " +
+                "-srckeystore x.jceks -srcstoretype JCEKS " +
+                "-destkeystore x.jks -deststoretype JKS " +
+                "-srcalias c1 -destalias c2");
         ks = loadStore("x.jks", "changeit", "JKS");
-        assertTrue(ks.size() == 3, "3 entries in JKS"); // c1, c2, c3
+        // c1, c2, c3
+        assertTrue(ks.size() == 3, "3 entries in JKS");
 
         // importkeystore, secretkey
         remove("x.jks");
-        testOK("changeit\n\n", "-keystore x.jceks -storetype JCEKS -genseckey -alias s1"); // create SecretKeyEntry
-        testOK("changeit\n\n", "-keystore x.jceks -storetype JCEKS -genseckey -alias s2"); // create SecretKeyEntry
-        testOK("changeit\n", "-keystore x.jceks -storetype JCEKS -delete -alias p2"); // remove the keypass!=storepass one
+        // create SecretKeyEntry
+        testOK("changeit\n\n", "-keystore x.jceks -storetype JCEKS " +
+                "-genseckey -alias s1");
+        // create SecretKeyEntry
+        testOK("changeit\n\n", "-keystore x.jceks -storetype JCEKS " +
+                "-genseckey -alias s2");
+        // remove the keypass!=storepass one
+        testOK("changeit\n", "-keystore x.jceks -storetype JCEKS " +
+                "-delete -alias p2");
         ks = loadStore("x.jceks", "changeit", "JCEKS");
-        assertTrue(ks.size() == 4, "4 entries in JCEKS");       // p1, c1, s1, s2
-        testOK("changeit\nchangeit\nchangeit\n", "-importkeystore -srckeystore x.jceks -srcstoretype JCEKS -destkeystore x.jks -deststoretype JKS -srcalias s1"); // normal
+        // p1, c1, s1, s2
+        assertTrue(ks.size() == 4, "4 entries in JCEKS");
+        // normal
+        testOK("changeit\nchangeit\nchangeit\n", "-importkeystore " +
+                "-srckeystore x.jceks -srcstoretype JCEKS " +
+                "-destkeystore x.jks -deststoretype JKS -srcalias s1");
         assertTrue(err.indexOf("not imported") != -1, "Not imported");
-        assertTrue(err.indexOf("Cannot store non-PrivateKeys") != -1, "Not imported");
+        assertTrue(err.indexOf("Cannot store non-PrivateKeys") != -1,
+                "Not imported");
 
-        // Importing a JCEKS keystore to a JKS one. Will warn for the 2 SecretKey entries
+        // Importing a JCEKS keystore to a JKS one. Will warn
+        // for the 2 SecretKey entries
 
         remove("x.jks");
         // Two "no" answers to bypass warnings
-        testOK("\n\n", "-srcstorepass changeit -deststorepass changeit -importkeystore -srckeystore x.jceks -srcstoretype JCEKS -destkeystore x.jks -deststoretype JKS"); // normal
+        // normal
+        testOK("\n\n", "-srcstorepass changeit -deststorepass changeit " +
+                "-importkeystore -srckeystore x.jceks -srcstoretype JCEKS " +
+                "-destkeystore x.jks -deststoretype JKS");
         assertTrue(err.indexOf("s1 not") != -1, "s1 not");
         assertTrue(err.indexOf("s2 not") != -1, "s2 not");
         assertTrue(err.indexOf("c1 success") != -1, "c1 success");
         assertTrue(err.indexOf("p1 success") != -1, "p1 success");
         remove("x.jks");
         // One "yes" to stop
-        testOK("yes\n", "-srcstorepass changeit -deststorepass changeit -importkeystore -srckeystore x.jceks -srcstoretype JCEKS -destkeystore x.jks -deststoretype JKS"); // normal
-        // maybe c1 or p1 has been imported before s1 or s2 is touched, anyway we know yesNo is only asked once.
+        // normal
+        testOK("yes\n", "-srcstorepass changeit -deststorepass changeit " +
+                "-importkeystore -srckeystore x.jceks -srcstoretype JCEKS " +
+                "-destkeystore x.jks -deststoretype JKS");
+        // maybe c1 or p1 has been imported before s1 or s2 is touched,
+        // anyway we know yesNo is only asked once.
 
         // pkcs12
         remove("x.jks");
-        testFail("changeit\nchangeit\n", "-keystore x.jks -storetype JKS -genkeypair -alias p1 -dname CN=olala"); // JKS prompt for keypass
+        // JKS prompt for keypass
+        testFail("changeit\nchangeit\n", "-keystore x.jks -storetype JKS " +
+                "-genkeypair -alias p1 -dname CN=olala");
         remove("x.jks");
-        testOK("changeit\nchangeit\n\n", "-keystore x.jks -storetype JKS -genkeypair -alias p1 -dname CN=olala"); // just type ENTER means keypass=storepass
+        // just type ENTER means keypass=storepass
+        testOK("changeit\nchangeit\n\n", "-keystore x.jks -storetype JKS " +
+                "-genkeypair -alias p1 -dname CN=olala");
         remove("x.p12");
-        testOK("", "-keystore x.p12 -storetype PKCS12 -storepass changeit -genkeypair -alias p0 -dname CN=olala"); // PKCS12 only need storepass
-        testOK("changeit\n", "-keystore x.p12 -storetype PKCS12 -genkeypair -alias p1 -dname CN=olala");
-        testOK("changeit\n", "-keystore x.p12 -keypass changeit -storetype PKCS12 -genkeypair -alias p3 -dname CN=olala"); // when specify keypass, make sure keypass==storepass...
-        assertTrue(err.indexOf("Warning") == -1, "PKCS12 silent when keypass == storepass");
-        testOK("changeit\n", "-keystore x.p12 -keypass another -storetype PKCS12 -genkeypair -alias p2 -dname CN=olala"); // otherwise, print a warning
-        assertTrue(err.indexOf("Warning") != -1, "PKCS12 warning when keypass != storepass");
-        testFail("", "-keystore x.p12 -storepass changeit -storetype PKCS12 -keypasswd -new changeit -alias p3"); // no -keypasswd for PKCS12
-        testOK("", "-keystore x.p12 -storepass changeit -storetype PKCS12 -changealias -alias p3 -destalias p33");
-        testOK("", "-keystore x.p12 -storepass changeit -storetype PKCS12 -keyclone -alias p33 -destalias p3");
+        // PKCS12 only need storepass
+        testOK("", "-keystore x.p12 -storetype PKCS12 -storepass changeit " +
+                "-genkeypair -alias p0 -dname CN=olala");
+        testOK("changeit\n", "-keystore x.p12 -storetype PKCS12 " +
+                "-genkeypair -alias p1 -dname CN=olala");
+        // when specify keypass, make sure keypass==storepass...
+        testOK("changeit\n", "-keystore x.p12 -keypass changeit " +
+                "-storetype PKCS12 -genkeypair -alias p3 -dname CN=olala");
+        assertTrue(err.indexOf("Warning") == -1,
+                "PKCS12 silent when keypass == storepass");
+        // otherwise, print a warning
+        testOK("changeit\n", "-keystore x.p12 -keypass another" +
+                " -storetype PKCS12 -genkeypair -alias p2 -dname CN=olala");
+        assertTrue(err.indexOf("Warning") != -1,
+                "PKCS12 warning when keypass != storepass");
+        // no -keypasswd for PKCS12
+        testFail("", "-keystore x.p12 -storepass changeit -storetype PKCS12" +
+                " -keypasswd -new changeit -alias p3");
+        testOK("", "-keystore x.p12 -storepass changeit -storetype PKCS12 " +
+                "-changealias -alias p3 -destalias p33");
+        testOK("", "-keystore x.p12 -storepass changeit -storetype PKCS12 " +
+                "-keyclone -alias p33 -destalias p3");
 
         // pkcs12
         remove("x.p12");
-        testOK("", "-keystore x.p12 -storetype PKCS12 -storepass changeit -genkeypair -alias p0 -dname CN=olala"); // PKCS12 only need storepass
-        testOK("", "-storepass changeit -keystore x.p12 -storetype PKCS12 -genkeypair -alias p1 -dname CN=olala");
-        testOK("", "-storepass changeit -keystore x.p12 -keypass changeit -storetype PKCS12 -genkeypair -alias p3 -dname CN=olala"); // when specify keypass, make sure keypass==storepass...
-        assertTrue(err.indexOf("Warning") == -1, "PKCS12 silent when keypass == storepass");
-        testOK("", "-storepass changeit -keystore x.p12 -keypass another -storetype PKCS12 -genkeypair -alias p2 -dname CN=olala"); // otherwise, print a warning
-        assertTrue(err.indexOf("Warning") != -1, "PKCS12 warning when keypass != storepass");
+        // PKCS12 only need storepass
+        testOK("", "-keystore x.p12 -storetype PKCS12 -storepass changeit " +
+                "-genkeypair -alias p0 -dname CN=olala");
+        testOK("", "-storepass changeit -keystore x.p12 -storetype PKCS12 " +
+                "-genkeypair -alias p1 -dname CN=olala");
+        // when specify keypass, make sure keypass==storepass...
+        testOK("", "-storepass changeit -keystore x.p12 -keypass changeit " +
+                "-storetype PKCS12 -genkeypair -alias p3 -dname CN=olala");
+        assertTrue(err.indexOf("Warning") == -1,
+                "PKCS12 silent when keypass == storepass");
+        // otherwise, print a warning
+        testOK("", "-storepass changeit -keystore x.p12 -keypass another " +
+                "-storetype PKCS12 -genkeypair -alias p2 -dname CN=olala");
+        assertTrue(err.indexOf("Warning") != -1,
+                "PKCS12 warning when keypass != storepass");
 
         remove("x.jks");
         remove("x.jceks");
@@ -512,7 +671,7 @@
 
     void testPKCS11() throws Exception {
         KeyStore ks;
-        // pkcs11, the password maybe different and maybe PKCS11 is not supported
+        // pkcs11, the password maybe different and maybe PKCS11 not supported
 
         // in case last test is not executed successfully
         testAnyway("", p11Arg + "-storepass test12 -delete -alias p1");
@@ -521,75 +680,97 @@
         testAnyway("", p11Arg + "-storepass test12 -delete -alias nss");
 
         testOK("", p11Arg + "-storepass test12 -list");
-        assertTrue(out.indexOf("Your keystore contains 0 entries") != -1, "*** MAKE SURE YOU HAVE NO ENTRIES IN YOUR PKCS11 KEYSTORE BEFORE THIS TEST ***");
+        assertTrue(out.indexOf("Your keystore contains 0 entries") != -1,
+                "*** MAKE SURE YOU HAVE NO ENTRIES IN YOUR PKCS11 KEYSTORE " +
+                        "BEFORE THIS TEST ***");
 
-        testOK("", p11Arg + "-storepass test12 -genkeypair -alias p1 -dname CN=olala");
+        testOK("", p11Arg +
+                "-storepass test12 -genkeypair -alias p1 -dname CN=olala");
         testOK("test12\n", p11Arg + "-genkeypair -alias p2 -dname CN=olala2");
-        testFail("test12\n", p11Arg + "-keypass test12 -genkeypair -alias p3 -dname CN=olala3"); // cannot provide keypass for PKCS11
-        testFail("test12\n", p11Arg + "-keypass nonsense -genkeypair -alias p3 -dname CN=olala3"); // cannot provide keypass for PKCS11
+        // cannot provide keypass for PKCS11
+        testFail("test12\n", p11Arg +
+                "-keypass test12 -genkeypair -alias p3 -dname CN=olala3");
+        // cannot provide keypass for PKCS11
+        testFail("test12\n", p11Arg +
+                "-keypass nonsense -genkeypair -alias p3 -dname CN=olala3");
 
         testOK("", p11Arg + "-storepass test12 -list");
-        assertTrue(out.indexOf("Your keystore contains 2 entries") != -1, "2 entries in p11");
+        assertTrue(out.indexOf("Your keystore contains 2 entries") != -1,
+                "2 entries in p11");
 
         testOK("test12\n", p11Arg + "-alias p1 -changealias -destalias p3");
         testOK("", p11Arg + "-storepass test12 -list -alias p3");
         testFail("", p11Arg + "-storepass test12 -list -alias p1");
 
         testOK("test12\n", p11Arg + "-alias p3 -keyclone -destalias p1");
-        testFail("", p11Arg + "-storepass test12 -list -alias p3");   // in PKCS11, keyclone will delete old
+        // in PKCS11, keyclone will delete old
+        testFail("", p11Arg + "-storepass test12 -list -alias p3");
         testOK("", p11Arg + "-storepass test12 -list -alias p1");
 
-        testFail("test12\n", p11Arg + "-alias p1 -keypasswd -new another"); // cannot change password for PKCS11
+        // cannot change password for PKCS11
+        testFail("test12\n", p11Arg + "-alias p1 -keypasswd -new another");
 
         testOK("", p11Arg + "-storepass test12 -list");
-        assertTrue(out.indexOf("Your keystore contains 2 entries") != -1, "2 entries in p11");
+        assertTrue(out.indexOf("Your keystore contains 2 entries") != -1,
+                "2 entries in p11");
 
         testOK("", p11Arg + "-storepass test12 -delete -alias p1");
         testOK("", p11Arg + "-storepass test12 -delete -alias p2");
 
         testOK("", p11Arg + "-storepass test12 -list");
-        assertTrue(out.indexOf("Your keystore contains 0 entries") != -1, "*** MAKE SURE YOU HAVE NO ENTRIES IN YOUR PKCS11 KEYSTORE BEFORE THIS TEST ***");
+        assertTrue(out.indexOf("Your keystore contains 0 entries") != -1,
+                "*** MAKE SURE YOU HAVE NO ENTRIES IN YOUR PKCS11 KEYSTORE" +
+                        " BEFORE THIS TEST ***");
     }
 
     void testPKCS11ImportKeyStore() throws Exception {
 
         KeyStore ks;
-        testOK("", p11Arg + "-storepass test12 -genkeypair -alias p1 -dname CN=olala");
+        testOK("", p11Arg +
+                "-storepass test12 -genkeypair -alias p1 -dname CN=olala");
         testOK("test12\n", p11Arg + "-genkeypair -alias p2 -dname CN=olala2");
         // test importkeystore for pkcs11
 
         remove("x.jks");
         // pkcs11 -> jks
-        testOK("changeit\nchangeit\ntest12\n", srcP11Arg + "-importkeystore -destkeystore x.jks -deststoretype JKS -srcalias p1");
-        assertTrue(err.indexOf("not imported") != -1, "cannot import key without destkeypass");
+        testOK("changeit\nchangeit\ntest12\n", srcP11Arg +
+                ("-importkeystore -destkeystore x.jks -deststoretype JKS " +
+                "-srcalias p1"));
+        assertTrue(err.indexOf("not imported") != -1,
+                "cannot import key without destkeypass");
         ks = loadStore("x.jks", "changeit", "JKS");
         assertTrue(!ks.containsAlias("p1"), "p1 is not imported");
 
-        testOK("changeit\ntest12\n", srcP11Arg + "-importkeystore -destkeystore x.jks -deststoretype JKS -srcalias p1 -destkeypass changeit");
-        testOK("changeit\ntest12\n", srcP11Arg + "-importkeystore -destkeystore x.jks -deststoretype JKS -srcalias p2 -destkeypass changeit");
+        testOK("changeit\ntest12\n", srcP11Arg +
+                ("-importkeystore -destkeystore x.jks -deststoretype JKS " +
+                "-srcalias p1 -destkeypass changeit"));
+        testOK("changeit\ntest12\n", srcP11Arg +
+                ("-importkeystore -destkeystore x.jks -deststoretype JKS " +
+                "-srcalias p2 -destkeypass changeit"));
         ks = loadStore("x.jks", "changeit", "JKS");
         assertTrue(ks.containsAlias("p1"), "p1 is imported");
         assertTrue(ks.containsAlias("p2"), "p2 is imported");
         // jks -> pkcs11
         testOK("", p11Arg + "-storepass test12 -delete -alias p1");
         testOK("", p11Arg + "-storepass test12 -delete -alias p2");
-        testOK("test12\nchangeit\n", p11Arg + "-importkeystore -srckeystore x.jks -srcstoretype JKS");
+        testOK("test12\nchangeit\n", p11Arg +
+                "-importkeystore -srckeystore x.jks -srcstoretype JKS");
         testOK("", p11Arg + "-storepass test12 -list -alias p1");
         testOK("", p11Arg + "-storepass test12 -list -alias p2");
         testOK("", p11Arg + "-storepass test12 -list");
-        assertTrue(out.indexOf("Your keystore contains 2 entries") != -1, "2 entries in p11");
+        assertTrue(out.indexOf("Your keystore contains 2 entries") != -1,
+                "2 entries in p11");
         // clean up
         testOK("", p11Arg + "-storepass test12 -delete -alias p1");
         testOK("", p11Arg + "-storepass test12 -delete -alias p2");
         testOK("", p11Arg + "-storepass test12 -list");
-        assertTrue(out.indexOf("Your keystore contains 0 entries") != -1, "empty p11");
+        assertTrue(out.indexOf("Your keystore contains 0 entries") != -1,
+                "empty p11");
 
         remove("x.jks");
     }
 
-    // The sqeTest reflects the test suggested by judy.gao and bill.situ at
-    // /net/sqesvr-nfs/global/nfs/sec/ws_6.0_int/security/src/SecurityTools/Keytool
-    //
+    // Selected sqeTest
     void sqeTest() throws Exception {
         FileOutputStream fos = new FileOutputStream("badkeystore");
         for (int i=0; i<100; i++) {
@@ -616,79 +797,131 @@
     void sqeImportTest() throws Exception {
         KeyStore ks;
         remove("x.jks");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -exportcert -file x.jks.p1.cert");
-        /* deleted */ testOK("", "-keystore x.jks -storetype JKS -storepass changeit -delete -alias mykey");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -importcert -file x.jks.p1.cert -noprompt");
-        /* deleted */ testOK("", "-keystore x.jks -storetype JKS -storepass changeit -delete -alias mykey");
-        testOK("yes\n", "-keystore x.jks -storetype JKS -storepass changeit -importcert -file x.jks.p1.cert");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-exportcert -file x.jks.p1.cert");
+        /* deleted */ testOK("", "-keystore x.jks -storetype JKS " +
+                "-storepass changeit -delete -alias mykey");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-importcert -file x.jks.p1.cert -noprompt");
+        /* deleted */ testOK("", "-keystore x.jks -storetype JKS " +
+                "-storepass changeit -delete -alias mykey");
+        testOK("yes\n", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-importcert -file x.jks.p1.cert");
         ks = loadStore("x.jks", "changeit", "JKS");
         assertTrue(ks.containsAlias("mykey"), "imported");
-        /* deleted */ testOK("", "-keystore x.jks -storetype JKS -storepass changeit -delete -alias mykey");
-        testOK("\n", "-keystore x.jks -storetype JKS -storepass changeit -importcert -file x.jks.p1.cert");
+        /* deleted */ testOK("", "-keystore x.jks -storetype JKS " +
+                "-storepass changeit -delete -alias mykey");
+        testOK("\n", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-importcert -file x.jks.p1.cert");
         ks = loadStore("x.jks", "changeit", "JKS");
         assertTrue(!ks.containsAlias("mykey"), "imported");
-        testOK("no\n", "-keystore x.jks -storetype JKS -storepass changeit -importcert -file x.jks.p1.cert");
+        testOK("no\n", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-importcert -file x.jks.p1.cert");
         ks = loadStore("x.jks", "changeit", "JKS");
         assertTrue(!ks.containsAlias("mykey"), "imported");
-        testFail("no\n", "-keystore x.jks -storetype JKS -storepass changeit -importcert -file nonexist");
-        testFail("no\n", "-keystore x.jks -storetype JKS -storepass changeit -importcert -file x.jks");
+        testFail("no\n", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-importcert -file nonexist");
+        testFail("no\n", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-importcert -file x.jks");
         remove("x.jks");
     }
     // keyclone: exist. nonexist err, cert err, dest exist, misc
     void sqeKeyclonetest() throws Exception {
         remove("x.jks");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -new newpass -keyclone -dest p0"); // new pass
-        testOK("\n", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -keyclone -dest p1"); // new pass
-        testOK("\n", "-keystore x.jks -storetype JKS -storepass changeit -keyclone -dest p2");
-        testFail("\n", "-keystore x.jks -storetype JKS -storepass changeit -keyclone -dest p2");
-        testFail("\n", "-keystore x.jks -storetype JKS -storepass changeit -keyclone -dest p3 -alias noexist");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala");
+        // new pass
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -new newpass -keyclone -dest p0");
+        // new pass
+        testOK("\n", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -keyclone -dest p1");
+        testOK("\n", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keyclone -dest p2");
+        testFail("\n", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keyclone -dest p2");
+        testFail("\n", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keyclone -dest p3 -alias noexist");
         // no cert
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -exportcert -file x.jks.p1.cert");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -delete -alias mykey");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -importcert -file x.jks.p1.cert -noprompt");
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -new newpass -keyclone -dest p0"); // new pass
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-exportcert -file x.jks.p1.cert");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-delete -alias mykey");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-importcert -file x.jks.p1.cert -noprompt");
+        // new pass
+        testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -new newpass -keyclone -dest p0");
         remove("x.jks");
     }
     // keypasswd: exist, short, nonexist err, cert err, misc
     void sqeKeypasswdTest() throws Exception {
         remove("x.jks");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -keypasswd -new newpass");
-        /*change back*/ testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass newpass -keypasswd -new changeit");
-        testOK("newpass\nnewpass\n", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -keypasswd");
-        /*change back*/ testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass newpass -keypasswd -new changeit");
-        testOK("new\nnew\nnewpass\nnewpass\n", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -keypasswd");
-        /*change back*/ testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass newpass -keypasswd -new changeit");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypasswd -new newpass");
-        /*change back*/ testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass newpass -keypasswd -new changeit");
-        testOK("changeit\n", "-keystore x.jks -storetype JKS -keypasswd -new newpass");
-        /*change back*/ testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass newpass -keypasswd -new changeit");
-        testFail("", "-keystore x.jks -storetype JKS -storepass badpass -keypass changeit -keypasswd -new newpass");
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -keypass bad -keypasswd -new newpass");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -keypasswd -new newpass");
+        /*change back*/ testOK("", "-keystore x.jks -storetype JKS " +
+                "-storepass changeit -keypass newpass -keypasswd -new changeit");
+        testOK("newpass\nnewpass\n", "-keystore x.jks -storetype JKS " +
+                "-storepass changeit -keypass changeit -keypasswd");
+        /*change back*/ testOK("", "-keystore x.jks -storetype JKS " +
+                "-storepass changeit -keypass newpass -keypasswd -new changeit");
+        testOK("new\nnew\nnewpass\nnewpass\n", "-keystore x.jks " +
+                "-storetype JKS -storepass changeit -keypass changeit -keypasswd");
+        /*change back*/ testOK("", "-keystore x.jks -storetype JKS " +
+                "-storepass changeit -keypass newpass -keypasswd -new changeit");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypasswd -new newpass");
+        /*change back*/ testOK("", "-keystore x.jks -storetype JKS " +
+                "-storepass changeit -keypass newpass -keypasswd -new changeit");
+        testOK("changeit\n", "-keystore x.jks -storetype JKS " +
+                "-keypasswd -new newpass");
+        /*change back*/ testOK("", "-keystore x.jks -storetype JKS " +
+                "-storepass changeit -keypass newpass -keypasswd -new changeit");
+        testFail("", "-keystore x.jks -storetype JKS -storepass badpass " +
+                "-keypass changeit -keypasswd -new newpass");
+        testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass bad -keypasswd -new newpass");
         // no cert
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -exportcert -file x.jks.p1.cert");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -delete -alias mykey");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -importcert -file x.jks.p1.cert -noprompt");
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -keypasswd -new newpass");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-exportcert -file x.jks.p1.cert");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-delete -alias mykey");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-importcert -file x.jks.p1.cert -noprompt");
+        testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -keypasswd -new newpass");
         // diff pass
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -delete -alias mykey");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass keypass -genkeypair -dname CN=olala");
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -keypasswd -new newpass");
-        testOK("keypass\n", "-keystore x.jks -storetype JKS -storepass changeit -keypasswd -new newpass");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-delete -alias mykey");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass keypass -genkeypair -dname CN=olala");
+        testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypasswd -new newpass");
+        testOK("keypass\n", "-keystore x.jks -storetype JKS " +
+                "-storepass changeit -keypasswd -new newpass");
         // i hate those misc test
         remove("x.jks");
     }
-    // list: -f -alias, exist, nonexist err; otherwise, check all shows, -rfc shows more, and misc
+    // list: -f -alias, exist, nonexist err;
+    // otherwise, check all shows, -rfc shows more, and misc
     void sqeListTest() throws Exception {
         remove("x.jks");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala");
         testOK("", "-keystore x.jks -storetype JKS -storepass changeit -list");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -list -alias mykey");
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -list -alias notexist");
-        testFail("", "-keystore x.jks -storetype JKS -storepass badpass -list -alias mykey");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass badpass -list -alias mykey");  // keypass ignore
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-list -alias mykey");
+        testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-list -alias notexist");
+        testFail("", "-keystore x.jks -storetype JKS -storepass badpass " +
+                "-list -alias mykey");
+        // keypass ignore
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass badpass -list -alias mykey");
         testOK("\n", "-keystore x.jks -storetype JKS -list");
         assertTrue(err.indexOf("WARNING") != -1, "no storepass");
         testOK("changeit\n", "-keystore x.jks -storetype JKS -list");
@@ -700,92 +933,182 @@
         testFail("", "-keystore badkeystore -storepass changeit -list");
         remove("x.jks");
     }
-    // selfcert: exist, non-exist err, cert err, sig..., dname, wrong keypass, misc
+    // selfcert: exist, non-exist err, cert err, sig, dname, wrong keypass, misc
     void sqeSelfCertTest() throws Exception {
         remove("x.jks");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala");
         testOK("", "-keystore x.jks -storetype JKS -storepass changeit -selfcert");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -selfcert");
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -selfcert -alias nonexisting"); // not exist
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -selfcert -dname CN=NewName");
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -selfcert -sigalg MD5withRSA"); // sig not compatible
-        testFail("", "-keystore x.jks -storetype JKS -storepass wrong -keypass changeit -selfcert"); // bad pass
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -keypass wrong -selfcert"); // bad pass
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -selfcert");
+        // not exist
+        testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -selfcert -alias nonexisting");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -selfcert -dname CN=NewName");
+        // sig not compatible
+        testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -selfcert -sigalg MD5withRSA");
+        // bad pass
+        testFail("", "-keystore x.jks -storetype JKS -storepass wrong " +
+                "-keypass changeit -selfcert");
+        // bad pass
+        testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass wrong -selfcert");
         //misc
-        testFail("", "-keystore nonexist -storepass changeit -keypass changeit -selfcert");
-        testFail("", "-keystore aa//dd\\gg -storepass changeit -keypass changeit -selfcert");
+        testFail("", "-keystore nonexist -storepass changeit " +
+                "-keypass changeit -selfcert");
+        testFail("", "-keystore aa//dd\\gg -storepass changeit " +
+                "-keypass changeit -selfcert");
         // diff pass
         remove("x.jks");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass keypass -genkeypair -dname CN=olala");
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -selfcert");
-        testOK("keypass\n", "-keystore x.jks -storetype JKS -storepass changeit -selfcert");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass keypass -genkeypair -dname CN=olala");
+        testFail("", "-keystore x.jks -storetype JKS " +
+                "-storepass changeit -selfcert");
+        testOK("keypass\n", "-keystore x.jks -storetype JKS " +
+                "-storepass changeit -selfcert");
 
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -exportcert -file x.jks.p1.cert");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -delete -alias mykey");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -importcert -file x.jks.p1.cert -noprompt");
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -selfcert");  // certentry cannot do selfcert
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-exportcert -file x.jks.p1.cert");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-delete -alias mykey");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-importcert -file x.jks.p1.cert -noprompt");
+        // certentry cannot do selfcert
+        testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-selfcert");
         remove("x.jks");
     }
     // storepass: bad old, short new, misc
     void sqeStorepassTest() throws Exception {
         remove("x.jks");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala");
-        testOK("", "-storepasswd -keystore x.jks -storetype JKS -storepass changeit -new newstore"); // all in arg
-        /* Change back */ testOK("", "-storepasswd -keystore x.jks -storetype JKS -storepass newstore -new changeit");
-        testOK("changeit\nnewstore\nnewstore\n", "-storepasswd -keystore x.jks -storetype JKS"); // all not in arg, new twice
-        /* Change back */ testOK("", "-storepasswd -keystore x.jks -storetype JKS -storepass newstore -new changeit");
-        testOK("changeit\n", "-storepasswd -keystore x.jks -storetype JKS -new newstore"); // new in arg
-        /* Change back */ testOK("", "-storepasswd -keystore x.jks -storetype JKS -storepass newstore -new changeit");
-        testOK("newstore\nnewstore\n", "-storepasswd -keystore x.jks -storetype JKS -storepass changeit"); // old in arg
-        /* Change back */ testOK("", "-storepasswd -keystore x.jks -storetype JKS -storepass newstore -new changeit");
-        testOK("new\nnew\nnewstore\nnewstore\n", "-storepasswd -keystore x.jks -storetype JKS -storepass changeit"); // old in arg
-        /* Change back */ testOK("", "-storepasswd -keystore x.jks -storetype JKS -storepass newstore -new changeit");
-        testFail("", "-storepasswd -keystore x.jks -storetype JKS -storepass badold -new newstore"); // bad old
-        testFail("", "-storepasswd -keystore x.jks -storetype JKS -storepass changeit -new new"); // short new
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala");
+        // all in arg
+        testOK("", "-storepasswd -keystore x.jks -storetype JKS " +
+                "-storepass changeit -new newstore");
+        /* Change back */ testOK("", "-storepasswd -keystore x.jks" +
+                " -storetype JKS -storepass newstore -new changeit");
+        // all not in arg, new twice
+        testOK("changeit\nnewstore\nnewstore\n", "-storepasswd " +
+                "-keystore x.jks -storetype JKS");
+        /* Change back */ testOK("", "-storepasswd -keystore x.jks " +
+                "-storetype JKS -storepass newstore -new changeit");
+        // new in arg
+        testOK("changeit\n", "-storepasswd -keystore x.jks " +
+                "-storetype JKS -new newstore");
+        /* Change back */ testOK("", "-storepasswd -keystore x.jks " +
+                "-storetype JKS -storepass newstore -new changeit");
+        // old in arg
+        testOK("newstore\nnewstore\n", "-storepasswd -keystore x.jks " +
+                "-storetype JKS -storepass changeit");
+        /* Change back */ testOK("", "-storepasswd -keystore x.jks " +
+                "-storetype JKS -storepass newstore -new changeit");
+        // old in arg
+        testOK("new\nnew\nnewstore\nnewstore\n", "-storepasswd " +
+                "-keystore x.jks -storetype JKS -storepass changeit");
+        /* Change back */ testOK("", "-storepasswd -keystore x.jks " +
+                "-storetype JKS -storepass newstore -new changeit");
+        // bad old
+        testFail("", "-storepasswd -keystore x.jks -storetype JKS " +
+                "-storepass badold -new newstore");
+        // short new
+        testFail("", "-storepasswd -keystore x.jks -storetype JKS " +
+                "-storepass changeit -new new");
         // misc
-        testFail("", "-storepasswd -keystore nonexist -storepass changeit -new newstore"); // non exist
-        testFail("", "-storepasswd -keystore badkeystore -storepass changeit -new newstore"); // bad file
-        testFail("", "-storepasswd -keystore aa\\bb//cc//dd -storepass changeit -new newstore"); // bad file
+        // non exist
+        testFail("", "-storepasswd -keystore nonexist " +
+                "-storepass changeit -new newstore");
+        // bad file
+        testFail("", "-storepasswd -keystore badkeystore " +
+                "-storepass changeit -new newstore");
+        // bad file
+        testFail("", "-storepasswd -keystore aa\\bb//cc//dd " +
+                "-storepass changeit -new newstore");
         remove("x.jks");
     }
 
     void sqeGenkeyTest() throws Exception {
 
         remove("x.jks");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala");
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala -alias newentry");
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala -alias newentry");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala -keyalg DSA -alias n1");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala -keyalg RSA -alias n2");
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala -keyalg NoSuchAlg -alias n3");
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala -keysize 56 -alias n4");
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala -keysize 999 -alias n5");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala -keysize 512 -alias n6");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala -keysize 1024 -alias n7");
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala -sigalg NoSuchAlg -alias n8");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala -keyalg RSA -sigalg MD2withRSA -alias n9");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala -keyalg RSA -sigalg MD5withRSA -alias n10");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala -keyalg RSA -sigalg SHA1withRSA -alias n11");
-        testFail("", "-keystore aa\\bb//cc\\dd -storepass changeit -keypass changeit -genkeypair -dname CN=olala -keyalg RSA -sigalg NoSuchAlg -alias n12");
-        testFail("", "-keystore badkeystore -storepass changeit -keypass changeit -genkeypair -dname CN=olala -alias n14");
-        testFail("", "-keystore x.jks -storetype JKS -storepass badpass -keypass changeit -genkeypair -dname CN=olala -alias n16");
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CNN=olala -alias n17");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala");
+        testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala -alias newentry");
+        testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala -alias newentry");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala -keyalg DSA " +
+                "-alias n1");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala -keyalg RSA " +
+                "-alias n2");
+        testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala " +
+                "-keyalg NoSuchAlg -alias n3");
+        testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala -keysize 56 " +
+                "-alias n4");
+        testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala -keysize 999 " +
+                "-alias n5");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala -keysize 512 " +
+                "-alias n6");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala -keysize 1024 " +
+                "-alias n7");
+        testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala " +
+                "-sigalg NoSuchAlg -alias n8");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala -keyalg RSA " +
+                "-sigalg MD2withRSA -alias n9");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala -keyalg RSA " +
+                "-sigalg MD5withRSA -alias n10");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala -keyalg RSA " +
+                "-sigalg SHA1withRSA -alias n11");
+        testFail("", "-keystore aa\\bb//cc\\dd -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala -keyalg RSA " +
+                "-sigalg NoSuchAlg -alias n12");
+        testFail("", "-keystore badkeystore -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala " +
+                "-alias n14");
+        testFail("", "-keystore x.jks -storetype JKS -storepass badpass " +
+                "-keypass changeit -genkeypair -dname CN=olala -alias n16");
+        testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CNN=olala -alias n17");
         remove("x.jks");
     }
 
     void sqeExportTest() throws Exception {
         remove("x.jks");
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -export -file mykey.cert -alias mykey"); // nonexist
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -export -file mykey.cert -alias mykey");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -delete -alias mykey");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -import -file mykey.cert -noprompt -alias c1");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -export -file mykey.cert2 -alias c1");
-        testFail("", "-keystore aa\\bb//cc\\dd -storepass changeit -export -file mykey.cert2 -alias c1");
-        testFail("", "-keystore nonexistkeystore -storepass changeit -export -file mykey.cert2 -alias c1");
-        testFail("", "-keystore badkeystore -storepass changeit -export -file mykey.cert2 -alias c1");
-        testFail("", "-keystore x.jks -storetype JKS -storepass badpass -export -file mykey.cert2 -alias c1");
+        // nonexist
+        testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-export -file mykey.cert -alias mykey");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-export -file mykey.cert -alias mykey");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-delete -alias mykey");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-import -file mykey.cert -noprompt -alias c1");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-export -file mykey.cert2 -alias c1");
+        testFail("", "-keystore aa\\bb//cc\\dd -storepass changeit " +
+                "-export -file mykey.cert2 -alias c1");
+        testFail("", "-keystore nonexistkeystore -storepass changeit " +
+                "-export -file mykey.cert2 -alias c1");
+        testFail("", "-keystore badkeystore -storepass changeit " +
+                "-export -file mykey.cert2 -alias c1");
+        testFail("", "-keystore x.jks -storetype JKS -storepass badpass " +
+                "-export -file mykey.cert2 -alias c1");
         remove("mykey.cert");
         remove("mykey.cert2");
         remove("x.jks");
@@ -793,14 +1116,27 @@
 
     void sqeDeleteTest() throws Exception {
         remove("x.jks");
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -delete -alias mykey"); // nonexist
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -delete -alias mykey");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala");
-        testFail("", "-keystore aa\\bb//cc\\dd -storepass changeit -delete -alias mykey"); // keystore name illegal
-        testFail("", "-keystore nonexistkeystore -storepass changeit -delete -alias mykey"); // keystore not exist
-        testFail("", "-keystore badkeystore -storepass changeit -delete -alias mykey"); // keystore invalid
-        testFail("", "-keystore x.jks -storetype JKS -storepass xxxxxxxx -delete -alias mykey"); // wrong pass
+        // nonexist
+        testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-delete -alias mykey");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-delete -alias mykey");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala");
+        // keystore name illegal
+        testFail("", "-keystore aa\\bb//cc\\dd -storepass changeit " +
+                "-delete -alias mykey");
+        // keystore not exist
+        testFail("", "-keystore nonexistkeystore -storepass changeit " +
+                "-delete -alias mykey");
+        // keystore invalid
+        testFail("", "-keystore badkeystore -storepass changeit " +
+                "-delete -alias mykey");
+        // wrong pass
+        testFail("", "-keystore x.jks -storetype JKS -storepass xxxxxxxx " +
+                "-delete -alias mykey");
         remove("x.jks");
     }
 
@@ -809,31 +1145,61 @@
         remove("x.jks.p1.cert");
         remove("csr1");
         // PrivateKeyEntry can do certreq
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala -keysize 1024");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -certreq -file csr1 -alias mykey");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -certreq -file csr1");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -certreq -file csr1 -sigalg SHA1withDSA");
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -certreq -file csr1 -sigalg MD5withRSA"); // unmatched sigalg
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala -keysize 1024");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-certreq -file csr1 -alias mykey");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-certreq -file csr1");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-certreq -file csr1 -sigalg SHA1withDSA");
+        // unmatched sigalg
+        testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-certreq -file csr1 -sigalg MD5withRSA");
         // misc test
-        testFail("", "-keystore x.jks -storetype JKS -storepass badstorepass -certreq -file csr1"); // bad storepass
-        testOK("changeit\n", "-keystore x.jks -storetype JKS -certreq -file csr1"); // storepass from terminal
-        testFail("\n", "-keystore x.jks -storetype JKS -certreq -file csr1"); // must provide storepass
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -keypass badkeypass -certreq -file csr1"); // bad keypass
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -certreq -file aa\\bb//cc\\dd");  // bad filepath
-        testFail("", "-keystore noexistks -storepass changeit -certreq -file csr1"); // non-existing keystore
+        // bad storepass
+        testFail("", "-keystore x.jks -storetype JKS -storepass badstorepass " +
+                "-certreq -file csr1");
+        // storepass from terminal
+        testOK("changeit\n", "-keystore x.jks -storetype JKS " +
+                "-certreq -file csr1");
+        // must provide storepass
+        testFail("\n", "-keystore x.jks -storetype JKS " +
+                "-certreq -file csr1");
+        // bad keypass
+        testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass badkeypass -certreq -file csr1");
+        // bad filepath
+        testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-certreq -file aa\\bb//cc\\dd");
+        // non-existing keystore
+        testFail("", "-keystore noexistks -storepass changeit " +
+                "-certreq -file csr1");
         // Try the RSA private key
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -delete -alias mykey");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala -keyalg RSA");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -certreq -file csr1 -alias mykey");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -certreq -file csr1");
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -certreq -file csr1 -sigalg SHA1withDSA"); // unmatched sigalg
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -certreq -file csr1 -sigalg MD5withRSA");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-delete -alias mykey");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala -keyalg RSA");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-certreq -file csr1 -alias mykey");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-certreq -file csr1");
+        // unmatched sigalg
+        testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-certreq -file csr1 -sigalg SHA1withDSA");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-certreq -file csr1 -sigalg MD5withRSA");
         // TrustedCertificateEntry cannot do certreq
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -exportcert -file x.jks.p1.cert");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -delete -alias mykey");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -importcert -file x.jks.p1.cert -noprompt");
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -certreq -file csr1 -alias mykey");
-        testFail("", "-keystore x.jks -storetype JKS -storepass changeit -certreq -file csr1");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-exportcert -file x.jks.p1.cert");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-delete -alias mykey");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-importcert -file x.jks.p1.cert -noprompt");
+        testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-certreq -file csr1 -alias mykey");
+        testFail("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-certreq -file csr1");
         remove("x.jks");
         remove("x.jks.p1.cert");
         remove("csr1");
@@ -842,8 +1208,10 @@
     void sqePrintcertTest() throws Exception {
         remove("x.jks");
         remove("mykey.cert");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -genkeypair -dname CN=olala");
-        testOK("", "-keystore x.jks -storetype JKS -storepass changeit -export -file mykey.cert -alias mykey");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -genkeypair -dname CN=olala");
+        testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-export -file mykey.cert -alias mykey");
         testFail("", "-printcert -file badkeystore");
         testFail("", "-printcert -file a/b/c/d");
         testOK("", "-printcert -file mykey.cert");
@@ -857,7 +1225,8 @@
     void v3extTest(String keyAlg) throws Exception {
         KeyStore ks;
         remove("x.jks");
-        String simple = "-keystore x.jks -storetype JKS -storepass changeit -keypass changeit -noprompt -keyalg " + keyAlg + " ";
+        String simple = "-keystore x.jks -storetype JKS -storepass changeit " +
+                "-keypass changeit -noprompt -keyalg " + keyAlg + " ";
         String pre = simple + "-genkeypair -dname CN=Olala -alias ";
 
         // Version and SKID
@@ -865,7 +1234,8 @@
 
         ks = loadStore("x.jks", "changeit", "JKS");
         assertTrue(((X509Certificate)ks.getCertificate("o1")).getVersion() == 3);
-        assertTrue(((X509CertImpl)ks.getCertificate("o1")).getSubjectKeyIdentifierExtension() != null);
+        assertTrue(((X509CertImpl)ks.getCertificate("o1"))
+                .getSubjectKeyIdentifierExtension() != null);
 
         // BC
         testOK("", pre + "b1 -ext BC:critical");
@@ -879,29 +1249,44 @@
         testOK("", pre + "b9 -ext BC=12");
 
         ks = loadStore("x.jks", "changeit", "JKS");
-        assertTrue(((X509CertImpl)ks.getCertificate("b1")).getBasicConstraintsExtension().isCritical());
-        assertTrue(!((X509CertImpl)ks.getCertificate("b2")).getBasicConstraintsExtension().isCritical());
-        assertTrue(((X509CertImpl)ks.getCertificate("b8")).getBasicConstraintsExtension().isCritical());
-        assertTrue(((X509Certificate)ks.getCertificate("b1")).getBasicConstraints() == Integer.MAX_VALUE);
-        assertTrue(((X509Certificate)ks.getCertificate("b2")).getBasicConstraints() == Integer.MAX_VALUE);
-        assertTrue(((X509Certificate)ks.getCertificate("b3")).getBasicConstraints() == Integer.MAX_VALUE);
-        assertTrue(((X509Certificate)ks.getCertificate("b4")).getBasicConstraints() == Integer.MAX_VALUE);
-        assertTrue(((X509Certificate)ks.getCertificate("b5")).getBasicConstraints() == Integer.MAX_VALUE);
-        assertTrue(((X509Certificate)ks.getCertificate("b6")).getBasicConstraints() == 12);
-        assertTrue(((X509Certificate)ks.getCertificate("b7")).getBasicConstraints() == -1);
-        assertTrue(((X509Certificate)ks.getCertificate("b9")).getBasicConstraints() == 12);
+        assertTrue(((X509CertImpl)ks.getCertificate("b1"))
+                .getBasicConstraintsExtension().isCritical());
+        assertTrue(!((X509CertImpl)ks.getCertificate("b2"))
+                .getBasicConstraintsExtension().isCritical());
+        assertTrue(((X509CertImpl)ks.getCertificate("b8"))
+                .getBasicConstraintsExtension().isCritical());
+        assertTrue(((X509Certificate)ks.getCertificate("b1"))
+                .getBasicConstraints() == Integer.MAX_VALUE);
+        assertTrue(((X509Certificate)ks.getCertificate("b2"))
+                .getBasicConstraints() == Integer.MAX_VALUE);
+        assertTrue(((X509Certificate)ks.getCertificate("b3"))
+                .getBasicConstraints() == Integer.MAX_VALUE);
+        assertTrue(((X509Certificate)ks.getCertificate("b4"))
+                .getBasicConstraints() == Integer.MAX_VALUE);
+        assertTrue(((X509Certificate)ks.getCertificate("b5"))
+                .getBasicConstraints() == Integer.MAX_VALUE);
+        assertTrue(((X509Certificate)ks.getCertificate("b6"))
+                .getBasicConstraints() == 12);
+        assertTrue(((X509Certificate)ks.getCertificate("b7"))
+                .getBasicConstraints() == -1);
+        assertTrue(((X509Certificate)ks.getCertificate("b9"))
+                .getBasicConstraints() == 12);
 
         // KU
         testOK("", pre + "ku1 -ext KeyUsage:critical=digitalsignature");
         testOK("", pre + "ku2 -ext KU=digitalSignature");
         testOK("", pre + "ku3 -ext KU=ds");
         testOK("", pre + "ku4 -ext KU=dig");
-        testFail("", pre + "ku5 -ext KU=d");    // ambigous value
-        testFail("", pre + "ku6 -ext KU=cs");   // cRLSign cannot be cs
+        // ambigous value
+        testFail("", pre + "ku5 -ext KU=d");
+        // cRLSign cannot be cs
+        testFail("", pre + "ku6 -ext KU=cs");
         testOK("", pre + "ku11 -ext KU=nr");
-        testFail("", pre + "ku12 -ext KU=ke");  // ke also means keyAgreement
+        // ke also means keyAgreement
+        testFail("", pre + "ku12 -ext KU=ke");
         testOK("", pre + "ku12 -ext KU=keyE");
-        testFail("", pre + "ku13 -ext KU=de");  // de also means decipherOnly
+        // de also means decipherOnly
+        testFail("", pre + "ku13 -ext KU=de");
         testOK("", pre + "ku13 -ext KU=dataE");
         testOK("", pre + "ku14 -ext KU=ka");
         testOK("", pre + "ku15 -ext KU=kcs");
@@ -919,7 +1304,8 @@
         class CheckKU {
             void check(KeyStore ks, String alias, int... pos) throws Exception {
                 System.err.print("x");
-                boolean[] bs = ((X509Certificate)ks.getCertificate(alias)).getKeyUsage();
+                boolean[] bs = ((X509Certificate)ks.getCertificate(alias))
+                        .getKeyUsage();
                 bs = Arrays.copyOf(bs, 9);
                 for (int i=0; i<bs.length; i++) {
                     boolean found = false;
@@ -936,8 +1322,10 @@
             }
         }
         CheckKU c = new CheckKU();
-        assertTrue(((X509CertImpl)ks.getCertificate("ku1")).getExtension(PKIXExtensions.KeyUsage_Id).isCritical());
-        assertTrue(!((X509CertImpl)ks.getCertificate("ku2")).getExtension(PKIXExtensions.KeyUsage_Id).isCritical());
+        assertTrue(((X509CertImpl)ks.getCertificate("ku1"))
+                .getExtension(PKIXExtensions.KeyUsage_Id).isCritical());
+        assertTrue(!((X509CertImpl)ks.getCertificate("ku2"))
+                .getExtension(PKIXExtensions.KeyUsage_Id).isCritical());
         c.check(ks, "ku1", 0);
         c.check(ks, "ku2", 0);
         c.check(ks, "ku3", 0);
@@ -976,7 +1364,8 @@
         class CheckEKU {
             void check(KeyStore ks, String alias, String... pos) throws Exception {
                 System.err.print("x");
-                List<String> bs = ((X509Certificate)ks.getCertificate(alias)).getExtendedKeyUsage();
+                List<String> bs = ((X509Certificate)ks.getCertificate(alias))
+                        .getExtendedKeyUsage();
                 int found = 0;
                 for (String p: pos) {
                     if (bs.contains(p)) {
@@ -991,8 +1380,10 @@
             }
         }
         CheckEKU cx = new CheckEKU();
-        assertTrue(((X509CertImpl)ks.getCertificate("eku1")).getExtension(PKIXExtensions.ExtendedKeyUsage_Id).isCritical());
-        assertTrue(!((X509CertImpl)ks.getCertificate("eku2")).getExtension(PKIXExtensions.ExtendedKeyUsage_Id).isCritical());
+        assertTrue(((X509CertImpl)ks.getCertificate("eku1"))
+                .getExtension(PKIXExtensions.ExtendedKeyUsage_Id).isCritical());
+        assertTrue(!((X509CertImpl)ks.getCertificate("eku2"))
+                .getExtension(PKIXExtensions.ExtendedKeyUsage_Id).isCritical());
         cx.check(ks, "eku1", "1.3.6.1.5.5.7.3.1");
         cx.check(ks, "eku2", "1.3.6.1.5.5.7.3.2");
         cx.check(ks, "eku3", "1.3.6.1.5.5.7.3.3");
@@ -1013,12 +1404,15 @@
         ks = loadStore("x.jks", "changeit", "JKS");
         class CheckSAN {
             // Please sort items with name type
-            void check(KeyStore ks, String alias, int type, Object... items) throws Exception {
+            void check(KeyStore ks, String alias, int type, Object... items)
+                    throws Exception {
                 int pos = 0;
                 System.err.print("x");
                 Object[] names = null;
-                if (type == 0) names = ((X509Certificate)ks.getCertificate(alias)).getSubjectAlternativeNames().toArray();
-                else names = ((X509Certificate)ks.getCertificate(alias)).getIssuerAlternativeNames().toArray();
+                if (type == 0) names = ((X509Certificate)ks.getCertificate(alias))
+                        .getSubjectAlternativeNames().toArray();
+                else names = ((X509Certificate)ks.getCertificate(alias))
+                        .getIssuerAlternativeNames().toArray();
                 Arrays.sort(names, new Comparator() {
                     public int compare(Object o1, Object o2) {
                         int i1 = (Integer)((List)o1).get(0);
@@ -1041,8 +1435,10 @@
             }
         }
         CheckSAN csan = new CheckSAN();
-        assertTrue(((X509CertImpl)ks.getCertificate("san1")).getSubjectAlternativeNameExtension().isCritical());
-        assertTrue(!((X509CertImpl)ks.getCertificate("san2")).getSubjectAlternativeNameExtension().isCritical());
+        assertTrue(((X509CertImpl)ks.getCertificate("san1"))
+                .getSubjectAlternativeNameExtension().isCritical());
+        assertTrue(!((X509CertImpl)ks.getCertificate("san2"))
+                .getSubjectAlternativeNameExtension().isCritical());
         csan.check(ks, "san1", 0, 1, "me@me.org");
         csan.check(ks, "san2", 0, 6, "http://me.org");
         csan.check(ks, "san3", 0, 2, "me.org");
@@ -1059,8 +1455,10 @@
         testOK("", pre+"ian235 -ext ian=uri:http://me.org,dns:me.org,oid:1.2.3.4");
 
         ks = loadStore("x.jks", "changeit", "JKS");
-        assertTrue(((X509CertImpl)ks.getCertificate("ian1")).getIssuerAlternativeNameExtension().isCritical());
-        assertTrue(!((X509CertImpl)ks.getCertificate("ian2")).getIssuerAlternativeNameExtension().isCritical());
+        assertTrue(((X509CertImpl)ks.getCertificate("ian1"))
+                .getIssuerAlternativeNameExtension().isCritical());
+        assertTrue(!((X509CertImpl)ks.getCertificate("ian2"))
+                .getIssuerAlternativeNameExtension().isCritical());
         csan.check(ks, "ian1", 1, 1, "me@me.org");
         csan.check(ks, "ian2", 1, 6, "http://me.org");
         csan.check(ks, "ian3", 1, 2, "me.org");
@@ -1071,63 +1469,85 @@
         // SIA
         testOK("", pre+"sia1 -ext sia=care:uri:ldap://ca.com/cn=CA");
         testOK("", pre+"sia2 -ext sia=ts:email:ts@ca.com");
-        testFail("SIA never critical", pre+"sia3 -ext sia:critical=ts:email:ts@ca.com");
+        testFail("SIA never critical", pre +
+                "sia3 -ext sia:critical=ts:email:ts@ca.com");
 
         ks = loadStore("x.jks", "changeit", "JKS");
         class CheckSia {
-            void check(KeyStore ks, String alias, int type, Object... items) throws Exception {
+            void check(KeyStore ks, String alias, int type, Object... items)
+                    throws Exception {
                 int pos = 0;
                 System.err.print("x");
                 AccessDescription[] ads = null;
                 if (type == 0) {
-                    SubjectInfoAccessExtension siae = (SubjectInfoAccessExtension)((X509CertImpl)ks.getCertificate(alias)).getExtension(PKIXExtensions.SubjectInfoAccess_Id);
-                    ads = siae.getAccessDescriptions().toArray(new AccessDescription[0]);
+                    SubjectInfoAccessExtension siae = (SubjectInfoAccessExtension)
+                            ((X509CertImpl)ks.getCertificate(alias))
+                            .getExtension(PKIXExtensions.SubjectInfoAccess_Id);
+                    ads = siae.getAccessDescriptions()
+                            .toArray(new AccessDescription[0]);
                 } else {
-                    AuthorityInfoAccessExtension aiae = (AuthorityInfoAccessExtension)((X509CertImpl)ks.getCertificate(alias)).getExtension(PKIXExtensions.AuthInfoAccess_Id);
-                    ads = aiae.getAccessDescriptions().toArray(new AccessDescription[0]);
+                    AuthorityInfoAccessExtension aiae =
+                            (AuthorityInfoAccessExtension)
+                            ((X509CertImpl)ks.getCertificate(alias))
+                            .getExtension(PKIXExtensions.AuthInfoAccess_Id);
+                    ads = aiae.getAccessDescriptions()
+                            .toArray(new AccessDescription[0]);
                 }
                 Arrays.sort(ads, new Comparator<AccessDescription>() {
                     @Override
-                    public int compare(AccessDescription o1, AccessDescription o2) {
-                        return o1.getAccessMethod().toString().compareTo(o2.getAccessMethod().toString());
+                    public int compare(AccessDescription o1,
+                                       AccessDescription o2) {
+                        return o1.getAccessMethod().toString()
+                                .compareTo(o2.getAccessMethod().toString());
                     }
                 });
                 for (AccessDescription ad: ads) {
                     if (!ad.getAccessMethod().equals(items[pos++]) ||
-                            !new Integer(ad.getAccessLocation().getType()).equals(items[pos++])) {
+                            !new Integer(ad.getAccessLocation().getType())
+                                    .equals(items[pos++])) {
                         throw new RuntimeException("Not same type at " + pos);
                     }
                     String name = null;
                     switch (ad.getAccessLocation().getType()) {
                         case 1:
-                            name = ((RFC822Name)ad.getAccessLocation().getName()).getName();
+                            name = ((RFC822Name)ad.getAccessLocation()
+                                    .getName()).getName();
                             break;
                         case 6:
-                            name = ((URIName)ad.getAccessLocation().getName()).getURI().toString();
+                            name = ((URIName)ad.getAccessLocation()
+                                    .getName()).getURI().toString();
                             break;
                         default:
                             throw new RuntimeException("Not implemented: " + ad);
                     }
                     if (!name.equals(items[pos++])) {
-                        throw new Exception("Name not same for " + ad + " at pos " + pos);
+                        throw new Exception("Name not same for " + ad +
+                                " at pos " + pos);
                     }
                 }
             }
         }
         CheckSia csia = new CheckSia();
-        assertTrue(!((X509CertImpl)ks.getCertificate("sia1")).getExtension(PKIXExtensions.SubjectInfoAccess_Id).isCritical());
-        csia.check(ks, "sia1", 0, AccessDescription.Ad_CAREPOSITORY_Id, 6, "ldap://ca.com/cn=CA");
-        csia.check(ks, "sia2", 0, AccessDescription.Ad_TIMESTAMPING_Id, 1, "ts@ca.com");
+        assertTrue(!((X509CertImpl)ks.getCertificate("sia1"))
+                .getExtension(PKIXExtensions.SubjectInfoAccess_Id).isCritical());
+        csia.check(ks, "sia1", 0,
+                AccessDescription.Ad_CAREPOSITORY_Id, 6, "ldap://ca.com/cn=CA");
+        csia.check(ks, "sia2",
+                0, AccessDescription.Ad_TIMESTAMPING_Id, 1, "ts@ca.com");
 
         // AIA
         testOK("", pre+"aia1 -ext aia=cai:uri:ldap://ca.com/cn=CA");
         testOK("", pre+"aia2 -ext aia=ocsp:email:ocsp@ca.com");
-        testFail("AIA never critical", pre+"aia3 -ext aia:critical=ts:email:ts@ca.com");
+        testFail("AIA never critical", pre +
+                "aia3 -ext aia:critical=ts:email:ts@ca.com");
 
         ks = loadStore("x.jks", "changeit", "JKS");
-        assertTrue(!((X509CertImpl)ks.getCertificate("aia1")).getExtension(PKIXExtensions.AuthInfoAccess_Id).isCritical());
-        csia.check(ks, "aia1", 1, AccessDescription.Ad_CAISSUERS_Id, 6, "ldap://ca.com/cn=CA");
-        csia.check(ks, "aia2", 1, AccessDescription.Ad_OCSP_Id, 1, "ocsp@ca.com");
+        assertTrue(!((X509CertImpl)ks.getCertificate("aia1"))
+                .getExtension(PKIXExtensions.AuthInfoAccess_Id).isCritical());
+        csia.check(ks, "aia1", 1,
+                AccessDescription.Ad_CAISSUERS_Id, 6, "ldap://ca.com/cn=CA");
+        csia.check(ks, "aia2", 1,
+                AccessDescription.Ad_OCSP_Id, 1, "ocsp@ca.com");
 
         // OID
         testOK("", pre+"oid1 -ext 1.2.3:critical=0102");
@@ -1136,18 +1556,23 @@
 
         ks = loadStore("x.jks", "changeit", "JKS");
         class CheckOid {
-            void check(KeyStore ks, String alias, String oid, byte[] value) throws Exception {
+            void check(KeyStore ks, String alias, String oid, byte[] value)
+                    throws Exception {
                 int pos = 0;
                 System.err.print("x");
-                Extension ex = ((X509CertImpl)ks.getCertificate(alias)).getExtension(new ObjectIdentifier(oid));
+                Extension ex = ((X509CertImpl)ks.getCertificate(alias))
+                        .getExtension(new ObjectIdentifier(oid));
                 if (!Arrays.equals(value, ex.getValue())) {
-                    throw new RuntimeException("Not same content in " + alias + " for " + oid);
+                    throw new RuntimeException("Not same content in " +
+                            alias + " for " + oid);
                 }
             }
         }
         CheckOid coid = new CheckOid();
-        assertTrue(((X509CertImpl)ks.getCertificate("oid1")).getExtension(new ObjectIdentifier("1.2.3")).isCritical());
-        assertTrue(!((X509CertImpl)ks.getCertificate("oid2")).getExtension(new ObjectIdentifier("1.2.3")).isCritical());
+        assertTrue(((X509CertImpl)ks.getCertificate("oid1"))
+                .getExtension(new ObjectIdentifier("1.2.3")).isCritical());
+        assertTrue(!((X509CertImpl)ks.getCertificate("oid2"))
+                .getExtension(new ObjectIdentifier("1.2.3")).isCritical());
         coid.check(ks, "oid1", "1.2.3", new byte[]{1,2});
         coid.check(ks, "oid2", "1.2.3", new byte[]{});
         coid.check(ks, "oid12", "1.2.3", new byte[]{});
@@ -1163,7 +1588,8 @@
                 "-rfc -file test.req");
         // printcertreq
         testOK("", "-printcertreq -file test.req");
-        // issue: deny KU, change criticality of 1.2.3 and 1.2.4, change content of BC, add 2.3.4
+        // issue: deny KU, change criticality of 1.2.3 and 1.2.4,
+        // change content of BC, add 2.3.4
         testOK("", simple+"-gencert -alias ca -infile test.req -ext " +
                 "honored=all,-KU,1.2.3:critical,1.2.4:non-critical " +
                 "-ext BC=2 -ext 2.3.4=01020304 " +
@@ -1184,6 +1610,22 @@
         assertTrue(!a.getExtension(new ObjectIdentifier("2.3.4")).isCritical());
         assertTrue(a.getExtensionValue("2.3.4").length == 6);
 
+        // 8073181: keytool -ext honored not working correctly
+        testOK("", simple+"-gencert -alias ca -infile test.req -ext " +
+                "honored=1.2.3,KU,1.2.4:critical " +
+                "-debug -rfc -outfile test2.cert");
+        testOK("", simple+"-importcert -file test2.cert -alias b");
+        ks = loadStore("x.jks", "changeit", "JKS");
+        X509CertImpl b = (X509CertImpl)ks.getCertificate("b");
+        assertTrue(!b.getExtension(new ObjectIdentifier("1.2.3")).isCritical());
+        assertTrue(b.getExtension(new ObjectIdentifier("1.2.4")).isCritical());
+
+        // 8073182: keytool may generate duplicate extensions
+        testOK("", pre+"dup -ext bc=2 -ext 2.5.29.19=30030101FF -ext bc=3");
+        ks = loadStore("x.jks", "changeit", "JKS");
+        X509CertImpl dup = (X509CertImpl)ks.getCertificate("dup");
+        assertTrue(dup.getBasicConstraints() == 3);
+
         remove("x.jks");
         remove("test.req");
         remove("test.cert");
@@ -1194,64 +1636,100 @@
         remove("x.jks");
         testOK("", "-help");
 
-        //   2. keytool -genkey -v -keysize 512 Enter "a" for the keystore password. Check error (password too short). Enter "password" for the keystore password. Hit 'return' for "first and last name", "organizational unit", "City", "State", and "Country Code". Type "yes" when they ask you if everything is correct. Type 'return' for new key password.
-        testOK("a\npassword\npassword\nMe\nHere\nNow\nPlace\nPlace\nUS\nyes\n\n", "-genkey -v -keysize 512 -keystore x.jks -storetype JKS");
+        //   2. keytool -genkey -v -keysize 512 Enter "a" for the keystore
+        // password. Check error (password too short). Enter "password" for
+        // the keystore password. Hit 'return' for "first and last name",
+        // "organizational unit", "City", "State", and "Country Code".
+        // Type "yes" when they ask you if everything is correct.
+        // Type 'return' for new key password.
+        testOK("a\npassword\npassword\nMe\nHere\nNow\nPlace\nPlace\nUS\nyes\n\n",
+                "-genkey -v -keysize 512 -keystore x.jks -storetype JKS");
         //   3. keytool -list -v -storepass password
         testOK("", "-list -v -storepass password -keystore x.jks -storetype JKS");
-        //   4. keytool -list -v Type "a" for the keystore password. Check error (wrong keystore password).
+        //   4. keytool -list -v Type "a" for the keystore password.
+        // Check error (wrong keystore password).
         testFail("a\n", "-list -v -keystore x.jks -storetype JKS");
         assertTrue(ex.indexOf("password was incorrect") != -1);
-        //   5. keytool -genkey -v -keysize 512 Enter "password" as the password. Check error (alias 'mykey' already exists).
-        testFail("password\n", "-genkey -v -keysize 512 -keystore x.jks -storetype JKS");
+        //   5. keytool -genkey -v -keysize 512 Enter "password" as the password.
+        // Check error (alias 'mykey' already exists).
+        testFail("password\n", "-genkey -v -keysize 512" +
+                " -keystore x.jks -storetype JKS");
         assertTrue(ex.indexOf("alias <mykey> already exists") != -1);
-        //   6. keytool -genkey -v -keysize 512 -alias mykey2 -storepass password Hit 'return' for "first and last name", "organizational unit", "City", "State", and "Country Code". Type "yes" when they ask you if everything is correct. Type 'return' for new key password.
-        testOK("\n\n\n\n\n\nyes\n\n", "-genkey -v -keysize 512 -alias mykey2 -storepass password -keystore x.jks -storetype JKS");
+        //   6. keytool -genkey -v -keysize 512 -alias mykey2 -storepass password
+        // Hit 'return' for "first and last name", "organizational unit", "City",
+        // "State", and "Country Code". Type "yes" when they ask you if
+        // everything is correct. Type 'return' for new key password.
+        testOK("\n\n\n\n\n\nyes\n\n", "-genkey -v -keysize 512 -alias mykey2" +
+                " -storepass password -keystore x.jks -storetype JKS");
         //   7. keytool -list -v Type 'password' for the store password.
         testOK("password\n", "-list -v -keystore x.jks -storetype JKS");
-        //   8. keytool -keypasswd -v -alias mykey2 -storepass password Type "a" for the new key password. Type "aaaaaa" for the new key password. Type "bbbbbb" when re-entering the new key password. Type "a" for the new key password. Check Error (too many failures).
-        testFail("a\naaaaaa\nbbbbbb\na\n", "-keypasswd -v -alias mykey2 -storepass password -keystore x.jks -storetype JKS");
+        //   8. keytool -keypasswd -v -alias mykey2 -storepass password
+        // Type "a" for the new key password. Type "aaaaaa" for the new key
+        // password. Type "bbbbbb" when re-entering the new key password.
+        // Type "a" for the new key password. Check Error (too many failures).
+        testFail("a\naaaaaa\nbbbbbb\na\n", "-keypasswd -v -alias mykey2" +
+                " -storepass password -keystore x.jks -storetype JKS");
         assertTrue(ex.indexOf("Too many failures - try later") != -1);
-        //   9. keytool -keypasswd -v -alias mykey2 -storepass password Type "aaaaaa" for the new key password. Type "aaaaaa" when re-entering the new key password.
-        testOK("aaaaaa\naaaaaa\n", "-keypasswd -v -alias mykey2 -storepass password -keystore x.jks -storetype JKS");
+        //   9. keytool -keypasswd -v -alias mykey2 -storepass password
+        // Type "aaaaaa" for the new key password. Type "aaaaaa"
+        // when re-entering the new key password.
+        testOK("aaaaaa\naaaaaa\n", "-keypasswd -v -alias mykey2 " +
+                "-storepass password -keystore x.jks -storetype JKS");
         //  10. keytool -selfcert -v -alias mykey -storepass password
-        testOK("", "-selfcert -v -alias mykey -storepass password -keystore x.jks -storetype JKS");
+        testOK("", "-selfcert -v -alias mykey -storepass password " +
+                "-keystore x.jks -storetype JKS");
         //  11. keytool -list -v -storepass password
         testOK("", "-list -v -storepass password -keystore x.jks -storetype JKS");
         //  12. keytool -export -v -alias mykey -file cert -storepass password
         remove("cert");
-        testOK("", "-export -v -alias mykey -file cert -storepass password -keystore x.jks -storetype JKS");
-        //  13. keytool -import -v -file cert -storepass password Check error (Certificate reply and cert are the same)
-        testFail("", "-import -v -file cert -storepass password -keystore x.jks -storetype JKS");
-        assertTrue(ex.indexOf("Certificate reply and certificate in keystore are identical") != -1);
+        testOK("", "-export -v -alias mykey -file cert -storepass password " +
+                "-keystore x.jks -storetype JKS");
+        //  13. keytool -import -v -file cert -storepass password
+        // Check error (Certificate reply and cert are the same)
+        testFail("", "-import -v -file cert -storepass password" +
+                " -keystore x.jks -storetype JKS");
+        assertTrue(ex.indexOf("Certificate reply and certificate" +
+                " in keystore are identical") != -1);
         //  14. keytool -printcert -file cert
         testOK("", "-printcert -file cert -keystore x.jks -storetype JKS");
         remove("cert");
         //  15. keytool -list -storepass password -provider sun.security.provider.Sun
-        testOK("", "-list -storepass password -provider sun.security.provider.Sun -keystore x.jks -storetype JKS");
+        testOK("", "-list -storepass password" +
+                " -provider sun.security.provider.Sun" +
+                " -keystore x.jks -storetype JKS");
 
         //Error tests
 
-        //   1. keytool -storepasswd -storepass password -new abc Check error (password too short)
+        //   1. keytool -storepasswd -storepass password -new abc
+        // Check error (password too short)
         testFail("", "-storepasswd -storepass password -new abc");
         assertTrue(ex.indexOf("New password must be at least 6 characters") != -1);
         // Changed, no NONE needed now
         //   2. keytool -list -storetype PKCS11 Check error (-keystore must be NONE)
         //testFail("", "-list -storetype PKCS11");
         //assertTrue(err.indexOf("keystore must be NONE") != -1);
-        //   3. keytool -storepasswd -storetype PKCS11 -keystore NONE Check error (unsupported operation)
+        //   3. keytool -storepasswd -storetype PKCS11 -keystore NONE
+        // Check error (unsupported operation)
         testFail("", "-storepasswd -storetype PKCS11 -keystore NONE");
         assertTrue(ex.indexOf("UnsupportedOperationException") != -1);
-        //   4. keytool -keypasswd -storetype PKCS11 -keystore NONE Check error (unsupported operation)
+        //   4. keytool -keypasswd -storetype PKCS11 -keystore NONE
+        // Check error (unsupported operation)
         testFail("", "-keypasswd -storetype PKCS11 -keystore NONE");
         assertTrue(ex.indexOf("UnsupportedOperationException") != -1);
-        //   5. keytool -list -protected -storepass password Check error (password can not be specified with -protected)
-        testFail("", "-list -protected -storepass password -keystore x.jks -storetype JKS");
+        //   5. keytool -list -protected -storepass password
+        // Check error (password can not be specified with -protected)
+        testFail("", "-list -protected -storepass password " +
+                "-keystore x.jks -storetype JKS");
         assertTrue(ex.indexOf("if -protected is specified, then") != -1);
-        //   6. keytool -keypasswd -protected -keypass password Check error (password can not be specified with -protected)
-        testFail("", "-keypasswd -protected -keypass password -keystore x.jks -storetype JKS");
+        //   6. keytool -keypasswd -protected -keypass password
+        // Check error (password can not be specified with -protected)
+        testFail("", "-keypasswd -protected -keypass password " +
+                "-keystore x.jks -storetype JKS");
         assertTrue(ex.indexOf("if -protected is specified, then") != -1);
-        //   7. keytool -keypasswd -protected -new password Check error (password can not be specified with -protected)
-        testFail("", "-keypasswd -protected -new password -keystore x.jks -storetype JKS");
+        //   7. keytool -keypasswd -protected -new password
+        // Check error (password can not be specified with -protected)
+        testFail("", "-keypasswd -protected -new password " +
+                "-keystore x.jks -storetype JKS");
         assertTrue(ex.indexOf("if -protected is specified, then") != -1);
         remove("x.jks");
     }
@@ -1261,14 +1739,19 @@
 
         //   1. sccs edit cert8.db key3.db
         //Runtime.getRuntime().exec("/usr/ccs/bin/sccs edit cert8.db key3.db");
-        testOK("", p11Arg + "-storepass test12 -genkey -alias genkey -dname cn=genkey -keysize 512 -keyalg rsa");
+        testOK("", p11Arg + ("-storepass test12 -genkey -alias genkey" +
+                " -dname cn=genkey -keysize 512 -keyalg rsa"));
         testOK("", p11Arg + "-storepass test12 -list");
         testOK("", p11Arg + "-storepass test12 -list -alias genkey");
-        testOK("", p11Arg + "-storepass test12 -certreq -alias genkey -file genkey.certreq");
-        testOK("", p11Arg + "-storepass test12 -export -alias genkey -file genkey.cert");
+        testOK("", p11Arg +
+                "-storepass test12 -certreq -alias genkey -file genkey.certreq");
+        testOK("", p11Arg +
+                "-storepass test12 -export -alias genkey -file genkey.cert");
         testOK("", "-printcert -file genkey.cert");
-        testOK("", p11Arg + "-storepass test12 -selfcert -alias genkey -dname cn=selfCert");
-        testOK("", p11Arg + "-storepass test12 -list -alias genkey -v");
+        testOK("", p11Arg +
+                "-storepass test12 -selfcert -alias genkey -dname cn=selfCert");
+        testOK("", p11Arg +
+                "-storepass test12 -list -alias genkey -v");
         assertTrue(out.indexOf("Owner: CN=selfCert") != -1);
         //(check that cert subject DN is [cn=selfCert])
         testOK("", p11Arg + "-storepass test12 -delete -alias genkey");
@@ -1285,7 +1768,8 @@
     void sszzTest() throws Exception {
         testAnyway("", NSS_P11_ARG+"-delete -alias nss -storepass test12");
         testAnyway("", NZZ_P11_ARG+"-delete -alias nss -storepass test12");
-        testOK("", NSS_P11_ARG+"-genkeypair -dname CN=NSS -alias nss -storepass test12");
+        testOK("", NSS_P11_ARG+"-genkeypair -dname CN=NSS " +
+                "-alias nss -storepass test12");
         testOK("", NSS_SRC_P11_ARG + NZZ_P11_ARG +
                 "-importkeystore -srcstorepass test12 -deststorepass test12");
         testAnyway("", NSS_P11_ARG+"-delete -alias nss -storepass test12");
@@ -1323,11 +1807,13 @@
                 // FAIL:
                 // 1. we still don't have srcprovidername yet
                 // 2. cannot store privatekey into NSS keystore
-                //    java.security.KeyStoreException: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_TEMPLATE_INCOMPLETE.
+                //    java.security.KeyStoreException: sun.security.pkcs11
+                //      .wrapper.PKCS11Exception: CKR_TEMPLATE_INCOMPLETE.
                 //t.testPKCS11ImportKeyStore();
 
                 t.i18nPKCS11Test();
-                //FAIL: currently PKCS11-NSS does not support 2 NSS KeyStores to be loaded at the same time
+                //FAIL: currently PKCS11-NSS does not support
+                // 2 NSS KeyStores to be loaded at the same time
                 //t.sszzTest();
             }
 
--- a/jdk/test/tools/launcher/TestSpecialArgs.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/jdk/test/tools/launcher/TestSpecialArgs.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
  * 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,12 +23,14 @@
 
 /*
  * @test
- * @bug 7124089 7131021 8042469
- * @summary Checks for MacOSX specific flags are accepted or rejected, and
- *          MacOSX platforms specific environment is consistent.
+ * @bug 7124089 7131021 8042469 8066185
+ * @summary Checks for Launcher special flags, such as MacOSX specific flags,
+ *          and JVM NativeMemoryTracking flags.
  * @compile -XDignore.symbol.file TestSpecialArgs.java EnvironmentVariables.java
  * @run main TestSpecialArgs
  */
+import java.io.File;
+import java.io.FileNotFoundException;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
@@ -36,10 +38,14 @@
 
 public class TestSpecialArgs extends TestHelper {
 
-    public static void main(String... args) {
+    public static void main(String... args) throws Exception {
+        new TestSpecialArgs().run(args);
+    }
+
+    @Test
+    void testDocking() {
         final Map<String, String> envMap = new HashMap<>();
         envMap.put("_JAVA_LAUNCHER_DEBUG", "true");
-
         TestResult tr = doExec(envMap, javaCmd, "-XstartOnFirstThread", "-version");
         if (isMacOSX) {
             if (!tr.contains("In same thread")) {
@@ -69,140 +75,10 @@
                 throw new RuntimeException("Error: argument was accepted ????");
             }
         }
-
-        /*
-         * test argument : -XX:NativeMemoryTracking=value
-         * A JVM flag, comsumed by the JVM, but requiring launcher
-         * to set an environmental variable if and only if value is supplied.
-         * Test and order:
-         * 1) execute with valid parameter: -XX:NativeMemoryTracking=MyValue
-         *    a) check for correct env variable name: "NMT_LEVEL_" + pid
-         *    b) check that "MyValue" was found in local env.
-         * 2) execute with invalid parameter: -XX:NativeMemoryTracking=
-         *    !) Won't find "NativeMemoryTracking:"
-         *       Code to create env variable not executed.
-         * 3) execute with invalid parameter: -XX:NativeMemoryTracking
-         *    !) Won't find "NativeMemoryTracking:"
-         *       Code to create env variable not executed.
-         * 4) give and invalid value and check to make sure JVM commented
-         */
-        { // NativeMemoryTracking
-            String launcherPidString = "launcher.pid=";
-            String envVarPidString = "TRACER_MARKER: NativeMemoryTracking: env var is NMT_LEVEL_";
-            String NMT_Option_Value = "off";
-            String myClassName = "helloworld";
-            boolean haveLauncherPid = false;
-
-            // === Run the tests ===
-
-            // ---Test 1a
-            tr = doExec(envMap,javaCmd, "-XX:NativeMemoryTracking=" + NMT_Option_Value,
-                        "-version");
-
-            // get the PID from the env var we set for the JVM
-            String envVarPid = null;
-            for (String line : tr.testOutput) {
-                if (line.contains(envVarPidString)) {
-                    int sindex = envVarPidString.length();
-                    envVarPid = line.substring(sindex);
-                    break;
-                }
-            }
-            // did we find envVarPid?
-            if (envVarPid == null) {
-                System.out.println(tr);
-                throw new RuntimeException("Error: failed to find env Var Pid in tracking info");
-            }
-            // we think we found the pid string.  min test, not "".
-            if (envVarPid.length() < 1) {
-                System.out.println(tr);
-                throw new RuntimeException("Error: env Var Pid in tracking info is empty string");
-            }
-
-            /*
-             * On Linux, Launcher Tracking will print the PID.  Use this info
-             * to validate what we got as the PID in the Launcher itself.
-             * Linux is the only one that prints this, and trying to get it
-             * here for win is awful.  So let the linux test make sure we get
-             * the valid pid, and for non-linux, just make sure pid string is
-             * non-zero.
-             */
-            if (isLinux) {
-                // get what the test says is the launcher pid
-                String launcherPid = null;
-                for (String line : tr.testOutput) {
-                    int index = line.indexOf(launcherPidString);
-                    if (index >= 0) {
-                        int sindex = index + launcherPidString.length();
-                        int tindex = sindex + line.substring(sindex).indexOf("'");
-                        System.out.println("DEBUG INFO: sindex = " + sindex);
-                        System.out.println("DEBUG INFO: searching substring: " + line.substring(sindex));
-                        System.out.println("DEBUG INFO: tindex = " + tindex);
-                        // DEBUG INFO
-                        System.out.println(tr);
-                        launcherPid = line.substring(sindex, tindex);
-                        break;
-                    }
-                }
-                if (launcherPid == null) {
-                    System.out.println(tr);
-                    throw new RuntimeException("Error: failed to find launcher Pid in launcher tracking info");
-                }
-
-                // did we create the env var with the correct pid?
-                if (!launcherPid.equals(envVarPid)) {
-                    System.out.println(tr);
-                    System.out.println("Error: wrong pid in creating env var");
-                    System.out.println("Error Info: launcherPid = " + launcherPid);
-                    System.out.println("Error Info: envVarPid   = " + envVarPid);
-                    throw new RuntimeException("Error: wrong pid in creating env var");
-                }
-            }
-
-
-            // --- Test 1b
-            if (!tr.contains("NativeMemoryTracking: got value " + NMT_Option_Value)) {
-                System.out.println(tr);
-                throw new RuntimeException("Error: Valid param failed to set env variable");
-            }
-
-            // --- Test 2
-            tr = doExec(envMap,javaCmd, "-XX:NativeMemoryTracking=",
-                        "-version");
-            if (tr.contains("NativeMemoryTracking:")) {
-                System.out.println(tr);
-                throw new RuntimeException("Error: invalid param caused env variable to be erroneously created");
-            }
-            if (!tr.contains("Syntax error, expecting -XX:NativeMemoryTracking=")) {
-                System.out.println(tr);
-                throw new RuntimeException("Error: invalid param not checked by JVM");
-            }
-
-            // --- Test 3
-            tr = doExec(envMap,javaCmd, "-XX:NativeMemoryTracking",
-                        "-version");
-            if (tr.contains("NativeMemoryTracking:")) {
-                System.out.println(tr);
-                throw new RuntimeException("Error: invalid param caused env variable to be erroneously created");
-            }
-            if (!tr.contains("Syntax error, expecting -XX:NativeMemoryTracking=")) {
-                System.out.println(tr);
-                throw new RuntimeException("Error: invalid param not checked by JVM");
-            }
-            // --- Test 4
-            tr = doExec(envMap,javaCmd, "-XX:NativeMemoryTracking=BADVALUE",
-                        "-version");
-            if (!tr.contains("expecting -XX:NativeMemoryTracking")) {
-                System.out.println(tr);
-                throw new RuntimeException("Error: invalid param did not get JVM Syntax error message");
-            }
-
-        } // NativeMemoryTracking
-
-
         // MacOSX specific tests ensue......
-        if (!isMacOSX)
+        if (!isMacOSX) {
             return;
+        }
         Set<String> envToRemove = new HashSet<>();
         Map<String, String> map = System.getenv();
         for (String s : map.keySet()) {
@@ -225,11 +101,187 @@
                 "APP_ICON_*", "TestAppIcon");
     }
 
-    static void runTest(Set<String> envToRemove, String... args) {
+    void runTest(Set<String> envToRemove, String... args) {
         TestResult tr = doExec(null, envToRemove, args);
         if (!tr.isOK()) {
             System.err.println(tr.toString());
             throw new RuntimeException("Test Fails");
         }
     }
+
+    @Test
+    void testNativeMemoryTracking() {
+        final Map<String, String> envMap = new HashMap<>();
+        envMap.put("_JAVA_LAUNCHER_DEBUG", "true");
+        TestResult tr;
+        /*
+         * test argument : -XX:NativeMemoryTracking=value
+         * A JVM flag, comsumed by the JVM, but requiring launcher
+         * to set an environmental variable if and only if value is supplied.
+         * Test and order:
+         * 1) execute with valid parameter: -XX:NativeMemoryTracking=MyValue
+         *    a) check for correct env variable name: "NMT_LEVEL_" + pid
+         *    b) check that "MyValue" was found in local env.
+         * 2) execute with invalid parameter: -XX:NativeMemoryTracking=
+         *    !) Won't find "NativeMemoryTracking:"
+         *       Code to create env variable not executed.
+         * 3) execute with invalid parameter: -XX:NativeMemoryTracking
+         *    !) Won't find "NativeMemoryTracking:"
+         *       Code to create env variable not executed.
+         * 4) give and invalid value and check to make sure JVM commented
+         */
+        String launcherPidString = "launcher.pid=";
+        String envVarPidString = "TRACER_MARKER: NativeMemoryTracking: env var is NMT_LEVEL_";
+        String NMT_Option_Value = "off";
+        String myClassName = "helloworld";
+        boolean haveLauncherPid = false;
+
+        // === Run the tests ===
+        // ---Test 1a
+        tr = doExec(envMap, javaCmd, "-XX:NativeMemoryTracking=" + NMT_Option_Value,
+                "-version");
+
+        // get the PID from the env var we set for the JVM
+        String envVarPid = null;
+        for (String line : tr.testOutput) {
+            if (line.contains(envVarPidString)) {
+                int sindex = envVarPidString.length();
+                envVarPid = line.substring(sindex);
+                break;
+            }
+        }
+        // did we find envVarPid?
+        if (envVarPid == null) {
+            System.out.println(tr);
+            throw new RuntimeException("Error: failed to find env Var Pid in tracking info");
+        }
+        // we think we found the pid string.  min test, not "".
+        if (envVarPid.length() < 1) {
+            System.out.println(tr);
+            throw new RuntimeException("Error: env Var Pid in tracking info is empty string");
+        }
+
+        /*
+         * On Linux, Launcher Tracking will print the PID.  Use this info
+         * to validate what we got as the PID in the Launcher itself.
+         * Linux is the only one that prints this, and trying to get it
+         * here for win is awful.  So let the linux test make sure we get
+         * the valid pid, and for non-linux, just make sure pid string is
+         * non-zero.
+         */
+        if (isLinux) {
+            // get what the test says is the launcher pid
+            String launcherPid = null;
+            for (String line : tr.testOutput) {
+                int index = line.indexOf(launcherPidString);
+                if (index >= 0) {
+                    int sindex = index + launcherPidString.length();
+                    int tindex = sindex + line.substring(sindex).indexOf("'");
+                    System.out.println("DEBUG INFO: sindex = " + sindex);
+                    System.out.println("DEBUG INFO: searching substring: " + line.substring(sindex));
+                    System.out.println("DEBUG INFO: tindex = " + tindex);
+                    // DEBUG INFO
+                    System.out.println(tr);
+                    launcherPid = line.substring(sindex, tindex);
+                    break;
+                }
+            }
+            if (launcherPid == null) {
+                System.out.println(tr);
+                throw new RuntimeException("Error: failed to find launcher Pid in launcher tracking info");
+            }
+
+            // did we create the env var with the correct pid?
+            if (!launcherPid.equals(envVarPid)) {
+                System.out.println(tr);
+                System.out.println("Error: wrong pid in creating env var");
+                System.out.println("Error Info: launcherPid = " + launcherPid);
+                System.out.println("Error Info: envVarPid   = " + envVarPid);
+                throw new RuntimeException("Error: wrong pid in creating env var");
+            }
+        }
+
+        // --- Test 1b
+        if (!tr.contains("NativeMemoryTracking: got value " + NMT_Option_Value)) {
+            System.out.println(tr);
+            throw new RuntimeException("Error: Valid param failed to set env variable");
+        }
+
+        // --- Test 2
+        tr = doExec(envMap, javaCmd, "-XX:NativeMemoryTracking=",
+                "-version");
+        if (tr.contains("NativeMemoryTracking:")) {
+            System.out.println(tr);
+            throw new RuntimeException("Error: invalid param caused env variable to be erroneously created");
+        }
+        if (!tr.contains("Syntax error, expecting -XX:NativeMemoryTracking=")) {
+            System.out.println(tr);
+            throw new RuntimeException("Error: invalid param not checked by JVM");
+        }
+
+        // --- Test 3
+        tr = doExec(envMap, javaCmd, "-XX:NativeMemoryTracking",
+                "-version");
+        if (tr.contains("NativeMemoryTracking:")) {
+            System.out.println(tr);
+            throw new RuntimeException("Error: invalid param caused env variable to be erroneously created");
+        }
+        if (!tr.contains("Syntax error, expecting -XX:NativeMemoryTracking=")) {
+            System.out.println(tr);
+            throw new RuntimeException("Error: invalid param not checked by JVM");
+        }
+        // --- Test 4
+        tr = doExec(envMap, javaCmd, "-XX:NativeMemoryTracking=BADVALUE",
+                "-version");
+        if (!tr.contains("expecting -XX:NativeMemoryTracking")) {
+            System.out.println(tr);
+            throw new RuntimeException("Error: invalid param did not get JVM Syntax error message");
+        }
+    }
+
+    @Test
+    void testNMArgumentProcessing() throws FileNotFoundException {
+        TestResult tr = null;
+        // the direct invokers of the VM
+        String options[] = {
+            "-version", "-fullversion", "-help", "-?", "-X"
+        };
+        for (String option : options) {
+            tr = doExec(javaCmd, option, "-XX:NativeMemoryTracking=summary");
+            checkTestResult(tr);
+        }
+
+        // create a test jar
+        File jarFile = new File("test.jar");
+        createJar(jarFile, "public static void main(String... args){}");
+
+        // ones that involve main-class of some sort
+        tr = doExec(javaCmd, "-jar", jarFile.getName(),
+                "-XX:NativeMemoryTracking=summary");
+        checkTestResult(tr);
+
+        tr = doExec(javaCmd, "-cp", jarFile.getName(), "Foo",
+                "-XX:NativeMemoryTracking=summary");
+        checkTestResult(tr);
+
+        final Map<String, String> envMap = new HashMap<>();
+        // checkwith CLASSPATH set ie. no -cp or -classpath
+        envMap.put("CLASSPATH", ".");
+        tr = doExec(envMap, javaCmd, "Foo", "-XX:NativeMemoryTracking=summary");
+        checkTestResult(tr);
+
+        // make sure a missing class is handled correctly, because the class
+        // resolution is performed by the JVM.
+        tr = doExec(javaCmd, "AbsentClass", "-XX:NativeMemoryTracking=summary");
+        if (!tr.contains("Error: Could not find or load main class AbsentClass")) {
+            throw new RuntimeException("Test Fails");
+        }
+    }
+
+    void checkTestResult(TestResult tr) {
+        if (!tr.isOK()) {
+            System.err.println(tr.toString());
+            throw new RuntimeException("Test Fails");
+        }
+    }
 }
--- a/langtools/.hgtags	Mon Feb 23 10:47:32 2015 -0800
+++ b/langtools/.hgtags	Tue Mar 03 08:49:13 2015 -0800
@@ -294,3 +294,4 @@
 15c79f28e30a1be561abe0d67674232ad5034d32 jdk9-b49
 1ccb6ef2f40bf9961b27adac390a6fc5181aa1fc jdk9-b50
 7c44d9a33bbea75f5d91625df9bbccea360aea2a jdk9-b51
+ee20efe0255d7ac6e06e88e06f7c72f6c6da7bf9 jdk9-b52
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Scope.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Scope.java	Tue Mar 03 08:49:13 2015 -0800
@@ -798,6 +798,10 @@
             prependSubScope(new FilterImportScope(types, origin, null, filter, staticImport));
         }
 
+        public boolean isFilled() {
+            return subScopes.nonEmpty();
+        }
+
     }
 
     public interface ImportFilter {
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java	Tue Mar 03 08:49:13 2015 -0800
@@ -477,6 +477,14 @@
             && (tsym.flags() & COMPOUND) != 0;
     }
 
+    public boolean isIntersection() {
+        return false;
+    }
+
+    public boolean isUnion() {
+        return false;
+    }
+
     public boolean isInterface() {
         return (tsym.flags() & INTERFACE) != 0;
     }
@@ -1079,6 +1087,11 @@
             return Collections.unmodifiableList(alternatives_field);
         }
 
+        @Override
+        public boolean isUnion() {
+            return true;
+        }
+
         @Override @DefinedBy(Api.LANGUAGE_MODEL)
         public TypeKind getKind() {
             return TypeKind.UNION;
@@ -1125,6 +1138,11 @@
             return interfaces_field.prepend(supertype_field);
         }
 
+        @Override
+        public boolean isIntersection() {
+            return true;
+        }
+
         public List<Type> getExplicitComponents() {
             return allInterfaces ?
                     interfaces_field :
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1402,8 +1402,7 @@
                     return isSameWildcard(t, s)
                         || isCaptureOf(s, t)
                         || ((t.isExtendsBound() || isSubtypeNoCapture(wildLowerBound(t), wildLowerBound(s))) &&
-                            // TODO: JDK-8039214, cvarUpperBound call here is incorrect
-                            (t.isSuperBound() || isSubtypeNoCapture(cvarUpperBound(wildUpperBound(s)), wildUpperBound(t))));
+                            (t.isSuperBound() || isSubtypeNoCapture(wildUpperBound(s), wildUpperBound(t))));
                 }
             }
 
@@ -1517,8 +1516,8 @@
                     }
                 }
 
-                if (t.isCompound() || s.isCompound()) {
-                    return !t.isCompound() ?
+                if (t.isIntersection() || s.isIntersection()) {
+                    return !t.isIntersection() ?
                             visitIntersectionType((IntersectionClassType)s, t, true) :
                             visitIntersectionType((IntersectionClassType)t, s, false);
                 }
@@ -2246,19 +2245,28 @@
     }
     // </editor-fold>
 
-    // <editor-fold defaultstate="collapsed" desc="makeCompoundType">
+    // <editor-fold defaultstate="collapsed" desc="makeIntersectionType">
     /**
-     * Make a compound type from non-empty list of types.  The list should be
-     * ordered according to {@link Symbol#precedes(TypeSymbol,Types)}.
+     * Make an intersection type from non-empty list of types.  The list should be ordered according to
+     * {@link TypeSymbol#precedes(TypeSymbol, Types)}. Note that this might cause a symbol completion.
+     * Hence, this version of makeIntersectionType may not be called during a classfile read.
      *
-     * @param bounds            the types from which the compound type is formed
-     * @param supertype         is objectType if all bounds are interfaces,
-     *                          null otherwise.
+     * @param bounds    the types from which the intersection type is formed
      */
-    public Type makeCompoundType(List<Type> bounds) {
-        return makeCompoundType(bounds, bounds.head.tsym.isInterface());
+    public IntersectionClassType makeIntersectionType(List<Type> bounds) {
+        return makeIntersectionType(bounds, bounds.head.tsym.isInterface());
     }
-    public Type makeCompoundType(List<Type> bounds, boolean allInterfaces) {
+
+    /**
+     * Make an intersection type from non-empty list of types.  The list should be ordered according to
+     * {@link TypeSymbol#precedes(TypeSymbol, Types)}. This does not cause symbol completion as
+     * an extra parameter indicates as to whether all bounds are interfaces - in which case the
+     * supertype is implicitly assumed to be 'Object'.
+     *
+     * @param bounds        the types from which the intersection type is formed
+     * @param allInterfaces are all bounds interface types?
+     */
+    public IntersectionClassType makeIntersectionType(List<Type> bounds, boolean allInterfaces) {
         Assert.check(bounds.nonEmpty());
         Type firstExplicitBound = bounds.head;
         if (allInterfaces) {
@@ -2271,23 +2279,13 @@
                                 : names.empty,
                             null,
                             syms.noSymbol);
-        bc.type = new IntersectionClassType(bounds, bc, allInterfaces);
+        IntersectionClassType intersectionType = new IntersectionClassType(bounds, bc, allInterfaces);
+        bc.type = intersectionType;
         bc.erasure_field = (bounds.head.hasTag(TYPEVAR)) ?
                 syms.objectType : // error condition, recover
                 erasure(firstExplicitBound);
         bc.members_field = WriteableScope.create(bc);
-        return bc.type;
-    }
-
-    /**
-     * A convenience wrapper for {@link #makeCompoundType(List)}; the
-     * arguments are converted to a list and passed to the other
-     * method.  Note that this might cause a symbol completion.
-     * Hence, this version of makeCompoundType may not be called
-     * during a classfile read.
-     */
-    public Type makeCompoundType(Type bound1, Type bound2) {
-        return makeCompoundType(List.of(bound1, bound2));
+        return intersectionType;
     }
     // </editor-fold>
 
@@ -2427,7 +2425,7 @@
         private final UnaryVisitor<List<Type>> directSupertypes = new UnaryVisitor<List<Type>>() {
 
             public List<Type> visitType(final Type type, final Void ignored) {
-                if (!type.isCompound()) {
+                if (!type.isIntersection()) {
                     final Type sup = supertype(type);
                     return (sup == Type.noType || sup == type || sup == null)
                         ? interfaces(type)
@@ -2481,30 +2479,32 @@
 
     // <editor-fold defaultstate="collapsed" desc="setBounds">
     /**
-     * Set the bounds field of the given type variable to reflect a
-     * (possibly multiple) list of bounds.
-     * @param t                 a type variable
-     * @param bounds            the bounds, must be nonempty
-     * @param supertype         is objectType if all bounds are interfaces,
-     *                          null otherwise.
+     * Same as {@link Types#setBounds(TypeVar, List, boolean)}, except that third parameter is computed directly,
+     * as follows: if all all bounds are interface types, the computed supertype is Object,otherwise
+     * the supertype is simply left null (in this case, the supertype is assumed to be the head of
+     * the bound list passed as second argument). Note that this check might cause a symbol completion.
+     * Hence, this version of setBounds may not be called during a classfile read.
+     *
+     * @param t         a type variable
+     * @param bounds    the bounds, must be nonempty
      */
     public void setBounds(TypeVar t, List<Type> bounds) {
         setBounds(t, bounds, bounds.head.tsym.isInterface());
     }
 
     /**
-     * Same as {@link #setBounds(Type.TypeVar,List,Type)}, except that
-     * third parameter is computed directly, as follows: if all
-     * all bounds are interface types, the computed supertype is Object,
-     * otherwise the supertype is simply left null (in this case, the supertype
-     * is assumed to be the head of the bound list passed as second argument).
-     * Note that this check might cause a symbol completion. Hence, this version of
-     * setBounds may not be called during a classfile read.
+     * Set the bounds field of the given type variable to reflect a (possibly multiple) list of bounds.
+     * This does not cause symbol completion as an extra parameter indicates as to whether all bounds
+     * are interfaces - in which case the supertype is implicitly assumed to be 'Object'.
+     *
+     * @param t             a type variable
+     * @param bounds        the bounds, must be nonempty
+     * @param allInterfaces are all bounds interface types?
      */
     public void setBounds(TypeVar t, List<Type> bounds, boolean allInterfaces) {
         t.bound = bounds.tail.isEmpty() ?
                 bounds.head :
-                makeCompoundType(bounds, allInterfaces);
+                makeIntersectionType(bounds, allInterfaces);
         t.rank_field = -1;
     }
     // </editor-fold>
@@ -3036,7 +3036,7 @@
                 if (st == supertype(t) && is == interfaces(t))
                     return t;
                 else
-                    return makeCompoundType(is.prepend(st));
+                    return makeIntersectionType(is.prepend(st));
             }
         }
 
@@ -3545,7 +3545,7 @@
         else if (compound.tail.isEmpty())
             return compound.head;
         else
-            return makeCompoundType(compound);
+            return makeIntersectionType(compound);
     }
 
     /**
@@ -3723,8 +3723,8 @@
                 synchronized (this) {
                     if (arraySuperType == null) {
                         // JLS 10.8: all arrays implement Cloneable and Serializable.
-                        arraySuperType = makeCompoundType(List.of(syms.serializableType,
-                                                                  syms.cloneableType), true);
+                        arraySuperType = makeIntersectionType(List.of(syms.serializableType,
+                                syms.cloneableType), true);
                     }
                 }
             }
@@ -3790,7 +3790,7 @@
                     return glbFlattened(union(bounds, lowers), errT);
             }
         }
-        return makeCompoundType(bounds);
+        return makeIntersectionType(bounds);
     }
     // </editor-fold>
 
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Tue Mar 03 08:49:13 2015 -0800
@@ -2355,7 +2355,7 @@
 
             @Override
             public Type visitClassType(ClassType t, DiagnosticPosition pos) {
-                return t.isCompound() ?
+                return t.isIntersection() ?
                         visitIntersectionClassType((IntersectionClassType)t, pos) : t;
             }
 
@@ -2386,8 +2386,7 @@
                     }
                     supertypes.append(i.tsym.type);
                 }
-                IntersectionClassType notionalIntf =
-                        (IntersectionClassType)types.makeCompoundType(supertypes.toList());
+                IntersectionClassType notionalIntf = types.makeIntersectionType(supertypes.toList());
                 notionalIntf.allparams_field = targs.toList();
                 notionalIntf.tsym.flags_field |= INTERFACE;
                 return notionalIntf.tsym;
@@ -3947,7 +3946,7 @@
         } else if (bounds.length() == 1) {
             return bounds.head.type;
         } else {
-            Type owntype = types.makeCompoundType(TreeInfo.types(bounds));
+            Type owntype = types.makeIntersectionType(TreeInfo.types(bounds));
             // ... the variable's bound is a class type flagged COMPOUND
             // (see comment for TypeVar.bound).
             // In this case, generate a class tree that represents the
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java	Tue Mar 03 08:49:13 2015 -0800
@@ -3528,7 +3528,7 @@
 
         for (Symbol sym : tsym.members().getSymbolsByName(name)) {
             if (sym.isStatic() &&
-                staticImportAccessible(sym, packge) &&
+                importAccessible(sym, packge) &&
                 sym.isMemberOf(origin, types)) {
                 return true;
             }
@@ -3538,17 +3538,23 @@
     }
 
     // is the sym accessible everywhere in packge?
-    public boolean staticImportAccessible(Symbol sym, PackageSymbol packge) {
-        int flags = (int)(sym.flags() & AccessFlags);
-        switch (flags) {
-        default:
-        case PUBLIC:
-            return true;
-        case PRIVATE:
+    public boolean importAccessible(Symbol sym, PackageSymbol packge) {
+        try {
+            int flags = (int)(sym.flags() & AccessFlags);
+            switch (flags) {
+            default:
+            case PUBLIC:
+                return true;
+            case PRIVATE:
+                return false;
+            case 0:
+            case PROTECTED:
+                return sym.packge() == packge;
+            }
+        } catch (ClassFinder.BadClassFile err) {
+            throw err;
+        } catch (CompletionFailure ex) {
             return false;
-        case 0:
-        case PROTECTED:
-            return sym.packge() == packge;
         }
     }
 
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java	Tue Mar 03 08:49:13 2015 -0800
@@ -417,7 +417,7 @@
             List<Type> upperBounds = uv.getBounds(InferenceBound.UPPER);
             if (Type.containsAny(upperBounds, vars)) {
                 TypeSymbol fresh_tvar = new TypeVariableSymbol(Flags.SYNTHETIC, uv.qtype.tsym.name, null, uv.qtype.tsym.owner);
-                fresh_tvar.type = new TypeVar(fresh_tvar, types.makeCompoundType(uv.getBounds(InferenceBound.UPPER)), null);
+                fresh_tvar.type = new TypeVar(fresh_tvar, types.makeIntersectionType(uv.getBounds(InferenceBound.UPPER)), null);
                 todo.append(uv);
                 uv.inst = fresh_tvar.type;
             } else if (upperBounds.nonEmpty()) {
@@ -670,7 +670,7 @@
         if (lubResult == syms.errType || lubResult == syms.botType) {
             return List.nil();
         }
-        List<Type> supertypesToCheck = lubResult.isCompound() ?
+        List<Type> supertypesToCheck = lubResult.isIntersection() ?
                 ((IntersectionClassType)lubResult).getComponents() :
                 List.of(lubResult);
         ListBuffer<Pair<Type, Type>> commonSupertypes = new ListBuffer<>();
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1667,7 +1667,7 @@
          * This class is used to store important information regarding translation of
          * lambda expression/method references (see subclasses).
          */
-        private abstract class TranslationContext<T extends JCFunctionalExpression> {
+        abstract class TranslationContext<T extends JCFunctionalExpression> {
 
             /** the underlying (untranslated) tree */
             final T tree;
@@ -1746,7 +1746,7 @@
          * and the used by the main translation routines in order to adjust references
          * to captured locals/members, etc.
          */
-        private class LambdaTranslationContext extends TranslationContext<JCLambda> {
+        class LambdaTranslationContext extends TranslationContext<JCLambda> {
 
             /** variable in the enclosing context to which this lambda is assigned */
             final Symbol self;
@@ -2040,7 +2040,7 @@
          * and the used by the main translation routines in order to adjust method
          * references (i.e. in case a bridge is needed)
          */
-        private final class ReferenceTranslationContext extends TranslationContext<JCMemberReference> {
+        final class ReferenceTranslationContext extends TranslationContext<JCMemberReference> {
 
             final boolean isSuper;
             final Symbol sigPolySym;
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1098,10 +1098,17 @@
                     DeferredType.SpeculativeCache.Entry e =
                             dt.speculativeCache.get(deferredAttrContext.msym, deferredAttrContext.phase);
                     if (e != null && e.speculativeTree != deferredAttr.stuckTree) {
-                        return functionalInterfaceMostSpecific(found, req, e.speculativeTree, warn);
+                        return functionalInterfaceMostSpecific(found, req, e.speculativeTree);
                     }
                 }
-                return super.compatible(found, req, warn);
+                return compatibleBySubtyping(found, req);
+            }
+
+            private boolean compatibleBySubtyping(Type found, Type req) {
+                if (!strict && found.isPrimitive() != req.isPrimitive()) {
+                    found = found.isPrimitive() ? types.boxedClass(found).type : types.unboxedType(found);
+                }
+                return types.isSubtypeNoCapture(found, deferredAttrContext.inferenceContext.asUndetVar(req));
             }
 
             /** Whether {@code t} and {@code s} are unrelated functional interface types. */
@@ -1113,8 +1120,8 @@
             }
 
             /** Parameters {@code t} and {@code s} are unrelated functional interface types. */
-            private boolean functionalInterfaceMostSpecific(Type t, Type s, JCTree tree, Warner warn) {
-                FunctionalInterfaceMostSpecificChecker msc = new FunctionalInterfaceMostSpecificChecker(t, s, warn);
+            private boolean functionalInterfaceMostSpecific(Type t, Type s, JCTree tree) {
+                FunctionalInterfaceMostSpecificChecker msc = new FunctionalInterfaceMostSpecificChecker(t, s);
                 msc.scan(tree);
                 return msc.result;
             }
@@ -1127,14 +1134,12 @@
 
                 final Type t;
                 final Type s;
-                final Warner warn;
                 boolean result;
 
                 /** Parameters {@code t} and {@code s} are unrelated functional interface types. */
-                FunctionalInterfaceMostSpecificChecker(Type t, Type s, Warner warn) {
+                FunctionalInterfaceMostSpecificChecker(Type t, Type s) {
                     this.t = t;
                     this.s = s;
-                    this.warn = warn;
                     result = true;
                 }
 
@@ -1172,7 +1177,7 @@
                             result &= (retValIsPrimitive == ret_t.isPrimitive()) &&
                                       (retValIsPrimitive != ret_s.isPrimitive());
                         } else {
-                            result &= MostSpecificCheckContext.super.compatible(ret_t, ret_s, warn);
+                            result &= compatibleBySubtyping(ret_t, ret_s);
                         }
                     }
                 }
@@ -1195,7 +1200,7 @@
                             result &= false;
                         } else if (unrelatedFunctionalInterfaces(ret_t, ret_s)) {
                             for (JCExpression expr : lambdaResults(tree)) {
-                                result &= functionalInterfaceMostSpecific(ret_t, ret_s, expr, warn);
+                                result &= functionalInterfaceMostSpecific(ret_t, ret_s, expr);
                             }
                         } else if (ret_t.isPrimitive() != ret_s.isPrimitive()) {
                             for (JCExpression expr : lambdaResults(tree)) {
@@ -1204,7 +1209,7 @@
                                           (retValIsPrimitive != ret_s.isPrimitive());
                             }
                         } else {
-                            result &= MostSpecificCheckContext.super.compatible(ret_t, ret_s, warn);
+                            result &= compatibleBySubtyping(ret_t, ret_s);
                         }
                     }
                 }
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java	Tue Mar 03 08:49:13 2015 -0800
@@ -764,7 +764,7 @@
                 ? typeCast.expr
                 : newExpression;
         }
-        if (originalTarget.isCompound()) {
+        if (originalTarget.isIntersection()) {
             Type.IntersectionClassType ict = (Type.IntersectionClassType)originalTarget;
             for (Type c : ict.getExplicitComponents()) {
                 Type ec = erasure(c);
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java	Tue Mar 03 08:49:13 2015 -0800
@@ -160,7 +160,7 @@
         // if there remain any unimported toplevels (these must have
         // no classes at all), process their import statements as well.
         for (JCCompilationUnit tree : trees) {
-            if (tree.starImportScope.isEmpty()) {
+            if (!tree.starImportScope.isFilled()) {
                 Env<AttrContext> topEnv = enter.topLevelEnv(tree);
                 finishImports(tree, () -> { completeClass.resolveImports(tree, topEnv); });
             }
@@ -280,12 +280,7 @@
 
         Env<AttrContext> env;
         ImportFilter staticImportFilter;
-        ImportFilter typeImportFilter = new ImportFilter() {
-            @Override
-            public boolean accepts(Scope origin, Symbol t) {
-                return t.kind == TYP;
-            }
-        };
+        ImportFilter typeImportFilter;
 
         @Override
         protected void doRunPhase(Env<AttrContext> env) {
@@ -304,26 +299,26 @@
         }
 
         private void resolveImports(JCCompilationUnit tree, Env<AttrContext> env) {
-            if (!tree.starImportScope.isEmpty()) {
+            if (tree.starImportScope.isFilled()) {
                 // we must have already processed this toplevel
                 return;
             }
 
             ImportFilter prevStaticImportFilter = staticImportFilter;
+            ImportFilter prevTypeImportFilter = typeImportFilter;
             DiagnosticPosition prevLintPos = deferredLintHandler.immediate();
             Lint prevLint = chk.setLint(lint);
             Env<AttrContext> prevEnv = this.env;
             try {
                 this.env = env;
                 final PackageSymbol packge = env.toplevel.packge;
-                this.staticImportFilter = new ImportFilter() {
-                    @Override
-                    public boolean accepts(Scope origin, Symbol sym) {
-                        return sym.isStatic() &&
-                               chk.staticImportAccessible(sym, packge) &&
-                               sym.isMemberOf((TypeSymbol) origin.owner, types);
-                    }
-                };
+                this.staticImportFilter =
+                        (origin, sym) -> sym.isStatic() &&
+                                         chk.importAccessible(sym, packge) &&
+                                         sym.isMemberOf((TypeSymbol) origin.owner, types);
+                this.typeImportFilter =
+                        (origin, sym) -> sym.kind == TYP &&
+                                         chk.importAccessible(sym, packge);
 
                 // Import-on-demand java.lang.
                 importAll(tree.pos, syms.enterPackage(names.java_lang), env);
@@ -340,6 +335,7 @@
                 chk.setLint(prevLint);
                 deferredLintHandler.setPos(prevLintPos);
                 this.staticImportFilter = prevStaticImportFilter;
+                this.typeImportFilter = prevTypeImportFilter;
             }
         }
 
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/ct.properties	Mon Feb 23 10:47:32 2015 -0800
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/ct.properties	Tue Mar 03 08:49:13 2015 -0800
@@ -687,7 +687,6 @@
 sun.rmi.transport.*: proprietary compact2
 sun.rmi.transport.proxy.*: proprietary compact2
 sun.rmi.transport.tcp.*: proprietary compact2
-sun.security.acl.*: proprietary compact1
 sun.security.action.*: proprietary compact1
 sun.security.jca.*: proprietary compact1
 sun.security.jgss.*: proprietary compact3
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/legacy.properties	Mon Feb 23 10:47:32 2015 -0800
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/legacy.properties	Tue Mar 03 08:49:13 2015 -0800
@@ -532,7 +532,6 @@
 sun.rmi.transport = tiger legacy
 sun.rmi.transport.proxy = tiger legacy
 sun.rmi.transport.tcp = tiger legacy
-sun.security.acl = tiger legacy
 sun.security.action = tiger legacy
 sun.security.jca = tiger legacy
 sun.security.jgss = tiger legacy
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/RootDocImpl.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/RootDocImpl.java	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -382,8 +382,9 @@
     }
 
     public boolean isFunctionalInterface(AnnotationDesc annotationDesc) {
-        return annotationDesc.annotationType().qualifiedName().equals(
-                env.syms.functionalInterfaceType.toString()) && env.source.allowLambda();
+        return env.source.allowLambda()
+            && annotationDesc.annotationType().qualifiedName().equals(
+                env.syms.functionalInterfaceType.toString());
     }
 
     public boolean showTagMessages() {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/inference/CaptureLowerBound.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,42 @@
+/*
+ * 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 8039214
+ * @summary Capture variable as an inference variable's lower bound
+ * @compile CaptureLowerBound.java
+ */
+
+public class CaptureLowerBound {
+
+    interface I<X1,X2> {}
+    static class C<T> implements I<T,T> {}
+
+    <X> void m(I<? extends X, X> arg) {}
+
+    void test(C<?> arg) {
+      m(arg);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/inference/CaptureLowerBoundNeg.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,19 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8039214
+ * @summary Capture variable as an inference variable's lower bound
+ * @compile/fail/ref=CaptureLowerBoundNeg.out -XDrawDiagnostics CaptureLowerBoundNeg.java
+ */
+
+public class CaptureLowerBoundNeg {
+
+    static class D<T> {
+        void take(T arg) {}
+        static <T> D<T> make(Class<? extends T> c) { return new D<T>(); }
+    }
+
+    void test(Object o) {
+        D.make(o.getClass()).take(o);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/inference/CaptureLowerBoundNeg.out	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,2 @@
+CaptureLowerBoundNeg.java:16:29: compiler.err.cant.apply.symbol: kindname.method, take, compiler.misc.type.captureof: 1, ? extends java.lang.Object, java.lang.Object, kindname.class, CaptureLowerBoundNeg.D<T>, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.lang.Object, compiler.misc.type.captureof: 1, ? extends java.lang.Object))
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/inference/NestedCapture.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,44 @@
+/*
+ * 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 8039214
+ * @summary Capture variable passed through multiple levels of nested inference
+ * @compile NestedCapture.java
+ */
+
+abstract class NestedCapture {
+  interface List<T> {}
+  abstract <T> List<T> copyOf(List<? extends T> lx);
+  abstract <E> List<E> filter(List<E> lx);
+
+  <U> void test1(List<U> lx) {
+    copyOf(filter(lx));
+  }
+
+  void test2(List<?> lx) {
+    copyOf(filter(lx));
+  }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/inference/NestedWildcards.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,44 @@
+/*
+ * 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 8039214
+ * @summary Nested generic methods that work on wildcard-parameterized types
+ * @compile NestedWildcards.java
+ */
+
+public class NestedWildcards {
+
+    public static void test(Box<String> b) {
+        foo(bar(b));
+    }
+    private static <X> Box<? extends X> foo(Box<? extends X> ts) {
+        return null;
+    }
+    public static <Y> Box<? extends Y> bar(Box<? extends Y> language) {
+        return null;
+    }
+
+    interface Box<T> {}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/wildcards/SubtypeCaptureLeak.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,72 @@
+/*
+ * 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 8039214
+ * @summary Capture variables used for subtyping should not leak out of inference
+ * @compile SubtypeCaptureLeak.java
+ */
+
+public class SubtypeCaptureLeak {
+
+    interface Parent<T> {}
+    interface Child<T> extends Parent<T> {}
+    interface Box<T> {}
+    interface SubBox<T> extends Box<T> {}
+
+    // applicability inference
+
+    <T> void m1(Parent<? extends T> arg) {}
+
+    void testApplicable(Child<?> arg) {
+        m1(arg);
+    }
+
+    // applicability inference, nested
+
+    <T> void m2(Box<? extends Parent<? extends T>> arg) {}
+
+    void testApplicable(Box<Child<?>> arg) {
+        m2(arg);
+    }
+
+    // most specific inference
+
+    <T> void m3(Parent<? extends T> arg) {}
+    void m3(Child<?> arg) {}
+
+    void testMostSpecific(Child<?> arg) {
+        m3(arg);
+    }
+
+    // most specific inference, nested
+
+    <T> void m4(Box<? extends Parent<? extends T>> arg) {}
+    void m4(SubBox<Child<?>> arg) {}
+
+    void testMostSpecificNested(SubBox<Child<?>> arg) {
+        m4(arg);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/importscope/ImportInaccessible.java	Tue Mar 03 08:49:13 2015 -0800
@@ -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.
+ */
+
+/**
+ * @test
+ * @bug 8067886
+ * @summary Verify that type import on demand won't put inaccessible types into the Scope
+ * @compile/fail/ref=ImportInaccessible.out -XDrawDiagnostics ImportInaccessible.java
+ */
+package p;
+import p.ImportInaccessible.Nested.*;
+
+class ImportInaccessible {
+    static class Nested<X extends Inner> {
+        private static class Inner{}
+     }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/importscope/ImportInaccessible.out	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,2 @@
+ImportInaccessible.java:34:35: compiler.err.cant.resolve.location: kindname.class, Inner, , , (compiler.misc.location: kindname.class, p.ImportInaccessible, null)
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/multicatch/8071291/T8071291.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 8071291
+ * @summary Compiler crashes trying to cast UnionType to IntersectionClassType
+ * @compile T8071291.java
+ */
+
+class T8071291 {
+
+    interface A { }
+    class Exception1 extends Exception implements A { }
+    class Exception2 extends Exception implements A { }
+
+    void test(boolean cond) {
+        try {
+            if (cond) {
+                throw new Exception1();
+            } else {
+                throw new Exception2();
+            }
+        }
+        catch (Exception1|Exception2 x) {
+            if (x instanceof Exception1) { }
+        }
+    }
+}
--- a/make/MakeHelpers.gmk	Mon Feb 23 10:47:32 2015 -0800
+++ b/make/MakeHelpers.gmk	Tue Mar 03 08:49:13 2015 -0800
@@ -382,7 +382,7 @@
 	    && $(MAKE) $(MAKE_ARGS) \
 	          -f $$($1_FILE_PREFIX)-$2.gmk \
 	          $$(addprefix -I, $$(wildcard $$(addprefix $3/, $(MAKE_MAKEDIR_LIST)) \
-	          $$(addsuffix /$3, $$(addprefix $3/, $(MAKE_MAKEDIR_LIST))))) \
+	          $$(addsuffix /$$($1_MAKE_SUBDIR), $$(addprefix $3/, $(MAKE_MAKEDIR_LIST))))) \
 	          MODULE=$2)
         endif
 
--- a/make/common/CORE_PKGS.gmk	Mon Feb 23 10:47:32 2015 -0800
+++ b/make/common/CORE_PKGS.gmk	Tue Mar 03 08:49:13 2015 -0800
@@ -103,6 +103,7 @@
     java.lang.reflect \
     java.math \
     java.net \
+    java.net.spi \
     java.nio \
     java.nio.channels \
     java.nio.channels.spi \
--- a/make/jprt.properties	Mon Feb 23 10:47:32 2015 -0800
+++ b/make/jprt.properties	Tue Mar 03 08:49:13 2015 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
 # 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,7 +86,8 @@
     --with-output-sync=recurse 						\
     --with-boot-jdk=$ALT_BOOTDIR 					\
     --with-jobs=$ALT_PARALLEL_COMPILE_JOBS 				\
-    ${my.additional.build.configure.args.${jprt.test.set}}
+    ${my.additional.build.configure.args.${jprt.test.set}}		\
+    ${my.custom.build.configure.args}
 
 # i586 is often cross-compiled from 64-bit machines, so need to set target bits explicitly
 jprt.i586.build.configure.args=						\
--- a/nashorn/.hgtags	Mon Feb 23 10:47:32 2015 -0800
+++ b/nashorn/.hgtags	Tue Mar 03 08:49:13 2015 -0800
@@ -285,3 +285,4 @@
 2ae58b5f05f803a469f0f6c1ed72c6b5313f4ff0 jdk9-b49
 32e48a0d59e186df8a041e1e5f8bfb0b8d2bc4cd jdk9-b50
 10b32cc48ccc2592621b28558a1cf70a0ce22fe5 jdk9-b51
+fada76c29db9c792ad7127e674ef5337e15d2225 jdk9-b52
--- a/nashorn/make/BuildNashorn.gmk	Mon Feb 23 10:47:32 2015 -0800
+++ b/nashorn/make/BuildNashorn.gmk	Tue Mar 03 08:49:13 2015 -0800
@@ -44,11 +44,11 @@
   endif
 endif
 
-# Need to use source and target 7 for nasgen to work.
+# Need to use source and target 8 for nasgen to work.
 $(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE_DEBUG, \
     JVM := $(JAVA), \
     JAVAC := $(NEW_JAVAC), \
-    FLAGS := -g -source 7 -target 7 -bootclasspath "$(JDK_CLASSES)", \
+    FLAGS := -g -source 8 -target 8 -bootclasspath "$(JDK_CLASSES)", \
     SERVER_DIR := $(SJAVAC_SERVER_DIR), \
     SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
 
--- a/nashorn/make/nbproject/project.xml	Mon Feb 23 10:47:32 2015 -0800
+++ b/nashorn/make/nbproject/project.xml	Tue Mar 03 08:49:13 2015 -0800
@@ -160,16 +160,16 @@
                 <package-root>../test/src</package-root>
                 <unit-tests/>
                 <classpath mode="compile">../test/lib/testng.jar:../build/classes:../src/jdk.scripting.nashorn/share/classes</classpath>
-                <source-level>1.7</source-level>
+                <source-level>1.8</source-level>
             </compilation-unit>
             <compilation-unit>
                 <package-root>../buildtools/nasgen/src</package-root>
                 <classpath mode="compile">../build/classes:../src</classpath>
-                <source-level>1.7</source-level>
+                <source-level>1.8</source-level>
             </compilation-unit>
             <compilation-unit>
                 <package-root>../src/jdk.scripting.nashorn/share/classes</package-root>
-                <source-level>1.7</source-level>
+                <source-level>1.8</source-level>
             </compilation-unit>
         </java-data>
     </configuration>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/DefaultValueImpl.java	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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 jdk.nashorn.api.scripting;
+
+import jdk.nashorn.internal.runtime.JSType;
+
+/**
+ * Default implementation of {@link JSObject#getDefaultValue(Class)}. Isolated into a separate class mostly so
+ * that we can have private static instances of function name arrays, something we couldn't declare without it
+ * being visible in {@link JSObject} interface.
+ */
+class DefaultValueImpl {
+    private static final String[] DEFAULT_VALUE_FNS_NUMBER = new String[] { "valueOf", "toString" };
+    private static final String[] DEFAULT_VALUE_FNS_STRING = new String[] { "toString", "valueOf" };
+
+    static Object getDefaultValue(final JSObject jsobj, final Class<?> hint) throws UnsupportedOperationException {
+        final boolean isNumber = hint == null || hint == Number.class;
+        for(final String methodName: isNumber ? DEFAULT_VALUE_FNS_NUMBER : DEFAULT_VALUE_FNS_STRING) {
+            final Object objMember = jsobj.getMember(methodName);
+            if (objMember instanceof JSObject) {
+                final JSObject member = (JSObject)objMember;
+                if (member.isFunction()) {
+                    final Object value = member.call(jsobj);
+                    if (JSType.isPrimitive(value)) {
+                        return value;
+                    }
+                }
+            }
+        }
+        throw new UnsupportedOperationException(isNumber ? "cannot.get.default.number" : "cannot.get.default.string");
+    }
+}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/JSObject.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/JSObject.java	Tue Mar 03 08:49:13 2015 -0800
@@ -27,6 +27,7 @@
 
 import java.util.Collection;
 import java.util.Set;
+import jdk.nashorn.internal.runtime.JSType;
 
 /**
  * This interface can be implemented by an arbitrary Java class. Nashorn will
@@ -186,6 +187,22 @@
      * Returns this object's numeric value.
      *
      * @return this object's numeric value.
+     * @deprecated use {@link #getDefaultValue(Class)} with {@link Number} hint instead.
      */
-    public double toNumber();
+    @Deprecated
+    default double toNumber() {
+        return JSType.toNumber(JSType.toPrimitive(this, Number.class));
+    }
+
+    /**
+     * Implements this object's {@code [[DefaultValue]]} method as per ECMAScript 5.1 section 8.6.2.
+     *
+     * @param hint the type hint. Should be either {@code null}, {@code Number.class} or {@code String.class}.
+     * @return this object's default value.
+     * @throws UnsupportedOperationException if the conversion can't be performed. The engine will convert this
+     * exception into a JavaScript {@code TypeError}.
+     */
+    default Object getDefaultValue(final Class<?> hint) throws UnsupportedOperationException {
+        return DefaultValueImpl.getDefaultValue(this, hint);
+    }
 }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptObjectMirror.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptObjectMirror.java	Tue Mar 03 08:49:13 2015 -0800
@@ -46,6 +46,7 @@
 import jdk.nashorn.internal.objects.Global;
 import jdk.nashorn.internal.runtime.ConsString;
 import jdk.nashorn.internal.runtime.Context;
+import jdk.nashorn.internal.runtime.ECMAException;
 import jdk.nashorn.internal.runtime.JSType;
 import jdk.nashorn.internal.runtime.ScriptFunction;
 import jdk.nashorn.internal.runtime.ScriptObject;
@@ -820,4 +821,21 @@
             }
         });
     }
+
+    @Override
+    public Object getDefaultValue(Class<?> hint) {
+        return inGlobal(new Callable<Object>() {
+            @Override public Object call() {
+                try {
+                    return sobj.getDefaultValue(hint);
+                } catch (final ECMAException e) {
+                    // We're catching ECMAException (likely TypeError), and translating it to
+                    // UnsupportedOperationException. This in turn will be translated into TypeError of the
+                    // caller's Global by JSType#toPrimitive(JSObject,Class) therefore ensuring that it's
+                    // recognized as "instanceof TypeError" in the caller.
+                    throw new UnsupportedOperationException(e.getMessage(), e);
+                }
+            }
+        });
+    }
 }
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/AstDeserializer.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/AstDeserializer.java	Tue Mar 03 08:49:13 2015 -0800
@@ -38,7 +38,6 @@
  */
 final class AstDeserializer {
     static FunctionNode deserialize(final byte[] serializedAst) {
-        // FIXME: do we need this doPrivileged block at all?
         return AccessController.doPrivileged(new PrivilegedAction<FunctionNode>() {
             @Override
             public FunctionNode run() {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/JSType.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/JSType.java	Tue Mar 03 08:49:13 2015 -0800
@@ -29,6 +29,7 @@
 import static jdk.nashorn.internal.codegen.ObjectClassGenerator.OBJECT_FIELDS_ONLY;
 import static jdk.nashorn.internal.lookup.Lookup.MH;
 import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
+
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
 import java.lang.reflect.Array;
@@ -210,7 +211,6 @@
     /** Method handle for void returns. */
     public static final Call VOID_RETURN = staticCall(JSTYPE_LOOKUP, JSType.class, "voidReturn", void.class);
 
-
     /**
      * The list of available accessor types in width order. This order is used for type guesses narrow{@literal ->} wide
      *  in the dual--fields world
@@ -480,17 +480,47 @@
      * @return the primitive form of the object
      */
     public static Object toPrimitive(final Object obj, final Class<?> hint) {
-        return obj instanceof ScriptObject ? toPrimitive((ScriptObject)obj, hint) : obj;
+        if (obj instanceof ScriptObject) {
+            return toPrimitive((ScriptObject)obj, hint);
+        } else if (isPrimitive(obj)) {
+            return obj;
+        } else if (obj instanceof JSObject) {
+            return toPrimitive((JSObject)obj, hint);
+        } else if (obj instanceof StaticClass) {
+            final String name = ((StaticClass)obj).getRepresentedClass().getName();
+            return new StringBuilder(12 + name.length()).append("[JavaClass ").append(name).append(']').toString();
+        }
+        return obj.toString();
     }
 
     private static Object toPrimitive(final ScriptObject sobj, final Class<?> hint) {
-        final Object result = sobj.getDefaultValue(hint);
+        return requirePrimitive(sobj.getDefaultValue(hint));
+    }
 
+    private static Object requirePrimitive(final Object result) {
         if (!isPrimitive(result)) {
             throw typeError("bad.default.value", result.toString());
         }
+        return result;
+    }
 
-        return result;
+    /**
+     * Primitive converter for a {@link JSObject} including type hint. Invokes
+     * {@link JSObject#getDefaultValue(Class)} and translates any thrown {@link UnsupportedOperationException}
+     * to a ECMAScript {@code TypeError}.
+     * See ECMA 9.1 ToPrimitive
+     *
+     * @param jsobj  a JSObject
+     * @param hint a type hint
+     *
+     * @return the primitive form of the JSObject
+     */
+    public static Object toPrimitive(final JSObject jsobj, final Class<?> hint) {
+        try {
+            return requirePrimitive(jsobj.getDefaultValue(hint));
+        } catch (final UnsupportedOperationException e) {
+            throw new ECMAException(Context.getGlobal().newTypeError(e.getMessage()), e);
+        }
     }
 
     /**
@@ -725,6 +755,18 @@
 
 
     /**
+     * JavaScript compliant conversion of Boolean to number
+     * See ECMA 9.3 ToNumber
+     *
+     * @param b a boolean
+     *
+     * @return JS numeric value of the boolean: 1.0 or 0.0
+     */
+    public static double toNumber(final Boolean b) {
+        return b ? 1d : +0d;
+    }
+
+    /**
      * JavaScript compliant conversion of Object to number
      * See ECMA 9.3 ToNumber
      *
@@ -1301,6 +1343,10 @@
             return (String)obj;
         }
 
+        if (obj instanceof ConsString) {
+            return obj.toString();
+        }
+
         if (obj instanceof Number) {
             return toString(((Number)obj).doubleValue());
         }
@@ -1313,23 +1359,19 @@
             return "null";
         }
 
-        if (obj instanceof ScriptObject) {
-            if (safe) {
-                final ScriptObject sobj = (ScriptObject)obj;
-                final Global gobj = Context.getGlobal();
-                return gobj.isError(sobj) ?
-                    ECMAException.safeToString(sobj) :
-                    sobj.safeToString();
-            }
-
-            return toString(toPrimitive(obj, String.class));
+        if (obj instanceof Boolean) {
+            return obj.toString();
         }
 
-        if (obj instanceof StaticClass) {
-            return "[JavaClass " + ((StaticClass)obj).getRepresentedClass().getName() + "]";
+        if (safe && obj instanceof ScriptObject) {
+            final ScriptObject sobj = (ScriptObject)obj;
+            final Global gobj = Context.getGlobal();
+            return gobj.isError(sobj) ?
+                ECMAException.safeToString(sobj) :
+                sobj.safeToString();
         }
 
-        return obj.toString();
+        return toString(toPrimitive(obj, String.class));
     }
 
     // trim from left for JS whitespaces.
@@ -1822,18 +1864,18 @@
         }
 
         if (obj instanceof Boolean) {
-            return (Boolean)obj ? 1 : +0.0;
+            return toNumber((Boolean)obj);
         }
 
         if (obj instanceof ScriptObject) {
             return toNumber((ScriptObject)obj);
         }
 
-        if (obj instanceof JSObject) {
-            return ((JSObject)obj).toNumber();
+        if (obj instanceof Undefined) {
+            return Double.NaN;
         }
 
-        return Double.NaN;
+        return toNumber(toPrimitive(obj, Number.class));
     }
 
     private static Object invoke(final MethodHandle mh, final Object arg) {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptRuntime.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptRuntime.java	Tue Mar 03 08:49:13 2015 -0800
@@ -32,6 +32,7 @@
 import static jdk.nashorn.internal.runtime.ECMAErrors.syntaxError;
 import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
 import static jdk.nashorn.internal.runtime.JSType.isRepresentableAsInt;
+
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.SwitchPoint;
@@ -720,7 +721,7 @@
             return true;
         }
         if (x instanceof ScriptObject && y instanceof ScriptObject) {
-            return x == y;
+            return false; // x != y
         }
         if (x instanceof ScriptObjectMirror || y instanceof ScriptObjectMirror) {
             return ScriptObjectMirror.identical(x, y);
@@ -784,37 +785,55 @@
      * @return true if they're equal
      */
     private static boolean equalDifferentTypeValues(final Object x, final Object y, final JSType xType, final JSType yType) {
-        if (xType == JSType.UNDEFINED && yType == JSType.NULL || xType == JSType.NULL && yType == JSType.UNDEFINED) {
+        if (isUndefinedAndNull(xType, yType) || isUndefinedAndNull(yType, xType)) {
             return true;
-        }
-
-        if (xType == JSType.NUMBER && yType == JSType.STRING) {
-            return equals(x, JSType.toNumber(y));
-        }
-
-        if (xType == JSType.STRING && yType == JSType.NUMBER) {
-            return equals(JSType.toNumber(x), y);
-        }
-
-        if (xType == JSType.BOOLEAN) {
-            return equals(JSType.toNumber(x), y);
-        }
-
-        if (yType == JSType.BOOLEAN) {
-            return equals(x, JSType.toNumber(y));
-        }
-
-        if ((xType == JSType.STRING || xType == JSType.NUMBER) && y instanceof ScriptObject)  {
-            return equals(x, JSType.toPrimitive(y));
-        }
-
-        if (x instanceof ScriptObject && (yType == JSType.STRING || yType == JSType.NUMBER)) {
-            return equals(JSType.toPrimitive(x), y);
+        } else if (isNumberAndString(xType, yType)) {
+            return equalNumberToString(x, y);
+        } else if (isNumberAndString(yType, xType)) {
+            // Can reverse order as both are primitives
+            return equalNumberToString(y, x);
+        } else if (xType == JSType.BOOLEAN) {
+            return equalBooleanToAny(x, y);
+        } else if (yType == JSType.BOOLEAN) {
+            // Can reverse order as y is primitive
+            return equalBooleanToAny(y, x);
+        } else if (isNumberOrStringAndObject(xType, yType)) {
+            return equalNumberOrStringToObject(x, y);
+        } else if (isNumberOrStringAndObject(yType, xType)) {
+            // Can reverse order as y is primitive
+            return equalNumberOrStringToObject(y, x);
         }
 
         return false;
     }
 
+    private static boolean isUndefinedAndNull(final JSType xType, final JSType yType) {
+        return xType == JSType.UNDEFINED && yType == JSType.NULL;
+    }
+
+    private static boolean isNumberAndString(final JSType xType, final JSType yType) {
+        return xType == JSType.NUMBER && yType == JSType.STRING;
+    }
+
+    private static boolean isNumberOrStringAndObject(final JSType xType, final JSType yType) {
+        return (xType == JSType.NUMBER || xType == JSType.STRING) && yType == JSType.OBJECT;
+    }
+
+    private static boolean equalNumberToString(final Object num, final Object str) {
+        // Specification says comparing a number to string should be done as "equals(num, JSType.toNumber(str))". We
+        // can short circuit it to this as we know that "num" is a number, so it'll end up being a number-number
+        // comparison.
+        return ((Number)num).doubleValue() == JSType.toNumber(str.toString());
+    }
+
+    private static boolean equalBooleanToAny(final Object bool, final Object any) {
+        return equals(JSType.toNumber((Boolean)bool), any);
+    }
+
+    private static boolean equalNumberOrStringToObject(final Object numOrStr, final Object any) {
+        return equals(numOrStr, JSType.toPrimitive(any));
+    }
+
     /**
      * ECMA 11.9.4 - The strict equal operator (===) - generic implementation
      *
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JSObjectLinker.java	Mon Feb 23 10:47:32 2015 -0800
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JSObjectLinker.java	Tue Mar 03 08:49:13 2015 -0800
@@ -27,14 +27,10 @@
 
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
-import java.lang.invoke.MethodType;
-import java.util.HashMap;
 import java.util.Map;
 import javax.script.Bindings;
 import jdk.internal.dynalink.CallSiteDescriptor;
 import jdk.internal.dynalink.linker.GuardedInvocation;
-import jdk.internal.dynalink.linker.GuardedTypeConversion;
-import jdk.internal.dynalink.linker.GuardingTypeConverterFactory;
 import jdk.internal.dynalink.linker.LinkRequest;
 import jdk.internal.dynalink.linker.LinkerServices;
 import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker;
@@ -49,7 +45,7 @@
  * A Dynalink linker to handle web browser built-in JS (DOM etc.) objects as well
  * as ScriptObjects from other Nashorn contexts.
  */
-final class JSObjectLinker implements TypeBasedGuardingDynamicLinker, GuardingTypeConverterFactory {
+final class JSObjectLinker implements TypeBasedGuardingDynamicLinker {
     private final NashornBeansLinker nashornBeansLinker;
 
     JSObjectLinker(final NashornBeansLinker nashornBeansLinker) {
@@ -95,22 +91,6 @@
         return Bootstrap.asTypeSafeReturn(inv, linkerServices, desc);
     }
 
-    @Override
-    public GuardedTypeConversion convertToType(final Class<?> sourceType, final Class<?> targetType) throws Exception {
-        final boolean sourceIsAlwaysJSObject = JSObject.class.isAssignableFrom(sourceType);
-        if(!sourceIsAlwaysJSObject && !sourceType.isAssignableFrom(JSObject.class)) {
-            return null;
-        }
-
-        final MethodHandle converter = CONVERTERS.get(targetType);
-        if(converter == null) {
-            return null;
-        }
-
-        return new GuardedTypeConversion(new GuardedInvocation(converter, sourceIsAlwaysJSObject ? null : IS_JSOBJECT_GUARD).asType(MethodType.methodType(targetType, sourceType)), true);
-    }
-
-
     private GuardedInvocation lookup(final CallSiteDescriptor desc, final LinkRequest request, final LinkerServices linkerServices) throws Exception {
         final String operator = CallSiteDescriptorFactory.tokenizeOperators(desc).get(0);
         final int c = desc.getNameTokenCount();
@@ -208,25 +188,6 @@
         }
     }
 
-    @SuppressWarnings("unused")
-    private static int toInt32(final JSObject obj) {
-        return JSType.toInt32(toNumber(obj));
-    }
-
-    @SuppressWarnings("unused")
-    private static long toLong(final JSObject obj) {
-        return JSType.toLong(toNumber(obj));
-    }
-
-    private static double toNumber(final JSObject obj) {
-        return obj == null ? 0 : obj.toNumber();
-    }
-
-    @SuppressWarnings("unused")
-    private static boolean toBoolean(final JSObject obj) {
-        return obj != null;
-    }
-
     private static int getIndex(final Number n) {
         final double value = n.doubleValue();
         return JSType.isRepresentableAsInt(value) ? (int)value : -1;
@@ -261,14 +222,6 @@
     private static final MethodHandle JSOBJECT_CALL_TO_APPLY = findOwnMH_S("callToApply", Object.class, MethodHandle.class, JSObject.class, Object.class, Object[].class);
     private static final MethodHandle JSOBJECT_NEW           = findJSObjectMH_V("newObject", Object.class, Object[].class);
 
-    private static final Map<Class<?>, MethodHandle> CONVERTERS = new HashMap<>();
-    static {
-        CONVERTERS.put(boolean.class, findOwnMH_S("toBoolean", boolean.class, JSObject.class));
-        CONVERTERS.put(int.class,     findOwnMH_S("toInt32", int.class, JSObject.class));
-        CONVERTERS.put(long.class,    findOwnMH_S("toLong", long.class, JSObject.class));
-        CONVERTERS.put(double.class,  findOwnMH_S("toNumber", double.class, JSObject.class));
-    }
-
     private static MethodHandle findJSObjectMH_V(final String name, final Class<?> rtype, final Class<?>... types) {
         return MH.findVirtual(MethodHandles.lookup(), JSObject.class, name, MH.type(rtype, types));
     }
--- a/nashorn/test/script/basic/JDK-8023026.js.EXPECTED	Mon Feb 23 10:47:32 2015 -0800
+++ b/nashorn/test/script/basic/JDK-8023026.js.EXPECTED	Tue Mar 03 08:49:13 2015 -0800
@@ -26,7 +26,7 @@
 reduceRight 15 1
 right sum 16
 squared 1,9,25,49
-iterating on [object Array]
+iterating on 2,4,6,8
 forEach 2
 forEach 4
 forEach 6
--- a/nashorn/test/script/basic/JDK-8024847.js	Mon Feb 23 10:47:32 2015 -0800
+++ b/nashorn/test/script/basic/JDK-8024847.js	Tue Mar 03 08:49:13 2015 -0800
@@ -102,7 +102,18 @@
 print(jlist);
 
 var obj = new JSObject() {
-    toNumber: function() { return 42; }
+    getMember: function(name) {
+        if (name == "valueOf") {
+            return new JSObject() {
+                isFunction: function() {
+                    return true;
+                },
+                call: function(thiz) {
+                    return 42;
+                }
+            };
+        }
+    }
 };
 
 print(32 + obj);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8072426.js	Tue Mar 03 08:49:13 2015 -0800
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
+ * 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-8072426: Can't compare Java objects to strings or numbers
+ *
+ * @test
+ * @run
+ */
+
+Assert.assertTrue(java.math.RoundingMode.UP == "UP");
+
+var JSObject = Java.type("jdk.nashorn.api.scripting.JSObject");
+
+// Adds an "isFunction" member to the JSObject that returns the specified value
+function addIsFunction(isFunction, obj) {
+    obj.isFunction = function() {
+        return isFunction;
+    };
+    return obj;
+}
+
+function makeJSObjectConstantFunction(value) {
+    return new JSObject(addIsFunction(true, {
+        call: function() {
+            return value;
+        }
+    }));
+}
+
+function makeJSObjectWithMembers(mapping) {
+    return new JSObject({
+        getMember: function(name) {
+            Assert.assertTrue(mapping.hasOwnProperty(name));
+            return mapping[name];
+        },
+        toNumber: function() {
+            // toNumber no longer invoked
+            Assert.fail();
+        }
+    });
+}
+
+// Test JSObjectLinker toInt32/toLong/toNumber
+function testNumericJSObject(kind, value) {
+    var obj = makeJSObjectWithMembers({
+            valueOf: makeJSObjectConstantFunction(value)
+        });
+
+    if (kind === "double") {
+        // There's no assertEquals(double actual, double expected). There's only
+        // assertEquals(double actual, double expected, double delta).
+        Assert["assertEquals(double,double,double)"](value, obj, 0);
+    } else {
+        Assert["assertEquals(" + kind + ", " + kind + ")"](value, obj);
+    }
+    Assert.assertTrue(value == Number(obj));
+}
+testNumericJSObject("int", 42);
+testNumericJSObject("long", 4294967296);
+testNumericJSObject("double", 1.2);
+
+// Test fallback from toNumber to toString for numeric conversion when toNumber doesn't exist
+(function() {
+    var obj = makeJSObjectWithMembers({
+        valueOf:  null, // Explicitly no valueOf
+        toString: makeJSObjectConstantFunction("123")
+    });
+    Assert["assertEquals(int,int)"](123, obj);
+})();
+
+// Test fallback from toNumber to toString for numeric conversion when toNumber isn't a callable
+(function() {
+    var obj = makeJSObjectWithMembers({
+        valueOf:  new JSObject(addIsFunction(false, {})),
+        toString: makeJSObjectConstantFunction("124")
+    });
+    Assert["assertEquals(int,int)"](124, obj);
+})();
+
+// Test fallback from toNumber to toString for numeric conversion when toNumber returns a non-primitive
+(function() {
+    var obj = makeJSObjectWithMembers({
+        valueOf:  makeJSObjectConstantFunction({}),
+        toString: makeJSObjectConstantFunction("125")
+    });
+    Assert["assertEquals(int,int)"](125, obj);
+})();
+
+// Test TypeError from toNumber to toString when both return a non-primitive
+(function() {
+    var obj = makeJSObjectWithMembers({
+        valueOf:  makeJSObjectConstantFunction({}),
+        toString: makeJSObjectConstantFunction({})
+    });
+    try {
+        Number(obj);
+        Assert.fail(); // must throw
+    } catch(e) {
+        Assert.assertTrue(e instanceof TypeError); 
+    }
+})();
+
+// Test toString for string conversion
+(function() {
+    var obj = makeJSObjectWithMembers({
+        toString: makeJSObjectConstantFunction("Hello")
+    });
+    Assert.assertTrue("Hello" === String(obj));
+    Assert["assertEquals(String,String)"]("Hello", obj);
+})();
+
+// Test fallback from toString to valueOf for string conversion when toString doesn't exist
+(function() {
+    var obj = makeJSObjectWithMembers({
+        toString: null,
+        valueOf:  makeJSObjectConstantFunction("Hello1")
+    });
+    Assert.assertTrue("Hello1" === String(obj));
+    Assert["assertEquals(String,String)"]("Hello1", obj);
+})();
+
+// Test fallback from toString to valueOf for string conversion when toString is not callable
+(function() {
+    var obj = makeJSObjectWithMembers({
+        toString: new JSObject(addIsFunction(false, {})),
+        valueOf:  makeJSObjectConstantFunction("Hello2")
+    });
+    Assert["assertEquals(String,String)"]("Hello2", obj);
+})();
+
+// Test fallback from toString to valueOf for string conversion when toString returns non-primitive
+(function() {
+    var obj = makeJSObjectWithMembers({
+        toString: makeJSObjectConstantFunction({}),
+        valueOf:  makeJSObjectConstantFunction("Hello3")
+    });
+    Assert["assertEquals(String,String)"]("Hello3", obj);
+})();
+
+// Test toBoolean for JSObject
+(function() {
+    Assert["assertEquals(boolean,boolean)"](true, new JSObject({}));
+})();