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
This commit is contained in:
Tom Tromey 2000-09-06 21:20:45 +00:00 committed by Tom Tromey
parent bab6226b6b
commit bcf98e48ef
2 changed files with 9 additions and 2 deletions

View File

@ -1,5 +1,8 @@
2000-09-06 Tom Tromey <tromey@cygnus.com>
* java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Accept null
`args' if method takes no parameters.
Fix for PR java.lang/339:
* java/lang/natPosixProcess.cc (fail): New function.
(cleanup): New function.

View File

@ -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) \