changeset 12803:c54a41fa5948

Merge
author asaha
date Wed, 27 Sep 2017 22:27:46 -0700
parents 14ec99ce504f 142b01c8fc80
children 3b1bfef6f82b ce62cccc3b7f
files .hgtags make/lib/CoreLibraries.gmk src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java src/macosx/native/sun/awt/AWTWindow.m src/macosx/native/sun/awt/JavaAccessibilityAction.m src/macosx/native/sun/awt/JavaComponentAccessibility.m src/share/classes/javax/swing/JList.java src/share/classes/sun/print/RasterPrinterJob.java src/solaris/native/java/net/NetworkInterface.c
diffstat 5 files changed, 256 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Wed Sep 13 02:05:05 2017 -0700
+++ b/.hgtags	Wed Sep 27 22:27:46 2017 -0700
@@ -664,6 +664,8 @@
 60767ec3909b3d0cb26dd7b3f952c62053719dda jdk8u112-b15
 5dd7e4bae5c2f1ee4f80c5570e7e3e2f715f7a32 jdk8u112-b16
 41fac11792c1ee6945f56721ee558a7424395a81 jdk8u112-b31
+548a51660ee94aeb77b2432594aeb87f87c21697 jdk8u112-b32
+a334b0815d34948188537a177a32cee27007ea2c jdk8u112-b33
 ab5ff8f1e52c5e3ca02e988f4d978af63ceca5b8 jdk8u121-b00
 5f0839ac7e0d25dd1ae705df496b12ca76c26d59 jdk8u121-b01
 f91e3aa155b3c6774afb456db15fb358313d5771 jdk8u121-b02
@@ -678,6 +680,12 @@
 ec72a941be0a50ab77f5375cf710bc06e4f118d3 jdk8u121-b11
 9561afc12df843ef21ecd9d7b3633371e7a2bfc4 jdk8u121-b12
 2974746e56192cdd14fc2dd43179bcf28e4faf4a jdk8u121-b13
+4f69f3363a2ecee8d3df2b046266a76c2a805139 jdk8u121-b31
+ec26e3331158912f86268ef473e64514c70cbd52 jdk8u121-b32
+cb2c7c89dd09edcda4cb7bd0db623c813d3e5dbc jdk8u121-b33
+90f36d39acdc5be0665722538749c59583e3b83d jdk8u121-b34
+cec5310dcc2b876dd53a057035cb63dd22f63257 jdk8u121-b35
+a5c94735ad3fb33f353abc23e25915db2ff7a36e jdk8u121-b36
 032874d46bf95478cb86690b3c91d335c0764b0b jdk8u131-b00
 bea5b22daf5ddd941f3bcbf7a4e5fc5244ceb788 jdk8u131-b01
 a01d217a232906e82f80e5bc3db4d60c4c74716e jdk8u131-b02
@@ -690,6 +698,10 @@
 40d00399869d8a28cfecf360234f340e9e0ad3b1 jdk8u131-b09
 c0091a673d766ce2e76a945bab6de325fe78dd88 jdk8u131-b10
 3ab471c4760a808e39406303ff33a25a542b9c75 jdk8u131-b11
+d50ccb38def5968145fd3f6e0579416bb027e85c jdk8u131-b31
+e54624a8ebe3639d3b2360adb9ae0fa32f1bef57 jdk8u131-b32
+15006e8dc79bd0005d264bff0b1677a109cf5a02 jdk8u131-b33
+e6e35f065443533c81db69022a272927b0b20f69 jdk8u131-b34
 a160009bbe1417d85f1c0eec890fdb17391b3637 jdk8u141-b00
 e95a13de2d36050302a1af422967f5260fc8eabd jdk8u141-b01
 936085d9aff0554a3bdab2fcbbec1d1864e656a2 jdk8u141-b02
@@ -710,8 +722,14 @@
 c6bc194fedb63b20c45c793405d215d206fb4654 jdk8u141-b13
 d630e23b8e36c2863225d7ae107c73a38d3e6102 jdk8u141-b14
 2ea94405100763c772ab3989200115d7a23c7532 jdk8u141-b15
+55899d2b99b0725d74eebc510a116423329ad6f0 jdk8u141-b31
+a3c4020f84aeb0dba467534239951f8818bdfb84 jdk8u141-b32
 b64b1dfdbe7cfe3859f1023c0f1fb0216bce4ae7 jdk8u144-b00
 d2744852f3e64f7b0ba54f3a64ed5e2107e6ee68 jdk8u144-b01
+a05113a4c91c59f44b9894e12aeda07a7534ff7e jdk8u144-b31
+c4f7f2878c4bc54dcc12eddbbcd90d4c7a5dddfe jdk8u144-b32
+785d45a4c0b715ff0131abda873e3c2f85874ac3 jdk8u144-b33
+71dee2264dddd5a2c90d8c6f3a3f4ffd8da02551 jdk8u144-b34
 072e084bceeedeb75467e40ca77786ac9ef5227a jdk8u151-b00
 5b0fa6e004312a5910a6a70e4fbc0f00a678e650 jdk8u151-b01
 bd40efd56b4544ff9048d2f7be4cf108b281a6f3 jdk8u151-b02
--- a/src/share/classes/sun/management/MemoryPoolImpl.java	Wed Sep 13 02:05:05 2017 -0700
+++ b/src/share/classes/sun/management/MemoryPoolImpl.java	Wed Sep 27 22:27:46 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -304,8 +304,7 @@
                                           getCount());
         }
         void triggerAction() {
-            // Should not reach here
-            throw new AssertionError("Should not reach here");
+            // do nothing
         }
         void clearAction() {
             // do nothing
@@ -332,8 +331,7 @@
                                           gcSensor.getCount());
         }
         void triggerAction() {
-            // Should not reach here
-            throw new AssertionError("Should not reach here");
+            // do nothing
         }
         void clearAction() {
             // do nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/ws/8172297/Main.java	Wed Sep 27 22:27:46 2017 -0700
@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * 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 8172297
+ * @summary Test that carriage-return and new-line characters
+ * are preserved in webservice parameters
+ * @compile ws/HelloWorld.java ws/HelloWorldImpl.java Main.java
+ * @run testng/othervm Main
+ */
+
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.net.URL;
+import java.util.concurrent.CountDownLatch;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Endpoint;
+import javax.xml.ws.Service;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import ws.HelloWorld;
+import ws.HelloWorldImpl;
+
+public class Main {
+
+    @Test
+    public void runTest() throws Exception {
+        //
+        CountDownLatch serverInitSignal = new CountDownLatch(1);
+        CountDownLatch testDoneSignal = new CountDownLatch(1);
+
+        WebserviceRunner serverThread = new WebserviceRunner(serverInitSignal, testDoneSignal);
+        (new Thread(serverThread)).start();
+
+        serverInitSignal.await();
+
+        boolean paramModified = runClientCode(serverThread.getPort());
+
+        testDoneSignal.countDown();
+
+        Assert.assertFalse(paramModified, "WS parameter was modified during round trip.");
+    }
+
+    /*
+     * Connects to launched web service endpoint, sends message with CR/NL symbols and
+     * checks if it was modified during the round trip client/server communication.
+     */
+    private boolean runClientCode(int port) throws Exception {
+        System.out.println("Launching WS client connection on " + port + " port");
+        URL url = new URL("http://localhost:" + port + "/ws/hello?wsdl");
+        QName qname = new QName("http://ws/", "HelloWorldImplService");
+        Service service = Service.create(url, qname);
+
+        HelloWorld hello = (HelloWorld) service.getPort(HelloWorld.class);
+
+        logStringContent("Client input parameter", WS_PARAM_VALUE);
+
+        String response = hello.getHelloWorldAsString(WS_PARAM_VALUE);
+        logStringContent("Client response parameter", response);
+
+        return !WS_PARAM_VALUE.equals(response);
+    }
+
+    /*
+     * Outputs the parameter value with newline and carriage-return symbols
+     * replaced with #CR and #NL text abbreviations.
+     */
+    private static void logStringContent(String description, String parameter) {
+        String readableContent = parameter.replaceAll("\r", "#CR")
+                                          .replaceAll("\n", "#NL");
+        System.out.println(description + ": '" + readableContent + "'");
+    }
+
+    /* Web service parameter value with newline and carriage-return symbols */
+    private final static String WS_PARAM_VALUE = "\r\r\n\r\r CarriageReturn and "
+                                                +"NewLine \r\n\n Test \r\r\r\r";
+
+    /*
+     * Web service server thread that publishes WS on vacant port and waits
+     * for client to finalize testing
+     */
+    class WebserviceRunner implements Runnable {
+        // Latch used to signalize when WS endpoint is initialized
+        private final CountDownLatch initSignal;
+        // Latch used to signalize when client completed testing
+        private final CountDownLatch doneSignal;
+        // Port where WS endpoint is published
+        private volatile int port = 0;
+
+        // Constructor
+        WebserviceRunner(CountDownLatch initSignal, CountDownLatch doneSignal) {
+            this.initSignal = initSignal;
+            this.doneSignal = doneSignal;
+        }
+
+        // Returns port of the published endpoint
+        public int getPort() {
+            return port;
+        }
+
+        /*
+         * Publish web service on vacant port and waits for the client to
+         * complete testing.
+         */
+        public void run() {
+            try {
+                // Find vacant port number
+                ServerSocket ss = new ServerSocket(0);
+                port = ss.getLocalPort();
+                ss.close();
+
+                // Publish WebService
+                System.out.println("Publishing WebService on " + port + " port");
+                Endpoint ep = Endpoint.publish("http://localhost:" + port + "/ws/hello", new HelloWorldImpl());
+
+                // Notify main thread that WS endpoint is published
+                initSignal.countDown();
+
+                // Wait for main thread to complete testing
+                System.out.println("Waiting for done signal from test client.");
+                doneSignal.await();
+
+                // Terminate WS endpoint
+                System.out.println("Got done signal from the client. Stopping WS endpoint.");
+                ep.stop();
+            } catch (IOException ioe) {
+                System.out.println("Failed to get vacant port number:" + ioe);
+            } catch (InterruptedException ie) {
+                System.out.println("Failed to wait for test completion:" + ie);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/ws/8172297/ws/HelloWorld.java	Wed Sep 27 22:27:46 2017 -0700
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package ws;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+import javax.jws.soap.SOAPBinding.Use;
+
+//Web service endpoint interface
+@WebService
+@SOAPBinding(style = Style.DOCUMENT, use = Use.LITERAL)
+public interface HelloWorld {
+
+    @WebMethod
+    String getHelloWorldAsString(String name);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/ws/8172297/ws/HelloWorldImpl.java	Wed Sep 27 22:27:46 2017 -0700
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package ws;
+
+import javax.jws.WebService;
+
+// Simple web service implementation that echoes its parameter
+@WebService(endpointInterface = "ws.HelloWorld")
+public class HelloWorldImpl implements HelloWorld {
+
+    @Override
+    public String getHelloWorldAsString(String name) {
+        System.out.println("Server-side parameter value: '"
+                + name.replaceAll("\r", "#CR")
+                      .replaceAll("\n", "#NL") + "'");
+        return name;
+    }
+}