google-java-format-eclipse-plugin-1.11.0.jar does not format the same as command line
Here is a test:
package some.test;
public class Test {
String myLongString =
"The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.";
}
Eclipse formats it just as above. google-java-format-1.11.0-all-deps.jar on the comamnd line formats it as follows:
package some.test;
public class Test {
String myLongString =
"The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog."
+ " The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy"
+ " dog.";
}
Possibly related to #566
The CLI has a separate pass that reflows long strings literals (corresponding to --skip-reflowing-long-strings):
https://github.com/google/google-java-format/blob/5104d0b27888f3bfab7113f5606374cda5632102/core/src/main/java/com/google/googlejavaformat/java/FormatFileCallable.java#L48
The plugin currently just runs the core formatter logic, not the string reflowing part.
Most likely related, the CLI formats short comments like
/**
* @return Optional qualifier with more details.
*/
public String getCustomQualifier() {
return qualifier;
}
while the Eclipse plugin formats it like
/** @return Optional qualifier with more details. */
public String getCustomQualifier() {
return qualifier;
}