summaryrefslogtreecommitdiffstats
path: root/runtime/dex_file.cc
diff options
context:
space:
mode:
authorJeff Hao <jeffhao@google.com>2015-09-02 13:52:20 -0700
committerJeff Hao <jeffhao@google.com>2015-09-02 14:56:43 -0700
commitfc8d247275d06047c652abbdd368fe784bf85e67 (patch)
tree8b71dd7c2a5c2f95c8f2c158016995718c023d93 /runtime/dex_file.cc
parentfe3879e6011f629d0dd6b04fab00b9496bd4ea08 (diff)
downloadart-fc8d247275d06047c652abbdd368fe784bf85e67.tar.gz
art-fc8d247275d06047c652abbdd368fe784bf85e67.tar.bz2
art-fc8d247275d06047c652abbdd368fe784bf85e67.zip
Fix native annotations returning TypeNotPresentException.
Also adds test cases for inner classes and TypeNotPresentException. Change-Id: I28041af455f09b43fcf0b07b79b5a21d4741079b
Diffstat (limited to 'runtime/dex_file.cc')
-rw-r--r--runtime/dex_file.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/runtime/dex_file.cc b/runtime/dex_file.cc
index 29413bf830..5526883330 100644
--- a/runtime/dex_file.cc
+++ b/runtime/dex_file.cc
@@ -1787,8 +1787,15 @@ bool DexFile::ProcessAnnotationValue(Handle<mirror::Class> klass, const uint8_t*
klass->GetDexFile(), index, klass.Get());
set_object = true;
if (element_object == nullptr) {
- // TODO: Put a TypeNotFoundExceptionProxy instead of throwing here.
- return false;
+ CHECK(self->IsExceptionPending());
+ if (result_style == kAllObjects) {
+ const char* msg = StringByTypeIdx(index);
+ self->ThrowNewWrappedException("Ljava/lang/TypeNotPresentException;", msg);
+ element_object = self->GetException();
+ self->ClearException();
+ } else {
+ return false;
+ }
}
}
break;