michael81877 commented on code in PR #6369:
URL: https://github.com/apache/nifi/pull/6369#discussion_r989230023


##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/MergeContent.java:
##########
@@ -827,6 +833,17 @@ public void process(final OutputStream rawOut) throws 
IOException {
             return bundle;
         }
 
+        private long getMaxEntrySize(List<FlowFile> contents) {
+            Optional<FlowFile> ffOpt = contents.stream()
+                .parallel()
+                .max(Comparator.comparingLong(ff -> ff.getSize()));
+            if (ffOpt.isPresent()) {
+                return ffOpt.get().getSize();
+            } else {
+                return 0L;
+            }

Review Comment:
   Ah that's a good shout. Changing that!
   
   Will `mapToLong()`, `max()`, and return `longVal.orElse(0)`



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