Fix and enhancement. When a .NET type implements a shadowed interface, we now also publish the original interface (e.g. if the .NET type implements System.IComparable, Java code will now see java.lang.Comparable and System.IComparable). In addition, the new code makes sure that when a .NET type explicitly implements both System.IComparable and java.lang.Comparable that the Java code will not see java.lang.Comparable twice.

This commit is contained in:
jfrijters 2011-06-27 15:13:20 +00:00
Родитель c742dbb2d9
Коммит 524bf7c090
1 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@ -3043,6 +3043,21 @@ namespace IKVM.Internal
interfaces[i] = ClassLoaderWrapper.GetWrapperFromType(interfaceTypes[i]); interfaces[i] = ClassLoaderWrapper.GetWrapperFromType(interfaceTypes[i]);
} }
} }
for (int i = 0; i < interfaceTypes.Length; i++)
{
if (interfaces[i].IsRemapped)
{
// for remapped interfaces, we also return the original interface (Java types will ignore it, if it isn't listed in the ImplementsAttribute)
TypeWrapper twRemapped = interfaces[i];
TypeWrapper tw = DotNetTypeWrapper.GetWrapperFromDotNetType(interfaceTypes[i]);
interfaces[i] = tw;
if (Array.IndexOf(interfaces, twRemapped) == -1)
{
Array.Resize(ref interfaces, interfaces.Length + 1);
interfaces[interfaces.Length - 1] = twRemapped;
}
}
}
return interfaces; return interfaces;
} }