afedulov commented on code in PR #19228:
URL: https://github.com/apache/flink/pull/19228#discussion_r853514163


##########
flink-runtime/src/main/java/org/apache/flink/runtime/messages/ThreadInfoSample.java:
##########
@@ -54,6 +61,27 @@ private ThreadInfoSample(Thread.State threadState, 
StackTraceElement[] stackTrac
         }
     }
 
+    /**
+     * Constructs a collection of {@link ThreadInfoSample}s from a {@link 
ThreadInfo} array.
+     *
+     * @param threadInfos {@link ThreadInfo} array where the data will be 
copied from.
+     * @return a Collection of the corresponding {@link ThreadInfoSample}s
+     */
+    public static Collection<ThreadInfoSample> from(ThreadInfo[] threadInfos) {
+        Collection<ThreadInfoSample> result = new ArrayList<>();
+        for (ThreadInfo threadInfo : threadInfos) {
+            if (threadInfo == null) {
+                LOG.warn("Missing thread info.");

Review Comment:
   I decided to handle still handle it here, but provide additional context to 
the method.



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