[Biojava-l] Compiling with Jikes

Thomas Down td2@sanger.ac.uk
Wed, 7 Mar 2001 11:54:25 +0000

On Sun, Mar 04, 2001 at 12:11:41AM -0800, Bradley A. Smith wrote:
> Has anyone successfully compiled BioJava 1.10 with the IBM Jikes compiler? I receive many errors. I believe some of the errors are allowed by the Sun compiler although they are valid errors. Is anyone interested in fixing the errors so that the BioJava can be compiled with Jikes?

We seem to be having general issues with code of the form:

public interface Foo {
    public void xMethod();

    public static class SimpleFooImpl implements Bar {
        public void xMethod() {}
        public void yMethod() {}

(in another compilation unit...)

public interface Bar extends Foo {
    public void yMethod();

We've run into this with the EmptyAlphabet problem you describe.
But I've just tried fixing this in the HEAD in CVS, and have run
into another case of the same problem (with jikes 1.10).  In recent
revisions, many of the FeatureFilter implementations (defined as
nested classes of FeatureFilter) actually implement the (separate)
OptimizableFeatureFilter interface.  Jikes is objecting for exactly
the same reason.

This latter problem is harder to fix, since we're expecting the
FeatureFilter implementations to stay as nested classes of
FeatureFilter.  This compilation issue puts some real limitations
on what you can do with nested classes.

So I've checked this in the JLS (2nd edition -- the latest version,
including nested classes).  Section 7.3:


states that:

  ``Types declared in different compilation units can depend on each 
    other, circularly. A Java compiler must arrange to compile all
    such types at the same time.''

I think this places javac, and BioJava, in the right.

Now, if there's demand I can still put out a 1.1-based version
which fixes this issue, but since there is code in the CVS HEAD
which is harder to fix, I don't think we can garuentee to stay
that way forever.  I guess maybe it's time to report this to IBM
and see what they say.


PS. Just looked through the jikes bug database at IBM.  This
    particular problem doesn't appear, but there are several other
    bugs concerning nested/inner classes, and dependancies, so it
    looks like we may have found the Achilles heel.

PPS. The anonymous-classes-hiding-local-variables bug is there,