--- a/jdk/src/java.base/share/classes/java/lang/Thread.java Fri Nov 20 19:26:16 2015 +0100
+++ b/jdk/src/java.base/share/classes/java/lang/Thread.java Mon Nov 23 12:44:50 2015 -0800
@@ -1329,11 +1329,9 @@
/**
* Prints a stack trace of the current thread to the standard error stream.
* This method is used only for debugging.
- *
- * @see Throwable#printStackTrace()
*/
public static void dumpStack() {
- new Exception("Stack trace").printStackTrace();
+ StackStreamFactory.makeStackTrace().printStackTrace(System.err);
}
/**
@@ -1556,7 +1554,7 @@
return stackTrace;
} else {
// Don't need JVM help for current thread
- return (new Exception()).getStackTrace();
+ return StackStreamFactory.makeStackTrace().getStackTraceElements();
}
}