Skip to content

Commit ac22509

Browse files
committed
JspReader.singleFile is always true. The nested files it supports have
not been used since Tomcat 3.x. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1634697 13f79535-47bb-0310-9956-ffa450edef68
1 parent 8775816 commit ac22509

3 files changed

Lines changed: 3 additions & 21 deletions

File tree

java/org/apache/jasper/compiler/JspReader.java

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,6 @@ class JspReader {
8383
*/
8484
private final ErrorDispatcher err;
8585

86-
/**
87-
* Set to true when using the JspReader on a single file where we read up
88-
* to the end and reset to the beginning many times.
89-
* (as in ParserController.figureOutJspDocument()).
90-
*/
91-
private boolean singleFile;
92-
9386
/**
9487
* Constructor.
9588
*
@@ -127,7 +120,6 @@ public JspReader(JspCompilationContext ctxt,
127120
this.err = err;
128121
sourceFiles = new Vector<>();
129122
currFileId = 0;
130-
singleFile = false;
131123
pushFile(fname, reader);
132124
}
133125

@@ -157,10 +149,6 @@ String getFile(final int fileid) {
157149
*/
158150
boolean hasMoreInput() throws JasperException {
159151
if (current.cursor >= current.stream.length) {
160-
if (singleFile) return false;
161-
while (popFile()) {
162-
if (current.cursor < current.stream.length) return true;
163-
}
164152
return false;
165153
}
166154
return true;
@@ -195,7 +183,7 @@ private int nextChar(Mark mark) throws JasperException {
195183

196184
int ch = current.stream[current.cursor];
197185

198-
mark.init(current, singleFile);
186+
mark.init(current, true);
199187

200188
current.cursor++;
201189

@@ -415,15 +403,15 @@ Mark skipUntil(String limit) throws JasperException {
415403
while((result = indexOf(firstChar, ret)) != null) {
416404
if (result.booleanValue()) {
417405
if (restart != null) {
418-
restart.init(current, singleFile);
406+
restart.init(current, true);
419407
} else {
420408
restart = mark();
421409
}
422410
for (int i = 1 ; i < limlen ; i++) {
423411
if (peekChar() == limit.charAt(i)) {
424412
nextChar();
425413
} else {
426-
current.init(restart, singleFile);
414+
current.init(restart, true);
427415
continue skip;
428416
}
429417
}
@@ -597,10 +585,6 @@ String parseToken(boolean quoted) throws JasperException {
597585
return StringBuilder.toString();
598586
}
599587

600-
void setSingleFile(boolean val) {
601-
singleFile = val;
602-
}
603-
604588

605589
/**
606590
* Parse utils - Is current character a token delimiter ?

java/org/apache/jasper/compiler/Parser.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1786,7 +1786,6 @@ private String getAttributeBodyType(Node n, String name) {
17861786
}
17871787

17881788
private void parseFileDirectives(Node parent) throws JasperException {
1789-
reader.setSingleFile(true);
17901789
reader.skipUntil("<");
17911790
while (reader.hasMoreInput()) {
17921791
start = reader.mark();

java/org/apache/jasper/compiler/ParserController.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@ private void determineSyntaxAndEncoding(String absFileName, Jar jar,
356356
} catch (FileNotFoundException ex) {
357357
throw new JasperException(ex);
358358
}
359-
jspReader.setSingleFile(true);
360359
Mark startMark = jspReader.mark();
361360
if (!isExternal) {
362361
jspReader.reset(startMark);

0 commit comments

Comments
 (0)