tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r696716 - /tomcat/trunk/java/org/apache/el/lang/ExpressionBuilder.java
Date Thu, 18 Sep 2008 17:08:11 GMT
Author: rjung
Date: Thu Sep 18 10:08:10 2008
New Revision: 696716

URL: http://svn.apache.org/viewvc?rev=696716&view=rev
Log:
Fix ClassCastException when we try to cast a

NullPointerException to an ELException.
I still need to investigate where the NPE came from,
but simply casting seems unsafe in any case.

Use a cast if possible and recreate exception
otherwise.

Modified:
    tomcat/trunk/java/org/apache/el/lang/ExpressionBuilder.java

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=696716&r1=696715&r2=696716&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/el/lang/ExpressionBuilder.java (original)
+++ tomcat/trunk/java/org/apache/el/lang/ExpressionBuilder.java Thu Sep 18 10:08:10 2008
@@ -132,7 +132,11 @@
         try {
             node.accept(this);
         } catch (Exception e) {
-            throw (ELException) e;
+            if (e instanceof ELException) {
+                throw (ELException) e;
+            } else {
+                throw (new ELException(e));
+            }
         }
         if (this.fnMapper instanceof FunctionMapperFactory) {
             this.fnMapper = ((FunctionMapperFactory) this.fnMapper).create();



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


Mime
View raw message