JetBrains / JetBrains/java-annotations

Module-level `@NotNullByDefault`

Offen
#113 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Kotlin
Sterne
463
Forks
72
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

In July the `@NotNullByDefault` annotation was added. This annotation can be used with target TYPE and PACKAGE, but sometimes you would want to have your fields, parameters and return types in (almost) every package in your module be default not null.

Therefore I propose to add the [MODULE](https://docs.oracle.com/en/java/javase/21/docs//api/java.base/java/lang/annotation/ElementType.html#MODULE) element type to the target annotation
So: `@Target(value={TYPE,PACKAGE,MODULE})` instead of `@Target(value={TYPE,PACKAGE})`

This would also require changes in any annotation processor, IDE or language server that acts on the `@NotNullByDefault`. I don't know to what extent that is part of this repo.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.