This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Compile errors with super.
- From: Rutger Ovidius <ovid at mailandnews dot com>
- To: java at gcc dot gnu dot org
- Date: Sun, 30 Nov 2003 09:57:28 -0800
- Subject: Compile errors with super.
- Reply-to: ovid at mailandnews dot com
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?