Merge
authorprr
Mon, 14 Nov 2016 09:03:07 -0800
changeset 42215 4efb5b19587b
parent 42214 03df10115c63 (current diff)
parent 41972 7a6bbc72b32d (diff)
child 42216 621af0ebf6c4
Merge
jdk/src/java.base/unix/native/libjli/ergo.c
jdk/src/java.base/unix/native/libjli/ergo.h
jdk/src/java.base/unix/native/libjli/ergo_i586.c
jdk/test/sun/net/www/http/HttpClient/RetryPost.sh
--- a/jdk/.hgtags	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/.hgtags	Mon Nov 14 09:03:07 2016 -0800
@@ -386,3 +386,4 @@
 8d752af5f61d41f226adf2cda72a20faa9ad620a jdk-9+141
 6ce43dd8e954b452f330dd7a412df5107f7e1923 jdk-9+142
 8dbc8594f9d5149bf1c22221272284609408227a jdk-9+143
+efa71dc820eb8bd5a6c9f2f66f39c383ac3ee99d jdk-9+144
--- a/jdk/make/launcher/Launcher-jdk.compiler.gmk	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/make/launcher/Launcher-jdk.compiler.gmk	Mon Nov 14 09:03:07 2016 -0800
@@ -28,14 +28,12 @@
 $(eval $(call SetupBuildLauncher, javac, \
    MAIN_CLASS := com.sun.tools.javac.Main, \
    JAVA_ARGS := --add-modules ALL-DEFAULT, \
-   CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
-        -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
+   CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
 ))
 
 $(eval $(call SetupBuildLauncher, javah, \
     MAIN_CLASS := com.sun.tools.javah.Main, \
-    CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
-        -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
+    CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
 ))
 
 $(eval $(call SetupBuildLauncher, serialver, \
@@ -48,8 +46,7 @@
   # into any real images
   $(eval $(call SetupBuildLauncher, sjavac, \
       MAIN_CLASS := com.sun.tools.sjavac.Main, \
-      CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
-          -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
+      CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
       OUTPUT_DIR := $(JDK_OUTPUTDIR)/bin, \
   ))
 endif
--- a/jdk/make/launcher/Launcher-jdk.javadoc.gmk	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/make/launcher/Launcher-jdk.javadoc.gmk	Mon Nov 14 09:03:07 2016 -0800
@@ -28,6 +28,5 @@
 $(eval $(call SetupBuildLauncher, javadoc, \
     MAIN_CLASS := jdk.javadoc.internal.tool.Main, \
     JAVA_ARGS := --add-modules ALL-DEFAULT, \
-    CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
-        -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
+    CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
 ))
--- a/jdk/make/launcher/Launcher-jdk.jdeps.gmk	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/make/launcher/Launcher-jdk.jdeps.gmk	Mon Nov 14 09:03:07 2016 -0800
@@ -27,18 +27,15 @@
 
 $(eval $(call SetupBuildLauncher, javap, \
     MAIN_CLASS := com.sun.tools.javap.Main, \
-    CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
-        -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
+    CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
 ))
 
 $(eval $(call SetupBuildLauncher, jdeps, \
     MAIN_CLASS := com.sun.tools.jdeps.Main, \
-    CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
-        -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
+    CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
 ))
 
 $(eval $(call SetupBuildLauncher, jdeprscan, \
     MAIN_CLASS := com.sun.tools.jdeprscan.Main, \
-    CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
-        -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
+    CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
 ))
--- a/jdk/make/launcher/Launcher-jdk.jlink.gmk	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/make/launcher/Launcher-jdk.jlink.gmk	Mon Nov 14 09:03:07 2016 -0800
@@ -34,13 +34,11 @@
     MAIN_CLASS := jdk.tools.jlink.internal.Main, \
     JAVA_ARGS :=  --add-modules ALL-DEFAULT, \
     CFLAGS := -DENABLE_ARG_FILES \
-        -DEXPAND_CLASSPATH_WILDCARDS \
-        -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
+        -DEXPAND_CLASSPATH_WILDCARDS, \
 ))
 
 $(eval $(call SetupBuildLauncher, jmod,\
     MAIN_CLASS := jdk.tools.jmod.Main, \
     CFLAGS := -DENABLE_ARG_FILES \
-        -DEXPAND_CLASSPATH_WILDCARDS \
-        -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
+        -DEXPAND_CLASSPATH_WILDCARDS, \
 ))
--- a/jdk/make/launcher/Launcher-jdk.jshell.gmk	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/make/launcher/Launcher-jdk.jshell.gmk	Mon Nov 14 09:03:07 2016 -0800
@@ -27,6 +27,5 @@
 
 $(eval $(call SetupBuildLauncher, jshell, \
     MAIN_CLASS := jdk.internal.jshell.tool.JShellTool, \
-    CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
-        -DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
+    CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
 ))
--- a/jdk/make/mapfiles/libjava/mapfile-vers	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/make/mapfiles/libjava/mapfile-vers	Mon Nov 14 09:03:07 2016 -0800
@@ -77,13 +77,13 @@
 		Java_java_io_FileDescriptor_initIDs;
 		Java_java_io_FileDescriptor_sync;
 		Java_java_io_FileDescriptor_getAppend;
-		Java_java_io_FileInputStream_available;
+		Java_java_io_FileInputStream_available0;
 		Java_java_io_FileInputStream_close0;
 		Java_java_io_FileInputStream_initIDs;
 		Java_java_io_FileInputStream_open0;
 		Java_java_io_FileInputStream_read0;
 		Java_java_io_FileInputStream_readBytes;
-		Java_java_io_FileInputStream_skip;
+		Java_java_io_FileInputStream_skip0;
 		Java_java_io_FileOutputStream_close0;
 		Java_java_io_FileOutputStream_initIDs;
 		Java_java_io_FileOutputStream_open0;
--- a/jdk/make/mapfiles/libjava/reorder-sparc	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/make/mapfiles/libjava/reorder-sparc	Mon Nov 14 09:03:07 2016 -0800
@@ -44,7 +44,7 @@
 text: .text%fileOpen;
 text: .text%Java_java_io_FileInputStream_readBytes;
 text: .text%readBytes;
-text: .text%Java_java_io_FileInputStream_available;
+text: .text%Java_java_io_FileInputStream_available0;
 text: .text%Java_java_io_FileInputStream_close0;
 text: .text%Java_java_lang_System_mapLibraryName;
 text: .text%Java_java_io_UnixFileSystem_getBooleanAttributes0;
--- a/jdk/make/mapfiles/libjava/reorder-sparcv9	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/make/mapfiles/libjava/reorder-sparcv9	Mon Nov 14 09:03:07 2016 -0800
@@ -48,7 +48,7 @@
 text: .text%fileOpen;
 text: .text%Java_java_io_FileInputStream_readBytes;
 text: .text%readBytes;
-text: .text%Java_java_io_FileInputStream_available;
+text: .text%Java_java_io_FileInputStream_available0;
 text: .text%Java_java_io_FileInputStream_close0;
 text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2;
 text: .text%Java_java_io_UnixFileSystem_list;
--- a/jdk/make/mapfiles/libjava/reorder-x86	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/make/mapfiles/libjava/reorder-x86	Mon Nov 14 09:03:07 2016 -0800
@@ -76,7 +76,7 @@
 text: .text%JNU_GetEnv;
 text: .text%Java_java_io_UnixFileSystem_checkAccess;
 text: .text%Java_sun_reflect_NativeMethodAccessorImpl_invoke0;
-text: .text%Java_java_io_FileInputStream_available;
+text: .text%Java_java_io_FileInputStream_available0;
 text: .text%Java_java_lang_reflect_Array_newArray;
 text: .text%Java_java_lang_StackTraceElement_initStackTraceElements;
 text: .text%Java_java_lang_System_identityHashCode;
--- a/jdk/src/java.base/macosx/conf/x86_64/jvm.cfg	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/macosx/conf/x86_64/jvm.cfg	Mon Nov 14 09:03:07 2016 -0800
@@ -23,7 +23,7 @@
 #
 # 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
+# NOTE that 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
--- a/jdk/src/java.base/macosx/native/libjli/java_md_macosx.c	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/macosx/native/libjli/java_md_macosx.c	Mon Nov 14 09:03:07 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -922,11 +922,6 @@
    /* Linux only */
 }
 
-jboolean
-ServerClassMachine(void) {
-    return JNI_TRUE;
-}
-
 static JavaVM* jvmInstance = NULL;
 static jboolean sameThread = JNI_FALSE; /* start VM in current thread */
 
--- a/jdk/src/java.base/share/classes/java/io/FileInputStream.java	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/share/classes/java/io/FileInputStream.java	Mon Nov 14 09:03:07 2016 -0800
@@ -280,7 +280,11 @@
      * @exception  IOException  if n is negative, if the stream does not
      *             support seek, or if an I/O error occurs.
      */
-    public native long skip(long n) throws IOException;
+    public long skip(long n) throws IOException {
+        return skip0(n);
+    }
+
+    private native long skip0(long n) throws IOException;
 
     /**
      * Returns an estimate of the number of remaining bytes that can be read (or
@@ -299,7 +303,11 @@
      * @exception  IOException  if this file input stream has been closed by calling
      *             {@code close} or an I/O error occurs.
      */
-    public native int available() throws IOException;
+    public int available() throws IOException {
+        return available0();
+    }
+
+    private native int available0() throws IOException;
 
     /**
      * Closes this file input stream and releases any system resources
--- a/jdk/src/java.base/share/classes/java/net/NetworkInterface.java	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/share/classes/java/net/NetworkInterface.java	Mon Nov 14 09:03:07 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -335,15 +335,19 @@
      * {@link #getInetAddresses()} to obtain all IP addresses for this node
      *
      * @return an Enumeration of NetworkInterfaces found on this machine
-     * @exception  SocketException  if an I/O error occurs.
+     * @exception  SocketException  if an I/O error occurs,
+     *             or if the platform does not have at least one configured
+     *             network interface.
      * @see #networkInterfaces()
      */
     public static Enumeration<NetworkInterface> getNetworkInterfaces()
         throws SocketException {
         NetworkInterface[] netifs = getAll();
-        assert netifs != null && netifs.length > 0;
-
-        return enumerationFromArray(netifs);
+        if (netifs != null && netifs.length > 0) {
+            return enumerationFromArray(netifs);
+        } else {
+            throw new SocketException("No network interfaces configured");
+        }
     }
 
     /**
@@ -361,15 +365,19 @@
      * }</pre>
      *
      * @return a Stream of NetworkInterfaces found on this machine
-     * @exception  SocketException  if an I/O error occurs.
+     * @exception  SocketException  if an I/O error occurs,
+     *             or if the platform does not have at least one configured
+     *             network interface.
      * @since 9
      */
     public static Stream<NetworkInterface> networkInterfaces()
         throws SocketException {
         NetworkInterface[] netifs = getAll();
-        assert netifs != null && netifs.length > 0;
-
-        return streamFromArray(netifs);
+        if (netifs != null && netifs.length > 0) {
+            return streamFromArray(netifs);
+        }  else {
+            throw new SocketException("No network interfaces configured");
+        }
     }
 
     private static <T> Enumeration<T> enumerationFromArray(T[] a) {
--- a/jdk/src/java.base/share/classes/java/util/Optional.java	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/share/classes/java/util/Optional.java	Mon Nov 14 09:03:07 2016 -0800
@@ -214,20 +214,20 @@
      * @apiNote
      * This method supports post-processing on {@code Optional} values, without
      * the need to explicitly check for a return status.  For example, the
-     * following code traverses a stream of file names, selects one that has not
-     * yet been processed, and then opens that file, returning an
-     * {@code Optional<FileInputStream>}:
+     * following code traverses a stream of URIs, selects one that has not
+     * yet been processed, and creates a path from that URI, returning
+     * an {@code Optional<Path>}:
      *
      * <pre>{@code
-     *     Optional<FileInputStream> fis =
-     *         names.stream().filter(name -> !isProcessedYet(name))
+     *     Optional<Path> p =
+     *         uris.stream().filter(uri -> !isProcessedYet(uri))
      *                       .findFirst()
-     *                       .map(name -> new FileInputStream(name));
+     *                       .map(Paths::get);
      * }</pre>
      *
-     * Here, {@code findFirst} returns an {@code Optional<String>}, and then
-     * {@code map} returns an {@code Optional<FileInputStream>} for the desired
-     * file if one exists.
+     * Here, {@code findFirst} returns an {@code Optional<URI>}, and then
+     * {@code map} returns an {@code Optional<Path>} for the desired
+     * URI if one exists.
      *
      * @param mapper the mapping function to apply to a value, if present
      * @param <U> The type of the value returned from the mapping function
--- a/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java	Mon Nov 14 09:03:07 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -139,8 +139,7 @@
      *    line entirely.
      */
     static void showSettings(boolean printToStderr, String optionFlag,
-            long initialHeapSize, long maxHeapSize, long stackSize,
-            boolean isServer) {
+            long initialHeapSize, long maxHeapSize, long stackSize) {
 
         initOutput(printToStderr);
         String opts[] = optionFlag.split(":");
@@ -149,8 +148,7 @@
                 : "all";
         switch (optStr) {
             case "vm":
-                printVmSettings(initialHeapSize, maxHeapSize,
-                                stackSize, isServer);
+                printVmSettings(initialHeapSize, maxHeapSize, stackSize);
                 break;
             case "properties":
                 printProperties();
@@ -159,8 +157,7 @@
                 printLocale();
                 break;
             default:
-                printVmSettings(initialHeapSize, maxHeapSize, stackSize,
-                                isServer);
+                printVmSettings(initialHeapSize, maxHeapSize, stackSize);
                 printProperties();
                 printLocale();
                 break;
@@ -172,7 +169,7 @@
      */
     private static void printVmSettings(
             long initialHeapSize, long maxHeapSize,
-            long stackSize, boolean isServer) {
+            long stackSize) {
 
         ostream.println(VM_SETTINGS);
         if (stackSize != 0L) {
@@ -190,8 +187,6 @@
             ostream.println(INDENT + "Max. Heap Size (Estimated): "
                     + SizePrefix.scaleValue(Runtime.getRuntime().maxMemory()));
         }
-        ostream.println(INDENT + "Ergonomics Machine Class: "
-                + ((isServer) ? "server" : "client"));
         ostream.println(INDENT + "Using VM: "
                 + System.getProperty("java.vm.name"));
         ostream.println();
@@ -379,18 +374,6 @@
     }
 
     /**
-     * Appends the vm Ergo message to the header, already created.
-     * initHelpSystem must be called before using this method.
-     */
-    static void appendVmErgoMessage(boolean isServerClass, String vm) {
-        outBuf = outBuf.append(getLocalizedMessage("java.launcher.ergo.message1",
-                vm));
-        outBuf = (isServerClass) ? outBuf.append(",\n")
-                .append(getLocalizedMessage("java.launcher.ergo.message2"))
-                .append("\n\n") : outBuf.append(".\n\n");
-    }
-
-    /**
      * Appends the last invariant part to the previously created messages,
      * and finishes up the printing to the desired output stream.
      * initHelpSystem must be called before using this method.
--- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher.properties	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher.properties	Mon Nov 14 09:03:07 2016 -0800
@@ -35,9 +35,6 @@
 java.launcher.opt.vmselect   =\    {0}\t  to select the "{1}" VM\n
 java.launcher.opt.hotspot    =\    {0}\t  is a synonym for the "{1}" VM  [deprecated]\n
 
-java.launcher.ergo.message1  =\                  The default VM is {0}
-java.launcher.ergo.message2  =\                  because you are running on a server-class machine.\n
-
 # Translators please note do not translate the options themselves
 java.launcher.opt.footer     =\    -cp <class search path of directories and zip/jar files>\n\
 \    -classpath <class search path of directories and zip/jar files>\n\
--- a/jdk/src/java.base/share/native/launcher/defines.h	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/share/native/launcher/defines.h	Mon Nov 14 09:03:07 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -70,14 +70,6 @@
 static const jboolean const_cpwildcard = JNI_FALSE;
 #endif /* EXPAND_CLASSPATH_WILDCARDS */
 
-#if defined(NEVER_ACT_AS_SERVER_CLASS_MACHINE)
-static const jint const_ergo_class = NEVER_SERVER_CLASS;
-#elif defined(ALWAYS_ACT_AS_SERVER_CLASS_MACHINE)
-static const jint const_ergo_class = ALWAYS_SERVER_CLASS;
-#else
-static const jint const_ergo_class = DEFAULT_POLICY;
-#endif /* NEVER_ACT_AS_SERVER_CLASS_MACHINE */
-
 #ifdef ENABLE_ARG_FILES
 static const jboolean const_disable_argfile = JNI_FALSE;
 #else
--- a/jdk/src/java.base/share/native/launcher/main.c	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/share/native/launcher/main.c	Mon Nov 14 09:03:07 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -156,5 +156,5 @@
                    (const_progname != NULL) ? const_progname : *margv,
                    (const_launcher != NULL) ? const_launcher : *margv,
                    HAS_JAVA_ARGS,
-                   const_cpwildcard, const_javaw, const_ergo_class);
+                   const_cpwildcard, const_javaw, 0);
 }
--- a/jdk/src/java.base/share/native/libjava/FileInputStream.c	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/share/native/libjava/FileInputStream.c	Mon Nov 14 09:03:07 2016 -0800
@@ -73,7 +73,7 @@
 }
 
 JNIEXPORT jlong JNICALL
-Java_java_io_FileInputStream_skip(JNIEnv *env, jobject this, jlong toSkip) {
+Java_java_io_FileInputStream_skip0(JNIEnv *env, jobject this, jlong toSkip) {
     jlong cur = jlong_zero;
     jlong end = jlong_zero;
     FD fd = GET_FD(this, fis_fd);
@@ -90,7 +90,7 @@
 }
 
 JNIEXPORT jint JNICALL
-Java_java_io_FileInputStream_available(JNIEnv *env, jobject this) {
+Java_java_io_FileInputStream_available0(JNIEnv *env, jobject this) {
     jlong ret;
     FD fd = GET_FD(this, fis_fd);
     if (fd == -1) {
--- a/jdk/src/java.base/share/native/libjli/java.c	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/share/native/libjli/java.c	Mon Nov 14 09:03:07 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -78,7 +78,6 @@
 static jboolean _have_classpath = JNI_FALSE;
 static const char *_fVersion;
 static jboolean _wc_enabled = JNI_FALSE;
-static jint _ergo_policy = DEFAULT_POLICY;
 
 /*
  * Entries for splash screen environment variables.
@@ -218,7 +217,7 @@
         jboolean javaargs,                      /* JAVA_ARGS */
         jboolean cpwildcard,                    /* classpath wildcard*/
         jboolean javaw,                         /* windows-only javaw */
-        jint ergo                               /* ergonomics class policy */
+        jint ergo                               /* unused */
 )
 {
     int mode = LM_UNKNOWN;
@@ -236,7 +235,6 @@
     _program_name = pname;
     _is_java_args = javaargs;
     _wc_enabled = cpwildcard;
-    _ergo_policy = ergo;
 
     InitLauncher(javaw);
     DumpState();
@@ -431,7 +429,7 @@
         LEAVE();
     }
 
-    FreeKnownVMs();  /* after last possible PrintUsage() */
+    FreeKnownVMs(); /* after last possible PrintUsage */
 
     if (JLI_IsTraceLauncher()) {
         end = CounterGet();
@@ -669,11 +667,6 @@
     /* use the default VM type if not specified (no alias processing) */
     if (jvmtype == NULL) {
       char* result = knownVMs[0].name+1;
-      /* Use a different VM type if we are on a server class machine? */
-      if ((knownVMs[0].flag == VM_IF_SERVER_CLASS) &&
-          (ServerClassMachine() == JNI_TRUE)) {
-        result = knownVMs[0].server_class+1;
-      }
       JLI_TraceLauncher("Default VM: %s\n", result);
       return result;
     }
@@ -1777,15 +1770,14 @@
     jclass cls = GetLauncherHelperClass(env);
     NULL_CHECK(cls);
     NULL_CHECK(showSettingsID = (*env)->GetStaticMethodID(env, cls,
-            "showSettings", "(ZLjava/lang/String;JJJZ)V"));
+            "showSettings", "(ZLjava/lang/String;JJJ)V"));
     NULL_CHECK(joptString = (*env)->NewStringUTF(env, optString));
     (*env)->CallStaticVoidMethod(env, cls, showSettingsID,
                                  USE_STDERR,
                                  joptString,
                                  (jlong)initialHeapSize,
                                  (jlong)maxHeapSize,
-                                 (jlong)threadStackSize,
-                                 ServerClassMachine());
+                                 (jlong)threadStackSize);
 }
 
 /**
@@ -1812,7 +1804,7 @@
 static void
 PrintUsage(JNIEnv* env, jboolean doXUsage)
 {
-  jmethodID initHelp, vmSelect, vmSynonym, vmErgo, printHelp, printXUsageMessage;
+  jmethodID initHelp, vmSelect, vmSynonym, printHelp, printXUsageMessage;
   jstring jprogname, vm1, vm2;
   int i;
   jclass cls = GetLauncherHelperClass(env);
@@ -1831,8 +1823,6 @@
     NULL_CHECK(vmSynonym = (*env)->GetStaticMethodID(env, cls,
                                         "appendVmSynonymMessage",
                                         "(Ljava/lang/String;Ljava/lang/String;)V"));
-    NULL_CHECK(vmErgo = (*env)->GetStaticMethodID(env, cls,
-                                        "appendVmErgoMessage", "(ZLjava/lang/String;)V"));
 
     NULL_CHECK(printHelp = (*env)->GetStaticMethodID(env, cls,
                                         "printHelpMessage", "(Z)V"));
@@ -1845,13 +1835,6 @@
 
 
     /* Assemble the other variant part of the usage */
-    if ((knownVMs[0].flag == VM_KNOWN) ||
-        (knownVMs[0].flag == VM_IF_SERVER_CLASS)) {
-      NULL_CHECK(vm1 = (*env)->NewStringUTF(env, knownVMs[0].name));
-      NULL_CHECK(vm2 =  (*env)->NewStringUTF(env, knownVMs[0].name+1));
-      (*env)->CallStaticVoidMethod(env, cls, vmSelect, vm1, vm2);
-      CHECK_EXCEPTION_RETURN();
-    }
     for (i=1; i<knownVMsCount; i++) {
       if (knownVMs[i].flag == VM_KNOWN) {
         NULL_CHECK(vm1 =  (*env)->NewStringUTF(env, knownVMs[i].name));
@@ -1869,20 +1852,6 @@
       }
     }
 
-    /* The first known VM is the default */
-    {
-      jboolean isServerClassMachine = ServerClassMachine();
-
-      const char* defaultVM  =  knownVMs[0].name+1;
-      if ((knownVMs[0].flag == VM_IF_SERVER_CLASS) && isServerClassMachine) {
-        defaultVM = knownVMs[0].server_class+1;
-      }
-
-      NULL_CHECK(vm1 =  (*env)->NewStringUTF(env, defaultVM));
-      (*env)->CallStaticVoidMethod(env, cls, vmErgo, isServerClassMachine,  vm1);
-      CHECK_EXCEPTION_RETURN();
-    }
-
     /* Complete the usage message and print to stderr*/
     (*env)->CallStaticVoidMethod(env, cls, printHelp, USE_STDERR);
   }
@@ -2011,19 +1980,7 @@
                 } else if (!JLI_StrCCmp(tmpPtr, "ERROR")) {
                     vmType = VM_ERROR;
                 } else if (!JLI_StrCCmp(tmpPtr, "IF_SERVER_CLASS")) {
-                    tmpPtr += JLI_StrCSpn(tmpPtr, whiteSpace);
-                    if (*tmpPtr != 0) {
-                        tmpPtr += JLI_StrSpn(tmpPtr, whiteSpace);
-                    }
-                    if (*tmpPtr == 0) {
-                        JLI_ReportErrorMessage(CFG_WARN4, lineno, jvmCfgName);
-                    } else {
-                        /* Null terminate server class VM name */
-                        serverClassVMName = tmpPtr;
-                        tmpPtr += JLI_StrCSpn(tmpPtr, whiteSpace);
-                        *tmpPtr = 0;
-                        vmType = VM_IF_SERVER_CLASS;
-                    }
+                    /* ignored */
                 } else {
                     JLI_ReportErrorMessage(CFG_WARN5, lineno, &jvmCfgName[0]);
                     vmType = VM_KNOWN;
@@ -2043,11 +2000,6 @@
                 JLI_TraceLauncher("    name: %s  vmType: %s  alias: %s\n",
                    knownVMs[cnt].name, "VM_ALIASED_TO", knownVMs[cnt].alias);
                 break;
-            case VM_IF_SERVER_CLASS:
-                knownVMs[cnt].server_class = JLI_StringDup(serverClassVMName);
-                JLI_TraceLauncher("    name: %s  vmType: %s  server_class: %s\n",
-                    knownVMs[cnt].name, "VM_IF_SERVER_CLASS", knownVMs[cnt].server_class);
-                break;
             }
             cnt++;
         }
@@ -2197,12 +2149,6 @@
     return _launcher_name;
 }
 
-jint
-GetErgoPolicy()
-{
-    return _ergo_policy;
-}
-
 jboolean
 IsJavaArgs()
 {
@@ -2267,17 +2213,6 @@
     printf("\tlauncher name:%s\n", GetLauncherName());
     printf("\tjavaw:%s\n", (IsJavaw() == JNI_TRUE) ? "on" : "off");
     printf("\tfullversion:%s\n", GetFullVersion());
-    printf("\tergo_policy:");
-    switch(GetErgoPolicy()) {
-        case NEVER_SERVER_CLASS:
-            printf("NEVER_ACT_AS_A_SERVER_CLASS_MACHINE\n");
-            break;
-        case ALWAYS_SERVER_CLASS:
-            printf("ALWAYS_ACT_AS_A_SERVER_CLASS_MACHINE\n");
-            break;
-        default:
-            printf("DEFAULT_ERGONOMICS_POLICY\n");
-    }
 }
 
 /*
--- a/jdk/src/java.base/share/native/libjli/java.h	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/share/native/libjli/java.h	Mon Nov 14 09:03:07 2016 -0800
@@ -166,19 +166,10 @@
 void AddOption(char *str, void *info);
 jboolean IsWhiteSpaceOption(const char* name);
 
-enum ergo_policy {
-   DEFAULT_POLICY = 0,
-   NEVER_SERVER_CLASS,
-   ALWAYS_SERVER_CLASS
-};
-
 const char* GetProgramName();
 const char* GetFullVersion();
 jboolean IsJavaArgs();
 jboolean IsJavaw();
-jint GetErgoPolicy();
-
-jboolean ServerClassMachine();
 
 int ContinueInNewThread(InvocationFunctions* ifn, jlong threadStackSize,
                    int argc, char** argv,
--- a/jdk/src/java.base/unix/conf/aarch64/jvm.cfg	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/unix/conf/aarch64/jvm.cfg	Mon Nov 14 09:03:07 2016 -0800
@@ -21,10 +21,9 @@
 # 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
+# NOTE that 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
--- a/jdk/src/java.base/unix/conf/amd64/jvm.cfg	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/unix/conf/amd64/jvm.cfg	Mon Nov 14 09:03:07 2016 -0800
@@ -21,10 +21,9 @@
 # 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
+# NOTE that 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
--- a/jdk/src/java.base/unix/conf/i586/jvm.cfg	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/unix/conf/i586/jvm.cfg	Mon Nov 14 09:03:07 2016 -0800
@@ -23,13 +23,13 @@
 #
 # 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
+# NOTE that 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.
 #
--client IF_SERVER_CLASS -server
 -server KNOWN
+-client KNOWN
 -minimal KNOWN
--- a/jdk/src/java.base/unix/conf/ia64/jvm.cfg	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/unix/conf/ia64/jvm.cfg	Mon Nov 14 09:03:07 2016 -0800
@@ -1,6 +1,3 @@
-#
-# 
-# 
 # Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
@@ -24,11 +21,9 @@
 # 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
+# NOTE that 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
--- a/jdk/src/java.base/unix/conf/ppc64/jvm.cfg	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/unix/conf/ppc64/jvm.cfg	Mon Nov 14 09:03:07 2016 -0800
@@ -23,7 +23,7 @@
 #
 # 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
+# NOTE that 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
--- a/jdk/src/java.base/unix/conf/ppc64le/jvm.cfg	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/unix/conf/ppc64le/jvm.cfg	Mon Nov 14 09:03:07 2016 -0800
@@ -23,7 +23,7 @@
 #
 # 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
+# NOTE that 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
--- a/jdk/src/java.base/unix/conf/s390x/jvm.cfg	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/unix/conf/s390x/jvm.cfg	Mon Nov 14 09:03:07 2016 -0800
@@ -23,7 +23,7 @@
 #
 # 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
+# NOTE that 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
--- a/jdk/src/java.base/unix/conf/sparc/jvm.cfg	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/unix/conf/sparc/jvm.cfg	Mon Nov 14 09:03:07 2016 -0800
@@ -1,4 +1,4 @@
-# Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -23,13 +23,13 @@
 #
 # 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
+# NOTE that 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.
 #
--client IF_SERVER_CLASS -server
 -server KNOWN
+-client KNOWN
 -minimal KNOWN
--- a/jdk/src/java.base/unix/conf/sparcv9/jvm.cfg	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/unix/conf/sparcv9/jvm.cfg	Mon Nov 14 09:03:07 2016 -0800
@@ -23,7 +23,7 @@
 #
 # 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
+# NOTE that 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
--- a/jdk/src/java.base/unix/conf/zero/jvm.cfg	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/unix/conf/zero/jvm.cfg	Mon Nov 14 09:03:07 2016 -0800
@@ -21,10 +21,9 @@
 # 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
+# NOTE that 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
--- a/jdk/src/java.base/unix/native/libjli/ergo.c	Fri Nov 11 17:07:33 2016 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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 houses the common methods for VM ergonomics the platforms
- * are split into ergo_sparc and ergo_x86, and they could be split more
- * in the future if required. The following comments are not entirely
- * true after bifurcation of the platform specific files.
- */
-
-/*
- * The following methods (down to ServerClassMachine()) answer
- * the question about whether a machine is a "server-class"
- * machine.  A server-class machine is loosely defined as one
- * with 2 or more processors and 2 gigabytes or more physical
- * memory.  The definition of a processor is a physical package,
- * not a hyperthreaded chip masquerading as a multi-processor.
- * The definition of memory is also somewhat fuzzy, since x86
- * machines seem not to report all the memory in their DIMMs, we
- * think because of memory mapping of graphics cards, etc.
- *
- * This code is somewhat more confused with #ifdef's than we'd
- * like because this file is used by both Solaris and Linux
- * platforms, and so needs to be parameterized for SPARC and
- * i586 hardware.  The other Linux platforms (amd64 and ia64)
- * don't even ask this question, because they only come with
- * server JVMs.
- */
-
-#include "ergo.h"
-
-/* Dispatch to the platform-specific definition of "server-class" */
-jboolean
-ServerClassMachine(void) {
-  jboolean result;
-  switch(GetErgoPolicy()) {
-    case NEVER_SERVER_CLASS:
-      return JNI_FALSE;
-    case ALWAYS_SERVER_CLASS:
-      return JNI_TRUE;
-    default:
-      result = ServerClassMachineImpl();
-      JLI_TraceLauncher("ServerClassMachine: returns default value of %s\n",
-           (result == JNI_TRUE ? "true" : "false"));
-      return result;
-  }
-}
-
-#ifdef USE_GENERIC_ERGO
-/* Ask the OS how many processors there are. */
-static unsigned long
-physical_processors(void) {
-  const unsigned long sys_processors = sysconf(_SC_NPROCESSORS_CONF);
-  JLI_TraceLauncher("sysconf(_SC_NPROCESSORS_CONF): %lu\n", sys_processors);
-  return sys_processors;
-}
-
-jboolean
-ServerClassMachineImpl(void) {
-  jboolean            result            = JNI_FALSE;
-  /* How big is a server class machine? */
-  const unsigned long server_processors = 2UL;
-  const uint64_t      server_memory     = 2UL * GB;
-  const uint64_t      actual_memory     = physical_memory();
-
-  /* Is this a server class machine? */
-  if (actual_memory >= server_memory) {
-    const unsigned long actual_processors = physical_processors();
-    if (actual_processors >= server_processors) {
-      result = JNI_TRUE;
-    }
-  }
-  JLI_TraceLauncher("unix_" LIBARCHNAME "_ServerClassMachine: %s\n",
-           (result == JNI_TRUE ? "JNI_TRUE" : "JNI_FALSE"));
-  return result;
-}
-#endif
-
-/* Compute physical memory by asking the OS */
-uint64_t
-physical_memory(void) {
-  const uint64_t pages     = (uint64_t) sysconf(_SC_PHYS_PAGES);
-  const uint64_t page_size = (uint64_t) sysconf(_SC_PAGESIZE);
-  const uint64_t result    = pages * page_size;
-# define UINT64_FORMAT "%" PRIu64
-
-  JLI_TraceLauncher("pages: " UINT64_FORMAT
-          "  page_size: " UINT64_FORMAT
-          "  physical memory: " UINT64_FORMAT " (%.3fGB)\n",
-           pages, page_size, result, result / (double) GB);
-  return result;
-}
--- a/jdk/src/java.base/unix/native/libjli/ergo.h	Fri Nov 11 17:07:33 2016 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#ifndef _ERGO_H
-#define _ERGO_H
-
-#include <inttypes.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <sys/types.h>
-
-#include "java.h"
-
-jboolean ServerClassMachineImpl(void);
-uint64_t physical_memory(void);
-
-#endif /* _ERGO_H */
--- a/jdk/src/java.base/unix/native/libjli/ergo_i586.c	Fri Nov 11 17:07:33 2016 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,323 +0,0 @@
-/*
- * Copyright (c) 1998, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "ergo.h"
-
-static unsigned long physical_processors(void);
-
-#ifdef __solaris__
-
-/*
- * A utility method for asking the CPU about itself.
- * There's a corresponding version of linux-i586
- * because the compilers are different.
- */
-static void
-get_cpuid(uint32_t arg,
-          uint32_t* eaxp,
-          uint32_t* ebxp,
-          uint32_t* ecxp,
-          uint32_t* edxp) {
-#ifdef _LP64
-  asm(
-  /* rbx is a callee-saved register */
-      " movq    %rbx, %r11  \n"
-  /* rdx and rcx are 3rd and 4th argument registers */
-      " movq    %rdx, %r10  \n"
-      " movq    %rcx, %r9   \n"
-      " movl    %edi, %eax  \n"
-      " cpuid               \n"
-      " movl    %eax, (%rsi)\n"
-      " movl    %ebx, (%r10)\n"
-      " movl    %ecx, (%r9) \n"
-      " movl    %edx, (%r8) \n"
-  /* Restore rbx */
-      " movq    %r11, %rbx");
-#else
-  /* EBX is a callee-saved register */
-  asm(" pushl   %ebx");
-  /* Need ESI for storing through arguments */
-  asm(" pushl   %esi");
-  asm(" movl    8(%ebp), %eax   \n"
-      " cpuid                   \n"
-      " movl    12(%ebp), %esi  \n"
-      " movl    %eax, (%esi)    \n"
-      " movl    16(%ebp), %esi  \n"
-      " movl    %ebx, (%esi)    \n"
-      " movl    20(%ebp), %esi  \n"
-      " movl    %ecx, (%esi)    \n"
-      " movl    24(%ebp), %esi  \n"
-      " movl    %edx, (%esi)      ");
-  /* Restore ESI and EBX */
-  asm(" popl    %esi");
-  /* Restore EBX */
-  asm(" popl    %ebx");
-#endif /* LP64 */
-}
-
-/* The definition of a server-class machine for solaris-i586/amd64 */
-jboolean
-ServerClassMachineImpl(void) {
-  jboolean            result            = JNI_FALSE;
-  /* How big is a server class machine? */
-  const unsigned long server_processors = 2UL;
-  const uint64_t      server_memory     = 2UL * GB;
-  /*
-   * We seem not to get our full complement of memory.
-   *     We allow some part (1/8?) of the memory to be "missing",
-   *     based on the sizes of DIMMs, and maybe graphics cards.
-   */
-  const uint64_t      missing_memory    = 256UL * MB;
-  const uint64_t      actual_memory     = physical_memory();
-
-  /* Is this a server class machine? */
-  if (actual_memory >= (server_memory - missing_memory)) {
-    const unsigned long actual_processors = physical_processors();
-    if (actual_processors >= server_processors) {
-      result = JNI_TRUE;
-    }
-  }
-  JLI_TraceLauncher("solaris_" LIBARCHNAME "_ServerClassMachine: %s\n",
-           (result == JNI_TRUE ? "true" : "false"));
-  return result;
-}
-
-#endif /* __solaris__ */
-
-#ifdef __linux__
-
-/*
- * A utility method for asking the CPU about itself.
- * There's a corresponding version of solaris-i586
- * because the compilers are different.
- */
-static void
-get_cpuid(uint32_t arg,
-          uint32_t* eaxp,
-          uint32_t* ebxp,
-          uint32_t* ecxp,
-          uint32_t* edxp) {
-#ifdef _LP64
-  __asm__ volatile (/* Instructions */
-                    "   movl    %4, %%eax  \n"
-                    "   cpuid              \n"
-                    "   movl    %%eax, (%0)\n"
-                    "   movl    %%ebx, (%1)\n"
-                    "   movl    %%ecx, (%2)\n"
-                    "   movl    %%edx, (%3)\n"
-                    : /* Outputs */
-                    : /* Inputs */
-                    "r" (eaxp),
-                    "r" (ebxp),
-                    "r" (ecxp),
-                    "r" (edxp),
-                    "r" (arg)
-                    : /* Clobbers */
-                    "%rax", "%rbx", "%rcx", "%rdx", "memory"
-                    );
-#else /* _LP64 */
-  uint32_t value_of_eax = 0;
-  uint32_t value_of_ebx = 0;
-  uint32_t value_of_ecx = 0;
-  uint32_t value_of_edx = 0;
-  __asm__ volatile (/* Instructions */
-                        /* ebx is callee-save, so push it */
-                    "   pushl   %%ebx      \n"
-                    "   movl    %4, %%eax  \n"
-                    "   cpuid              \n"
-                    "   movl    %%eax, %0  \n"
-                    "   movl    %%ebx, %1  \n"
-                    "   movl    %%ecx, %2  \n"
-                    "   movl    %%edx, %3  \n"
-                        /* restore ebx */
-                    "   popl    %%ebx      \n"
-
-                    : /* Outputs */
-                    "=m" (value_of_eax),
-                    "=m" (value_of_ebx),
-                    "=m" (value_of_ecx),
-                    "=m" (value_of_edx)
-                    : /* Inputs */
-                    "m" (arg)
-                    : /* Clobbers */
-                    "%eax", "%ecx", "%edx"
-                    );
-  *eaxp = value_of_eax;
-  *ebxp = value_of_ebx;
-  *ecxp = value_of_ecx;
-  *edxp = value_of_edx;
-#endif /* _LP64 */
-}
-
-/* The definition of a server-class machine for linux-i586 */
-jboolean
-ServerClassMachineImpl(void) {
-  jboolean            result            = JNI_FALSE;
-  /* How big is a server class machine? */
-  const unsigned long server_processors = 2UL;
-  const uint64_t      server_memory     = 2UL * GB;
-  /*
-   * We seem not to get our full complement of memory.
-   *     We allow some part (1/8?) of the memory to be "missing",
-   *     based on the sizes of DIMMs, and maybe graphics cards.
-   */
-  const uint64_t      missing_memory    = 256UL * MB;
-  const uint64_t      actual_memory     = physical_memory();
-
-  /* Is this a server class machine? */
-  if (actual_memory >= (server_memory - missing_memory)) {
-    const unsigned long actual_processors = physical_processors();
-    if (actual_processors >= server_processors) {
-      result = JNI_TRUE;
-    }
-  }
-  JLI_TraceLauncher("linux_" LIBARCHNAME "_ServerClassMachine: %s\n",
-           (result == JNI_TRUE ? "true" : "false"));
-  return result;
-}
-#endif /* __linux__ */
-
-/*
- * Routines shared by solaris-i586 and linux-i586.
- */
-
-enum HyperThreadingSupport_enum {
-  hts_supported        =  1,
-  hts_too_soon_to_tell =  0,
-  hts_not_supported    = -1,
-  hts_not_pentium4     = -2,
-  hts_not_intel        = -3
-};
-typedef enum HyperThreadingSupport_enum HyperThreadingSupport;
-
-/* Determine if hyperthreading is supported */
-static HyperThreadingSupport
-hyperthreading_support(void) {
-  HyperThreadingSupport result = hts_too_soon_to_tell;
-  /* Bits 11 through 8 is family processor id */
-# define FAMILY_ID_SHIFT 8
-# define FAMILY_ID_MASK 0xf
-  /* Bits 23 through 20 is extended family processor id */
-# define EXT_FAMILY_ID_SHIFT 20
-# define EXT_FAMILY_ID_MASK 0xf
-  /* Pentium 4 family processor id */
-# define PENTIUM4_FAMILY_ID 0xf
-  /* Bit 28 indicates Hyper-Threading Technology support */
-# define HT_BIT_SHIFT 28
-# define HT_BIT_MASK 1
-  uint32_t vendor_id[3] = { 0U, 0U, 0U };
-  uint32_t value_of_eax = 0U;
-  uint32_t value_of_edx = 0U;
-  uint32_t dummy        = 0U;
-
-  /* Yes, this is supposed to be [0], [2], [1] */
-  get_cpuid(0, &dummy, &vendor_id[0], &vendor_id[2], &vendor_id[1]);
-  JLI_TraceLauncher("vendor: %c %c %c %c %c %c %c %c %c %c %c %c \n",
-           ((vendor_id[0] >>  0) & 0xff),
-           ((vendor_id[0] >>  8) & 0xff),
-           ((vendor_id[0] >> 16) & 0xff),
-           ((vendor_id[0] >> 24) & 0xff),
-           ((vendor_id[1] >>  0) & 0xff),
-           ((vendor_id[1] >>  8) & 0xff),
-           ((vendor_id[1] >> 16) & 0xff),
-           ((vendor_id[1] >> 24) & 0xff),
-           ((vendor_id[2] >>  0) & 0xff),
-           ((vendor_id[2] >>  8) & 0xff),
-           ((vendor_id[2] >> 16) & 0xff),
-           ((vendor_id[2] >> 24) & 0xff));
-  get_cpuid(1, &value_of_eax, &dummy, &dummy, &value_of_edx);
-  JLI_TraceLauncher("value_of_eax: 0x%x  value_of_edx: 0x%x\n",
-           value_of_eax, value_of_edx);
-  if ((((value_of_eax >> FAMILY_ID_SHIFT) & FAMILY_ID_MASK) == PENTIUM4_FAMILY_ID) ||
-      (((value_of_eax >> EXT_FAMILY_ID_SHIFT) & EXT_FAMILY_ID_MASK) != 0)) {
-    if ((((vendor_id[0] >>  0) & 0xff) == 'G') &&
-        (((vendor_id[0] >>  8) & 0xff) == 'e') &&
-        (((vendor_id[0] >> 16) & 0xff) == 'n') &&
-        (((vendor_id[0] >> 24) & 0xff) == 'u') &&
-        (((vendor_id[1] >>  0) & 0xff) == 'i') &&
-        (((vendor_id[1] >>  8) & 0xff) == 'n') &&
-        (((vendor_id[1] >> 16) & 0xff) == 'e') &&
-        (((vendor_id[1] >> 24) & 0xff) == 'I') &&
-        (((vendor_id[2] >>  0) & 0xff) == 'n') &&
-        (((vendor_id[2] >>  8) & 0xff) == 't') &&
-        (((vendor_id[2] >> 16) & 0xff) == 'e') &&
-        (((vendor_id[2] >> 24) & 0xff) == 'l')) {
-      if (((value_of_edx >> HT_BIT_SHIFT) & HT_BIT_MASK) == HT_BIT_MASK) {
-        JLI_TraceLauncher("Hyperthreading supported\n");
-        result = hts_supported;
-      } else {
-        JLI_TraceLauncher("Hyperthreading not supported\n");
-        result = hts_not_supported;
-      }
-    } else {
-      JLI_TraceLauncher("Not GenuineIntel\n");
-      result = hts_not_intel;
-    }
-  } else {
-    JLI_TraceLauncher("not Pentium 4 or extended\n");
-    result = hts_not_pentium4;
-  }
-  return result;
-}
-
-/* Determine how many logical processors there are per CPU */
-static unsigned int
-logical_processors_per_package(void) {
-  /*
-   * After CPUID with EAX==1, register EBX bits 23 through 16
-   * indicate the number of logical processors per package
-   */
-# define NUM_LOGICAL_SHIFT 16
-# define NUM_LOGICAL_MASK 0xff
-  unsigned int result                        = 1U;
-  const HyperThreadingSupport hyperthreading = hyperthreading_support();
-
-  if (hyperthreading == hts_supported) {
-    uint32_t value_of_ebx = 0U;
-    uint32_t dummy        = 0U;
-
-    get_cpuid(1, &dummy, &value_of_ebx, &dummy, &dummy);
-    result = (value_of_ebx >> NUM_LOGICAL_SHIFT) & NUM_LOGICAL_MASK;
-    JLI_TraceLauncher("logical processors per package: %u\n", result);
-  }
-  return result;
-}
-
-/* Compute the number of physical processors, not logical processors */
-static unsigned long
-physical_processors(void) {
-  const long sys_processors = sysconf(_SC_NPROCESSORS_CONF);
-  unsigned long result      = sys_processors;
-
-  JLI_TraceLauncher("sysconf(_SC_NPROCESSORS_CONF): %lu\n", sys_processors);
-  if (sys_processors > 1) {
-    unsigned int logical_processors = logical_processors_per_package();
-    if (logical_processors > 1) {
-      result = (unsigned long) sys_processors / logical_processors;
-    }
-  }
-  JLI_TraceLauncher("physical processors: %lu\n", result);
-  return result;
-}
--- a/jdk/src/java.base/windows/conf/amd64/jvm.cfg	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/windows/conf/amd64/jvm.cfg	Mon Nov 14 09:03:07 2016 -0800
@@ -1,6 +1,3 @@
-#
-# 
-# 
 # Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
@@ -27,7 +24,7 @@
 #
 # 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
+# NOTE that 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
--- a/jdk/src/java.base/windows/conf/i586/jvm.cfg	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/windows/conf/i586/jvm.cfg	Mon Nov 14 09:03:07 2016 -0800
@@ -23,7 +23,7 @@
 #
 # 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
+# NOTE that 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
--- a/jdk/src/java.base/windows/conf/ia64/jvm.cfg	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/windows/conf/ia64/jvm.cfg	Mon Nov 14 09:03:07 2016 -0800
@@ -1,6 +1,3 @@
-#
-# 
-# 
 # Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
@@ -24,10 +21,9 @@
 # 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
+# NOTE that 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
--- a/jdk/src/java.base/windows/native/libjli/java_md.c	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/java.base/windows/native/libjli/java_md.c	Mon Nov 14 09:03:07 2016 -0800
@@ -639,11 +639,6 @@
     }
 }
 
-jboolean
-ServerClassMachine() {
-    return (GetErgoPolicy() == ALWAYS_SERVER_CLASS) ? JNI_TRUE : JNI_FALSE;
-}
-
 /*
  * Wrapper for platform dependent unsetenv function.
  */
--- a/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/console/ConsoleReader.java	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/console/ConsoleReader.java	Mon Nov 14 09:03:07 2016 -0800
@@ -3222,7 +3222,7 @@
     }
     //where:
         private Pattern CURSOR_COLUMN_PATTERN =
-                Pattern.compile("(?<prefix>.*)\033\\[[0-9]+;(?<column>[0-9]+)R");
+                Pattern.compile("(?<prefix>.*)\033\\[[0-9]+;(?<column>[0-9]+)R", Pattern.DOTALL);
 
     /**
      * Read a line for unsupported terminals.
--- a/jdk/test/TEST.ROOT	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/test/TEST.ROOT	Mon Nov 14 09:03:07 2016 -0800
@@ -18,7 +18,7 @@
 othervm.dirs=java/awt java/beans javax/accessibility javax/imageio javax/sound javax/print javax/management com/sun/awt sun/awt sun/java2d sun/pisces javax/xml/jaxp/testng/validation java/lang/ProcessHandle
 
 # Tests that cannot run concurrently
-exclusiveAccess.dirs=java/rmi/Naming java/util/prefs sun/management/jmxremote sun/tools/jstatd sun/security/mscapi java/util/stream javax/rmi
+exclusiveAccess.dirs=java/rmi/Naming java/util/prefs sun/management/jmxremote sun/tools/jstatd sun/security/mscapi java/util/stream javax/rmi com/sun/corba/cachedSocket
 
 # Group definitions
 groups=TEST.groups [closed/TEST.groups]
--- a/jdk/test/com/sun/net/httpserver/TEST.properties	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/test/com/sun/net/httpserver/TEST.properties	Mon Nov 14 09:03:07 2016 -0800
@@ -1,1 +1,1 @@
-modules = jdk.httpserver
\ No newline at end of file
+modules = jdk.httpserver java.logging
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/net/ssl/interop/ClientHelloChromeInterOp.java	Mon Nov 14 09:03:07 2016 -0800
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ */
+
+//
+// SunJSSE does not support dynamic system properties, no way to re-use
+// system properties in samevm/agentvm mode.
+//
+
+/*
+ * @test
+ * @bug 8169362
+ * @summary Interop automated testing with Chrome
+ * @modules java.base/sun.security.util
+ * @run main/othervm ClientHelloChromeInterOp
+ */
+
+import java.util.Base64;
+import sun.security.util.HexDumpEncoder;
+
+public class ClientHelloChromeInterOp extends ClientHelloInterOp {
+    // The ClientHello message.
+    //
+    // Captured from Chrome browser (version 54.0.2840.87 m (64-bit)) on
+    // Windows 10.
+    private final static String ClientHelloMsg =
+        "FgMBAL4BAAC6AwOWBEueOntnurZ+WAW0D9Qn2HpdzXLu0MgDjsD9e5JU6AAAIsA\n" +
+        "rwC/ALMAwzKnMqMwUzBPACcATwArAFACcAJ0ALwA1AAoBAABv/wEAAQAAAAATAB\n" +
+        "EAAA53d3cub3JhY2xlLmNvbQAXAAAAIwAAAA0AEgAQBgEGAwUBBQMEAQQDAgECA\n" +
+        "wAFAAUBAAAAAAASAAAAEAAOAAwCaDIIaHR0cC8xLjF1UAAAAAsAAgEAAAoACAAG\n" +
+        "AB0AFwAY";
+
+    /*
+     * Main entry point for this test.
+     */
+    public static void main(String args[]) throws Exception {
+        (new ClientHelloChromeInterOp()).run();
+    }
+
+    @Override
+    protected byte[] createClientHelloMessage() {
+        byte[] bytes = Base64.getMimeDecoder().decode(ClientHelloMsg);
+
+        // Dump the hex codes of the ClientHello message so that developers
+        // can easily check whether the message is captured correct or not.
+        HexDumpEncoder dump = new HexDumpEncoder();
+        System.out.println("The ClientHello message used");
+        try {
+            dump.encodeBuffer(bytes, System.out);
+        } catch (Exception e) {
+            // ignore
+        }
+
+        return bytes;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/net/ssl/interop/ClientHelloInterOp.java	Mon Nov 14 09:03:07 2016 -0800
@@ -0,0 +1,432 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * 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 javax.net.ssl.*;
+import javax.net.ssl.SSLEngineResult.*;
+import java.io.*;
+import java.nio.*;
+import java.security.KeyStore;
+import java.security.PrivateKey;
+import java.security.KeyFactory;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateFactory;
+import java.security.spec.*;
+import java.util.Base64;
+
+public abstract class ClientHelloInterOp {
+
+    /*
+     * Certificates and keys used in the test.
+     */
+    // Trusted certificates.
+    private final static String[] trustedCertStrs = {
+        // SHA256withECDSA, curve prime256v1
+        // Validity
+        //     Not Before: Nov  9 03:24:05 2016 GMT
+        //     Not After : Oct 20 03:24:05 2037 GMT
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIICHDCCAcGgAwIBAgIJAM83C/MVp9F5MAoGCCqGSM49BAMCMDsxCzAJBgNVBAYT\n" +
+        "AlVTMQ0wCwYDVQQKEwRKYXZhMR0wGwYDVQQLExRTdW5KU1NFIFRlc3QgU2VyaXZj\n" +
+        "ZTAeFw0xNjExMDkwMzI0MDVaFw0zNzEwMjAwMzI0MDVaMDsxCzAJBgNVBAYTAlVT\n" +
+        "MQ0wCwYDVQQKEwRKYXZhMR0wGwYDVQQLExRTdW5KU1NFIFRlc3QgU2VyaXZjZTBZ\n" +
+        "MBMGByqGSM49AgEGCCqGSM49AwEHA0IABGeQXwyeNyU4UAATfwUbMO5zaREI21Wh\n" +
+        "bds6WDu+PmfK8SWsTgsgpYxBRui+fZtYqSmbdjkurvAQ3j2fvN++BtWjga0wgaow\n" +
+        "HQYDVR0OBBYEFDF/OeJ82qBSRkAm1rdZUPbWfDzyMGsGA1UdIwRkMGKAFDF/OeJ8\n" +
+        "2qBSRkAm1rdZUPbWfDzyoT+kPTA7MQswCQYDVQQGEwJVUzENMAsGA1UEChMESmF2\n" +
+        "YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2WCCQDPNwvzFafReTAPBgNV\n" +
+        "HRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBBjAKBggqhkjOPQQDAgNJADBGAiEAlHQY\n" +
+        "QFPlODOsjLVQYSxgeSUvYzMp0vP8naeVB9bfFG8CIQCFfrKZvhq9z3bOtlYKxs2a\n" +
+        "EWUjUZ82a1JTqkP+lgHY5A==\n" +
+        "-----END CERTIFICATE-----",
+
+        // SHA256withRSA, 2048 bits
+        // Validity
+        //     Not Before: Nov  9 03:24:16 2016 GMT
+        //     Not After : Oct 20 03:24:16 2037 GMT
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIIDpzCCAo+gAwIBAgIJAJAYpR2aIlA1MA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNV\n" +
+        "BAYTAlVTMQ0wCwYDVQQKEwRKYXZhMR0wGwYDVQQLExRTdW5KU1NFIFRlc3QgU2Vy\n" +
+        "aXZjZTAeFw0xNjExMDkwMzI0MTZaFw0zNzEwMjAwMzI0MTZaMDsxCzAJBgNVBAYT\n" +
+        "AlVTMQ0wCwYDVQQKEwRKYXZhMR0wGwYDVQQLExRTdW5KU1NFIFRlc3QgU2VyaXZj\n" +
+        "ZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL+F/FTPODYzsU0Pakfp\n" +
+        "lsh88YoQWZPjABhCU+HPsCTMYc8UBkaiduUzregwwVBW3D7kmec2K408krGQsxdy\n" +
+        "oKJA12GL/XX1YgzDEsyBRk/gvex5lPaBIZiJ5IZlUfjLuRDGxPjtRelBTpZ7SUet\n" +
+        "PJVZz6zV6hMPGO6kQzCtbzzET515EE0okIS40LkAmtWoOmVm3gRldomaZTrZ0V2L\n" +
+        "MMaJGzrXYqk0SX+PYul8v+2EEHeMuaXG/XpK5xsg9gZvzpKqFQcBOdENoJHB07go\n" +
+        "jCmRC328ALqr+bMyktKAuYfB+mhjmN2AU8TQx72WPpvNTXxFDYcwo+8254cCAVKB\n" +
+        "e98CAwEAAaOBrTCBqjAdBgNVHQ4EFgQUlJQlQTbi8YIyiNf+SqF7LtH+gicwawYD\n" +
+        "VR0jBGQwYoAUlJQlQTbi8YIyiNf+SqF7LtH+giehP6Q9MDsxCzAJBgNVBAYTAlVT\n" +
+        "MQ0wCwYDVQQKEwRKYXZhMR0wGwYDVQQLExRTdW5KU1NFIFRlc3QgU2VyaXZjZYIJ\n" +
+        "AJAYpR2aIlA1MA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMA0GCSqGSIb3\n" +
+        "DQEBCwUAA4IBAQAI0lTY0YAKQ2VdoIQ6dnqolphLVWdNGiC9drHEYSn7+hmAD2r2\n" +
+        "v1U/9m752TkcT74a65xKbEVuVtleD/w6i+QjALW2PYt6ivjOnnY0a9Y9a9UCa00j\n" +
+        "C9415sCw84Tp9VoKtuYqzhN87bBUeABOw5dsW3z32C2N/YhprkqeF/vdx4JxulPr\n" +
+        "PKze5BREXnKLA1ISoDioCPphvNMKrSpkAofb1rTCwtgt5V/WFls283L52ORmpRGO\n" +
+        "Ja88ztXOz00ZGu0RQLwlmpN7m8tNgA/5MPrldyYIwegP4RSkkJlF/8+hxvvqfJhK\n" +
+        "FFDa0HHQSJfR2b9628Iniw1UHOMMT6qx5EHr\n" +
+        "-----END CERTIFICATE-----"
+        };
+
+    // End entity certificate.
+    private final static String[] endEntityCertStrs = {
+        // SHA256withECDSA, curve prime256v1
+        // Validity
+        //     Not Before: Nov  9 03:24:05 2016 GMT
+        //     Not After : Jul 27 03:24:05 2036 GMT
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIIB1DCCAXmgAwIBAgIJAKVa+4dIUjaLMAoGCCqGSM49BAMCMDsxCzAJBgNVBAYT\n" +
+        "AlVTMQ0wCwYDVQQKEwRKYXZhMR0wGwYDVQQLExRTdW5KU1NFIFRlc3QgU2VyaXZj\n" +
+        "ZTAeFw0xNjExMDkwMzI0MDVaFw0zNjA3MjcwMzI0MDVaMFIxCzAJBgNVBAYTAlVT\n" +
+        "MQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZjZTEV\n" +
+        "MBMGA1UEAwwMSW50ZXJPcCBUZXN0MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE\n" +
+        "h4vXNUJzULq4e7fAOvF0WiWU6cllOAMus1GqTFvcnRPOChl8suZsvksO0CpZqL3h\n" +
+        "jXmVX9dp1FV/rUBGLo1aG6NPME0wCwYDVR0PBAQDAgPoMB0GA1UdDgQWBBSO8V5+\n" +
+        "bj0ik0T9BtJc4jLJt7m6wjAfBgNVHSMEGDAWgBQxfznifNqgUkZAJta3WVD21nw8\n" +
+        "8jAKBggqhkjOPQQDAgNJADBGAiEAk7MF+L9bFRwUsbPsBCbCqH9DMdzBQR+kFDNf\n" +
+        "lfn8Rs4CIQD9qWvBXd+EJqwraxiX6cftaFchn+T2HpvMboy+irMFow==\n" +
+        "-----END CERTIFICATE-----",
+
+        // SHA256withRSA, 2048 bits
+        // Validity
+        //     Not Before: Nov  9 03:24:16 2016 GMT
+        //     Not After : Jul 27 03:24:16 2036 GMT
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIIDczCCAlugAwIBAgIJAPhM2oUKx0aJMA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNV\n" +
+        "BAYTAlVTMQ0wCwYDVQQKEwRKYXZhMR0wGwYDVQQLExRTdW5KU1NFIFRlc3QgU2Vy\n" +
+        "aXZjZTAeFw0xNjExMDkwMzI0MTZaFw0zNjA3MjcwMzI0MTZaMFIxCzAJBgNVBAYT\n" +
+        "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" +
+        "ZTEVMBMGA1UEAwwMSW50ZXJPcCBUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A\n" +
+        "MIIBCgKCAQEA36tJaXfJ2B/AFvES+tnueyQPSNABVu9nfMdU+NEPamJ+FH7cEF8Z\n" +
+        "1Spr1vlQgNzCpDUVrfnmT75rCapgz5ldA9+y+3hdfUyHjZBzzfx+6GHXLB4u6eU2\n" +
+        "NATa7vqSLNbcLcfZ7/QmkFqg4JRJbX4F42kKkRJrWdKZ8UoCYC8WXWvDaZ3nUs05\n" +
+        "XHe+mBJ8qMNPTbYST1jpzXPyH5CljlFGYi2mKJDTImDhwht7mu2+zvwvbJ81Gj2X\n" +
+        "JUSTSf9fu0zxFcCk6RmJPw9nSVqePVlOwtNNBodfKN+k4yr+gOz1v8NmMtmEtklV\n" +
+        "Sulr/J4QxI+E2Zar/C+4XjxkvstIS+PNKQIDAQABo2MwYTALBgNVHQ8EBAMCA+gw\n" +
+        "HQYDVR0OBBYEFHt19CItAz0VOF0WKGWwaT4DtEsSMB8GA1UdIwQYMBaAFJSUJUE2\n" +
+        "4vGCMojX/kqhey7R/oInMBIGA1UdEQEB/wQIMAaHBH8AAAEwDQYJKoZIhvcNAQEL\n" +
+        "BQADggEBACKYZWvo9B9IEpCCdBba2sNo4X1NI/VEY3fyUx1lkw+Kna+1d2Ab+RCZ\n" +
+        "cf3Y85fcwv03hNE///wNBp+Nde4NQRDK/oiQARzWwWslfinm5d83eQwzC3cpSzt+\n" +
+        "7ts6M5UlOblGsLXZI7THWO1tkgoEra9p+zezxLMmf/2MpNyZMZlVoJPM2YGxU9cN\n" +
+        "ws0AyeY1gpBEdT21vjsBPdxxj6qklXVMnzS3zF8YwXyOndDYQWdjmFEknRK/qmQ2\n" +
+        "gkLHrzpSpyCziecna5mGuDRdCU2dpsWiq1npEPXTq+PQGwWYcoaFTtXF8DDqhfPC\n" +
+        "4Abe8gPm6MfzerdmS3RFTj9b/DIIENM=\n" +
+        "-----END CERTIFICATE-----"
+        };
+
+    // Private key in the format of PKCS#8.
+    private final static String[] endEntityPrivateKeys = {
+        //
+        // EC private key related to cert endEntityCertStrs[0].
+        //
+        "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgA3pmS+OrIjGyUv2F\n" +
+        "K/PkyayJIePM2RTFYxNoQqmJGnihRANCAASHi9c1QnNQurh7t8A68XRaJZTpyWU4\n" +
+        "Ay6zUapMW9ydE84KGXyy5my+Sw7QKlmoveGNeZVf12nUVX+tQEYujVob",
+
+        //
+        // RSA private key related to cert endEntityCertStrs[1].
+        //
+        "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDfq0lpd8nYH8AW\n" +
+        "8RL62e57JA9I0AFW72d8x1T40Q9qYn4UftwQXxnVKmvW+VCA3MKkNRWt+eZPvmsJ\n" +
+        "qmDPmV0D37L7eF19TIeNkHPN/H7oYdcsHi7p5TY0BNru+pIs1twtx9nv9CaQWqDg\n" +
+        "lEltfgXjaQqREmtZ0pnxSgJgLxZda8NpnedSzTlcd76YEnyow09NthJPWOnNc/If\n" +
+        "kKWOUUZiLaYokNMiYOHCG3ua7b7O/C9snzUaPZclRJNJ/1+7TPEVwKTpGYk/D2dJ\n" +
+        "Wp49WU7C000Gh18o36TjKv6A7PW/w2Yy2YS2SVVK6Wv8nhDEj4TZlqv8L7hePGS+\n" +
+        "y0hL480pAgMBAAECggEBAJyP1zk+IkloIBtu7+wrdCU6HoDHKMjjlzrehHoOTI4Z\n" +
+        "F0vdaMkE6J4vrYCyz0kEPjKW/e/jxvT2wxHm8xEdtuApS61+mWJFmXTcMlNzdJnR\n" +
+        "Mr6s+gW67fAHngA94OgGFeTtyX2PFxdgeM/6vFMqLZD7S+w0SnR7WEpvla4iB7On\n" +
+        "lXqhJKVQeVc+IpByg/S4MmJb91jck73GltCaCL/b6BTrsz+zc/AY5tb8JInxjMZ9\n" +
+        "jmjmA+s6l7tnBrFQfJHlF9a374lxCOtZTxyxVJjD7tQcGpsUpSHXZGdpDcT34qYT\n" +
+        "UGh0yp2Mc/1PfWni5gS/6UGLrYmT57RRCn5YJBJTEkkCgYEA/XPCNehFaOMSxOZh\n" +
+        "OGBVhQ+eRAmdpJfMhSUsDdEdQLZyWGmZsMTHjZZrwevBX/D0dxQYDv/sAl0GZomJ\n" +
+        "d6iRCHlscycwx5Q0U/EpacsgRlYHz1nMRzXqS3Ry+8O8qQlliqCLUM7SfVgzdI5/\n" +
+        "ll9JMrng9NnRl8ccjEdOGK8g/MMCgYEA4eriKMfRslGY4uOQoTPbuEJSMMwQ2X4k\n" +
+        "lPj1p+xSQfU9QBaWJake67oBj3vpCxqN7/VkvCIeC6LCjhLpWHCn4EkdGiqkEdWz\n" +
+        "m5CHzpzVIgznzWnbt0rCVL2KdL+ihgY8KPDdsZ6tZrABHuYhsWkAu10wyvuQYM88\n" +
+        "3u6yOIQn36MCgYEAk5qR1UEzAxWTPbaJkgKQa5Cf9DHBbDS3eCcg098f8SsPxquh\n" +
+        "RRAkwzGCCgqZsJ0sUhkStdGXifzRGHAq7dPuuwe0ABAn2WNXYjeFjcYtQqkhnUFH\n" +
+        "tYURsOXdfQAOZEdDqos691GrxjHSraO7bECL6Y3VE+Oyq3jbCFsSgU+kn28CgYBT\n" +
+        "mrXZO6FJqVK33FlAns1YEgsSjeJKapklHEDkxNroF9Zz6ifkhgKwX6SGMefbORd/\n" +
+        "zsNZsBKIYdI3+52pIf+uS8BeV5tiEkCmeEUZ3AYv1LDP3rX1zc++xmn/rI97o8EN\n" +
+        "sZ2JRtyK3OV9RtL/MYmYzPLqm1Ah02+GXLVNnvKWmwKBgE8Ble8CzrXYuuPdGxXz\n" +
+        "BZU6HnXQrmTUcgeze0tj8SDHzCfsGsaG6pHrVNkT7CKsRuCHTZLM0kXmUijLFKuP\n" +
+        "5xyE257z4IbbEbs+tcbB3p28n4/47MzZkSR3kt8+FrsEMZq5oOHbFTGzgp9dhZCC\n" +
+        "dKUqlw5BPHdbxoWB/JpSHGCV"
+        };
+
+    // Private key names of endEntityPrivateKeys.
+    private final static String[] endEntityPrivateKeyNames = {
+        "EC",
+        "RSA"
+        };
+
+    /*
+     * Run the test case.
+     */
+    public void run() throws Exception {
+        SSLEngine serverEngine = createServerEngine();
+
+        //
+        // Create and size the buffers appropriately.
+        //
+        SSLSession session = serverEngine.getSession();
+        ByteBuffer serverAppInbound =
+            ByteBuffer.allocate(session.getApplicationBufferSize());
+        ByteBuffer clientHello =
+            ByteBuffer.allocate(session.getPacketBufferSize());
+
+        //
+        // Generate a ClientHello message, and check if the server
+        // engine can read it or not.
+        //
+        clientHello.put(createClientHelloMessage());
+        clientHello.flip();
+
+        SSLEngineResult serverResult =
+                serverEngine.unwrap(clientHello, serverAppInbound);
+        log("Server unwrap: ", serverResult);
+        runDelegatedTasks(serverResult, serverEngine);
+
+        //
+        // Generate server responses to the ClientHello request.
+        //
+        ByteBuffer clientNetInbound =
+            ByteBuffer.allocate(session.getPacketBufferSize());
+        ByteBuffer clientAppInbound =
+            ByteBuffer.wrap("Hello Client, I'm Server".getBytes());
+
+        serverResult = serverEngine.wrap(clientAppInbound, clientNetInbound);
+        log("Server wrap: ", serverResult);
+        runDelegatedTasks(serverResult, serverEngine);
+    }
+
+    /*
+     * Create a ClientHello message.
+     */
+    abstract protected byte[] createClientHelloMessage();
+
+    /*
+     * Create an instance of SSLContext for client use.
+     */
+    protected SSLContext createClientSSLContext() throws Exception {
+        return createSSLContext(trustedCertStrs, null, null, null);
+    }
+
+    /*
+     * Create an instance of SSLContext for server use.
+     */
+    protected SSLContext createServerSSLContext() throws Exception {
+        return createSSLContext(null,
+                endEntityCertStrs, endEntityPrivateKeys,
+                endEntityPrivateKeyNames);
+    }
+
+    /*
+     * Create an instance of SSLContext with the specified trust/key materials.
+     */
+    protected SSLContext createSSLContext(
+            String[] trustedMaterials,
+            String[] keyMaterialCerts,
+            String[] keyMaterialKeys,
+            String[] keyMaterialKeyAlgs) throws Exception {
+
+        KeyStore ts = null;     // trust store
+        KeyStore ks = null;     // key store
+        char passphrase[] = "passphrase".toCharArray();
+
+        // Generate certificate from cert string.
+        CertificateFactory cf = CertificateFactory.getInstance("X.509");
+
+        // Import the trused certs.
+        ByteArrayInputStream is;
+        if (trustedMaterials != null && trustedMaterials.length != 0) {
+            ts = KeyStore.getInstance("JKS");
+            ts.load(null, null);
+
+            Certificate[] trustedCert =
+                    new Certificate[trustedMaterials.length];
+            for (int i = 0; i < trustedMaterials.length; i++) {
+                String trustedCertStr = trustedMaterials[i];
+
+                is = new ByteArrayInputStream(trustedCertStr.getBytes());
+                try {
+                    trustedCert[i] = cf.generateCertificate(is);
+                } finally {
+                    is.close();
+                }
+
+                ts.setCertificateEntry("trusted-cert-" + i, trustedCert[i]);
+            }
+        }
+
+        // Import the key materials.
+        //
+        // Note that certification pathes bigger than one are not supported yet.
+        boolean hasKeyMaterials =
+            (keyMaterialCerts != null) && (keyMaterialCerts.length != 0) &&
+            (keyMaterialKeys != null) && (keyMaterialKeys.length != 0) &&
+            (keyMaterialKeyAlgs != null) && (keyMaterialKeyAlgs.length != 0) &&
+            (keyMaterialCerts.length == keyMaterialKeys.length) &&
+            (keyMaterialCerts.length == keyMaterialKeyAlgs.length);
+        if (hasKeyMaterials) {
+            ks = KeyStore.getInstance("JKS");
+            ks.load(null, null);
+
+            for (int i = 0; i < keyMaterialCerts.length; i++) {
+                String keyCertStr = keyMaterialCerts[i];
+
+                // generate the private key.
+                PKCS8EncodedKeySpec priKeySpec = new PKCS8EncodedKeySpec(
+                    Base64.getMimeDecoder().decode(keyMaterialKeys[i]));
+                KeyFactory kf =
+                    KeyFactory.getInstance(keyMaterialKeyAlgs[i]);
+                PrivateKey priKey = kf.generatePrivate(priKeySpec);
+
+                // generate certificate chain
+                is = new ByteArrayInputStream(keyCertStr.getBytes());
+                Certificate keyCert = null;
+                try {
+                    keyCert = cf.generateCertificate(is);
+                } finally {
+                    is.close();
+                }
+
+                Certificate[] chain = new Certificate[] { keyCert };
+
+                // import the key entry.
+                ks.setKeyEntry("cert-" + i, priKey, passphrase, chain);
+            }
+        }
+
+        // Create an SSLContext object.
+        TrustManagerFactory tmf = TrustManagerFactory.getInstance("PKIX");
+        tmf.init(ts);
+
+        SSLContext context = SSLContext.getInstance("TLS");
+        if (hasKeyMaterials && ks != null) {
+            KeyManagerFactory kmf = KeyManagerFactory.getInstance("NewSunX509");
+            kmf.init(ks, passphrase);
+
+            context.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
+        } else {
+            context.init(null, tmf.getTrustManagers(), null);
+        }
+
+        return context;
+    }
+
+    /*
+     * Create an instance of SSLEngine in client mode.
+     */
+    protected SSLEngine createClientEngine() throws Exception {
+        return createClientEngine(createClientSSLContext());
+    }
+
+    /*
+     * Create an instance of SSLEngine in client mode with the
+     * specified SSLContext object.
+     */
+    protected SSLEngine createClientEngine(
+        SSLContext context) throws Exception {
+
+        SSLEngine engine = context.createSSLEngine();
+        engine.setUseClientMode(true);
+
+        /*
+         * Customize the SSLEngine object.
+         */
+        // blank
+
+        return engine;
+    }
+
+    /*
+     * Create an instance of SSLEngine in server mode.
+     */
+    protected SSLEngine createServerEngine() throws Exception {
+        return createServerEngine(createServerSSLContext());
+    }
+
+    /*
+     * Create an instance of SSLEngine in server mode with the
+     * specified SSLContext object.
+     */
+    protected SSLEngine createServerEngine(
+        SSLContext context) throws Exception {
+
+        SSLEngine engine = context.createSSLEngine();
+        engine.setUseClientMode(false);
+
+        /*
+         * Customize the SSLEngine object.
+         */
+        engine.setNeedClientAuth(false);
+
+        return engine;
+    }
+
+    /*
+     * Run the delagayed tasks if any.
+     *
+     * If the result indicates that we have outstanding tasks to do,
+     * go ahead and run them in this thread.
+     */
+    protected static void runDelegatedTasks(SSLEngineResult result,
+            SSLEngine engine) throws Exception {
+
+        if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) {
+            Runnable runnable;
+            while ((runnable = engine.getDelegatedTask()) != null) {
+                log("\trunning delegated task...");
+                runnable.run();
+            }
+            HandshakeStatus hsStatus = engine.getHandshakeStatus();
+            if (hsStatus == HandshakeStatus.NEED_TASK) {
+                throw new Exception(
+                    "handshake shouldn't need additional tasks");
+            }
+            log("\tnew HandshakeStatus: " + hsStatus);
+        }
+    }
+
+    /*
+     * Logging the specificated message and the SSLEngine operation result.
+     */
+    protected static void log(String str, SSLEngineResult result) {
+        HandshakeStatus hsStatus = result.getHandshakeStatus();
+        log(str +
+            result.getStatus() + "/" + hsStatus + ", consumed: " +
+            result.bytesConsumed() + "/produced: " + result.bytesProduced() +
+            " bytes");
+
+        if (hsStatus == HandshakeStatus.FINISHED) {
+            log("\t...ready for application data");
+        }
+    }
+
+    /*
+     * Logging the specificated message.
+     */
+    protected static void log(String str) {
+        System.out.println(str);
+    }
+}
--- a/jdk/test/sun/net/www/http/HttpClient/RetryPost.java	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/test/sun/net/www/http/HttpClient/RetryPost.java	Mon Nov 14 09:03:07 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,10 +21,25 @@
  * questions.
  */
 
-import java.net.*;
-import java.util.*;
-import java.io.*;
-import com.sun.net.httpserver.*;
+/*
+ * @test
+ * @bug 6427251 6382788
+ * @modules jdk.httpserver
+ * @run main RetryPost
+ * @run main/othervm -Dsun.net.http.retryPost=false RetryPost noRetry
+ * @summary HttpURLConnection automatically retries non-idempotent method POST
+ */
+
+import com.sun.net.httpserver.HttpContext;
+import com.sun.net.httpserver.HttpExchange;
+import com.sun.net.httpserver.HttpHandler;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.InetSocketAddress;
+import java.net.Proxy;
+import java.net.SocketException;
+import java.net.URL;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ExecutorService;
 
--- a/jdk/test/sun/net/www/http/HttpClient/RetryPost.sh	Fri Nov 11 17:07:33 2016 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-#
-# Copyright (c) 2006, 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.
-#
-
- # @test
- # @bug 6427251 6382788
- # @run shell/timeout=140 RetryPost.sh
- # @summary HttpURLConnection automatically retries non-idempotent method POST
-
-OS=`uname -s`
-case "$OS" in
-  SunOS | Linux | Darwin | AIX )
-    PS=":"
-    FS="/"
-    ;;
-  CYGWIN* )
-    PS=";"
-    FS="/"
-    ;;
-  Windows* )
-    PS=";"
-    FS="\\"
-    ;;
-  * )
-    echo "Unrecognized system!"
-    exit 1;
-    ;;
-esac
-
-# compile
-${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}${FS}RetryPost.java
-
-# run with no option specified. Should retry POST request.
-${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} RetryPost
-result=$?
-if [ "$result" -ne "0" ]; then
-    exit 1
-fi
-
-# run with option specified. Should not retry POST request.
-${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Dsun.net.http.retryPost=false RetryPost noRetry
-result=$?
-if [ "$result" -ne "0" ]; then
-    exit 1
-fi
-
-# no failures, exit.
-exit 0
-
--- a/jdk/test/sun/net/www/http/KeepAliveStream/InfiniteLoop.java	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/test/sun/net/www/http/KeepAliveStream/InfiniteLoop.java	Mon Nov 14 09:03:07 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,14 +24,19 @@
 /*
  * @test
  * @bug 8004863
+ * @modules jdk.httpserver
  * @summary Checks for proper close code in KeepAliveStream
  */
 
 import com.sun.net.httpserver.HttpExchange;
 import com.sun.net.httpserver.HttpHandler;
 import com.sun.net.httpserver.HttpServer;
-import java.io.*;
-import java.net.*;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.InetSocketAddress;
+import java.net.URL;
 import java.util.concurrent.Phaser;
 
 // Racey test, will not always fail, but if it does then we have a problem.
--- a/jdk/test/sun/net/www/protocol/http/NoNTLM.java	Fri Nov 11 17:07:33 2016 +0300
+++ b/jdk/test/sun/net/www/protocol/http/NoNTLM.java	Mon Nov 14 09:03:07 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,11 +26,19 @@
  * @summary Sanity check that NTLM will not be selected by the http protocol
  *    handler when running on a profile that does not support NTLM
  * @modules java.base/sun.net.www
+ *          java.base/sun.net.www.protocol.http
  * @run main/othervm NoNTLM
  */
 
-import java.net.*;
-import java.io.*;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.net.Authenticator;
+import java.net.HttpURLConnection;
+import java.net.PasswordAuthentication;
+import java.net.Proxy;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.URL;
 import sun.net.www.MessageHeader;
 
 public class NoNTLM {
@@ -208,11 +216,14 @@
     }
 
     public static void main(String[] args) throws Exception {
-        // assume NTLM is not supported when Kerberos is not available
         try {
-            Class.forName("javax.security.auth.kerberos.KerberosPrincipal");
-            System.out.println("Kerberos is present, assuming NTLM is supported too");
-            return;
+            Class<?> ntlmProxyClass = Class.forName("sun.net.www.protocol.http.NTLMAuthenticationProxy", true, NoNTLM.class.getClassLoader());
+            Field ntlmSupportedField = ntlmProxyClass.getDeclaredField("supported");
+            ntlmSupportedField.setAccessible(true);
+            if (ntlmSupportedField.getBoolean(null)) {
+                System.out.println("NTLM is supported. Nothing to do. Exiting.");
+                return;
+            }
         } catch (ClassNotFoundException okay) { }
 
         // setup Authenticator