Skip to content
This repository
Browse code

set InvocationTargetException target

When using the OpenJDK classpath, the target exception and the
Throwable cause are two different fields; we must set them both.
  • Loading branch information...
commit b4c3eea0f1e7385b679220dd322bb93990ab11fd 1 parent 81d7786
Joel Dice authored April 18, 2013
2  classpath/java/lang/reflect/InvocationTargetException.java
@@ -11,6 +11,8 @@
11 11
 package java.lang.reflect;
12 12
 
13 13
 public class InvocationTargetException extends Exception {
  14
+  private Throwable target; // for compatibility with OpenJDK
  15
+
14 16
   public InvocationTargetException(Throwable targetException, String message) {
15 17
     super(message, targetException);
16 18
   }
3  src/avian/classpath-common.h
@@ -561,6 +561,9 @@ invoke(Thread* t, object method, object instance, object args)
561 561
         object exception = t->exception;
562 562
         t->exception = makeThrowable
563 563
           (t, Machine::InvocationTargetExceptionType, 0, 0, exception);
  564
+        
  565
+        set(t, t->exception, InvocationTargetExceptionTarget,
  566
+            throwableCause(t, t->exception));
564 567
       }
565 568
     });
566 569
 

0 notes on commit b4c3eea

Please sign in to comment.
Something went wrong with that request. Please try again.