25 Dec 2006 17:06
Mauve vs 1.5
Hi,
Here is the Christmas riddle for you all.
Going through the mauve diffs between GNU Classpath 0.93 and current CVS
which switched to full 1.5 language support I noticed some compilation
errors. There are 2 main failures:
When compiling mauve without the 1.5 flag there is the following issue
with anything extending java.io.Writer. e.g.:
1. ERROR in gnu/testlet/java/io/CharArrayWriter/ProtectedVars.java line 30:
public class ProtectedVars extends CharArrayWriter implements Testlet
^^^^^^^^^^^^^
The return type is incompatible with Writer.append(CharSequence, int, int),
CharArrayWriter.append(CharSequence, int, int)
jcf-dump shows the issue. CharArrayWriter implements Writer which
extends Appendable, but makes the return type of some methods more
specific:
Method name:"append" public Signature: (char)java.io.Writer
Method name:"append" public bridge synthetic Signature: (char)java.lang.Appendable
Without -1.5 the bridge method for the covariant return type is ignored.
Meaning that the compiler thinks that the class isn't implementing
public Appendable append(char c) as defined by the super interface
Appendable.
Now this is of course easily fixed by using -1.5 so the compiler knows
(Continue reading)
RSS Feed