Format source code
This commit is contained in:
parent
07ec8ad2dd
commit
28656559d2
|
@ -2568,28 +2568,25 @@ public abstract class ToStringStyle implements Serializable {
|
|||
protected void appendDetail(StringBuffer buffer, String fieldName, Object value) {
|
||||
|
||||
if (value == null) {
|
||||
|
||||
appendNullText(buffer, fieldName);
|
||||
return;
|
||||
}
|
||||
|
||||
if (value instanceof String || value instanceof Character) {
|
||||
|
||||
appendValueAsString(buffer, value.toString());
|
||||
return;
|
||||
}
|
||||
|
||||
if (value instanceof Number || value instanceof Boolean) {
|
||||
|
||||
buffer.append(value);
|
||||
return;
|
||||
}
|
||||
|
||||
final String valueAsString = value.toString();
|
||||
if (valueAsString.startsWith(getContentStart()) && valueAsString.endsWith(getContentEnd())
|
||||
|| valueAsString.startsWith(getArrayStart()) && valueAsString.startsWith(getArrayEnd())
|
||||
) {
|
||||
|
||||
if (valueAsString.startsWith(getContentStart())
|
||||
&& valueAsString.endsWith(getContentEnd())
|
||||
|| valueAsString.startsWith(getArrayStart())
|
||||
&& valueAsString.startsWith(getArrayEnd())) {
|
||||
buffer.append(value);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -94,7 +94,6 @@ public class JsonToStringStyleTest {
|
|||
|
||||
@Test
|
||||
public void testChar() {
|
||||
|
||||
try {
|
||||
new ToStringBuilder(base).append('A').toString();
|
||||
fail("Should have generated UnsupportedOperationException");
|
||||
|
@ -109,7 +108,6 @@ public class JsonToStringStyleTest {
|
|||
|
||||
@Test
|
||||
public void testDate() {
|
||||
|
||||
final Date now = new Date();
|
||||
final Date afterNow = new Date(System.currentTimeMillis() + 1);
|
||||
|
||||
|
|
Loading…
Reference in New Issue