Closed mvetom closed 1 year ago
Hi, and thanks for the report. This eclipse-platform GitHub org is for general issues of Eclipse Platform (workspace, UI, text editor frameworks, SCM frameworks...); the Java Development Tools are in a separate org. So please report this issue to https://github.com/eclipse-jdt/eclipse.jdt.core/issues to reach the right audience.
Hmm, I believe Eclipse is right, javac is not here. Package protected methods can't be accessed from other packages. Just try with reduced example:
package package1;
import package2.MyAbstract;
public class MyGenericClass extends MyAbstract {
public MyGenericClass() {
}
}
package package2;
public abstract class MyAbstract {
abstract void someAbstractMethod();
}
Hmm, I believe Eclipse is right, javac is not here. Package protected methods can't be accessed from other packages.
Sorry, overlooked the fact that there was multiple bounds and it was working with a single one. Indeed, sounds like a bug. => https://github.com/eclipse-jdt/eclipse.jdt.core/issues/656
mickael and iloveeclipse,
Thanks for looking into this, and for pointing out and moving the bug report to the correct spot!
Here's an an example that will reproduce the issue.
Create a Simple Java project in Eclipse.
Create two packages: package1 and package 2
In package2 create the following abstract class and interface:
In package1, create this Java Class:
Save the project. Note that it compiles with no issues.
Now change the line with the class declaration of MyGenericClass like this:
public class MyGenericClass<T extends MyAbstract & MyInterface> {
You will get an error in the Eclipse IDE. Note that the error does not talk about MyInterface, which you just added. Instead it talks about MyAbstract, which it had no issue with a minute ago, when you had not added MyInterface as the lower bound. This is the error:
For comparison, you should be able to run compile this code on the command line with no issues.
Just wanted to let the Eclipse team know about this.
Thanks!