This commit is contained in:
Gary Gregory 2020-06-14 09:44:59 -04:00
commit 7852ed9d4d
1 changed files with 2 additions and 13 deletions

View File

@ -437,19 +437,8 @@ public abstract class ToStringStyle implements Serializable {
* @since 2.0
*/
protected void removeLastFieldSeparator(final StringBuffer buffer) {
final int len = buffer.length();
final int sepLen = fieldSeparator.length();
if (sepLen > 0 && len >= sepLen) {
boolean match = true;
for (int i = 0; i < sepLen; i++) {
if (buffer.charAt(len - 1 - i) != fieldSeparator.charAt(sepLen - 1 - i)) {
match = false;
break;
}
}
if (match) {
buffer.setLength(len - sepLen);
}
if (StringUtils.endsWith(buffer, fieldSeparator)) {
buffer.setLength(buffer.length() - fieldSeparator.length());
}
}