Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Go to Implementation on interface method does not work for inherited implementations

未关闭
#9,455 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
java
领域
devtools

调研方向

在 Java Editor 中通过复现使用 B::a 和 B::b 的示例开始,然后检查 Go to Implementation 命令和 editor-gutter 中的实现指示器。当通过接口上下文找到继承的实现,并且两个方法都显示相应的徽章时,工作就完成了。

由索引模型根据 Issue 内容生成。

描述

Java kind:bug needs:triage
Apache NetBeans version

Apache NetBeans 30

What happened

Go to Implementation (Ctrl+Alt+B, or context menu > Navigate > Go to Implementation) does not work on interface methods whose implementations are inherited from classes that themselves aren't declared to implement the interface (but subclasses are). The "Ⓘ" badges in the editor gutter are correspondingly missing.

This makes it more difficult to locate method implementations from a call site that invokes the method from the interface type, and it makes it misleadingly look like there are no implementations of the method.

Language / Project Type / NetBeans Component

Java, Editor

How to reproduce
class Example
{
    interface A
    {
        CharSequence a();
    }
    
    interface B extends A
    {
        @Override
        String a();

        String b();

        String c();
    }
    
    static class AImpl implements A
    {
        @Override
        public String a() { return "a"; }

        public String b() { return "b"; }
    }
    
    static class BImpl extends AImpl implements B
    {
        public String c() { return "c"; }
    }
}

On B::a anb B::b, Go to Implementation (Ctrl+Alt+B, or context menu > Navigate > Go to Implementation) does not work, although these methods are implemented by AImpl (in the context of BImpl).

In addition, no "Ⓘ" badge is shown on B::b, although interface B is fully implemented by BImpl.

Did this work correctly in an earlier version?

No / Don't know

Operating System

Windows

JDK

JDK 21

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

No response

Are you willing to submit a pull request?

No

主要语言
Java
星标
3.1k
派生
939
平均合并
5 天 3 小时
30 天内合并 PR
22

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/netbeans 的其他 Issue

查看 apache/netbeans 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。