Index: apache/jasper/compiler/Mark.java =================================================================== --- apache/jasper/compiler/Mark.java (revision 1370136) +++ apache/jasper/compiler/Mark.java (working copy) @@ -89,9 +89,23 @@ * Constructor */ Mark(Mark other) { - - this.reader = other.reader; - this.ctxt = other.reader.getJspCompilationContext(); + init(other); + } + + /** + * Simpler than {@link #init(Mark)}. To make good performance + * + * @param other + */ + void update(Mark other) { + this.cursor = other.cursor; + this.line = other.line; + this.col = other.col; + } + + void init(Mark other) { + this.reader = other.reader; + this.ctxt = other.ctxt; this.stream = other.stream; this.fileId = other.fileId; this.fileName = other.fileName; @@ -102,7 +116,12 @@ this.encoding = other.encoding; // clone includeStack without cloning contents - includeStack = new Stack(); + if (includeStack != null) { + includeStack.clear(); + } + else { + includeStack = new Stack(); + } for ( int i=0; i < other.includeStack.size(); i++ ) { includeStack.addElement( other.includeStack.elementAt(i) ); }