You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sc...@apache.org on 2006/01/07 02:14:53 UTC
svn commit: r366619 -
/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ExceptionUtils.java
Author: scolebourne
Date: Fri Jan 6 17:14:51 2006
New Revision: 366619
URL: http://svn.apache.org/viewcvs?rev=366619&view=rev
Log:
Change method ordering to group getStackTrace/getStackFrames
Modified:
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ExceptionUtils.java
Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ExceptionUtils.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ExceptionUtils.java?rev=366619&r1=366618&r2=366619&view=diff
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ExceptionUtils.java (original)
+++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ExceptionUtils.java Fri Jan 6 17:14:51 2006
@@ -806,25 +806,6 @@
//-----------------------------------------------------------------------
/**
- * <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>The result of this method is highly dependent on the JDK version
@@ -849,6 +830,25 @@
//-----------------------------------------------------------------------
/**
+ * <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
* <code>Throwable</code> object, decomposing it into a list of
* stack frames.</p>
@@ -868,6 +868,7 @@
return getStackFrames(getStackTrace(throwable));
}
+ //-----------------------------------------------------------------------
/**
* <p>Returns an array where each element is a line from the argument.</p>
*
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org