# HG changeset patch
# User dcubed
# Date 1460048628 25200
# Node ID 820fef956a152e5a72a7b62a651413354dfc90fc
# Parent 2696577a976c1d755b5a97a0954f397be990c97b# Parent ad222f3750f5681b6f5ce2e2a3d52219be76f2fb
Merge
diff -r 2696577a976c -r 820fef956a15 jdk/make/mapfiles/libjava/mapfile-vers
--- a/jdk/make/mapfiles/libjava/mapfile-vers Mon Apr 04 13:40:23 2016 -0700
+++ b/jdk/make/mapfiles/libjava/mapfile-vers Thu Apr 07 10:03:48 2016 -0700
@@ -224,8 +224,7 @@
Java_java_lang_System_setOut0;
Java_java_lang_Thread_registerNatives;
Java_java_lang_Throwable_fillInStackTrace;
- Java_java_lang_Throwable_getStackTraceDepth;
- Java_java_lang_Throwable_getStackTraceElement;
+ Java_java_lang_Throwable_getStackTraceElements;
Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2;
Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2Ljava_security_AccessControlContext_2;
Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2;
diff -r 2696577a976c -r 820fef956a15 jdk/make/mapfiles/libjava/reorder-sparc
--- a/jdk/make/mapfiles/libjava/reorder-sparc Mon Apr 04 13:40:23 2016 -0700
+++ b/jdk/make/mapfiles/libjava/reorder-sparc Thu Apr 07 10:03:48 2016 -0700
@@ -78,8 +78,7 @@
text: .text%JNU_GetEnv;
text: .text%Java_java_io_UnixFileSystem_checkAccess;
text: .text%Java_java_lang_reflect_Array_newArray;
-text: .text%Java_java_lang_Throwable_getStackTraceDepth;
-text: .text%Java_java_lang_Throwable_getStackTraceElement;
+text: .text%Java_java_lang_Throwable_getStackTraceElements;
text: .text%throwFileNotFoundException;
text: .text%JNU_NotifyAll;
# Test LoadFrame
diff -r 2696577a976c -r 820fef956a15 jdk/make/mapfiles/libjava/reorder-sparcv9
--- a/jdk/make/mapfiles/libjava/reorder-sparcv9 Mon Apr 04 13:40:23 2016 -0700
+++ b/jdk/make/mapfiles/libjava/reorder-sparcv9 Thu Apr 07 10:03:48 2016 -0700
@@ -74,8 +74,7 @@
text: .text%JNU_GetEnv;
text: .text%Java_java_io_UnixFileSystem_checkAccess;
text: .text%Java_java_lang_reflect_Array_newArray;
-text: .text%Java_java_lang_Throwable_getStackTraceDepth;
-text: .text%Java_java_lang_Throwable_getStackTraceElement;
+text: .text%Java_java_lang_Throwable_getStackTraceElements;
text: .text%throwFileNotFoundException: OUTPUTDIR/io_util.o;
text: .text%JNU_NotifyAll;
# Test LoadFrame
diff -r 2696577a976c -r 820fef956a15 jdk/make/mapfiles/libjava/reorder-x86
--- a/jdk/make/mapfiles/libjava/reorder-x86 Mon Apr 04 13:40:23 2016 -0700
+++ b/jdk/make/mapfiles/libjava/reorder-x86 Thu Apr 07 10:03:48 2016 -0700
@@ -78,8 +78,7 @@
text: .text%Java_sun_reflect_NativeMethodAccessorImpl_invoke0;
text: .text%Java_java_io_FileInputStream_available;
text: .text%Java_java_lang_reflect_Array_newArray;
-text: .text%Java_java_lang_Throwable_getStackTraceDepth;
-text: .text%Java_java_lang_Throwable_getStackTraceElement;
+text: .text%Java_java_lang_Throwable_getStackTraceElements;
text: .text%Java_java_lang_System_identityHashCode;
text: .text%JNU_NotifyAll;
# Test LoadFrame
diff -r 2696577a976c -r 820fef956a15 jdk/src/java.base/share/classes/java/lang/StackTraceElement.java
--- a/jdk/src/java.base/share/classes/java/lang/StackTraceElement.java Mon Apr 04 13:40:23 2016 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/StackTraceElement.java Thu Apr 07 10:03:48 2016 -0700
@@ -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
@@ -112,6 +112,12 @@
this.lineNumber = lineNumber;
}
+
+ /**
+ * Creates an empty stack frame element to be filled in by Throwable.
+ */
+ StackTraceElement() { }
+
/**
* Returns the name of the source file containing the execution point
* represented by this stack trace element. Generally, this corresponds
diff -r 2696577a976c -r 820fef956a15 jdk/src/java.base/share/classes/java/lang/Throwable.java
--- a/jdk/src/java.base/share/classes/java/lang/Throwable.java Mon Apr 04 13:40:23 2016 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/Throwable.java Thu Apr 07 10:03:48 2016 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -118,7 +118,7 @@
private static final long serialVersionUID = -3042686055658047285L;
/**
- * Native code saves some indication of the stack backtrace in this slot.
+ * The JVM saves some indication of the stack backtrace in this slot.
*/
private transient Object backtrace;
@@ -211,6 +211,11 @@
*/
private StackTraceElement[] stackTrace = UNASSIGNED_STACK;
+ /**
+ * The JVM code sets the depth of the backtrace for later retrieval
+ */
+ private transient int depth;
+
// Setting this static field introduces an acceptable
// initialization dependency on a few java.util classes.
private static final List SUPPRESSED_SENTINEL = Collections.emptyList();
@@ -828,10 +833,11 @@
if (backtrace instanceof StackStreamFactory.StackTrace) {
stackTrace = ((StackStreamFactory.StackTrace)backtrace).getStackTraceElements();
} else {
- int depth = getStackTraceDepth();
stackTrace = new StackTraceElement[depth];
- for (int i = 0; i < depth; i++)
- stackTrace[i] = getStackTraceElement(i);
+ for (int i = 0; i < depth; i++) {
+ stackTrace[i] = new StackTraceElement();
+ }
+ getStackTraceElements(stackTrace);
}
} else if (stackTrace == null) {
return UNASSIGNED_STACK;
@@ -884,23 +890,11 @@
}
/**
- * Returns the number of elements in the stack trace (or 0 if the stack
- * trace is unavailable).
- *
- * package-protection for use by SharedSecrets.
+ * Gets the stack trace elements.
+ * @param elements
+ * @throws IndexOutOfBoundsException if {@code elements.length != depth }
*/
- native int getStackTraceDepth();
-
- /**
- * Returns the specified element of the stack trace.
- *
- * package-protection for use by SharedSecrets.
- *
- * @param index index of the element to return.
- * @throws IndexOutOfBoundsException if {@code index < 0 ||
- * index >= getStackTraceDepth() }
- */
- native StackTraceElement getStackTraceElement(int index);
+ private native void getStackTraceElements(StackTraceElement[] elements);
/**
* Reads a {@code Throwable} from a stream, enforcing
diff -r 2696577a976c -r 820fef956a15 jdk/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java
--- a/jdk/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java Mon Apr 04 13:40:23 2016 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java Thu Apr 07 10:03:48 2016 -0700
@@ -34,11 +34,11 @@
import java.lang.invoke.MethodHandles.Lookup;
import java.security.AccessController;
-import java.security.PrivilegedAction;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.function.Function;
+import sun.security.action.GetPropertyAction;
import static jdk.internal.org.objectweb.asm.Opcodes.*;
@@ -188,20 +188,14 @@
private static final ProxyClassesDumper DUMPER;
static {
- // Poke the privileged block once, taking everything we need:
- final Object[] values = new Object[4];
- AccessController.doPrivileged((PrivilegedAction
+ * InetAddress.getLocalHost().getHostName() if local host name
+ * can be resolved to an IP. Else numeric IP address of an active
+ * network interface will be used.
*
*
In either case, if the host was specified using the
* [...] syntax for numeric IPv6 addresses, the
diff -r 2696577a976c -r 820fef956a15 jdk/src/java.management/share/classes/sun/management/jdp/JdpBroadcaster.java
--- a/jdk/src/java.management/share/classes/sun/management/jdp/JdpBroadcaster.java Mon Apr 04 13:40:23 2016 -0700
+++ b/jdk/src/java.management/share/classes/sun/management/jdp/JdpBroadcaster.java Thu Apr 07 10:03:48 2016 -0700
@@ -99,30 +99,7 @@
throw new JdpException("Unable to bind to source address");
}
channel.setOption(StandardSocketOptions.IP_MULTICAST_IF, interf);
- } else {
- Enumeration nics = NetworkInterface.getNetworkInterfaces();
- boolean succeed = false;
-
- while (nics.hasMoreElements()) {
- NetworkInterface nic = nics.nextElement();
-
- if (nic.isUp() && nic.supportsMulticast()) {
- try {
- channel.setOption(StandardSocketOptions.IP_MULTICAST_IF, nic);
- succeed = true;
- } catch (IOException ex) {
- // pass
- }
- }
-
- }
-
- if (!succeed) {
- throw new JdpException("Unable to bind to any interfaces.");
- }
-
}
-
}
/**
diff -r 2696577a976c -r 820fef956a15 jdk/src/jdk.jcmd/share/classes/sun/tools/jstat/resources/jstat_options
diff -r 2696577a976c -r 820fef956a15 jdk/src/jdk.jdwp.agent/share/native/libjdwp/invoker.c
diff -r 2696577a976c -r 820fef956a15 jdk/test/ProblemList.txt
--- a/jdk/test/ProblemList.txt Mon Apr 04 13:40:23 2016 -0700
+++ b/jdk/test/ProblemList.txt Thu Apr 07 10:03:48 2016 -0700
@@ -153,8 +153,6 @@
javax/management/remote/mandatory/notif/NotifReconnectDeadlockTest.java 8042215 generic-all
-sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java 8147985 generic-all
-
############################################################################
# jdk_net
@@ -335,6 +333,10 @@
com/sun/jdi/GetLocalVariables4Test.sh 8067354 windows-all
+com/sun/jdi/InterfaceMethodsTest.java 8152586 generic-all
+
+com/sun/jdi/InvokeTest.java 8152586 generic-all
+
############################################################################
# jdk_util
diff -r 2696577a976c -r 820fef956a15 jdk/test/com/sun/jdi/InterruptHangTest.java
--- a/jdk/test/com/sun/jdi/InterruptHangTest.java Mon Apr 04 13:40:23 2016 -0700
+++ b/jdk/test/com/sun/jdi/InterruptHangTest.java Thu Apr 07 10:03:48 2016 -0700
@@ -153,14 +153,17 @@
timerThread = new Thread("test timer") {
public void run() {
int mySteps = 0;
+ float timeoutFactor = Float.parseFloat(System.getProperty("test.timeout.factor", "1.0"));
+ long sleepSeconds = (long)(20 * timeoutFactor);
+ println("Timer watching for steps every " + sleepSeconds + " seconds");
while (true) {
try {
- Thread.sleep(20000);
+ Thread.sleep(sleepSeconds * 1000);
synchronized(sync) {
- System.out.println("steps = " + nSteps);
+ println("steps = " + nSteps);
if (mySteps == nSteps) {
- // no step for 10 secs
- failure("failure: Debuggee appears to be hung");
+ // no step for a long time
+ failure("failure: Debuggee appears to be hung (no steps for " + sleepSeconds + "s)");
vm().exit(-1);
break;
}
diff -r 2696577a976c -r 820fef956a15 jdk/test/com/sun/jdi/ShellScaffold.sh
--- a/jdk/test/com/sun/jdi/ShellScaffold.sh Mon Apr 04 13:40:23 2016 -0700
+++ b/jdk/test/com/sun/jdi/ShellScaffold.sh Thu Apr 07 10:03:48 2016 -0700
@@ -131,6 +131,9 @@
# This can be increased if timing seems to be an issue.
sleep_seconds=1
+if [ -n "$TIMEOUT_FACTOR" ] ; then
+ sleep_seconds=$(echo $TIMEOUT_FACTOR $sleep_seconds | awk '{printf "%d\n", int($1 * $2)}')
+fi
echo "ShellScaffold.sh: Version" >& 2
topPid=$$
diff -r 2696577a976c -r 820fef956a15 jdk/test/com/sun/jdi/TestScaffold.java
--- a/jdk/test/com/sun/jdi/TestScaffold.java Mon Apr 04 13:40:23 2016 -0700
+++ b/jdk/test/com/sun/jdi/TestScaffold.java Thu Apr 07 10:03:48 2016 -0700
@@ -64,6 +64,7 @@
boolean vmDisconnected = false;
final String[] args;
protected boolean testFailed = false;
+ protected long startTime;
static private class ArgInfo {
String targetVMArgs = "";
@@ -425,6 +426,7 @@
abstract protected void runTests() throws Exception;
final public void startTests() throws Exception {
+ startTime = System.currentTimeMillis();
try {
runTests();
} finally {
@@ -433,7 +435,8 @@
}
protected void println(String str) {
- System.err.println(str);
+ long elapsed = System.currentTimeMillis() - startTime;
+ System.err.println("[" + elapsed + "ms] " + str);
}
protected void print(String str) {
diff -r 2696577a976c -r 820fef956a15 jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java Mon Apr 04 13:40:23 2016 -0700
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java Thu Apr 07 10:03:48 2016 -0700
@@ -35,6 +35,11 @@
public class ThreadLists {
public static void main(String args[]) {
+ // Bug id : JDK-8151797
+ // Use a lambda expression so that call-site cleaner thread is started
+ Runnable printLambda = () -> {System.out.println("Starting Test");};
+ printLambda.run();
+
// get top-level thread group
ThreadGroup top = Thread.currentThread().getThreadGroup();
ThreadGroup parent;
diff -r 2696577a976c -r 820fef956a15 jdk/test/java/text/Format/DateFormat/DFSConstructorCloneTest.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/text/Format/DateFormat/DFSConstructorCloneTest.java Thu Apr 07 10:03:48 2016 -0700
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8087104
+ * @summary Make sure that clone() method is not called from DateFormatSymbols constructor.
+ */
+import java.text.DateFormatSymbols;
+
+public class DFSymbolsCloneTest extends DateFormatSymbols {
+
+ private Foo foo;
+
+ public DFSymbolsCloneTest(Foo fooObj) {
+ if (fooObj == null) {
+ this.foo = new Foo();
+ } else {
+ this.foo = fooObj;
+ }
+ }
+
+ @Override
+ public Object clone() {
+ DFSymbolsCloneTest dfsclone = (DFSymbolsCloneTest) super.clone();
+ if (this.foo == null) {
+ throw new RuntimeException("Clone method should not be called from "
+ + " Superclass(DateFormatSymbols) Constructor...");
+ } else {
+ dfsclone.foo = (Foo) this.foo.clone();
+ }
+ return dfsclone;
+ }
+
+ public static void main(String[] args) {
+ DFSymbolsCloneTest dfsctest = new DFSymbolsCloneTest(new Foo());
+ }
+}
+
+class Foo {
+
+ public Foo() {
+ }
+
+ @Override
+ protected Object clone() {
+ return new Foo();
+ }
+
+}
diff -r 2696577a976c -r 820fef956a15 jdk/test/sun/management/jdp/JdpDefaultsTest.java
--- a/jdk/test/sun/management/jdp/JdpDefaultsTest.java Mon Apr 04 13:40:23 2016 -0700
+++ b/jdk/test/sun/management/jdp/JdpDefaultsTest.java Thu Apr 07 10:03:48 2016 -0700
@@ -57,7 +57,6 @@
"-Dcom.sun.management.jmxremote.autodiscovery=true",
"-Dcom.sun.management.jdp.pause=1",
"-Dcom.sun.management.jdp.name=" + jdpName,
- "-Dcom.sun.management.jdp.address=224.0.23.178",
"-Djava.util.logging.SimpleFormatter.format='%1$tF %1$tT %4$-7s %5$s %n'",
testName
};
diff -r 2696577a976c -r 820fef956a15 jdk/test/sun/management/jdp/JdpTestCase.java
--- a/jdk/test/sun/management/jdp/JdpTestCase.java Mon Apr 04 13:40:23 2016 -0700
+++ b/jdk/test/sun/management/jdp/JdpTestCase.java Thu Apr 07 10:03:48 2016 -0700
@@ -122,7 +122,7 @@
*/
private void jdpPacketReceived(Map payload) throws Exception {
final String instanceName = payload.get("INSTANCE_NAME");
- if (instanceName.equals(connection.instanceName)) {
+ if (instanceName != null && instanceName.equals(connection.instanceName)) {
packetFromThisVMReceived(payload);
} else {
packetFromOtherVMReceived(payload);
diff -r 2696577a976c -r 820fef956a15 jdk/test/sun/tools/jhsdb/BasicLauncherTest.java
--- a/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java Mon Apr 04 13:40:23 2016 -0700
+++ b/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java Thu Apr 07 10:03:48 2016 -0700
@@ -143,6 +143,7 @@
launch("No deadlocks found", "jstack");
launch("compiler detected", "jmap");
launch("Java System Properties", "jinfo");
+ launch("java.threads", "jsnap");
// The test throws RuntimeException on error.
// IOException is thrown if LingeredApp can't start because of some bad
diff -r 2696577a976c -r 820fef956a15 jdk/test/sun/tools/jhsdb/SAGetoptTest.java
--- a/jdk/test/sun/tools/jhsdb/SAGetoptTest.java Mon Apr 04 13:40:23 2016 -0700
+++ b/jdk/test/sun/tools/jhsdb/SAGetoptTest.java Thu Apr 07 10:03:48 2016 -0700
@@ -153,5 +153,8 @@
String[] optionSet6 = {"--exe", "--core", "bla_core"};
badOptionsTest(6, optionSet6, "Argument is expected for 'exe'");
+
+ String[] optionSet7 = {"--exe"};
+ badOptionsTest(7, optionSet7, "Argument is expected for 'exe'");
}
}
diff -r 2696577a976c -r 820fef956a15 jdk/test/sun/tools/jstat/gcCapacityOutput1.awk
diff -r 2696577a976c -r 820fef956a15 jdk/test/sun/tools/jstat/gcCauseOutput1.awk
diff -r 2696577a976c -r 820fef956a15 jdk/test/sun/tools/jstat/gcMetaCapacityOutput1.awk
diff -r 2696577a976c -r 820fef956a15 jdk/test/sun/tools/jstat/gcNewCapacityOutput1.awk
diff -r 2696577a976c -r 820fef956a15 jdk/test/sun/tools/jstat/gcOldCapacityOutput1.awk
diff -r 2696577a976c -r 820fef956a15 jdk/test/sun/tools/jstat/gcOldOutput1.awk
diff -r 2696577a976c -r 820fef956a15 jdk/test/sun/tools/jstat/gcOutput1.awk
diff -r 2696577a976c -r 820fef956a15 jdk/test/sun/tools/jstat/lineCounts1.awk
diff -r 2696577a976c -r 820fef956a15 jdk/test/sun/tools/jstat/lineCounts2.awk
diff -r 2696577a976c -r 820fef956a15 jdk/test/sun/tools/jstat/lineCounts3.awk
diff -r 2696577a976c -r 820fef956a15 jdk/test/sun/tools/jstat/lineCounts4.awk
diff -r 2696577a976c -r 820fef956a15 jdk/test/sun/tools/jstat/timeStamp1.awk