redhat-developer / redhat-developer/vscode-java

Null type safety not working with jakarta.validation.constraints.NotNull

Aperta
#3,501 8 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@snjeza ci sta già lavorando.

Dal 20/2/2024.

upstream
Lingua principale
TypeScript
Stelle
2.3k
Fork
546
Merge medio
20h 1m
PR unite (30g)
11

Descrizione

[provide a description of the issue]

Environment
  • Operating System: Linux Ubuntu 22.04
  • JDK version: 17.0.8 (Oracle GraalVM 17.0.8+9.1 build 17.0.8+9-LTS-jvmci-23.0-b14)
  • Visual Studio Code version: 1.86.2
  • Java extension version: v1.28.1
Steps To Reproduce
  1. Create a method with org.springframework.lang.NonNull annotation
  2. Calls that method with arguments annotated with jakarta.validation.constraints.NotNull
  3. A yellow line shows up on the method call highlighting: Null type safety: The expression of type 'String' needs unchecked conversion to conform to '@NonNull String'Java(16778128)

[Please attach a sample project reproducing the error]
Here:
warnings-bug.zip

Please attach logs
Here:
warning-logs.log

Current Result

VS Code says it could be null, it may have null value.

Expected Result

No warnings at all, since it was annotated with NotNull;

Additional Informations

None

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.