From 6271c4236223aaeb58cbc942db5815c23c93cb68 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 11 Oct 2011 15:43:35 -0700 Subject: Fix a few UNIMPLEMENTEDs. The pre-allocated OOME is per-thread in art, and already handled in Thread::VisitRoots. We don't have pre-allocated instances of the other two exceptions. Change-Id: I3d874e0760411188408941424925e2eaeb71d6b7 --- src/java_lang_reflect_Array.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/java_lang_reflect_Array.cc') diff --git a/src/java_lang_reflect_Array.cc b/src/java_lang_reflect_Array.cc index b1ae682c8c..f1456b10d3 100644 --- a/src/java_lang_reflect_Array.cc +++ b/src/java_lang_reflect_Array.cc @@ -27,9 +27,6 @@ namespace { // Recursively create an array with multiple dimensions. Elements may be // Objects or primitive types. -// -// The dimension we're creating is in dimensions[0], so when we recurse -// we advance the pointer. Array* CreateMultiArray(Class* array_class, int current_dimension, IntArray* dimensions) { int32_t array_length = dimensions->Get(current_dimension++); Array* new_array = Array::Alloc(array_class, array_length); @@ -93,8 +90,10 @@ jobject Array_createMultiArray(JNIEnv* env, jclass, jclass javaElementClass, job DCHECK_LE(num_dimensions, 255); for (int i = 0; i < num_dimensions; i++) { - if (dimensions_array->Get(i) < 0) { - UNIMPLEMENTED(FATAL) << "ThrowNegativeArraySizeException(dimensions[i])"; + int dimension = dimensions_array->Get(i); + if (dimension < 0) { + Thread::Current()->ThrowNewExceptionF("Ljava/lang/NegativeArraySizeException;", + "Dimension %d: %d", i, dimension); return NULL; } } @@ -124,7 +123,7 @@ jobject Array_createObjectArray(JNIEnv* env, jclass, jclass javaElementClass, ji DCHECK(javaElementClass != NULL); Class* element_class = Decode(env, javaElementClass); if (length < 0) { - UNIMPLEMENTED(FATAL) << "ThrowNegativeArraySizeException(length)"; + Thread::Current()->ThrowNewExceptionF("Ljava/lang/NegativeArraySizeException;", "%d", length); return NULL; } std::string descriptor; -- cgit v1.2.3-59-g8ed1b