redhat-developer / redhat-developer/vscode-java

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

Abierto
#3,501 8 comentarios 0 reacciones 1 asignado Ver en GitHub

@snjeza ya está trabajando en esto.

Desde el 20/2/2024.

upstream
Lenguaje dominante
TypeScript
Estrellas
2.3k
Forks
546
Merge medio
20 h 1 min
PR fusionados (30 d)
11

Descripción

[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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.