--- a/jdk/src/java.base/share/classes/java/lang/Thread.java Tue Nov 24 18:32:38 2015 +0000
+++ b/jdk/src/java.base/share/classes/java/lang/Thread.java Tue Nov 24 15:05:58 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();
}
}