Merge
authoramurillo
Tue, 31 May 2016 13:15:48 -0700
changeset 38760 bd8975d946b8
parent 38759 ff0f46d3773a (current diff)
parent 38755 8852a837f30a (diff)
child 38761 e31b47204f64
Merge
--- a/jdk/src/java.base/share/conf/security/java.policy	Tue May 31 09:41:18 2016 -0700
+++ b/jdk/src/java.base/share/conf/security/java.policy	Tue May 31 13:15:48 2016 -0700
@@ -33,6 +33,14 @@
         permission java.io.FilePermission "${java.home}/conf/security/ucrypto-solaris.cfg", "read";
 };
 
+grant codeBase "jrt:/java.sql" {
+        permission java.security.AllPermission;
+};
+
+grant codeBase "jrt:/java.sql.rowset" {
+        permission java.security.AllPermission;
+};
+
 grant codeBase "jrt:/jdk.crypto.ec" {
         permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
         permission java.lang.RuntimePermission "loadLibrary.sunec";
--- a/jdk/src/java.base/share/native/libjli/java.c	Tue May 31 09:41:18 2016 -0700
+++ b/jdk/src/java.base/share/native/libjli/java.c	Tue May 31 13:15:48 2016 -0700
@@ -108,6 +108,7 @@
 static void SetPatchProp(const jint n, const char *s);
 static void SelectVersion(int argc, char **argv, char **main_class);
 static void SetJvmEnvironment(int argc, char **argv);
+static jboolean IsWhiteSpaceOptionArgument(const char* name);
 static jboolean ParseArguments(int *pargc, char ***pargv,
                                int *pmode, char **pwhat,
                                int *pret, const char *jrepath);
@@ -500,6 +501,20 @@
 }
 
 /*
+ * Test if the given option name has a whitespace separated argument.
+ */
+jboolean
+IsWhiteSpaceOptionArgument(const char* name) {
+    return JLI_StrCmp(name, "-classpath") == 0 ||
+           JLI_StrCmp(name, "-cp") == 0 ||
+           JLI_StrCmp(name, "-modulepath") == 0 ||
+           JLI_StrCmp(name, "-mp") == 0 ||
+           JLI_StrCmp(name, "-upgrademodulepath") == 0 ||
+           JLI_StrCmp(name, "-addmods") == 0 ||
+           JLI_StrCmp(name, "-limitmods") == 0;
+}
+
+/*
  * Checks the command line options to find which JVM type was
  * specified.  If no command line option was given for the JVM type,
  * the default type is used.  The environment variable
@@ -534,13 +549,7 @@
                 continue;
             }
         } else {
-            if (JLI_StrCmp(arg, "-classpath") == 0 ||
-                JLI_StrCmp(arg, "-cp") == 0 ||
-                JLI_StrCmp(arg, "-modulepath") == 0 ||
-                JLI_StrCmp(arg, "-mp") == 0 ||
-                JLI_StrCmp(arg, "-upgrademodulepath") == 0 ||
-                JLI_StrCmp(arg, "-addmods") == 0 ||
-                JLI_StrCmp(arg, "-limitmods") == 0) {
+            if (IsWhiteSpaceOptionArgument(arg)) {
                 newArgv[newArgvIdx++] = arg;
                 argi++;
                 if (argi < argc) {
@@ -682,9 +691,7 @@
         if (i > 0) {
             char *prev = argv[i - 1];
             // skip non-dash arg preceded by class path specifiers
-            if (*arg != '-' &&
-                    ((JLI_StrCmp(prev, "-cp") == 0
-                    || JLI_StrCmp(prev, "-classpath") == 0))) {
+            if (*arg != '-' && IsWhiteSpaceOptionArgument(prev)) {
                 continue;
             }
 
@@ -1028,9 +1035,7 @@
         } else {
             if (JLI_StrCmp(arg, "-jar") == 0)
                 jarflag = 1;
-            /* deal with "unfortunate" classpath syntax */
-            if ((JLI_StrCmp(arg, "-classpath") == 0 || JLI_StrCmp(arg, "-cp") == 0) &&
-              (argc >= 2)) {
+            if (IsWhiteSpaceOptionArgument(arg) && (argc >= 2)) {
                 argc--;
                 argv++;
                 arg = *argv;
--- a/jdk/test/ProblemList.txt	Tue May 31 09:41:18 2016 -0700
+++ b/jdk/test/ProblemList.txt	Tue May 31 13:15:48 2016 -0700
@@ -346,6 +346,13 @@
 
 ############################################################################
 
+# jdk_time
+
+java/time/test/java/time/TestClock_System.java                  8158128 solaris-all
+
+
+############################################################################
+
 # jdk_util
 
 java/util/spi/ResourceBundleControlProvider/UserDefaultControlTest.java 8062512 generic-all
--- a/jdk/test/sun/net/www/protocol/http/ZoneId.java	Tue May 31 09:41:18 2016 -0700
+++ b/jdk/test/sun/net/www/protocol/http/ZoneId.java	Tue May 31 13:15:48 2016 -0700
@@ -24,9 +24,7 @@
 /*
  * @test
  * @bug 8027308
- * @key intermittent
- * @modules java.base/sun.net.www.protocol.http
- *          jdk.httpserver
+ * @modules jdk.httpserver
  * @summary  verifies that HttpURLConnection does not send the zone id in the
  *           'Host' field of the header:
  *              Host: [fe80::a00:27ff:aaaa:aaaa] instead of
@@ -42,40 +40,41 @@
 import java.net.*;
 import java.util.Enumeration;
 import java.util.List;
+import java.util.Optional;
 import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutionException;
+import static java.lang.System.out;
+import static java.net.Proxy.NO_PROXY;
 
 public class ZoneId {
 
     public static void main(String[] args) throws Exception {
 
-        InetAddress address = getAppropriateIPv6Address();
+        InetAddress address = getIPv6LookbackAddress();
 
         if (address == null) {
-            System.out.println(
-                    "The test will be skipped as not a single " +
-                    "appropriate IPv6 address was found on this machine");
+            out.println("Cannot find the IPv6 loopback address. Skipping test.");
             return;
         }
         String ip6_literal = address.getHostAddress();
 
-        System.out.println("Found an appropriate IPv6 address: " + address);
+        out.println("Found an appropriate IPv6 address: " + address);
 
-        System.out.println("Starting http server...");
-        HttpServer server =
-                HttpServer.create(new InetSocketAddress(address, 0), 0);
+        out.println("Starting http server...");
+        HttpServer server = HttpServer.create(new InetSocketAddress(0), 0);
         CompletableFuture<Headers> headers = new CompletableFuture<>();
         server.createContext("/", createCapturingHandler(headers));
         server.start();
-        System.out.println("Started at " + server.getAddress());
+        out.println("Started at " + server.getAddress());
+
         try {
-            String spec = "http://[" + address.getHostAddress() + "]:" + server.getAddress().getPort();
-            System.out.println("Client is connecting to: " + spec);
-            URLConnection urlConnection = new URL(spec).openConnection();
-            ((sun.net.www.protocol.http.HttpURLConnection) urlConnection)
-                    .getResponseCode();
+            int port = server.getAddress().getPort();
+            String spec = "http://[" + address.getHostAddress() + "]:" + port;
+            out.println("Client is connecting to: " + spec);
+            URL url = new URL(spec);
+            HttpURLConnection uc = (HttpURLConnection)url.openConnection(NO_PROXY);
+            uc.getResponseCode();
         } finally {
-            System.out.println("Shutting down the server...");
+            out.println("Shutting down the server...");
             server.stop(0);
         }
 
@@ -83,7 +82,7 @@
         String ip6_address = ip6_literal.substring(0, idx);
         List<String> hosts = headers.get().get("Host");
 
-        System.out.println("Host: " + hosts);
+        out.println("Host: " + hosts);
 
         if (hosts.size() != 1 || hosts.get(0).contains("%") ||
                                 !hosts.get(0).contains(ip6_address)) {
@@ -91,33 +90,27 @@
         }
     }
 
-    private static InetAddress getAppropriateIPv6Address() throws SocketException {
-        System.out.println("Searching through the network interfaces...");
+    static InetAddress getIPv6LookbackAddress() throws SocketException {
+        out.println("Searching for the IPv6 loopback address...");
         Enumeration<NetworkInterface> is = NetworkInterface.getNetworkInterfaces();
+
+        // The IPv6 loopback address contains a scope id, and is "connect-able".
         while (is.hasMoreElements()) {
             NetworkInterface i = is.nextElement();
-            System.out.println("\tinterface: " + i);
-
-            // just a "good enough" marker that the interface
-            // does not support a loopback and therefore should not be used
-            if ( i.getHardwareAddress() == null) continue;
-            if (!i.isUp()) continue;
+            if (!i.isLoopback())
+                continue;
+            Optional<InetAddress> addr = i.inetAddresses()
+                    .filter(x -> x instanceof Inet6Address)
+                    .filter(y -> y.toString().contains("%"))
+                    .findFirst();
+            if (addr.isPresent())
+                return addr.get();
+        }
 
-            Enumeration<InetAddress> as = i.getInetAddresses();
-            while (as.hasMoreElements()) {
-                InetAddress a = as.nextElement();
-                System.out.println("\t\taddress: " + a.getHostAddress());
-                if ( !(a instanceof Inet6Address &&
-                       a.toString().contains("%")) ) {
-                    continue;
-                }
-                return a;
-            }
-        }
         return null;
     }
 
-    private static HttpHandler createCapturingHandler(CompletableFuture<Headers> headers) {
+    static HttpHandler createCapturingHandler(CompletableFuture<Headers> headers) {
         return new HttpHandler() {
             @Override
             public void handle(HttpExchange exchange) throws IOException {