fix exception wrapping for Method.invoke and static initializers

Method.invoke should initialize its class before invoking the method,
throwing an ExceptionInInitializerError if it fails, without wrapping
said error in an InvocationTargetException.

Also, we must initialize ExceptionInInitializerError.exception when
throwing instances from the VM, since OpenJDK's
ExceptionInInitializerError.getCause uses the exception field, not the
cause field.
This commit is contained in:
Joel Dice
2013-12-05 22:28:13 -07:00
parent 451fe159c2
commit abe8bc6fda
6 changed files with 70 additions and 6 deletions

View File

@ -11,11 +11,11 @@
package java.lang;
public class ExceptionInInitializerError extends Error {
private final Throwable cause2;
private final Throwable exception;
public ExceptionInInitializerError(String message) {
super(message);
cause2 = null;
exception = null;
}
public ExceptionInInitializerError() {