diff options
author | Jeff Hao <jeffhao@google.com> | 2015-09-02 13:52:20 -0700 |
---|---|---|
committer | Jeff Hao <jeffhao@google.com> | 2015-09-02 14:56:43 -0700 |
commit | fc8d247275d06047c652abbdd368fe784bf85e67 (patch) | |
tree | 8b71dd7c2a5c2f95c8f2c158016995718c023d93 /runtime/dex_file.cc | |
parent | fe3879e6011f629d0dd6b04fab00b9496bd4ea08 (diff) | |
download | art-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.cc | 11 |
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; |