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


##########
modules/commons/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringNodeFactory.java:
##########
@@ -0,0 +1,164 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.util.tostring;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.function.Supplier;
+
+import static 
org.apache.ignite.internal.util.tostring.GridToStringNode.identities;
+
+/**
+ * A factory class responsible for creating appropriate GridToStringNode 
instances
+ * based on the type and value of the object being processed.
+ */
+public class GridToStringNodeFactory {
+    /**
+     * Creates a list of nodes from arrays of property names and values.
+     * Handles sensitive data exclusion and node reuse from a thread-local 
cache.
+     * @param addNames Array of property names.
+     * @param addVals Array of property values.
+     * @param addSens Array of flags indicating if a property is sensitive.
+     * @param addLen The number of elements to process.
+     * @return A list of constructed GridToStringNode objects.
+     */
+    public static List<GridToStringNode> getNodes(Object[] addNames,
+                                                  Object[] addVals,
+                                                  boolean[] addSens,
+                                                  int addLen) {
+        List<GridToStringNode> result = new LinkedList<>();

Review Comment:
   I don't know what capacity this List would have, so I used LinkedList



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