зеркало из https://github.com/mono/ikvm-fork.git
When a dynamic only interface method ends up being "implemented" by a static or non-public method, it should throw the appropriate exception.
This commit is contained in:
Родитель
e3d95f6da5
Коммит
93ebbdb473
|
@ -474,10 +474,14 @@ namespace IKVM.Internal
|
|||
// we can resolve to a real method and call that instead
|
||||
TypeWrapper tw = TypeWrapper.FromClass(NativeCode.ikvm.runtime.Util.getClassFromObject(obj));
|
||||
MethodWrapper mw = tw.GetMethodWrapper(this.Name, this.Signature, true);
|
||||
if (mw == null)
|
||||
if (mw == null || mw.IsStatic)
|
||||
{
|
||||
throw new java.lang.AbstractMethodError(tw.Name + "." + this.Name + this.Signature);
|
||||
}
|
||||
if (!mw.IsPublic)
|
||||
{
|
||||
throw new java.lang.IllegalAccessError(tw.Name + "." + this.Name + this.Signature);
|
||||
}
|
||||
java.lang.reflect.Method m = (java.lang.reflect.Method)mw.ToMethodOrConstructor(true);
|
||||
m.@override = true;
|
||||
return m.invoke(obj, args, callerID);
|
||||
|
|
Загрузка…
Ссылка в новой задаче