fix(java): go to an interface method implemented by a superclass (#7781)

Go to Implementation on an interface method found nothing when the implementing class inherits the method from a superclass that does not implement the interface itself. The superclass's method is now listed, once however many classes inherit it.

Closes #7760
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-12-03 18:03:56 +08:00
1 джерело 82fdd97588
коміт e86e28ae63
3 files changed
+45 -1

No files matched your search

+25
Переглянути файл
@@ -86,6 +86,29 @@ public class Words implements SubRepo {
return "words";
}
}
''',
'Handler.java': '''package zoo;
public interface Handler {
void handle();
}
''',
'BaseHandler.java': '''package zoo;
public class BaseHandler {
public void handle() {
}
}
''',
'HandlerImpl.java': '''package zoo;
public class HandlerImpl extends BaseHandler implements Handler {
}
''',
'OtherHandler.java': '''package zoo;
public class OtherHandler extends BaseHandler implements Handler {
}
''',
'Task.java': '''package zoo;
@@ -246,6 +269,8 @@ try:
('Repo.java', 'save(T'): (['Anon.java:5', 'Anon.java:9', 'Longs.java:0', 'Numbers.java:3', 'Words.java:3'], True),
('Use.java', 'save("x")'): (['Anon.java:5', 'Anon.java:9', 'Longs.java:0', 'Numbers.java:3', 'Words.java:3'], True),
('Repo.java', 'name()'): (['Words.java:6'], True),
# Implemented by a superclass of the implementing classes, listed once.
('Handler.java', 'handle()'): (['BaseHandler.java:3'], True),
# A library type's implementations in the sources; the library has more.
('Use.java', 'Runnable task'): (['Task.java:2'], False),
('Use.java', 'run();'): (['Task.java:3'], False),