[kaffe] Small kjc problem in BeanBug regression test

Dalibor Topic robilad at kaffe.org
Fri Aug 6 11:45:31 PDT 2004


the latest kjc in kaffe has a tiny problem that makes BeanBug.java 
regression test fail when the class library is compiled with kjc.

$ /tmp/topic/current/bin/kaffe BeanBug
java.lang.NoSuchMethodError: java/awt/AWTKeyStroke$1.<init>(IFZ)V
    at java.lang.Class.forName (Class.java)
    at java.lang.Class.forName (Class.java:44)
    at BeanBug.main (BeanBug.java:12)

The code in question is from java/awt/AWTKeyStroke.java

      87   private static final LinkedHashMap cache = new 
LinkedHashMap(11, 0.75f
      87 , true)
      88   {
      89     /** The largest the keystroke cache can grow. */
      90     private static final int MAX_CACHE_SIZE = 2048;
      92     /** Prune stale entries. */
      93     protected boolean removeEldestEntry(Map.Entry eldest)
      94     {   // XXX - FIXME Use Map.Entry, not just Entry  as gcj 
3.1 workaro
      94 und.
      95       return size() > MAX_CACHE_SIZE;
      96     }
      97   };

I seems that current kjc in kaffe does not generate the AWTKeyStroke$1 
class in question. It seems that kjc does generate the other two inner 
classes, though, it names them AWTKeyStroke$1 and AWTKeyStroke$2. So 
apparently the anonymous inner class which extends LinkedHashMap goes 
missing somehow.

Jikes 1.21 generates all three inner classes.

dalibor topic

More information about the kaffe mailing list