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]

Compile errors with super.


Hi, I'm having trouble understanding a few compile errors. I guess I can best explain
it with an example:

public class One {
   public Object A() {
      return new Object();
   }
}
public class Two extends One {
     public void B () {
          Object obj = Two.super.A();
     }
     public static void main(String[] args)
     {}
}

gcj -c *.java

Two.java:5: error: 'class' or 'this' expected.
                Object obj = Two.super.A ()


javac *.java works fine.

If I make "A" return void:

---
One: public A() {}
Two: public void B {} { Two.super.A(); }
---
I get:

gcj -c *.java
Two.java:5: error: '(' expected.
                Two.super.A ();

The original code I am trying to compile from .java is from jface
(eclipse):

    protected Control createContents(final Composite parent) {
        final Control[] control = new Control[1];
        BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
            public void run() {
                control[0] = PreferenceDialog.super.createContents(parent);
                // Add the first page
                selectSavedItem();
            }
        });
        return control[0];
    }

This returns a:
org\eclipse\jface\preference\PreferenceDialog.java:294: error: 'class' or 'this' expected.
                                control[0] = PreferenceDialog.super.createContents(parent);

gcc version 3.4 20031123 (experimental)   (thisiscool win32 build)

Any pointers?



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