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 2011/06/29 15:56:28 UTC

svn commit: r1141104 - in /tomcat/trunk: java/org/apache/el/Messages.properties java/org/apache/el/lang/ExpressionBuilder.java webapps/docs/changelog.xml

Author: markt
Date: Wed Jun 29 13:56:28 2011
New Revision: 1141104

URL: http://svn.apache.org/viewvc?rev=1141104&view=rev
Log:
Better error handling that may help track down the cause of https://issues.apache.org/bugzilla/show_bug.cgi?id=51088

Modified:
    tomcat/trunk/java/org/apache/el/Messages.properties
    tomcat/trunk/java/org/apache/el/lang/ExpressionBuilder.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/el/Messages.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/el/Messages.properties?rev=1141104&r1=1141103&r2=1141104&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/el/Messages.properties (original)
+++ tomcat/trunk/java/org/apache/el/Messages.properties Wed Jun 29 13:56:28 2011
@@ -32,6 +32,9 @@ error.method=Not a valid MethodExpressio
 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}
 

Modified: tomcat/trunk/java/org/apache/el/lang/ExpressionBuilder.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/el/lang/ExpressionBuilder.java?rev=1141104&r1=1141103&r2=1141104&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/el/lang/ExpressionBuilder.java (original)
+++ tomcat/trunk/java/org/apache/el/lang/ExpressionBuilder.java Wed Jun 29 13:56:28 2011
@@ -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 imp
                     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;

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1141104&r1=1141103&r2=1141104&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed Jun 29 13:56:28 2011
@@ -219,6 +219,12 @@
         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">



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org