This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]