private static object InvokeNonVirtual(ManagedJNIEnv env, MethodWrapper mw, object obj, object[] argarray)
{
if (mw.HasCallerID || mw.IsDynamicOnly)
{
throw new NotSupportedException();
}
if (mw.DeclaringType.IsRemapped && !mw.DeclaringType.TypeAsBaseType.IsInstanceOfType(obj))
{
return mw.InvokeNonvirtualRemapped(obj, argarray);
}
else
{
Delegate del = (Delegate)Activator.CreateInstance(mw.GetDelegateType(),
new object[] { obj, mw.GetMethod().MethodHandle.GetFunctionPointer() });
try
{
return del.DynamicInvoke(argarray);
}
catch (TargetInvocationException x)
{
throw ikvm.runtime.Util.mapException(x.InnerException);
}
}
}