Commit bcf98e48 by Tom Tromey Committed by Tom Tromey

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
parent bab6226b
2000-09-06 Tom Tromey <tromey@cygnus.com> 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: Fix for PR java.lang/339:
* java/lang/natPosixProcess.cc (fail): New function. * java/lang/natPosixProcess.cc (fail): New function.
(cleanup): New function. (cleanup): New function.
......
...@@ -447,13 +447,17 @@ _Jv_CallAnyMethodA (jobject obj, ...@@ -447,13 +447,17 @@ _Jv_CallAnyMethodA (jobject obj,
{ {
// FIXME: access checks. // 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); JvThrow (new java::lang::IllegalArgumentException);
int param_count = parameter_types->length; int param_count = parameter_types->length;
jclass *paramelts = elements (parameter_types); jclass *paramelts = elements (parameter_types);
jobject *argelts = elements (args); jobject *argelts = args == NULL ? NULL : elements (args);
jvalue argvals[param_count]; jvalue argvals[param_count];
#define COPY(Where, What, Type) \ #define COPY(Where, What, Type) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment