You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kk...@apache.org on 2011/11/14 00:40:50 UTC

svn commit: r1201548 - in /tomcat/trunk/java/org/apache/el/parser: AstFunction.java AstValue.java

Author: kkolinko
Date: Sun Nov 13 23:40:50 2011
New Revision: 1201548

URL: http://svn.apache.org/viewvc?rev=1201548&view=rev
Log:
Improve processing of errors that are wrapped into InvocationTargetException.
Rethrow errors that must be rethrown.

Modified:
    tomcat/trunk/java/org/apache/el/parser/AstFunction.java
    tomcat/trunk/java/org/apache/el/parser/AstValue.java

Modified: tomcat/trunk/java/org/apache/el/parser/AstFunction.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/el/parser/AstFunction.java?rev=1201548&r1=1201547&r2=1201548&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/el/parser/AstFunction.java (original)
+++ tomcat/trunk/java/org/apache/el/parser/AstFunction.java Sun Nov 13 23:40:50 2011
@@ -114,8 +114,15 @@ public final class AstFunction extends S
             throw new ELException(MessageFactory.get("error.function", this
                     .getOutputName()), iae);
         } catch (InvocationTargetException ite) {
+            Throwable cause = ite.getCause();
+            if (cause instanceof ThreadDeath) {
+                throw (ThreadDeath) cause;
+            }
+            if (cause instanceof VirtualMachineError) {
+                throw (VirtualMachineError) cause;
+            }
             throw new ELException(MessageFactory.get("error.function", this
-                    .getOutputName()), ite.getCause());
+                    .getOutputName()), cause);
         }
         return result;
     }

Modified: tomcat/trunk/java/org/apache/el/parser/AstValue.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/el/parser/AstValue.java?rev=1201548&r1=1201547&r2=1201548&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/el/parser/AstValue.java (original)
+++ tomcat/trunk/java/org/apache/el/parser/AstValue.java Sun Nov 13 23:40:50 2011
@@ -265,7 +265,14 @@ public final class AstValue extends Simp
         } catch (IllegalArgumentException iae) {
             throw new ELException(iae);
         } catch (InvocationTargetException ite) {
-            throw new ELException(ite.getCause());
+            Throwable cause = ite.getCause();
+            if (cause instanceof ThreadDeath) {
+                throw (ThreadDeath) cause;
+            }
+            if (cause instanceof VirtualMachineError) {
+                throw (VirtualMachineError) cause;
+            }
+            throw new ELException(cause);
         }
         return result;
     }



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