Github user jacktan1991 commented on a diff in the pull request:
https://github.com/apache/commons-lang/pull/74#discussion_r29491785
--- Diff: src/main/java/org/apache/commons/lang3/builder/ToStringStyle.java
---
@@ -2568,13 +2573,13 @@ protected void appendDetail(StringBuffer buffer,
String fieldName, Object value)
return;
}
- if (value.getClass() == String.class) {
+ if (value instanceof Number || value.getClass() ==
Boolean.class) {
- appendValueAsString(buffer, (String)value);
+ buffer.append(value);
return;
}
- buffer.append(value);
+ appendValueAsString(buffer, value.toString());
--- End diff --
Yes. But if `Address` like you suppose here does not *Override*
`Object.toString()` (maybe someone just wants Address instance represented by
its hash code), then its json style looks like `"address":"Address@1ab2f62"`.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---