JetBrains / JetBrains/java-annotations

@Language should be applicable as a type-annotation.

Abierto
#43 2 comentarios 7 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Kotlin
Estrellas
463
Forks
72
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

# 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.

Guía de contribución

Abrir la guía de contribución

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.