Better error handling that may help track down the cause of https://issues.apache...
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 29 Jun 2011 13:56:28 +0000 (13:56 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 29 Jun 2011 13:56:28 +0000 (13:56 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1141104 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/el/Messages.properties
java/org/apache/el/lang/ExpressionBuilder.java
webapps/docs/changelog.xml

index 7fdc6f2..4a598fc 100644 (file)
@@ -32,6 +32,9 @@ error.method=Not a valid MethodExpression : {0}
 error.method.nullParms=Parameter types cannot be null
 error.value.expectedType=Expected type cannot be null
 
+# ExpressionBuilder
+error.parseFail=Failed to parse the expression [{0}]
+
 # ExpressionMediator
 error.eval=Error Evaluating {0} : {1}
 
index 049b715..53161dd 100644 (file)
@@ -41,7 +41,6 @@ import org.apache.el.parser.AstValue;
 import org.apache.el.parser.ELParser;
 import org.apache.el.parser.Node;
 import org.apache.el.parser.NodeVisitor;
-import org.apache.el.parser.ParseException;
 import org.apache.el.util.ConcurrentCache;
 import org.apache.el.util.MessageFactory;
 
@@ -143,8 +142,9 @@ public final class ExpressionBuilder implements NodeVisitor {
                     n = n.jjtGetChild(0);
                 }
                 cache.put(expr, n);
-            } catch (ParseException pe) {
-                throw new ELException("Error Parsing: " + expr, pe);
+            } catch (Exception e) {
+                throw new ELException(
+                        MessageFactory.get("error.parseFail", expr), e);
             }
         }
         return n;
index 02cb8f7..477a444 100644 (file)
         use any valid XML name) have a name which is not a Java identifier.
         (markt)
       </fix>
+      <add>
+        Broaden the exception handling in the EL Parser so that more failures to
+        parse an expression include the failed expression in the exception
+        message. Hopefully, this will help track down the cause of
+        <bug>51088</bug>. (markt)
+      </add>
     </changelog>
   </subsection>
   <subsection name="Cluster">