org.jutil.java.throwable
Class StackTrace

java.lang.Object
  |
  +--org.jutil.java.throwable.StackTrace

public class StackTrace
extends java.lang.Object

Utility methods to deal with the stack trace of throwables. This is nominally only available as output on an OutputStream, and we want more.


Field Summary
static java.lang.String CVS_REVISION
           
 
Constructor Summary
StackTrace()
           
 
Method Summary
static java.util.List asList(java.lang.Throwable t)
          Converts the stack trace of into a list of names of active methods. This method was based on private String junit.framework.TestSuite.exceptionToString(Throwable t) and public static String junit.runner.BaseTestRunner.filterStack(String stack) from JUnit. //JDJDJD check copyright
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CVS_REVISION

public static final java.lang.String CVS_REVISION
Constructor Detail

StackTrace

public StackTrace()
Method Detail

asList

public static java.util.List asList(java.lang.Throwable t)

Converts the stack trace of into a list of names of active methods.

This method was based on private String junit.framework.TestSuite.exceptionToString(Throwable t) and public static String junit.runner.BaseTestRunner.filterStack(String stack) from JUnit.

//JDJDJD check copyright

Parameters:
t - The Throwable to get the stack trace of.
Returns:
The stack trace of , as a list of Strings. The Strings are the names of the active methods. They are ordered in the list starting from main, with the method during whose execution the throwable was generated the last entry. // JDJDJD perhaps it would not be a bad idea to use new objects, holding a reference to the method and a string for the location in that file

Specifications:
requires t != null;
ensures (\result != null)&&( \forall Object o; \result .contains(o); o != null)&&( \forall Object o; \result .contains(o); o instanceof String);