diff options
Diffstat (limited to 'libjava/java/lang')
-rw-r--r-- | libjava/java/lang/reflect/natArray.cc | 5 | ||||
-rw-r--r-- | libjava/java/lang/reflect/natMethod.cc | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/libjava/java/lang/reflect/natArray.cc b/libjava/java/lang/reflect/natArray.cc index bc48041..7875122 100644 --- a/libjava/java/lang/reflect/natArray.cc +++ b/libjava/java/lang/reflect/natArray.cc @@ -43,11 +43,12 @@ java::lang::reflect::Array::newInstance (jclass componentType, jint length) } jobject -java::lang::reflect::Array::newInstance (jclass componentType, jintArray dimensions) +java::lang::reflect::Array::newInstance (jclass componentType, + jintArray dimensions) { jint ndims = dimensions->length; if (ndims == 0) - return componentType->newInstance (); + throw new java::lang::IllegalArgumentException (); jint* dims = elements (dimensions); if (ndims == 1) return newInstance (componentType, dims[0]); diff --git a/libjava/java/lang/reflect/natMethod.cc b/libjava/java/lang/reflect/natMethod.cc index 96cc132..26c270e 100644 --- a/libjava/java/lang/reflect/natMethod.cc +++ b/libjava/java/lang/reflect/natMethod.cc @@ -100,8 +100,8 @@ can_widen (jclass from, jclass to) // Boolean arguments may not be widened. if (fromx == BOOLEAN && tox != BOOLEAN) return false; - // Special-case short->char conversions. - if (fromx == SHORT && tox == CHAR) + // Nothing promotes to char. + if (tox == CHAR && fromx != CHAR) return false; return fromx <= tox; |