Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source methods that both override and implement methods should fail (for the right reason) #114

Open
khatchad opened this issue Mar 18, 2016 · 4 comments
Assignees
Milestone

Comments

@khatchad
Copy link
Member

khatchad commented Mar 18, 2016

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.

@khatchad khatchad self-assigned this Mar 18, 2016
@khatchad khatchad added this to the Preconditions milestone Mar 18, 2016
@khatchad khatchad added the bug label Mar 18, 2016
@khatchad
Copy link
Member Author

Current failures:

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

khatchad pushed a commit that referenced this issue Mar 18, 2016
@khatchad
Copy link
Member Author

khatchad commented Apr 5, 2016

Isn't this done?

@khatchad
Copy link
Member Author

Dupe of #111.

@khatchad
Copy link
Member Author

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 ...".

@khatchad khatchad reopened this Apr 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant