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

Hide snythetic lambda stack frames on debugger stacks

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

Start from the stack trace: org.netbeans.modules.debugger.jpda.ui.values.ComputeInlineValues.computeVariables (line 41) feeds a frame's line number into javac's Position.getPosition, which throws when the frame is a synthetic lambda with no line number. Read ComputeInlineValues.java and InlineValueComputerImpl.java to see where frames are collected and where a no-line-number guard belongs; check whether the maintainer's comment thread already decides between hiding such frames vs. guarding the lookup. Done means clicking a lambda frame no longer logs ArrayIndexOutOfBoundsException and synthetic frames are either skipped or handled safely, verified with the sample snippet in the issue.

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

描述

debugger Java
    private static <V> V foo(Callable<V> call) throws Exception {
        return call.call();
    }

    static void main() throws Exception {
        foo(() -> {
            return null; // set breakpoint
        });
    }

trying to get to the marked stack frame causes an exception, should we hide frames without line numbers?

Image
SEVERE [org.openide.util.Exceptions]
java.lang.ArrayIndexOutOfBoundsException: Index -2 out of bounds for length 22
	at com.sun.tools.javac.util.Position$LineTabMapImpl.getPosition(Position.java:278)
	at com.sun.tools.javac.util.Position$LineMapImpl.getPosition(Position.java:193)
	at com.sun.tools.javac.util.Position$LineTabMapImpl.getPosition(Position.java:253)
	at org.netbeans.modules.debugger.jpda.ui.values.ComputeInlineValues.computeVariables(ComputeInlineValues.java:41)
	at org.netbeans.modules.debugger.jpda.ui.models.InlineValueComputerImpl$ComputeInlineVariablesFactory$1.run(InlineValueComputerImpl.java:355)
	at org.netbeans.modules.debugger.jpda.ui.models.InlineValueComputerImpl$ComputeInlineVariablesFactory$1.run(InlineValueComputerImpl.java:332)
[catch] at org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper.run(JavaSourceAccessor.java:273)
	at org.netbeans.modules.parsing.impl.TaskProcessor.callParserResultTask(TaskProcessor.java:561)
	at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.run(TaskProcessor.java:786)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:288)
	at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.execute(TaskProcessor.java:702)
	at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:663)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:545)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:330)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1370)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1981)

cc @lahodaj

主要语言
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 摘要。