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


##########
server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ChannelImapResponseWriter.java:
##########
@@ -68,6 +83,15 @@ public void setFlushCallback(FlushCallback flushCallback) {
 
     @Override
     public void write(byte[] buffer) {
+        if (LOGGER.isTraceEnabled()) {
+            if (ctx != null) {
+                ImapSession imapSession = 
ctx.channel().attr(IMAP_SESSION_ATTRIBUTE_KEY).get();
+                String username = retrieveUsername(imapSession);

Review Comment:
   I'm sorry I am definitly picky here but this means a map read every time we 
send an IMAP response.
   
   This is likely unecessary are the code that creates 
ChannelImapResponseWriter already have an ImapSession at hand.
   
   I would add the ImapSession as a field, then pass it as an argument and 
avoid resolve it here.
   
   (Sorry that's a critical section so I'm picky!)



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