Cyclic definition of overriding

Alex Buckley alex.buckley at
Tue Jun 9 19:34:28 UTC 2015

I don't know where you're seeing jls- -- there is only 
jls-{A,B,C} in the HTML and the master files.

That said, jls- says "An instance method mC declared in or 
inherited by class C, 'overrides from C' another method mI declared in 
an interface I, iff all of the following are true:" -- so you have to 
know that foo() is already inherited by class Test (say from Test1) in 
order to check if overrides As you say, we're 
still trying to figure if foo() is inherited from Test1. This all seems 
disturbingly tricky for such a simple scenario. Dan, any comments?


On 6/9/2015 8:00 AM, Konstantin wrote:
> Hello,
> I consider this simple case:
> interface Test1  {
>      int foo(); // m1
> }
> interface Test2{
>      int foo(); // m2
> }
> class Test implements Test1, Test2{
> }
> I try to understand if m1 is inherited by Test. I follow jls-8.4.8-200.
> All subassertions are true except jls-8.4.8-200-E. To decide if it is
> true or not we need to turn to overriding definition jls-
> More detailed, I want to be sure that m2 isn't m'. That's why I need to
> know if m2 overrides m1.
> And new subassertion jls- says about inheriting.
> " C does not inherit mI."
> So we get a circle. In order to understand if m1 is inherited we need to
> know if it is inherited.
> Please correct me if i misunderstand anything.
> Thanks,
> Konstantin

More information about the compiler-dev mailing list