>cat a.java class A { int x (){ return 0; } } class B extends A { int y(){ B.super.x(); return 0; } } >javac a.java #no error >gcj a.java a.java:8: error: '(' expected. B.super.x(); ^ 1 error I know it is not good to use another compiler to check for validity of code. Nevertheless, I looked this up and it is valid code according to Sun. I can't find the reference now. The super in this example is redundant, but it wouldn't be if B had an x() method. The errors are the same in either case. This is needed to compile freenet/crypt/ThrottledAsyncEntropyYarrow.java Please check
Created attachment 7224 [details] Test case (with int x() in both A and B)
Confirmed.
A workaround is to change B.super.x() to just super.x().
The workaround does not work when in an inner class. This was the original problem. >cat a.java class A { int x() { return 0; } } class B extends A { int x(){ return 1; } class C { int y(){ return B.super.x(); } } } >javac a.java #no error >gcj a.java a.java:13: error: 'class' or 'this' expected. return B.super.x(); ^ 1 error
(In reply to comment #4) This might be a completely unrelated bug; at least the error message is different.
Then a workaround is: class A { int x() { return 0; } } class B extends A { int x() { return 1; } // Extra workaround method int ax() { return super.x(); } class C { int y() { return ax(); } } } But this is getting silly indeed. It is a real bug that mist be fixed.
All gcj front end bugs have been fixed by the gcj-eclipse branch merge. I'm mass-closing the affected PRs. If you believe one of these was closed in error, please reopen it with a note explaining why. Thanks.