Tested to fail with prettier-plugin-java 2.7.5 and 2.7.0, and work with 2.6.8, using prettier 3.5.3.
Have this as a field or variable declaration.
String[] DATA = {
// nothing yet
};
It gets formatted like this, which does not compile.
String[] DATA = { // nothing yet };
2.6.8 does not change the code at all.
I'd be fine with keeping the comment on its own line, or with moving it to the end of the collapsed line like so:
String[] DATA = {}; // nothing yet