Merge
This commit is contained in:
commit
74c006ac7f
jdk
make/mapfiles/libjava
src/java.base/share
classes/java/lang
native
test
java/text/Format/DateFormat
sun/tools/jhsdb
@ -227,8 +227,7 @@ SUNWprivate_1.1 {
|
|||||||
Java_java_lang_System_setOut0;
|
Java_java_lang_System_setOut0;
|
||||||
Java_java_lang_Thread_registerNatives;
|
Java_java_lang_Thread_registerNatives;
|
||||||
Java_java_lang_Throwable_fillInStackTrace;
|
Java_java_lang_Throwable_fillInStackTrace;
|
||||||
Java_java_lang_Throwable_getStackTraceDepth;
|
Java_java_lang_Throwable_getStackTraceElements;
|
||||||
Java_java_lang_Throwable_getStackTraceElement;
|
|
||||||
Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2;
|
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_PrivilegedAction_2Ljava_security_AccessControlContext_2;
|
||||||
Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2;
|
Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2;
|
||||||
|
@ -78,8 +78,7 @@ text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_Pri
|
|||||||
text: .text%JNU_GetEnv;
|
text: .text%JNU_GetEnv;
|
||||||
text: .text%Java_java_io_UnixFileSystem_checkAccess;
|
text: .text%Java_java_io_UnixFileSystem_checkAccess;
|
||||||
text: .text%Java_java_lang_reflect_Array_newArray;
|
text: .text%Java_java_lang_reflect_Array_newArray;
|
||||||
text: .text%Java_java_lang_Throwable_getStackTraceDepth;
|
text: .text%Java_java_lang_Throwable_getStackTraceElements;
|
||||||
text: .text%Java_java_lang_Throwable_getStackTraceElement;
|
|
||||||
text: .text%throwFileNotFoundException;
|
text: .text%throwFileNotFoundException;
|
||||||
text: .text%JNU_NotifyAll;
|
text: .text%JNU_NotifyAll;
|
||||||
# Test LoadFrame
|
# Test LoadFrame
|
||||||
|
@ -74,8 +74,7 @@ text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_Pri
|
|||||||
text: .text%JNU_GetEnv;
|
text: .text%JNU_GetEnv;
|
||||||
text: .text%Java_java_io_UnixFileSystem_checkAccess;
|
text: .text%Java_java_io_UnixFileSystem_checkAccess;
|
||||||
text: .text%Java_java_lang_reflect_Array_newArray;
|
text: .text%Java_java_lang_reflect_Array_newArray;
|
||||||
text: .text%Java_java_lang_Throwable_getStackTraceDepth;
|
text: .text%Java_java_lang_Throwable_getStackTraceElements;
|
||||||
text: .text%Java_java_lang_Throwable_getStackTraceElement;
|
|
||||||
text: .text%throwFileNotFoundException: OUTPUTDIR/io_util.o;
|
text: .text%throwFileNotFoundException: OUTPUTDIR/io_util.o;
|
||||||
text: .text%JNU_NotifyAll;
|
text: .text%JNU_NotifyAll;
|
||||||
# Test LoadFrame
|
# Test LoadFrame
|
||||||
|
@ -78,8 +78,7 @@ text: .text%Java_java_io_UnixFileSystem_checkAccess;
|
|||||||
text: .text%Java_sun_reflect_NativeMethodAccessorImpl_invoke0;
|
text: .text%Java_sun_reflect_NativeMethodAccessorImpl_invoke0;
|
||||||
text: .text%Java_java_io_FileInputStream_available;
|
text: .text%Java_java_io_FileInputStream_available;
|
||||||
text: .text%Java_java_lang_reflect_Array_newArray;
|
text: .text%Java_java_lang_reflect_Array_newArray;
|
||||||
text: .text%Java_java_lang_Throwable_getStackTraceDepth;
|
text: .text%Java_java_lang_Throwable_getStackTraceElements;
|
||||||
text: .text%Java_java_lang_Throwable_getStackTraceElement;
|
|
||||||
text: .text%Java_java_lang_System_identityHashCode;
|
text: .text%Java_java_lang_System_identityHashCode;
|
||||||
text: .text%JNU_NotifyAll;
|
text: .text%JNU_NotifyAll;
|
||||||
# Test LoadFrame
|
# Test LoadFrame
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2013, 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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -74,6 +74,12 @@ public final class StackTraceElement implements java.io.Serializable {
|
|||||||
this.lineNumber = lineNumber;
|
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
|
* Returns the name of the source file containing the execution point
|
||||||
* represented by this stack trace element. Generally, this corresponds
|
* represented by this stack trace element. Generally, this corresponds
|
||||||
|
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -118,7 +118,7 @@ public class Throwable implements Serializable {
|
|||||||
private static final long serialVersionUID = -3042686055658047285L;
|
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;
|
private transient Object backtrace;
|
||||||
|
|
||||||
@ -211,6 +211,11 @@ public class Throwable implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private StackTraceElement[] stackTrace = UNASSIGNED_STACK;
|
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
|
// Setting this static field introduces an acceptable
|
||||||
// initialization dependency on a few java.util classes.
|
// initialization dependency on a few java.util classes.
|
||||||
private static final List<Throwable> SUPPRESSED_SENTINEL = Collections.emptyList();
|
private static final List<Throwable> SUPPRESSED_SENTINEL = Collections.emptyList();
|
||||||
@ -828,10 +833,11 @@ public class Throwable implements Serializable {
|
|||||||
if (backtrace instanceof StackStreamFactory.StackTrace) {
|
if (backtrace instanceof StackStreamFactory.StackTrace) {
|
||||||
stackTrace = ((StackStreamFactory.StackTrace)backtrace).getStackTraceElements();
|
stackTrace = ((StackStreamFactory.StackTrace)backtrace).getStackTraceElements();
|
||||||
} else {
|
} else {
|
||||||
int depth = getStackTraceDepth();
|
|
||||||
stackTrace = new StackTraceElement[depth];
|
stackTrace = new StackTraceElement[depth];
|
||||||
for (int i = 0; i < depth; i++)
|
for (int i = 0; i < depth; i++) {
|
||||||
stackTrace[i] = getStackTraceElement(i);
|
stackTrace[i] = new StackTraceElement();
|
||||||
|
}
|
||||||
|
getStackTraceElements(stackTrace);
|
||||||
}
|
}
|
||||||
} else if (stackTrace == null) {
|
} else if (stackTrace == null) {
|
||||||
return UNASSIGNED_STACK;
|
return UNASSIGNED_STACK;
|
||||||
@ -884,23 +890,11 @@ public class Throwable implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of elements in the stack trace (or 0 if the stack
|
* Gets the stack trace elements.
|
||||||
* trace is unavailable).
|
* @param elements
|
||||||
*
|
* @throws IndexOutOfBoundsException if {@code elements.length != depth }
|
||||||
* package-protection for use by SharedSecrets.
|
|
||||||
*/
|
*/
|
||||||
native int getStackTraceDepth();
|
private native void getStackTraceElements(StackTraceElement[] elements);
|
||||||
|
|
||||||
/**
|
|
||||||
* 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);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads a {@code Throwable} from a stream, enforcing
|
* Reads a {@code Throwable} from a stream, enforcing
|
||||||
|
@ -34,11 +34,11 @@ import jdk.internal.misc.Unsafe;
|
|||||||
|
|
||||||
import java.lang.invoke.MethodHandles.Lookup;
|
import java.lang.invoke.MethodHandles.Lookup;
|
||||||
import java.security.AccessController;
|
import java.security.AccessController;
|
||||||
import java.security.PrivilegedAction;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.ConcurrentMap;
|
import java.util.concurrent.ConcurrentMap;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
import sun.security.action.GetPropertyAction;
|
||||||
|
|
||||||
import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
||||||
|
|
||||||
@ -188,20 +188,14 @@ public final class StringConcatFactory {
|
|||||||
private static final ProxyClassesDumper DUMPER;
|
private static final ProxyClassesDumper DUMPER;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
// Poke the privileged block once, taking everything we need:
|
final String strategy = AccessController.doPrivileged(
|
||||||
final Object[] values = new Object[4];
|
new GetPropertyAction("java.lang.invoke.stringConcat"));
|
||||||
AccessController.doPrivileged((PrivilegedAction<Object>) () -> {
|
CACHE_ENABLE = Boolean.parseBoolean(AccessController.doPrivileged(
|
||||||
values[0] = System.getProperty("java.lang.invoke.stringConcat");
|
new GetPropertyAction("java.lang.invoke.stringConcat.cache")));
|
||||||
values[1] = Boolean.getBoolean("java.lang.invoke.stringConcat.cache");
|
DEBUG = Boolean.parseBoolean(AccessController.doPrivileged(
|
||||||
values[2] = Boolean.getBoolean("java.lang.invoke.stringConcat.debug");
|
new GetPropertyAction("java.lang.invoke.stringConcat.debug")));
|
||||||
values[3] = System.getProperty("java.lang.invoke.stringConcat.dumpClasses");
|
final String dumpPath = AccessController.doPrivileged(
|
||||||
return null;
|
new GetPropertyAction("java.lang.invoke.stringConcat.dumpClasses"));
|
||||||
});
|
|
||||||
|
|
||||||
final String strategy = (String) values[0];
|
|
||||||
CACHE_ENABLE = (Boolean) values[1];
|
|
||||||
DEBUG = (Boolean) values[2];
|
|
||||||
final String dumpPath = (String) values[3];
|
|
||||||
|
|
||||||
STRATEGY = (strategy == null) ? DEFAULT_STRATEGY : Strategy.valueOf(strategy);
|
STRATEGY = (strategy == null) ? DEFAULT_STRATEGY : Strategy.valueOf(strategy);
|
||||||
CACHE = CACHE_ENABLE ? new ConcurrentHashMap<>() : null;
|
CACHE = CACHE_ENABLE ? new ConcurrentHashMap<>() : null;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -171,11 +171,8 @@ JVM_IsSupportedJNIVersion(jint version);
|
|||||||
JNIEXPORT void JNICALL
|
JNIEXPORT void JNICALL
|
||||||
JVM_FillInStackTrace(JNIEnv *env, jobject throwable);
|
JVM_FillInStackTrace(JNIEnv *env, jobject throwable);
|
||||||
|
|
||||||
JNIEXPORT jint JNICALL
|
JNIEXPORT void JNICALL
|
||||||
JVM_GetStackTraceDepth(JNIEnv *env, jobject throwable);
|
JVM_GetStackTraceElements(JNIEnv *env, jobject throwable, jobjectArray elements);
|
||||||
|
|
||||||
JNIEXPORT jobject JNICALL
|
|
||||||
JVM_GetStackTraceElement(JNIEnv *env, jobject throwable, jint index);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* java.lang.StackWalker
|
* java.lang.StackWalker
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1994, 2011, 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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -50,15 +50,9 @@ Java_java_lang_Throwable_fillInStackTrace(JNIEnv *env, jobject throwable, jint d
|
|||||||
return throwable;
|
return throwable;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jint JNICALL
|
JNIEXPORT void JNICALL
|
||||||
Java_java_lang_Throwable_getStackTraceDepth(JNIEnv *env, jobject throwable)
|
Java_java_lang_Throwable_getStackTraceElements(JNIEnv *env,
|
||||||
|
jobject throwable, jobjectArray elements)
|
||||||
{
|
{
|
||||||
return JVM_GetStackTraceDepth(env, throwable);
|
JVM_GetStackTraceElements(env, throwable, elements);
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT jobject JNICALL
|
|
||||||
Java_java_lang_Throwable_getStackTraceElement(JNIEnv *env,
|
|
||||||
jobject throwable, jint index)
|
|
||||||
{
|
|
||||||
return JVM_GetStackTraceElement(env, throwable, index);
|
|
||||||
}
|
}
|
||||||
|
@ -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();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -143,6 +143,7 @@ public class BasicLauncherTest {
|
|||||||
launch("No deadlocks found", "jstack");
|
launch("No deadlocks found", "jstack");
|
||||||
launch("compiler detected", "jmap");
|
launch("compiler detected", "jmap");
|
||||||
launch("Java System Properties", "jinfo");
|
launch("Java System Properties", "jinfo");
|
||||||
|
launch("java.threads", "jsnap");
|
||||||
|
|
||||||
// The test throws RuntimeException on error.
|
// The test throws RuntimeException on error.
|
||||||
// IOException is thrown if LingeredApp can't start because of some bad
|
// IOException is thrown if LingeredApp can't start because of some bad
|
||||||
|
@ -152,5 +152,8 @@ public class SAGetoptTest {
|
|||||||
|
|
||||||
String[] optionSet6 = {"--exe", "--core", "bla_core"};
|
String[] optionSet6 = {"--exe", "--core", "bla_core"};
|
||||||
badOptionsTest(6, optionSet6, "Argument is expected for 'exe'");
|
badOptionsTest(6, optionSet6, "Argument is expected for 'exe'");
|
||||||
|
|
||||||
|
String[] optionSet7 = {"--exe"};
|
||||||
|
badOptionsTest(7, optionSet7, "Argument is expected for 'exe'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user