@Test public void testPrint() { final Exception exception = new CustomException( "message" ); assertEquals( "stackTrace is not correct", "message at com.adobe.ac.utils.StackTraceUtilsTest.testPrint(StackTraceUtilsTest.java:51)\n" + "sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" + "sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)", StackTraceUtils.print( exception ) ); }
public static String print( final Exception exception ) { final StringBuffer buffer = new StringBuffer(); buffer.append( exception.getMessage() + " at " + exception.getStackTrace()[ 0 ] + "\n" ); buffer.append( exception.getStackTrace()[ 1 ] + "\n" + exception.getStackTrace()[ 2 ] ); return buffer.toString(); }
StackTraceUtils { public static String print( final Exception exception ) { final StringBuffer buffer = new StringBuffer(); buffer.append( exception.getMessage() + " at " + exception.getStackTrace()[ 0 ] + "\n" ); buffer.append( exception.getStackTrace()[ 1 ] + "\n" + exception.getStackTrace()[ 2 ] ); return buffer.toString(); } }
StackTraceUtils { public static String print( final Exception exception ) { final StringBuffer buffer = new StringBuffer(); buffer.append( exception.getMessage() + " at " + exception.getStackTrace()[ 0 ] + "\n" ); buffer.append( exception.getStackTrace()[ 1 ] + "\n" + exception.getStackTrace()[ 2 ] ); return buffer.toString(); } private  StackTraceUtils(); }
StackTraceUtils { public static String print( final Exception exception ) { final StringBuffer buffer = new StringBuffer(); buffer.append( exception.getMessage() + " at " + exception.getStackTrace()[ 0 ] + "\n" ); buffer.append( exception.getStackTrace()[ 1 ] + "\n" + exception.getStackTrace()[ 2 ] ); return buffer.toString(); } private  StackTraceUtils(); static String print( final Exception exception ); static String print( final String fileName,
                               final Exception exception ); }
StackTraceUtils { public static String print( final Exception exception ) { final StringBuffer buffer = new StringBuffer(); buffer.append( exception.getMessage() + " at " + exception.getStackTrace()[ 0 ] + "\n" ); buffer.append( exception.getStackTrace()[ 1 ] + "\n" + exception.getStackTrace()[ 2 ] ); return buffer.toString(); } private  StackTraceUtils(); static String print( final Exception exception ); static String print( final String fileName,
                               final Exception exception );  }