privatestaticvoid getTrace(Thread t) {
StackTraceElement trace[] = t.getStackTrace(); if (!pleaseStop && (trace.length < 1 || trace.length > 20)) { // If called from traceGetter, we were started by the main thread, and it was still // running after the trace, so the main thread should have at least one frame on // the stack. If called by main(), we waited for all the traceGetters to start, // and didn't yet allow them to stop, so the same should be true.
System.out.println("Stack trace for " + t.getName() + " has size " + trace.length); for (StackTraceElement e : trace) {
System.out.println(e.toString());
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.