Hi all,

The following bug is triggered by the combination of Jikes 1.21 with the current version of Kaffe from CVS. It is not triggered by Jikes + sunjava or by sunjavac + Kaffe...

With jikes+Kaffe, the following code:

-----------------------------------------------------------------
public class Bug {
    static interface I1 {
        public String toString();
    }
    static interface I2 extends I1 {
    }
    static class CBug implements I2 {
    }
    public static void main(String[] argv) throws Exception {
        I2 b = new CBug();
        System.out.println(b);
        System.out.println(b.toString().length());
        System.out.println(b.toString());
    }
}
-----------------------------------------------------------------

gives me this output with a freshly compiled version of Kaffe from CVS:

-----------------------------------------------------------------
[EMAIL PROTECTED]:/tmp$ jikes Bug.java; kaffe Bug
[EMAIL PROTECTED]
137009132
java.lang.OutOfMemoryError
   at java.io.Writer.write (Writer.java:185)
   at java.io.OutputStreamWriter.write (OutputStreamWriter.java:196)
   at java.io.PrintWriter.write (PrintWriter.java:542)
   at java.io.PrintWriter.write (PrintWriter.java:568)
   at java.io.PrintWriter.print (PrintWriter.java:204)
   at java.io.PrintWriter.println (PrintWriter.java:453)
   at java.io.PrintStream.println (PrintStream.java:389)
   at Bug.main (Bug.java:16)
-----------------------------------------------------------------

which is obviously wrong, since the returned string should be "[EMAIL PROTECTED]", which does not have length 137009132...

I first noticed this bug in a much more complex program, where I would get NullPointerExceptions when calling any method on the string returned by toString().

Not sure whether this should be seen as a bug in Kaffe or Jikes -- but since Kaffe aims to run programs that work on Sun's JDK, I guess this should be fixed. I don't understand Kaffe well enough to do it, though.

Cheers,
- Benja

_______________________________________________
kaffe mailing list
[EMAIL PROTECTED]
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe

Reply via email to