Community
Participate
Working Groups
We are dealing with a library that has the following classes pack1 public abstract Class1<T> implements Iterator<T> abstract Iterator getPendingChildren(T n); // package-protected public class Class2<T> extends Class1<T> @Override Iterator<? extends T> getPendingChildren(Object n) {...} This code compiles fine (no errors and no warnings) on Eclipse (3.5 M5 on my machine) and during the PDE build (3.2.1) so it seems that Class2.getPendingChildren(Object) is indeed considered an override of Class1.getPendingChildren(T). Then, inside a method on, say, pack2.Foo, there is a code like this Iterator<Bar> i = new Class2<Bar>() { //overide a method that is not getPendingChildren } Again no problems, so everything looks good. The problem happens when I run this code as a stand-alone application (I tried it with Sun and IBM JVMs, 5 and 6 versions). I get this exception Exception in thread "Thread-0" java.lang.Error: Unresolved compilation problem: This class must implement the inherited abstract method Class2<Bar>.getPendingChildren(Bar), but cannot override it since it is not visible from new Class1(){}. Either make the type abstract or make the inherited method visible. I think I understand the exception. What is puzzling me is why Eclipse is compiling the classes above (pack1.Class2 specially) without any problems.
Created attachment 125406 [details] Small project reproducing the scenario
I've spent a few hours trying to reproduce the problem with a small example (attached here) using 3.5 M5. I couldn't. On our actual scenario, even though we are using either 3.4 or 3.5 as development environment, the code is deployed on Eclipse 3.2.1 so that's what we have as the PDE target environment and also on our build machine. So I've imported the small example on 3.2.1 and got the compilation error there. I think now the question is whether this an Eclipse 3.2 or a 3.5 issue. To be clear, if it is a 3.2 issue, I will NOT push for a fix (I am not even sure if that stream is still open).
Marcelo, I wasn't able to reproduce on either 3.5M5 or 3.4.2. I suspect this bug was fixed a while ago.
I agree... I tried this on the very same version and didn't get the problem. Thank you for the time you spend on this.
Verified by reporter