tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1374086 - in /tomcat/trunk/java/org/apache/jasper/compiler: ELFunctionMapper.java ELNode.java ELParser.java
Date Thu, 16 Aug 2012 22:19:30 GMT
Author: markt
Date: Thu Aug 16 22:19:30 2012
New Revision: 1374086

URL: http://svn.apache.org/viewvc?rev=1374086&view=rev
Log:
Code clean-up
 - Java 7 <>
 - UCDetector use of final

Modified:
    tomcat/trunk/java/org/apache/jasper/compiler/ELFunctionMapper.java
    tomcat/trunk/java/org/apache/jasper/compiler/ELNode.java
    tomcat/trunk/java/org/apache/jasper/compiler/ELParser.java

Modified: tomcat/trunk/java/org/apache/jasper/compiler/ELFunctionMapper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/ELFunctionMapper.java?rev=1374086&r1=1374085&r2=1374086&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/ELFunctionMapper.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/ELFunctionMapper.java Thu Aug 16 22:19:30
2012
@@ -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<>();
 
         @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<>();
+                final HashMap<String, String> keyMap = new HashMap<>();
                 @Override
                 public void visit(ELNode.Function n) throws JasperException {
                     String key = n.getPrefix() + ":" + n.getName();

Modified: tomcat/trunk/java/org/apache/jasper/compiler/ELNode.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/ELNode.java?rev=1374086&r1=1374085&r2=1374086&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/ELNode.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/ELNode.java Thu Aug 16 22:19:30 2012
@@ -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 String uri;
         private FunctionInfo functionInfo;
         private String methodName;
@@ -187,10 +187,10 @@ 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>();
+            list = new ArrayList<>();
         }
 
         public void add(ELNode en) {

Modified: tomcat/trunk/java/org/apache/jasper/compiler/ELParser.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/ELParser.java?rev=1374086&r1=1374085&r2=1374086&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/ELParser.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/ELParser.java Thu Aug 16 22:19:30 2012
@@ -33,18 +33,16 @@ public class ELParser {
     private Token curToken;  // current token
     private Token prevToken; // previous token
 
-    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",
@@ -193,8 +191,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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message