chibenwa commented on code in PR #2554:
URL: https://github.com/apache/james-project/pull/2554#discussion_r1875647676


##########
protocols/imap/src/main/java/org/apache/james/imap/processor/IdProcessor.java:
##########
@@ -83,7 +84,10 @@ private Mono<Void> logMailUserAgent(String mailUserAgent) {
     private void addMailUserAgentToMDC(ImapSession session, String 
mailUserAgent) {
         Object maybeMDC = session.getAttribute(MDC_KEY);
         if (maybeMDC instanceof MDCBuilder boundMDC) {
-            MDCBuilder newMDC = boundMDC.addToContext("mailUserAgent", 
mailUserAgent);
+            if 
(boundMDC.snapshotContextMap().containsKey(MAIL_USER_AGENT_KEY)) {

Review Comment:
   Materialising the map here is uggly. 
   
   Can't we rather rely on the recording of the MUA done in the session?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to