Community
Participate
Working Groups
Let's have 2 classes: public class First implements Second.SecondInterf { interface FirstInterf { } } public class Second implements First.FirstInterf { interface SecondInterf { } } javac First.java reports error: cyclic inheritance involving Second While Eclipse compiler silently allows such cycle. Probably Eclipse compiler should have validation for such situation synchronous with the JDK (because otherwise code that compiles well in Eclipse fails to compile under standalone JDK). Related discussion on stackoverflow about why Java prohibits such cycle: http://stackoverflow.com/a/7998053/1429367 Spec: https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.1.4
Created attachment 263457 [details] File with no cycle detected by ecj
Reproduced on Linux with latest integration and nightly build (N20160730). I've attached source files to reproduce the case. Note that removing the imports make the compilation fail.
Well, the example in comment 0 is rejected by all versions of ecj. This is in line with javac's behavior and the accepted answer on SO. The attached project, OTOH, uses imports and simple type references, and hence I don't see X mentioned in its hierarchy. => This program does not violate JLS as quoted in the SO answer. However, the corresponding JLS section has since been changed from as a qualifier of a superclass or superinterface name to as a qualifier in the fully qualified form of a superclass or superinterface name This change was effective as of Java 7 and should be adopted by ecj.
Also javac 6 accepts the attached example, demonstrating that this was an intented change.
bulk move out of 4.8
Bulk move out of 4.9
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.