jeantil commented on code in PR #2696: URL: https://github.com/apache/james-project/pull/2696#discussion_r2023550113
########## server/mailet/mailetcontainer-impl/src/main/java/org/apache/james/mailetcontainer/lib/AbstractStateCompositeProcessor.java: ########## @@ -151,13 +150,17 @@ private void checkProcessors() throws ConfigurationException { } } - private Stream<ProcessingState> requiredProcessorStates(Mailet mailet) { - return Stream.concat(mailet.requiredProcessingState().stream(), - Stream.of( - mailet.onMailetException(), - mailet.onMatchException()) - .flatMap(Optional::stream) - .map(ProcessingState::new)); + private Stream<ProcessingState> requiredProcessorStates(MatcherMailetPair matcherMailetPair) { + var mailet = matcherMailetPair.getMailet(); + + return Stream.concat( + mailet.requiredProcessingState().stream(), + Stream.of( + matcherMailetPair.onMailetException(), + matcherMailetPair.onMatchException() + ).flatMap(Optional::stream) + .map(ProcessingState::new) + ); Review Comment: don't be sorry, byt I'm not sure I understand your comment/suggestion. I find that clearly separating scopes in stream pipelines is much easier to read. I put the closing parens on line 160 and 163 on the next line on purpose to clearly align the scope nmarkers Your propose change is much more compact but the visual scoping is lost. -- 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: notifications-unsubscr...@james.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org For additional commands, e-mail: notifications-h...@james.apache.org