summaryrefslogtreecommitdiffstats
path: root/libjava/java/lang/natClassLoader.cc
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-05 22:26:26 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-05 22:26:26 +0000
commitbe7d01ed62d74d9c4b7b53f96bb82c8f109f859e (patch)
tree2e7ab5655ae0f92acaf1825446f2fec39bb2a56e /libjava/java/lang/natClassLoader.cc
parent9f587d943d2e682a674b64bb64f0086318dc8eb7 (diff)
downloadppe42-gcc-be7d01ed62d74d9c4b7b53f96bb82c8f109f859e.tar.gz
ppe42-gcc-be7d01ed62d74d9c4b7b53f96bb82c8f109f859e.zip
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97660 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/lang/natClassLoader.cc')
-rw-r--r--libjava/java/lang/natClassLoader.cc29
1 files changed, 16 insertions, 13 deletions
diff --git a/libjava/java/lang/natClassLoader.cc b/libjava/java/lang/natClassLoader.cc
index 00292f93dad..b8d87c6062b 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);
}
OpenPOWER on IntegriCloud