Finish cleanup of class/field/method caching.
Change-Id: I289ae724cbd98487429275837d23b7b2d7096156
diff --git a/src/oat/runtime/support_proxy.cc b/src/oat/runtime/support_proxy.cc
index 26f61cf..37cacb4 100644
--- a/src/oat/runtime/support_proxy.cc
+++ b/src/oat/runtime/support_proxy.cc
@@ -188,10 +188,7 @@
// In the case of checked exceptions that aren't declared, the exception must be wrapped by
// a UndeclaredThrowableException.
Throwable* exception = self->GetException();
- self->ClearException();
- if (!exception->IsCheckedException()) {
- self->SetException(exception);
- } else {
+ if (exception->IsCheckedException()) {
SynthesizedProxyClass* proxy_class =
down_cast<SynthesizedProxyClass*>(proxy_method->GetDeclaringClass());
int throws_index = -1;
@@ -210,10 +207,8 @@
Class* declared_exception = declared_exceptions->Get(i);
declares_exception = declared_exception->IsAssignableFrom(exception_class);
}
- if (declares_exception) {
- self->SetException(exception);
- } else {
- ThrowNewUndeclaredThrowableException(self, env, exception);
+ if (!declares_exception) {
+ self->ThrowNewWrappedException("Ljava/lang/reflect/UndeclaredThrowableException;", NULL);
}
}
}