redhat-developer / redhat-developer/vscode-java

Annotation processing causes spurious reporting in Problem pane

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

还没有人认领这个 Issue。

主要语言
TypeScript
星标
2.3k
派生
546
平均合并
20 小时 1 分钟
30 天内合并 PR
11

描述

Environment
  • Operating System: Ubuntu Focal 20.04.6
  • JDK version: 17.0.7
  • Visual Studio Code version: 1.82.2
  • Extensions:
    • vscjava.vscode-java-pack 0.25.14
    • vscjava.vscode-java-debug 0.54.0
    • redhat.java 1.22.1
    • vscjava.vscode-maven 0.42.0
    • vscjava.vscode-java-dependency 0.23.1
    • vscjava.vscode-java-test 0.39.1
Steps To Reproduce
  1. Unzip the attached project.zip file into an otherwise empty directory
  2. Start code bug.code-workspace
  3. Ensure that a text editor is not open for Foo.java
  4. Click that you trust the author of this workspace (to enable debugging)
  5. Observe that no problems are reported in the Problems pane
  6. Open the file src/test/java/com/example/QuxTest.java from the Explorer pane
  7. Right-click the triangular play icon next to public class QuxTest
  8. Choose Debug Test from the context menu
  9. Notice that a problem appear in the Problems pane for file Foo.java:
    "The method b() is undefined for the type Mumble"
  10. Click on the problem to open file src/main/java/com/example/Foo.java
  11. Notice that the problem disappears by itself as the editor for Foo.java opens
  12. Close the editor for Foo.java
  13. Exit VSCode
  14. Restart VSCode, as in point 1.
  15. Observe that the problem reappears in the Problem pane, this time without opening the debugger.
Current Result:

A problem is reported for the class used in an annotation.

Expected Result:

No problems should be reported.

Additional Informations:

I reckon that this problem is related to annotation processing inserting stubs for the depended-on classes, and then these stubs aren't resolved properly. It started to appear related to the debugger a couple of minor versions ago, but from 1.82.2 it also happens every time the project is loaded, after it has been triggered by the debugger initially.

@testforstephen In microsoft/vscode-java-debug issue #1247 you asked for a minimal example. This looks a lot like it is related, so maybe this could be used?

project.zip

贡献指南

打开贡献指南

从这里开始

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

调研方向

解压 project.zip 并按照编号的 VS Code 重现步骤操作,比较 Debug Test 前后以及重启前后的 Problems-pane 诊断结果。使用 Foo.java 和 QuxTest.java 作为最小案例;完成的标准是,annotation 使用的类在两种流程中都不再产生“method b() is undefined for the type Mumble”问题。

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

评估

技术栈
java, typescript, vscode
领域
developer-experience, tooling
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

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