Merge
authordbuck
Mon, 21 Dec 2015 19:59:17 +0100
changeset 34777 0c33c65fa858
parent 34776 9229b3f76c40 (diff)
parent 34764 f9bcdce2df26 (current diff)
child 34778 45c1293ab19a
Merge
hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp
hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp
hotspot/src/os/aix/vm/thread_aix.inline.hpp
hotspot/src/os/bsd/vm/thread_bsd.inline.hpp
hotspot/src/os/linux/vm/thread_linux.inline.hpp
hotspot/src/os/solaris/vm/thread_solaris.inline.hpp
hotspot/src/os/windows/vm/thread_windows.inline.hpp
hotspot/src/os_cpu/aix_ppc/vm/threadLS_aix_ppc.cpp
hotspot/src/os_cpu/aix_ppc/vm/threadLS_aix_ppc.hpp
hotspot/src/os_cpu/bsd_x86/vm/threadLS_bsd_x86.cpp
hotspot/src/os_cpu/bsd_x86/vm/threadLS_bsd_x86.hpp
hotspot/src/os_cpu/bsd_zero/vm/threadLS_bsd_zero.cpp
hotspot/src/os_cpu/bsd_zero/vm/threadLS_bsd_zero.hpp
hotspot/src/os_cpu/linux_aarch64/vm/threadLS_linux_aarch64.cpp
hotspot/src/os_cpu/linux_aarch64/vm/threadLS_linux_aarch64.hpp
hotspot/src/os_cpu/linux_ppc/vm/threadLS_linux_ppc.cpp
hotspot/src/os_cpu/linux_ppc/vm/threadLS_linux_ppc.hpp
hotspot/src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.cpp
hotspot/src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.hpp
hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.cpp
hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp
hotspot/src/os_cpu/linux_zero/vm/threadLS_linux_zero.cpp
hotspot/src/os_cpu/linux_zero/vm/threadLS_linux_zero.hpp
hotspot/src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.cpp
hotspot/src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.hpp
hotspot/src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.cpp
hotspot/src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.hpp
hotspot/src/os_cpu/windows_x86/vm/threadLS_windows_x86.cpp
hotspot/src/os_cpu/windows_x86/vm/threadLS_windows_x86.hpp
hotspot/src/share/vm/gc/g1/g1RootClosures.inline.hpp
hotspot/src/share/vm/runtime/threadLocalStorage.cpp
hotspot/test/runtime/logging/SafepointTestMain.java
hotspot/test/runtime/logging/VMOperationTestMain.java
langtools/test/tools/javac/6547131/p/Outer$I.class
langtools/test/tools/javac/6547131/p/Outer.class
langtools/test/tools/javac/InnerClassesAttribute/Outside$1$Inside.class
langtools/test/tools/javac/InnerClassesAttribute/Outside.class
langtools/test/tools/javac/T6435291/T.class
langtools/test/tools/javac/missingSuperRecovery/impl.class
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/LongArrayData.java
--- a/jdk/src/java.base/share/classes/java/net/URL.java	Wed Jul 05 21:09:59 2017 +0200
+++ b/jdk/src/java.base/share/classes/java/net/URL.java	Mon Dec 21 19:59:17 2015 +0100
@@ -310,7 +310,8 @@
      * @param      host       the name of the host.
      * @param      port       the port number on the host.
      * @param      file       the file on the host
-     * @exception  MalformedURLException  if an unknown protocol is specified.
+     * @exception  MalformedURLException  if an unknown protocol or the port
+     *                  is a negative number other than -1
      * @see        java.lang.System#getProperty(java.lang.String)
      * @see        java.net.URL#setURLStreamHandlerFactory(
      *                  java.net.URLStreamHandlerFactory)
@@ -329,9 +330,9 @@
      * name, {@code host} name, and {@code file} name. The
      * default port for the specified protocol is used.
      * <p>
-     * This method is equivalent to calling the four-argument
-     * constructor with the arguments being {@code protocol},
-     * {@code host}, {@code -1}, and {@code file}.
+     * This constructor is equivalent to the four-argument
+     * constructor with the only difference of using the
+     * default port for the specified protocol.
      *
      * No validation of the inputs is performed by this constructor.
      *
@@ -372,7 +373,8 @@
      * @param      port       the port number on the host.
      * @param      file       the file on the host
      * @param      handler    the stream handler for the URL.
-     * @exception  MalformedURLException  if an unknown protocol is specified.
+     * @exception  MalformedURLException  if an unknown protocol or the port
+                        is a negative number other than -1
      * @exception  SecurityException
      *        if a security manager exists and its
      *        {@code checkPermission} method doesn't allow
@@ -446,7 +448,9 @@
      *
      * @param      spec   the {@code String} to parse as a URL.
      * @exception  MalformedURLException  if no protocol is specified, or an
-     *               unknown protocol is found, or {@code spec} is {@code null}.
+     *               unknown protocol is found, or {@code spec} is {@code null},
+     *               or the parsed URL fails to comply with the specific syntax
+     *               of the associated protocol.
      * @see        java.net.URL#URL(java.net.URL, java.lang.String)
      */
     public URL(String spec) throws MalformedURLException {
@@ -493,7 +497,9 @@
      * @param      context   the context in which to parse the specification.
      * @param      spec      the {@code String} to parse as a URL.
      * @exception  MalformedURLException  if no protocol is specified, or an
-     *               unknown protocol is found, or {@code spec} is {@code null}.
+     *               unknown protocol is found, or {@code spec} is {@code null},
+     *               or the parsed URL fails to comply with the specific syntax
+     *               of the associated protocol.
      * @see        java.net.URL#URL(java.lang.String, java.lang.String,
      *                  int, java.lang.String)
      * @see        java.net.URLStreamHandler
@@ -513,7 +519,9 @@
      * @param      spec      the {@code String} to parse as a URL.
      * @param      handler   the stream handler for the URL.
      * @exception  MalformedURLException  if no protocol is specified, or an
-     *               unknown protocol is found, or {@code spec} is {@code null}.
+     *               unknown protocol is found, or {@code spec} is {@code null},
+     *               or the parsed URL fails to comply with the specific syntax
+     *               of the associated protocol.
      * @exception  SecurityException
      *        if a security manager exists and its
      *        {@code checkPermission} method doesn't allow
--- a/jdk/test/java/net/URL/TestPort.java	Wed Jul 05 21:09:59 2017 +0200
+++ b/jdk/test/java/net/URL/TestPort.java	Mon Dec 21 19:59:17 2015 +0100
@@ -23,28 +23,33 @@
 
 /*
  * @test
- * @bug 4101492 4444213
+ * @bug 4101492 4444213 4906983
  * @summary The java.net.URL constructor allows port < 0 and port > 65535
  */
 
 import java.net.*;
 
 public class TestPort {
-    public static void main(String[] args) {
-        URL url = null;
+    public static void main(String[] args) throws MalformedURLException {
+        // URLs are able to have port bigger than TCP-Port 65535 and
+        // to have no port (-1) at all.:
+        URL url = new URL("http","server",Integer.MAX_VALUE,"/path");
+        url = new URL("http://server:"+Integer.MAX_VALUE+"/path");
+        url = new URL("http://server/path");
+        url = new URL("http","server",-1,"/path");
+
         try {
             url = new URL("ftp", "java.sun.com", -20, "/pub/");
+            throw new RuntimeException("MalformedURLException not thrown!");
         } catch (MalformedURLException e) {
-            url = null;
+            // Everything fine. MalformedURLException expected
         }
-        if (url != null)
-            throw new RuntimeException("MalformedURLException not thrown!");
+
         try {
             url = new URL("ftp://java.sun.com:-20/pub/");
+            throw new RuntimeException("MalformedURLException not thrown!");
         } catch (MalformedURLException e) {
-            url = null;
+            // Everything fine. MalformedURLException expected
         }
-        if (url != null)
-            throw new RuntimeException("MalformedURLException not thrown!");
     }
 }