[jboss-svn-commits] JBL Code SVN: r29624 - labs/jbosstm/workspace/adinn/byteman/trunk/src/org/jboss/byteman/rule/expression.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Oct 15 13:02:31 EDT 2009


Author: adinn
Date: 2009-10-15 13:02:31 -0400 (Thu, 15 Oct 2009)
New Revision: 29624

Modified:
   labs/jbosstm/workspace/adinn/byteman/trunk/src/org/jboss/byteman/rule/expression/MethodExpression.java
Log:
fixed exception handling for interpreted method expressions to be the same as for compiled method expressions

Modified: labs/jbosstm/workspace/adinn/byteman/trunk/src/org/jboss/byteman/rule/expression/MethodExpression.java
===================================================================
--- labs/jbosstm/workspace/adinn/byteman/trunk/src/org/jboss/byteman/rule/expression/MethodExpression.java	2009-10-15 15:31:22 UTC (rev 29623)
+++ labs/jbosstm/workspace/adinn/byteman/trunk/src/org/jboss/byteman/rule/expression/MethodExpression.java	2009-10-15 17:02:31 UTC (rev 29624)
@@ -29,6 +29,7 @@
 import org.jboss.byteman.rule.exception.TypeException;
 import org.jboss.byteman.rule.exception.ExecuteException;
 import org.jboss.byteman.rule.exception.CompileException;
+import org.jboss.byteman.rule.exception.ThrowException;
 import org.jboss.byteman.rule.Rule;
 import org.jboss.byteman.rule.compiler.StackHeights;
 import org.jboss.byteman.rule.helper.HelperAdapter;
@@ -42,6 +43,7 @@
 import java.io.StringWriter;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
+import java.lang.reflect.InvocationTargetException;
 
 /**
  * an expression which identifies a method invocation
@@ -262,6 +264,13 @@
             }
 
             return method.invoke(recipientValue, argValues);
+        } catch (InvocationTargetException e) {
+            Throwable th = e.getCause();
+            if (th instanceof ExecuteException) {
+                throw (ExecuteException)th;
+            } else {
+                throw new ExecuteException("MethodExpression.interpret : exception invoking method " + token.getText() + getPos(), th);
+            }
         } catch (ExecuteException e) {
             throw e;
         } catch (Exception e) {



More information about the jboss-svn-commits mailing list