Consider the example below,
public class Testing extends SupCls implements Intf { public static void main(String[] args) { new Testing().test(); } } class SupCls { public void test() { System.out.println("From SupCls"); } } interface Intf { public default void test() { System.out.println("From Intf"); } }
As you can see, there is no connection between SupCls and Intf . But both of them define a common method.
And the Testing class is distributed by SupCls and implements Intf .
So, when I call the test() method on Testing , there is output,
From SupCls
Which I think makes sense, because an extension from a class should have a higher priority than an implementation from an interface.
But eclipse reports differently, as shown in the screenshot below.

I strongly believe that this is a bug in Eclipse .
But before assuming this behavior is defined and documented in JLS ? Or is there something else that defines this behavior?
Edit: Eclipse Mars Release version (4.5.0) , if that matters.
java eclipse java-8 default-method
Codebender
source share