View | Details | Raw Unified | Return to bug 53713
Collapse All | Expand All

(-)org/apache/jasper/compiler/Mark.java (-12 / +29 lines)
Lines 89-110 Link Here
89
     * Constructor
89
     * Constructor
90
     */
90
     */
91
    Mark(Mark other) {
91
    Mark(Mark other) {
92
    	init(other, false);
93
    }
92
94
93
        this.reader = other.reader;
95
    void update(int cursor, int line, int col) {
94
        this.ctxt = other.reader.getJspCompilationContext();
96
        this.cursor = cursor;
95
        this.stream = other.stream;
97
        this.line = line;
96
        this.fileId = other.fileId;
98
        this.col = col;
97
        this.fileName = other.fileName;
99
    }
100
    
101
    void init(Mark other, boolean singleFile) {
98
        this.cursor = other.cursor;
102
        this.cursor = other.cursor;
99
        this.line = other.line;
103
        this.line = other.line;
100
        this.col = other.col;
104
        this.col = other.col;
101
        this.baseDir = other.baseDir;
105
        if (!singleFile) {
102
        this.encoding = other.encoding;
106
	    	this.reader = other.reader;
103
107
	        this.ctxt = other.ctxt;
104
        // clone includeStack without cloning contents
108
	        this.stream = other.stream;
105
        includeStack = new Stack<IncludeState>();
109
	        this.fileId = other.fileId;
106
        for ( int i=0; i < other.includeStack.size(); i++ ) {
110
	        this.fileName = other.fileName;
107
            includeStack.addElement( other.includeStack.elementAt(i) );
111
	  
112
	        this.baseDir = other.baseDir;
113
	        this.encoding = other.encoding;
114
	
115
	        // clone includeStack without cloning contents
116
	        if (includeStack != null) {
117
	        	includeStack.clear();
118
	        }
119
	        else {
120
	        	includeStack = new Stack<IncludeState>();
121
	        }
122
	        for ( int i=0; i < other.includeStack.size(); i++ ) {
123
	            includeStack.addElement( other.includeStack.elementAt(i) );
124
	        }
108
        }
125
        }
109
    }
126
    }
110
127

Return to bug 53713