You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by di...@apache.org on 2007/11/04 15:15:40 UTC

svn commit: r591785 - /commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/ExpressionFactory.java

Author: dion
Date: Sun Nov  4 06:15:39 2007
New Revision: 591785

URL: http://svn.apache.org/viewvc?rev=591785&view=rev
Log:
Remove more throws Exception JEXL-33

Modified:
    commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/ExpressionFactory.java

Modified: commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/ExpressionFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/ExpressionFactory.java?rev=591785&r1=591784&r2=591785&view=diff
==============================================================================
--- commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/ExpressionFactory.java (original)
+++ commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/ExpressionFactory.java Sun Nov  4 06:15:39 2007
@@ -98,12 +98,12 @@
      * must contain either a reference or an expression.
      * @param expression A String containing valid JEXL syntax
      * @return An Expression object which can be evaluated with a JexlContext
-     * @throws Exception An exception can be thrown if there is a problem
+     * @throws ParseException An exception can be thrown if there is a problem
      *      parsing this expression, or if the expression is neither an
      *      expression or a reference.
      */
     public static Expression createExpression(String expression)
-        throws Exception {
+        throws ParseException {
         return getInstance().createNewExpression(expression);
     }
 
@@ -113,11 +113,9 @@
      *
      *  @param expression valid Jexl expression
      *  @return Expression
-     *  @throws Exception for a variety of reasons - mostly malformed
-     *          Jexl expression
+     *  @throws ParseException for malformed Jexl expression
      */
-    public Expression createNewExpression(final String expression)
-        throws Exception {
+    public Expression createNewExpression(final String expression) throws ParseException {
 
         String expr = cleanExpression(expression);
 
@@ -129,6 +127,10 @@
                 tree = parser.parse(new StringReader(expr));
             } catch (TokenMgrError tme) {
                 throw new ParseException(tme.getMessage());
+            } catch (ParseException e) {
+                throw e;
+            } catch (Exception e) {
+                throw new RuntimeException(e);
             }
         }