reta commented on code in PR #404:
URL: https://github.com/apache/cxf-xjc-utils/pull/404#discussion_r4313146413
##########
runtime/src/main/java/org/apache/cxf/xjc/runtime/JAXBToStringStyle.java:
##########
@@ -51,6 +52,21 @@ private JAXBToStringStyle() {
class JAXBToStringStyleImpl extends ToStringStyle {
private static final long serialVersionUID = -584903238590491314L;
+ /*
+ * The state of the toString() call in progress on this thread, removed
once it completes or
+ * fails. commons-lang3 only detects cycles (objects on the current path),
so an object
+ * referenced from several places, e.g. through xs:IDREF, would otherwise
be printed once per
+ * path, which grows exponentially with the depth of such references.
+ */
+ private static final ThreadLocal<CallState> STATE = new ThreadLocal<>();
Review Comment:
```suggestion
private static final ThreadLocal<CallState> STATE =
ThreadLocal.withInitial(CallState::new);
```
--
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]