EgorBaranovEnjoysTyping commented on code in PR #13262:
URL: https://github.com/apache/ignite/pull/13262#discussion_r3481732050


##########
modules/commons/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringBuilder.java:
##########
@@ -1030,148 +773,33 @@ private static void handleOverflow(SBLimitedLength buf, 
int size) {
      */
     private static <T> String toStringImpl(
         Class<T> cls,
-        SBLimitedLength buf,
         T obj,
         Object[] addNames,
         Object[] addVals,
         @Nullable boolean[] addSens,
         int addLen) {
         assert cls != null;
-        assert buf != null;
         assert obj != null;
         assert addNames != null;
         assert addVals != null;
         assert addNames.length == addVals.length;
         assert addLen <= addNames.length;
-
-        boolean newStr = buf.length() == 0;
-
-        IdentityHashMap<Object, EntryReference> svdObjs = savedObjects.get();
-
-        if (newStr)
-            svdObjs.put(obj, new EntryReference(buf.length()));
-
+        boolean isNew = GridToStringNode.init();
         try {
-            int len = buf.length();
-
-            String s = toStringImpl0(cls, buf, obj, addNames, addVals, 
addSens, addLen);
-
-            if (newStr)
-                return s;
-
-            buf.setLength(len);
-
-            return s.substring(len);
+            List<GridToStringNode> addNodes =
+                    GridToStringNodeFactory.getNodes(addNames, addVals, 
addSens, addLen);
+            GridToStringNode node = GridToStringNode.getRootNode(obj, cls, 
addNodes);
+            return isNew ? node.toString() : GridToStringNode.markNode(node);

Review Comment:
   Ok, Agree, now it returns toString result but still holds marker for whole 
decision.



-- 
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]

Reply via email to