summaryrefslogtreecommitdiffstats
path: root/src/java_lang_reflect_Array.cc
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2011-10-11 15:43:35 -0700
committerElliott Hughes <enh@google.com>2011-10-11 15:43:35 -0700
commit6271c4236223aaeb58cbc942db5815c23c93cb68 (patch)
tree144382bb39f1981642811a8005a0f91f73b5a99a /src/java_lang_reflect_Array.cc
parent0e5b90555f1cf53005dead4853a223e5811918ee (diff)
downloadart-6271c4236223aaeb58cbc942db5815c23c93cb68.zip
art-6271c4236223aaeb58cbc942db5815c23c93cb68.tar.gz
art-6271c4236223aaeb58cbc942db5815c23c93cb68.tar.bz2
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
Diffstat (limited to 'src/java_lang_reflect_Array.cc')
-rw-r--r--src/java_lang_reflect_Array.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/java_lang_reflect_Array.cc b/src/java_lang_reflect_Array.cc
index b1ae682..f1456b1 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<Class*>(env, javaElementClass);
if (length < 0) {
- UNIMPLEMENTED(FATAL) << "ThrowNegativeArraySizeException(length)";
+ Thread::Current()->ThrowNewExceptionF("Ljava/lang/NegativeArraySizeException;", "%d", length);
return NULL;
}
std::string descriptor;