You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
packageabc;
importjava.util.Arrays;
importjava.util.Collections;
importjava.util.List;
publicclassFoo {
publicstaticfinalList<Object> XXXXXXXXXXXXXXXXXX = Collections.unmodifiableList(
Arrays.asList(// b // a// c// d
)
);
}
Output after second run:
packageabc;
importjava.util.Arrays;
importjava.util.Collections;
importjava.util.List;
publicclassFoo {
publicstaticfinalList<Object> XXXXXXXXXXXXXXXXXX = Collections.unmodifiableList(
Arrays.asList(// c // b // a// d
)
);
}
I won't go for the third run; I guess the pattern is clear.
Expected behavior:
It is probably not very common to put single-line comments inside a parameter list. Nevertheless, it is valid Java code, so Prettier should be able to format it. Multiple runs of Prettier should not produce different outputs, but Prettier should immediately produce a stable output.
The text was updated successfully, but these errors were encountered:
martijndwars
changed the title
Formatting not deterministic/idempotent
Formatting not stable
Dec 5, 2020
Prettier-Java 1.0.1 (through Prettier Maven Plugin 0.12)
Similar to #368, code needs to be formatted multiple times before it stabilizes.
Input:
Output after first run:
Output after second run:
I won't go for the third run; I guess the pattern is clear.
Expected behavior:
It is probably not very common to put single-line comments inside a parameter list. Nevertheless, it is valid Java code, so Prettier should be able to format it. Multiple runs of Prettier should not produce different outputs, but Prettier should immediately produce a stable output.
The text was updated successfully, but these errors were encountered: