set InvocationTargetException target

When using the OpenJDK classpath, the target exception and the
Throwable cause are two different fields; we must set them both.
This commit is contained in:
Joel Dice 2013-04-18 11:23:59 -06:00
parent 81d7786716
commit b4c3eea0f1
2 changed files with 5 additions and 0 deletions

View File

@ -11,6 +11,8 @@
package java.lang.reflect;
public class InvocationTargetException extends Exception {
private Throwable target; // for compatibility with OpenJDK
public InvocationTargetException(Throwable targetException, String message) {
super(message, targetException);
}

View File

@ -561,6 +561,9 @@ invoke(Thread* t, object method, object instance, object args)
object exception = t->exception;
t->exception = makeThrowable
(t, Machine::InvocationTargetExceptionType, 0, 0, exception);
set(t, t->exception, InvocationTargetExceptionTarget,
throwableCause(t, t->exception));
}
});