StackTraceElement[] traces = pc.getThread().getStackTrace();
String template="";
StackTraceElement trace=null;
ArrayList list=new ArrayList();
Resource res;
PageSource ps;
int index=stack.size();
for(int i=traces.length-1;i>=0;i--) {
trace=traces[i];
ps=null;
if(trace.getLineNumber()<=0) continue;
template=trace.getFileName();
if(template==null || ResourceUtil.getExtension(template,"").equals("java")) continue;
if(index>0)ps=(PageSource) stack.get(--index);
// inside the if is the old way, that only work when the cfm is inside the mapping, but i'm not shure woth the new way
if(ps==null || !(ps.getFullClassName().equals(trace.getClassName()) && ps.getDisplayPath().equals(template))){
res = ResourceUtil.toResourceNotExisting(pc, template);
ps = pc.toPageSource(res, null);
}
FDStackFrameImpl frame = new FDStackFrameImpl(this,pc,trace,ps);