int length = Math.min(trace.length, current.length); int leave = 0; while (leave < length && trace[leave].equals(current[leave])) leave++;  int start = leave; while (traceAtStartsWith(start, "scalai.")) start++; while (traceAtStartsWith(start, "java.lang.reflect.")) start++; while (traceAtStartsWith(start, "sun.reflect.")) start++;
int leave = entry; while (leave < trace.length && !traceAtStartsWith(leave, "scalai.")) leave++; if (leave < trace.length) {  while (traceAtStartsWith(leave - 1, "java.lang.reflect.")) leave--; while (traceAtStartsWith(leave - 1, "sun.reflect.")) leave--; }
    public void addScalaLeavePoint() {        StackTraceElement[] current = getCurrentTrace();        // find leave point        int length = Math.min(trace.length, current.length);        int leave = 0;        while (leave < length && trace[leave].equals(current[leave])) leave++;        // skip calls through interpreter & reflection        int start = leave;        while (traceAtStartsWith(start, "scalai.")) start++;        while (traceAtStartsWith(start, "java.lang.reflect.")) start++;        while (traceAtStartsWith(start, "sun.reflect.")) start++;        // complete stack with java trace        for (int i = stop - 1; start <= i; i--) stack.add(trace[i]);        // save new trace end        stop = leave;    }