private void fillStackTrace(StringBuffer buffer,StackTraceElement[] elements){
  for (int index=0; index < elements.length; index++) {
    buffer.append(elements[index]);
    buffer.append("\n");
  }
}

private void fillStackTrace ( StringBuffer buffer , StackTraceElement [ ] elements ) { for ( int index = 0 ; index < elements . length ; index ++ ) { buffer . append ( elements [ index ] ) ; buffer . append ( "\n" ) ; } }
creates a printing stacktrace from the given elements .
