JetBrains / JetBrains/java-annotations

@Language should be applicable as a type-annotation.

Aperta
#43 2 commenti 7 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Kotlin
Stelle
463
Fork
72
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

# Description

`@Target` `ElementType.TYPE_USE` may be added to `@Language` annotation to allow its usage in applicablecontexts.

# Example

Currently the following example won't compile although it is logical:
```java
private final @NotNull Map<@NotNull NamespacedKey, @Language("json") @NotNull String> addedAdvancements;
```

Another positive side is that while currently IntelliJ warns on incorrect order in the following case:
```java
public void addAdvancement(final @NotNull NamespacedKey key,
final @Language("json") @NotNull String advancementJson) { /* ... */ }
```
suggesting swapping of `final` and `@Language("json")`, this wouldn't be true if `TYPE_USE` was present on the annotation.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.