public static List<String> getStackFrames(Throwable t)
	{
		StackTraceElement[] elements = t.getStackTrace();
		List<String> frames = new ArrayList<String>(elements.length);
		for (StackTraceElement element : elements) {
			frames.add(element.toString());
		}
		return Collections.unmodifiableList(frames);
	}
public static List < String > getStackFrames ( Throwable t ) { StackTraceElement [ ] elements = t . getStackTrace ( ) ; List < String > frames = new ArrayList < String > ( elements . length ) ; for ( StackTraceElement element : elements ) { frames . add ( element . toString ( ) ) ; } return Collections . unmodifiableList ( frames ) ; }
Returns the stack frames of the given {@code Throwable}. The stack
frames are simply obtained from calling {@code toString} on each
{@link StackTraceElement} of {@code t}.

@param t the {@code Throwable} to get the stack frames.

@return the stack frames of the given {@code Throwable}.

@throws NullPointerException if {@code t} is {@code null}.

@see Throwable#getStackTrace()