palantir-java-format
palantir-java-format copied to clipboard
Join string concatenations if they end up on the same line
What happened?
throw new SafeIllegalArgumentException("Invalid recipient field - contains multiple "
+ "foreign key properties.", UnsafeArg.of("field", maybeField));
gets turned into
throw new SafeIllegalArgumentException(
"Invalid recipient field - contains multiple " + "foreign key properties.", UnsafeArg.of("field", maybeField));
but the +
is left behind.
What did you want to happen?
There should be a single string literal and no +
.
Implementation wise, my intuition is that we should rewrap string concatenations that end up being moved in normal formatting, which will achieve this.
Currently, StringWrapper.wrap
will bail out if there are no overly long lines.