From db7c757726dddbb4342b2f2969f0b4cca12eabf6 Mon Sep 17 00:00:00 2001 From: Lance Andersen Date: Sat, 29 Nov 2014 11:14:20 -0500 Subject: [PATCH 1/4] 8066188: BaseRowSet default value for escape processing is not correct Reviewed-by: alanb --- .../share/classes/javax/sql/rowset/BaseRowSet.java | 2 +- jdk/test/javax/sql/testng/test/rowset/BaseRowSetTests.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/BaseRowSet.java b/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/BaseRowSet.java index 2998715e3c8..7f65c0eed9c 100644 --- a/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/BaseRowSet.java +++ b/jdk/src/java.sql.rowset/share/classes/javax/sql/rowset/BaseRowSet.java @@ -462,7 +462,7 @@ public abstract class BaseRowSet implements Serializable, Cloneable { * false that it is not. The default is true. * @serial */ - private boolean escapeProcessing; + private boolean escapeProcessing = true; /** * A constant indicating the isolation level of the connection diff --git a/jdk/test/javax/sql/testng/test/rowset/BaseRowSetTests.java b/jdk/test/javax/sql/testng/test/rowset/BaseRowSetTests.java index e1b5457bda8..8e92f20af33 100644 --- a/jdk/test/javax/sql/testng/test/rowset/BaseRowSetTests.java +++ b/jdk/test/javax/sql/testng/test/rowset/BaseRowSetTests.java @@ -186,11 +186,11 @@ public class BaseRowSetTests extends BaseTest { } /* - * Validate that getEscapeProcessing() returns false by default + * Validate that getEscapeProcessing() returns true by default */ @Test public void test08() throws Exception { - assertFalse(brs.getEscapeProcessing()); + assertTrue(brs.getEscapeProcessing()); } /* From 14ee08928760e5d97c574e746775d28c0ae552cb Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Mon, 1 Dec 2014 13:44:57 +0000 Subject: [PATCH 2/4] 8066196: (fs) Typo in Path::normalize, empty path only returned if path does not have a root component Reviewed-by: dfuchs --- jdk/src/java.base/share/classes/java/nio/file/Path.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/src/java.base/share/classes/java/nio/file/Path.java b/jdk/src/java.base/share/classes/java/nio/file/Path.java index daa09f4cf87..9df57c120e0 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/Path.java +++ b/jdk/src/java.base/share/classes/java/nio/file/Path.java @@ -325,7 +325,7 @@ public interface Path * * @return the resulting path or this path if it does not contain * redundant name elements; an empty path is returned if this path - * does have a root component and all name elements are redundant + * does not have a root component and all name elements are redundant * * @see #getParent * @see #toRealPath From 5f72abe97e68570cff5d58fe52b4efc3d38fa250 Mon Sep 17 00:00:00 2001 From: Lance Andersen Date: Mon, 1 Dec 2014 11:34:44 -0500 Subject: [PATCH 3/4] 8066261: Typo in Connection.isValid Reviewed-by: dfuchs --- jdk/src/java.sql/share/classes/java/sql/Connection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/src/java.sql/share/classes/java/sql/Connection.java b/jdk/src/java.sql/share/classes/java/sql/Connection.java index ac73fde29dd..ac5d3158b6e 100644 --- a/jdk/src/java.sql/share/classes/java/sql/Connection.java +++ b/jdk/src/java.sql/share/classes/java/sql/Connection.java @@ -1116,7 +1116,7 @@ public interface Connection extends Wrapper, AutoCloseable { * * @return true if the connection is valid, false otherwise * @exception SQLException if the value supplied for timeout - * is less then 0 + * is less than 0 * @since 1.6 * * @see java.sql.DatabaseMetaData#getClientInfoProperties From 392436eade0b7eef17305e45fd3de51128883bd8 Mon Sep 17 00:00:00 2001 From: Mark Sheppard Date: Mon, 1 Dec 2014 17:20:06 +0000 Subject: [PATCH 4/4] 8066130: com.sun.net.httpserver stop() throws NullPointerException if it is not started Added null check on dispatcherThread variable in stop method Reviewed-by: chegar --- .../sun/net/httpserver/ServerImpl.java | 12 +++--- .../sun/net/httpserver/StopNoStartTest.java | 42 +++++++++++++++++++ 2 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 jdk/test/com/sun/net/httpserver/StopNoStartTest.java diff --git a/jdk/src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java b/jdk/src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java index 5952c79ee87..24ab8b014db 100644 --- a/jdk/src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java +++ b/jdk/src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java @@ -206,11 +206,13 @@ class ServerImpl implements TimeSource { if (timer1Enabled) { timer1.cancel(); } - try { - dispatcherThread.join(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - logger.log(Level.FINER, "ServerImpl.stop: ", e); + if (dispatcherThread != null) { + try { + dispatcherThread.join(); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + logger.log(Level.FINER, "ServerImpl.stop: ", e); + } } } diff --git a/jdk/test/com/sun/net/httpserver/StopNoStartTest.java b/jdk/test/com/sun/net/httpserver/StopNoStartTest.java new file mode 100644 index 00000000000..c10d767e7d7 --- /dev/null +++ b/jdk/test/com/sun/net/httpserver/StopNoStartTest.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8066130 + * @summary Test HttpServer stop method invocation before a start has been called + */ + +import java.net.InetSocketAddress; +import com.sun.net.httpserver.HttpServer; + + +public class StopNoStartTest { + + public static void main(String[] args) throws Exception { + + InetSocketAddress serverAddr = new InetSocketAddress(0); + HttpServer server = HttpServer.create(serverAddr, 0); + server.stop(0); + } +}