diff options
author | Tom Tromey <tromey@cygnus.com> | 2000-09-06 21:20:45 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2000-09-06 21:20:45 +0000 |
commit | bcf98e48ef4b9eeee82ca6505153216d4b55a22b (patch) | |
tree | 780c248203856cfbb39819bd9a522607d31007b3 /libjava/java | |
parent | bab6226b6bcaa60ba346f5c082ab9284cbb53d1b (diff) | |
download | gcc-bcf98e48ef4b9eeee82ca6505153216d4b55a22b.zip gcc-bcf98e48ef4b9eeee82ca6505153216d4b55a22b.tar.gz gcc-bcf98e48ef4b9eeee82ca6505153216d4b55a22b.tar.bz2 |
natMethod.cc (_Jv_CallAnyMethodA): Accept null `args' if method takes no parameters.
* java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Accept null
`args' if method takes no parameters.
From-SVN: r36209
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/lang/reflect/natMethod.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libjava/java/lang/reflect/natMethod.cc b/libjava/java/lang/reflect/natMethod.cc index ef6ab53..8972852 100644 --- a/libjava/java/lang/reflect/natMethod.cc +++ b/libjava/java/lang/reflect/natMethod.cc @@ -447,13 +447,17 @@ _Jv_CallAnyMethodA (jobject obj, { // FIXME: access checks. - if (parameter_types->length != args->length) + if (parameter_types->length == 0 && args == NULL) + { + // The JDK accepts this, so we do too. + } + else if (parameter_types->length != args->length) JvThrow (new java::lang::IllegalArgumentException); int param_count = parameter_types->length; jclass *paramelts = elements (parameter_types); - jobject *argelts = elements (args); + jobject *argelts = args == NULL ? NULL : elements (args); jvalue argvals[param_count]; #define COPY(Where, What, Type) \ |