redhat-developer / redhat-developer/vscode-java

On Nonnull Annotation Setting

Open
#2,779 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

code analysis compile
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

I found annotation based nonnull analysis was added from version 1.11.0. The README says there are two configurations java.compile.nullAnalysis.nonnull and java.compile.nullAnalysis.nullable in .vscode/settings.json .

When I read https://github.com/redhat-developer/vscode-java/issues/1693 I also found we can set org.eclipse.jdt.core.compiler.annotation.nonnull and etc in the setting file specified by java.settings.url.

If I set both of them, which one will be used?

In addition, if I set org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault in the the file of java.settings.url, I got expected null check behaviour. Is there any equivalent direct setting in .vscode/settings.json ?

Environment
  • Operating System: Ubuntu 22.04
  • JDK version: OpenJDK 64-Bit Server VM (build 17.0.4+8-Ubuntu-122.04, mixed mode, sharing)
  • Visual Studio Code version: 1.73.0
  • Java extension version: 1.12.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the README's null-analysis settings and compare them with the properties supplied through the file named by java.settings.url. Determine which configuration takes precedence and whether org.eclipse.jdt.core.compiler.annotation.nonnullbydefault has a direct .vscode/settings.json equivalent; done means both answers are documented or the requested setting is supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
developer-experience
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.