ART: Change behavior for rethrowing init failures (2)
Always store the pending exception when making a class erroneous.
Instead of filtering by ExceptionInInitializerError, add an option
to the rethrow that enforces a NoClassDefFoundError, which is required
by the specification.
Use the libcore companion change to add the stored error (if any) as
a cause to the NoClassDefFoundError, which should significantly help
tracking down issues.
Fix run-test 008 to expect spec-compliant behavior. Test that a cause
has been set.
Bug: 25445103
Change-Id: I6a0dc54e78312283faf23415887eff387531407f
diff --git a/test/008-exceptions/expected.txt b/test/008-exceptions/expected.txt
index ea59a49..083ecf7 100644
--- a/test/008-exceptions/expected.txt
+++ b/test/008-exceptions/expected.txt
@@ -9,7 +9,9 @@
... 2 more
Static Init
BadError: This is bad by convention: BadInit
+java.lang.NoClassDefFoundError: BadInit
BadError: This is bad by convention: BadInit
Static BadInitNoStringInit
BadErrorNoStringInit: This is bad by convention
+java.lang.NoClassDefFoundError: BadInitNoStringInit
BadErrorNoStringInit: This is bad by convention