question: public static Throwable sanitize ( Throwable t ) { if ( ! Boolean . getBoolean ( "groovy.full.stacktrace" ) ) { StackTraceElement [ ] trace = t . getStackTrace ( ) ; List < StackTraceElement > newTrace = new ArrayList < StackTraceElement > ( ) ; for ( StackTraceElement stackTraceElement : trace ) { if ( isApplicationClass ( stackTraceElement . getClassName ( ) ) ) { newTrace . add ( stackTraceElement ) ; } } STACK_LOG . log ( Level . WARNING , "Sanitizing stacktrace:" , t ) ; StackTraceElement [ ] clean = new StackTraceElement [ newTrace . size ( ) ] ; newTrace . toArray ( clean ) ; t . setStackTrace ( clean ) ; } return t ; }
target:  Remove all apparently groovy-internal trace entries from the exception instance <p> This modifies the original instance and returns it, it does not clone