This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

interfaces and sub-class implementations


I found a few problems with source and native compilation where
interface methods not being implemented by the implementing class.

I'll report these later on (probably after the 3.1 release unless
people are desperate for bugs to fix /8-) but here's the jist:


  public interface Thingy
    public void someOperation (int x);
    public int anOperation (String x);

  public abstract class DooDah
    implements Thingy

    public void someOperation (int x)
    { }


  public class ThingumyJig extends DooDah
    public int anOperation (String x)
    {
      return "ha!";
    }


The above (or something analagous to the above) won't source compile.

One can make it compile by adding an abstract implementation of the
missing interface method, eg:

  public abstract class DooDah
    implements Thingy

    public void someOperation (int x)
    { }

    public abstract int anOperation (String x);

will fix the problem.


In certain circumstances native compilation won't happen either.



Just thought I'd let you know, as I say, I'll put a proper bug
together.


Nic


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]