void (final Rectangle value) { myBuffer.setLength(0); myBuffer.append('[').append(value.x).append(", "); myBuffer.append(value.y).append(", "); myBuffer.append(value.width).append(", "); myBuffer.append(value.height).append("]"); @NlsSafe String text = myBuffer.substring(0, myBuffer.length()); // [jeka] important! do not use toString() on the StringBuffer that is reused setText(text); }