Use specific exception class to abort transaction

We used to throw a java.lang.InternalError when aborting a
transaction (when preinitializing image classes at compilation time).

We now use dedicated class dalvik.system.TransactionAbortError that
is only thrown by the compiler to abort a transaction. This class has
constructors taking a java.lang.Throwable "cause" so we can wrap
exceptions causing the transaction to abort (for instance class
java.lang.ClassNotFoundException) and give more information about the
cause of the transaction abort.

Bug: 20019689
Change-Id: I019a72a1c754d8bba6a7ad6bb0f02e4fd6668622
diff --git a/runtime/transaction_test.cc b/runtime/transaction_test.cc
index 5db51c8..24ecf6b 100644
--- a/runtime/transaction_test.cc
+++ b/runtime/transaction_test.cc
@@ -35,8 +35,9 @@
         hs.NewHandle(soa.Decode<mirror::ClassLoader*>(jclass_loader)));
     ASSERT_TRUE(class_loader.Get() != nullptr);
 
-    // Load and initialize java.lang.ExceptionInInitializerError and java.lang.InternalError
-    // classes so they can be thrown during class initialization if the transaction aborts.
+    // Load and initialize java.lang.ExceptionInInitializerError and the exception class used
+    // to abort transaction so they can be thrown during class initialization if the transaction
+    // aborts.
     MutableHandle<mirror::Class> h_klass(
         hs.NewHandle(class_linker_->FindSystemClass(soa.Self(),
                                                     "Ljava/lang/ExceptionInInitializerError;")));
@@ -44,7 +45,8 @@
     class_linker_->EnsureInitialized(soa.Self(), h_klass, true, true);
     ASSERT_TRUE(h_klass->IsInitialized());
 
-    h_klass.Assign(class_linker_->FindSystemClass(soa.Self(), "Ljava/lang/InternalError;"));
+    h_klass.Assign(class_linker_->FindSystemClass(soa.Self(),
+                                                  Transaction::kAbortExceptionSignature));
     ASSERT_TRUE(h_klass.Get() != nullptr);
     class_linker_->EnsureInitialized(soa.Self(), h_klass, true, true);
     ASSERT_TRUE(h_klass->IsInitialized());