redhat-developer / redhat-developer/vscode-java

org.eclipse.jdt.core.compiler.problem.potentialNullReference preference not taken into account

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

还没有人认领这个 Issue。

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

描述

Describe the bug
The value of org.eclipse.jdt.core.compiler.problem.potentialNullReference preference seems to not being taken into account.

To Reproduce
Steps to reproduce the behavior:

  1. Create a settings.prefs file
  2. Add following value to the just created prefs file:
org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
  1. In VSCode, under customizations/vscode/setting, set java.settings.url value pointing to the settings.prefs file just created.
  2. In the PROBLEMS view, any Potential null pointer access: The variable myVar may be null at this location error should disappear, but does not.

Expected behavior
The configuration is obeyed and the specified warnings disappear.

Environment

  • Operating System: DevContainer with mcr.microsoft.com/devcontainers/base Docker image on Debian WSL under Windows 11
  • JDK version: openjdk version "1.8.0_482" as Project Java version and openjdk version "25.0.2" 2026-01-20 LTS as the JVM to be used by the Java Language Server
  • Visual Studio Code version: 1.114.0
  • Java extension version: 1.53.0

Additional Information
Other configuration preferences seems to be working as expected. For example setting org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.problem.deprecation=ignore removes any deprecation warning.

贡献指南

打开贡献指南

从这里开始

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

调研方向

在 VS Code 中使用包含 potentialNullReference 偏好的 settings.prefs 文件重现该问题,然后将其处理方式与据报告可正常工作的 deprecation 偏好进行比较。跟踪 Java 扩展或语言服务器对这些偏好的配置路径;当将 potentialNullReference 设置为 ignore 后,报告的潜在 null 警告被移除时,即表示完成。

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

评估

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

把新 issue 发到你的邮箱

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