reta commented on code in PR #397:
URL: https://github.com/apache/cxf-xjc-utils/pull/397#discussion_r4253825083
##########
runtime/src/main/java/org/apache/cxf/xjc/runtime/JAXBToStringStyle.java:
##########
@@ -77,8 +82,96 @@ class JAXBToStringStyleImpl extends ToStringStyle {
protected void appendDetail(StringBuffer buffer, String fieldName, Object
value) {
if (value instanceof JAXBElement) {
buffer.append(ToStringBuilder.reflectionToString(value, this));
+ } else {
+ appendValue(buffer, value);
+ }
+ }
+
+ @Override
+ protected void appendDetail(StringBuffer buffer, String fieldName, char
value) {
+ appendEscaped(buffer, String.valueOf(value));
+ }
+
+ /*
+ * Older commons-lang3 releases append collections and maps via their own
+ * toString(), which bypasses both the escaping below and cycle detection.
+ * Route each element through appendInternal instead (as commons-lang3
+ * 3.21+ does), keeping the AbstractCollection/AbstractMap layout.
+ */
+ @Override
+ protected void appendDetail(StringBuffer buffer, String fieldName,
Collection<?> coll) {
+ buffer.append('[');
Review Comment:
Sorry @coheigea , not very familiar with this code, but the overrides for
`appendDetails` are quite different from what `ToStringStyle` produced by
default, it is intentional? Thank you
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]