private AssetException rewrite(final AssetException ex) {
    List<StackTraceElement> stacktrace = Lists.newArrayList(ex.getStackTrace());
    List<AssetProblem> problems = ex.getProblems();
    AssetProblem head = problems.get(0);
    stacktrace.add(0,
        new StackTraceElement(head.getFilename(), "", head.getFilename(), head.getLine()));
    ex.setStackTrace(stacktrace.toArray(new StackTraceElement[stacktrace.size()]));
    return ex;
  }
private AssetException rewrite(final AssetException ex) {
    List<StackTraceElement> stacktrace = Lists.newArrayList(ex.getStackTrace());
    List<AssetProblem> problems = ex.getProblems();
    AssetProblem head = problems.get(0);
    stacktrace.add(0,
        new StackTraceElement(head.getFilename(), "", head.getFilename(), head.getLine()));
    ex.setStackTrace(stacktrace.toArray(new StackTraceElement[stacktrace.size()]));
    return ex;
  }
private AssetException rewrite ( final AssetException ex ) { List < StackTraceElement > stacktrace = Lists . newArrayList ( ex . getStackTrace ( ) ) ; List < AssetProblem > problems = ex . getProblems ( ) ; AssetProblem head = problems . get ( 0 ) ; stacktrace . add ( 0 , new StackTraceElement ( head . getFilename ( ) , "" , head . getFilename ( ) , head . getLine ( ) ) ) ; ex . setStackTrace ( stacktrace . toArray ( new StackTraceElement [ stacktrace . size ( ) ] ) ) ; return ex ; }
Add a virtual/fake stacktrace element with the offending file, useful for whoops.

@param ex Stack trace to rewrite.
@return Same exception with new stacktrace.
Add a virtual / fake stacktrace element with the offending file useful for whoops .