always pass null instance to native version of Method.invoke when invoking static methods

This commit is contained in:
Joel Dice 2009-08-04 18:30:16 -06:00
parent 63fa0668ff
commit e18ab49f4d

View File

@ -103,6 +103,10 @@ public class Method<T> extends AccessibleObject
throws InvocationTargetException, IllegalAccessException
{
if ((flags & Modifier.STATIC) != 0 || class_.isInstance(instance)) {
if ((flags & Modifier.STATIC) != 0) {
instance = null;
}
if (arguments.length == parameterCount) {
return invoke(this, instance, arguments);
} else {