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:
parent
bab6226b6b
commit
bcf98e48ef
@ -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.
|
||||
|
@ -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) \
|
||||
|
Loading…
Reference in New Issue
Block a user