< prev index next >
src/java.base/share/classes/java/lang/Thread.java
Print this page
rev 13118 : [mq]: backout-stackw
@@ -1327,13 +1327,15 @@
}
/**
* 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() {
- StackStreamFactory.makeStackTrace().printStackTrace(System.err);
+ new Exception("Stack trace").printStackTrace();
}
/**
* Marks this thread as either a {@linkplain #isDaemon daemon} thread
* or a user thread. The Java Virtual Machine exits when the only
@@ -1552,11 +1554,11 @@
stackTrace = EMPTY_STACK_TRACE;
}
return stackTrace;
} else {
// Don't need JVM help for current thread
- return StackStreamFactory.makeStackTrace().getStackTraceElements();
+ return (new Exception()).getStackTrace();
}
}
/**
* Returns a map of stack traces for all live threads.
< prev index next >