This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: throw NoClassDefFoundError for missing array type
- From: Andrew Haley <aph at redhat dot com>
- To: java-patches at gcc dot gnu dot org
- Date: Wed, 3 May 2006 18:05:42 +0100
- Subject: Patch: throw NoClassDefFoundError for missing array type
For some reason we throw the correct error when a single-dimension
array type is missing, but not a multi-dimension array type.
Andrew.
2006-05-03 Andrew Haley <aph@redhat.com>
* prims.cc (_Jv_NewMultiArray): Throw NoClassDefFoundError if
array_type is phantom.
Index: libjava/prims.cc
===================================================================
--- libjava/prims.cc (revision 113252)
+++ libjava/prims.cc (working copy)
@@ -762,6 +762,11 @@
jobject
_Jv_NewMultiArray (jclass array_type, jint dimensions, ...)
{
+ // Creating an array of an unresolved type is impossible. So we throw
+ // the NoClassDefFoundError.
+ if (_Jv_IsPhantomClass(array_type))
+ throw new java::lang::NoClassDefFoundError(array_type->getName());
+
va_list args;
jint sizes[dimensions];
va_start (args, dimensions);