Author: kkolinko Date: Wed Jan 22 02:46:08 2014 New Revision: 1560237 URL: http://svn.apache.org/r1560237 Log: Merging ELParser changes from trunk, to better align TC7 code with trunk here (proposed TC6 patch for BZ 56029 already ports these changes to Tomcat 6)
This commit is a merge of r1374086 minus Java 7 generics changes: Code clean-up - UCDetector use of final ........ Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/ELFunctionMapper.java tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/ELNode.java tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/ELParser.java Propchange: tomcat/tc7.0.x/trunk/ ------------------------------------------------------------------------------ Merged /tomcat/trunk:r1374086 Modified: tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/ELFunctionMapper.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/ELFunctionMapper.java?rev=1560237&r1=1560236&r2=1560237&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/ELFunctionMapper.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/ELFunctionMapper.java Wed Jan 22 02:46:08 2014 @@ -74,7 +74,7 @@ public class ELFunctionMapper { * Use a global name map to facilitate reuse of function maps. * The key used is prefix:function:uri. */ - private HashMap<String, String> gMap = new HashMap<String, String>(); + private final HashMap<String, String> gMap = new HashMap<String, String>(); @Override public void visit(Node.ParamAction n) throws JasperException { @@ -163,9 +163,8 @@ public class ELFunctionMapper { // Only care about functions in ELNode's class Fvisitor extends ELNode.Visitor { - ArrayList<ELNode.Function> funcs = - new ArrayList<ELNode.Function>(); - HashMap<String, String> keyMap = new HashMap<String, String>(); + final ArrayList<ELNode.Function> funcs = new ArrayList<ELNode.Function>(); + final HashMap<String, String> keyMap = new HashMap<String, String>(); @Override public void visit(ELNode.Function n) throws JasperException { String key = n.getPrefix() + ":" + n.getName(); Modified: tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/ELNode.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/ELNode.java?rev=1560237&r1=1560236&r2=1560237&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/ELNode.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/ELNode.java Wed Jan 22 02:46:08 2014 @@ -48,8 +48,8 @@ abstract class ELNode { */ public static class Root extends ELNode { - private ELNode.Nodes expr; - private char type; + private final ELNode.Nodes expr; + private final char type; Root(ELNode.Nodes expr, char type) { this.expr = expr; @@ -75,7 +75,7 @@ abstract class ELNode { */ public static class Text extends ELNode { - private String text; + private final String text; Text(String text) { this.text = text; @@ -97,7 +97,7 @@ abstract class ELNode { */ public static class ELText extends ELNode { - private String text; + private final String text; ELText(String text) { this.text = text; @@ -120,8 +120,8 @@ abstract class ELNode { */ public static class Function extends ELNode { - private String prefix; - private String name; + private final String prefix; + private final String name; private final String originalText; private String uri; private FunctionInfo functionInfo; @@ -193,7 +193,7 @@ abstract class ELNode { EL expression, for communication to Generator. */ String mapName = null; // The function map associated this EL - private List<ELNode> list; + private final List<ELNode> list; public Nodes() { list = new ArrayList<ELNode>(); Modified: tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/ELParser.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/ELParser.java?rev=1560237&r1=1560236&r2=1560237&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/ELParser.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/ELParser.java Wed Jan 22 02:46:08 2014 @@ -40,18 +40,16 @@ public class ELParser { private Token prevToken; // previous token private String whiteSpace = ""; - private ELNode.Nodes expr; + private final ELNode.Nodes expr; private ELNode.Nodes ELexpr; private int index; // Current index of the expression - private String expression; // The EL expression + private final String expression; // The EL expression private char type; - private boolean escapeBS; // is '\' an escape char in text outside EL? - private final boolean isDeferredSyntaxAllowedAsLiteral; private static final String reservedWords[] = { "and", "div", "empty", @@ -211,8 +209,7 @@ public class ELParser { prev = 0; if (ch == '\\') { buf.append('\\'); - if (!escapeBS) - prev = '\\'; + prev = '\\'; } else if (ch == '$' || (!isDeferredSyntaxAllowedAsLiteral && ch == '#')) { buf.append(ch); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org