The development of a Java VM for .NET
The System.TypeLoadException I mentioned here turns out to be caused by a bug in the .NET 1.0 CLR (MS has already fixed it in the current 1.1 beta).
Here is some code that triggers it:
interface __Shape{ public abstract __Rectangle getBounds(); public abstract __Rectangle2D getBounds2D();}
abstract class __RectangularShape implements __Shape{ public __Rectangle getBounds() { return null; }}
abstract class __Rectangle2D extends __RectangularShape{ public __Rectangle2D getBounds2D() { return null; }}
class __Rectangle extends __Rectangle2D implements __Shape{ public __Rectangle getBounds() { return null; }
public __Rectangle2D getBounds2D() { return null; }}
If this code was compiled with Jikes 1.18 (which doesn't emit Miranda methods) and then run in IK.VM.NET, it failed with a System.TypeLoadException. The fix was easy, just emit an abstract method for each interface method that a type doesn't implement. A compiled DLL of the above code can be found here. When run through peverify 1.0, it will fail verification, in 1.1 this is fixed.
I compiled the Classpath code I got on Friday with Jikes 1.18 and made a new release based on that (including, of course, all the VM fixes I had to do).
Updated the binaries and source snaphots.
Remember Me
I apologize for the lameness of this, but the comment spam was driving me nuts. In order to be able to post a comment, you need to answer a simple question. Hopefully this question is easy enough not to annoy serious commenters, but hard enough to keep the spammers away.
Anti-Spam Question: What method on java.lang.System returns an object's original hashcode (i.e. the one that would be returned by java.lang.Object.hashCode() if it wasn't overridden)? (case is significant)