You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose that a skeletal implementation A defines a method m() and implements two interfaces I and J, each of which declare the same method m(). As such, A.m() is an implementation of both I.m() and J.m(). Further suppose that I.m() is a default method. In this case, A.m() overrides I.m(). If we choose to migrate A.m() to J as a default method, then any subclass of A inheriting A.m() will break because it must now choose which implementation, either I.m() or J.m(), it will inherit.
The text was updated successfully, but these errors were encountered:
Mar 18, 2016 4:35:07 PM edu.cuny.citytech.refactoring.common.tests.RefactoringTest assertFailedPrecondition
INFO: Initial status: <ERROR
ERROR: Method 'p.A.m()' is in type 'p.A' that implements multiple interfaces.
Context: A.java [in p [in src [in TestProject1458333305614]]]
package p
interface I
void m()
interface J
void m()
class A
void m()
code: none
Data: null
ERROR: Declaring type 'p.A's hierarchy contains an invalid interface.
Context: A.java [in p [in src [in TestProject1458333305614]]]
package p
interface I
void m()
interface J
void m()
class A
void m()
code: none
Data: null
Actually, we need to run testMethodWithInheritedDefaultMethod() and make sure we are getting the correct error message (and not the ones from the description). We should see something mentioning "both implementing and overriding ...".
Suppose that a skeletal implementation A defines a method m() and implements two interfaces I and J, each of which declare the same method m(). As such, A.m() is an implementation of both I.m() and J.m(). Further suppose that I.m() is a default method. In this case, A.m() overrides I.m(). If we choose to migrate A.m() to J as a default method, then any subclass of A inheriting A.m() will break because it must now choose which implementation, either I.m() or J.m(), it will inherit.
The text was updated successfully, but these errors were encountered: