Prettier-Java 2.9.1
Input:
import org.jspecify.annotations.Nullable;
class Example {
int @Nullable [] array;
}
Output:
import org.jspecify.annotations.Nullable;
class Example {
int@Nullable [] array;
}
Expected behavior:
The output is valid Java, but int@Nullable looks like a single token and is hard to read. Would be nice to keep the space:
Note: annotating the array type rather than the element type (i.e. int @Nullable [] vs @Nullable int []) is the style jspecify needs (https://jspecify.dev/docs/user-guide/#type-use-annotation-syntax) for nullable arrays.
Prettier-Java 2.9.1
Input:
Output:
Expected behavior:
The output is valid Java, but int@Nullable looks like a single token and is hard to read. Would be nice to keep the space:
Note: annotating the array type rather than the element type (i.e.
int @Nullable []vs@Nullable int []) is the style jspecify needs (https://jspecify.dev/docs/user-guide/#type-use-annotation-syntax) for nullable arrays.