RE: [Ikvm-developers] (no subject)
Brought to you by:
jfrijters
|
From: Jeroen F. <je...@su...> - 2003-07-23 14:21:51
|
Jonathan Pierce wrote: > >the only exception being making String implement CharSequence. >=20 > Why is this difficult?=20 > Can't you just return another string using String.SubString=20 > since String implements CharSequence?=20 In IKVM java.lang.String =3D=3D System.String. Obviously, System.String doesn't implement CharSequence, so I'm going to have to fake it. I think I've got pretty much figured out how to do it, but I haven't gotten around to implement it. This is mostly due to the fact that I've never encountered code that actually used CharSequence. > >>These are expected exceptions. >=20 > Is there any way to minimize them from being thrown in the=20 > implementation? > Doesn't this slow down the implementation every time an=20 > exception is thrown and caught? Yes, this is bad library design, but in most cases there is not much you can do. > http://www.junglecreatures.com/jungle/ClassVersionBug.zip This turns out to be caused by one unimplemented feature and one bug in my reflection code. The reflection code for statically compiled code is different from the path for dynamically compiled code and the static path was taking a shortcut with respect to reporting the implemented interfaces. In Java, Class.getInterfaces() only returns the interfaces directly implemented by the Class, but in .NET, Type.GetInterfaces() returns all interfaces that the Type implements. I fixed this by adding a custom attribute (OpenSystem.Java.ImplementsAttribute) for each interface that a class implements and modified the reflection code (for statically compiled code) to look for this attribute instead of using .NET reflection. A second bug was in the modifiers reported for constructors, they appeared to be final and this is not correct. I'll make a new snapshot tomorrow. BTW, I've not yet checked in the code. Regards, Jeroen |