mirror of
https://github.com/apache/commons-lang.git
synced 2025-02-12 13:05:06 +00:00
Change method ordering to group getStackTrace/getStackFrames
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@366619 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
dcb7dded14
commit
9116953ca1
@ -805,25 +805,6 @@ public static void removeCommonFrames(List causeFrames, List wrapperFrames) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
/**
|
|
||||||
* <p>Gets the stack trace from a Throwable as a String.</p>
|
|
||||||
*
|
|
||||||
* <p>The result of this method vary by JDK version as this method
|
|
||||||
* uses {@link Throwable#printStackTrace(java.io.PrintWriter)}.
|
|
||||||
* On JDK1.3 and earlier, the cause exception will not be shown
|
|
||||||
* unless the specified throwable alters printStackTrace.</p>
|
|
||||||
*
|
|
||||||
* @param throwable the <code>Throwable</code> to be examined
|
|
||||||
* @return the stack trace as generated by the exception's
|
|
||||||
* <code>printStackTrace(PrintWriter)</code> method
|
|
||||||
*/
|
|
||||||
public static String getStackTrace(Throwable throwable) {
|
|
||||||
StringWriter sw = new StringWriter();
|
|
||||||
PrintWriter pw = new PrintWriter(sw, true);
|
|
||||||
throwable.printStackTrace(pw);
|
|
||||||
return sw.getBuffer().toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>A way to get the entire nested stack-trace of an throwable.</p>
|
* <p>A way to get the entire nested stack-trace of an throwable.</p>
|
||||||
*
|
*
|
||||||
@ -848,6 +829,25 @@ public static String getFullStackTrace(Throwable throwable) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>Gets the stack trace from a Throwable as a String.</p>
|
||||||
|
*
|
||||||
|
* <p>The result of this method vary by JDK version as this method
|
||||||
|
* uses {@link Throwable#printStackTrace(java.io.PrintWriter)}.
|
||||||
|
* On JDK1.3 and earlier, the cause exception will not be shown
|
||||||
|
* unless the specified throwable alters printStackTrace.</p>
|
||||||
|
*
|
||||||
|
* @param throwable the <code>Throwable</code> to be examined
|
||||||
|
* @return the stack trace as generated by the exception's
|
||||||
|
* <code>printStackTrace(PrintWriter)</code> method
|
||||||
|
*/
|
||||||
|
public static String getStackTrace(Throwable throwable) {
|
||||||
|
StringWriter sw = new StringWriter();
|
||||||
|
PrintWriter pw = new PrintWriter(sw, true);
|
||||||
|
throwable.printStackTrace(pw);
|
||||||
|
return sw.getBuffer().toString();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Captures the stack trace associated with the specified
|
* <p>Captures the stack trace associated with the specified
|
||||||
* <code>Throwable</code> object, decomposing it into a list of
|
* <code>Throwable</code> object, decomposing it into a list of
|
||||||
@ -868,6 +868,7 @@ public static String[] getStackFrames(Throwable throwable) {
|
|||||||
return getStackFrames(getStackTrace(throwable));
|
return getStackFrames(getStackTrace(throwable));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* <p>Returns an array where each element is a line from the argument.</p>
|
* <p>Returns an array where each element is a line from the argument.</p>
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user