diff options
author | Tom Tromey <tromey@redhat.com> | 2005-04-05 22:26:26 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2005-04-05 22:26:26 +0000 |
commit | 8b6e76905300f33b868a3619d416cc9285cbfee1 (patch) | |
tree | 2e7ab5655ae0f92acaf1825446f2fec39bb2a56e /libjava/java/lang/natClassLoader.cc | |
parent | 13148dd26aafe25ef31d5303f6383d464cc8db61 (diff) | |
download | gcc-8b6e76905300f33b868a3619d416cc9285cbfee1.zip gcc-8b6e76905300f33b868a3619d416cc9285cbfee1.tar.gz gcc-8b6e76905300f33b868a3619d416cc9285cbfee1.tar.bz2 |
jni.cc (_Jv_JNI_GetAnyFieldID): Throw ClassNotFoundException.
* jni.cc (_Jv_JNI_GetAnyFieldID): Throw ClassNotFoundException.
* java/lang/reflect/natMethod.cc (_Jv_GetTypesFromSignature):
Rewrote to use _Jv_FindClassFromSignature.
* verify.cc (resolve): throw NoClassDefFoundError.
* link.cc (resolve_field): Throw NoClassDefFoundError.
(find_field): Likewise.
* prims.cc (_Jv_FindClassFromSignature): Removed recursion.
Handle error cases. Added 'endp' argument.
* include/jvm.h (_Jv_FindClassFromSignature): Updated prototype.
From-SVN: r97660
Diffstat (limited to 'libjava/java/lang/natClassLoader.cc')
-rw-r--r-- | libjava/java/lang/natClassLoader.cc | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/libjava/java/lang/natClassLoader.cc b/libjava/java/lang/natClassLoader.cc index 00292f9..b8d87c6 100644 --- a/libjava/java/lang/natClassLoader.cc +++ b/libjava/java/lang/natClassLoader.cc @@ -252,27 +252,30 @@ _Jv_FindClass (_Jv_Utf8Const *name, java::lang::ClassLoader *loader) // Not even a bootstrap loader, try the built-in cache. klass = _Jv_FindClassInCache (name); - bool found = false; - for (int i = 0; i < bootstrap_index; ++i) + if (klass) { - if (bootstrap_class_list[i] == klass) + bool found = false; + for (int i = 0; i < bootstrap_index; ++i) { - found = true; - break; + if (bootstrap_class_list[i] == klass) + { + found = true; + break; + } + } + if (! found) + { + if (bootstrap_index == BOOTSTRAP_CLASS_LIST_SIZE) + abort (); + bootstrap_class_list[bootstrap_index++] = klass; } - } - if (! found) - { - if (bootstrap_index == BOOTSTRAP_CLASS_LIST_SIZE) - abort (); - bootstrap_class_list[bootstrap_index++] = klass; } } } else { - // we need classes to be in the hash while - // we're loading, so that they can refer to themselves. + // We need classes to be in the hash while we're loading, so + // that they can refer to themselves. _Jv_Linker::wait_for_state (klass, JV_STATE_LOADED); } |