You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2018/07/02 20:34:51 UTC
svn commit: r1834888 - /tomcat/tc7.0.x/trunk/java/org/apache/jasper/JspC.java
Author: markt
Date: Mon Jul 2 20:34:51 2018
New Revision: 1834888
URL: http://svn.apache.org/viewvc?rev=1834888&view=rev
Log:
Back-port code clean-up to avoid conflicts in subsequent back-ports.
Modified:
tomcat/tc7.0.x/trunk/java/org/apache/jasper/JspC.java
Modified: tomcat/tc7.0.x/trunk/java/org/apache/jasper/JspC.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/jasper/JspC.java?rev=1834888&r1=1834887&r2=1834888&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/jasper/JspC.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/jasper/JspC.java Mon Jul 2 20:34:51 2018
@@ -34,7 +34,6 @@ import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -139,7 +138,7 @@ public class JspC extends Task implement
protected static final int DEFAULT_DIE_LEVEL = 1;
protected static final int NO_DIE_LEVEL = 0;
protected static final Set<String> insertBefore = new HashSet<String>();
-
+
static {
insertBefore.add("</web-app>");
insertBefore.add("<servlet-mapping>");
@@ -289,7 +288,7 @@ public class JspC extends Task implement
/**
* Apply command-line arguments.
- *
+ *
* @param arg
* The arguments
*/
@@ -354,7 +353,7 @@ public class JspC extends Task implement
caching = false;
} else {
caching = true;
- }
+ }
} else if (tok.equals(SWITCH_CLASSPATH)) {
setClassPath(nextArg());
} else if (tok.startsWith(SWITCH_DIE)) {
@@ -548,7 +547,7 @@ public class JspC extends Task implement
/**
* Sets the option to enable caching.
- *
+ *
* @see Options#isCaching()
*/
public void setCaching(boolean caching) {
@@ -590,8 +589,8 @@ public class JspC extends Task implement
public boolean getRecompileOnFail() {
return false;
}
-
-
+
+
/**
* In JspC this always returns <code>false</code>.
* {@inheritDoc}
@@ -626,14 +625,14 @@ public class JspC extends Task implement
/**
* Sets smapDumped flag.
- *
+ *
* @see Options#isSmapDumped()
*/
public void setSmapDumped(boolean smapDumped) {
this.smapDumped = smapDumped;
}
-
+
/**
* Determines whether text strings are to be generated as char arrays,
* which improves performance in some cases.
@@ -656,7 +655,7 @@ public class JspC extends Task implement
/**
* Sets the class-id value to be sent to Internet Explorer when using
* <jsp:plugin> tags.
- *
+ *
* @param ieClassId
* Class-id value
*/
@@ -690,7 +689,7 @@ public class JspC extends Task implement
/**
* Sets the option to determine what compiler to use.
- *
+ *
* @see Options#getCompiler()
*/
public void setCompiler(String c) {
@@ -715,7 +714,7 @@ public class JspC extends Task implement
/**
* Sets the compiler target VM.
- *
+ *
* @see Options#getCompilerTargetVM()
*/
public void setCompilerTargetVM(String vm) {
@@ -732,7 +731,7 @@ public class JspC extends Task implement
/**
* Sets the compiler source VM.
- *
+ *
* @see Options#getCompilerSourceVM()
*/
public void setCompilerSourceVM(String vm) {
@@ -986,11 +985,11 @@ public class JspC extends Task implement
/**
* Sets the encoding to be used to read and write web.xml files.
- *
+ *
* <p>
* If not specified, defaults to the platform default encoding.
* </p>
- *
+ *
* @param encoding
* Encoding, e.g. "UTF-8".
*/
@@ -1001,7 +1000,7 @@ public class JspC extends Task implement
/**
* Sets the option to merge generated web.xml fragment into the
* WEB-INF/web.xml file of the web application that we were processing.
- *
+ *
* @param b
* <code>true</code> to merge the fragment into the existing
* web.xml file of the processed web application
@@ -1046,7 +1045,7 @@ public class JspC extends Task implement
/**
* Adds servlet declaration and mapping for the JSP page servlet to the
* generated web.xml fragment.
- *
+ *
* @param file
* Context-relative path to the JSP file, e.g.
* <code>/index.jsp</code>
@@ -1208,21 +1207,21 @@ public class JspC extends Task implement
if(!webXml2.delete() && log.isDebugEnabled())
log.debug(Localizer.getMessage("jspc.delete.fail",
webXml2.toString()));
-
+
if (!(new File(webxmlFile)).delete() && log.isDebugEnabled())
log.debug(Localizer.getMessage("jspc.delete.fail", webxmlFile));
}
-
+
/*
* Assumes valid xml
*/
private String getElement(Reader reader) throws IOException {
StringBuilder result = new StringBuilder();
result.append('<');
-
+
boolean done = false;
-
+
while (!done) {
int current = reader.read();
while (current != '>') {
@@ -1233,7 +1232,7 @@ public class JspC extends Task implement
current = reader.read();
}
result.append((char) current);
-
+
int len = result.length();
if (len > 4 && result.substring(0, 4).equals("<!--")) {
// This is a comment - make sure we are at the end
@@ -1244,8 +1243,8 @@ public class JspC extends Task implement
done = true;
}
}
-
-
+
+
return result.toString();
}
@@ -1427,9 +1426,7 @@ public class JspC extends Task implement
initWebXml();
- Iterator<String> iter = pages.iterator();
- while (iter.hasNext()) {
- String nextjsp = iter.next();
+ for (String nextjsp : pages) {
File fjsp = new File(nextjsp);
if (!fjsp.isAbsolute()) {
fjsp = new File(uriRootF, nextjsp);
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org