You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by GitBox <gi...@apache.org> on 2020/12/26 07:49:38 UTC

[GitHub] [james-project] chibenwa commented on a change in pull request #282: JAMES-3477 Drop MimeMessageCopyOnWriteProxy

chibenwa commented on a change in pull request #282:
URL: https://github.com/apache/james-project/pull/282#discussion_r548956195



##########
File path: server/container/core/src/main/java/org/apache/james/server/core/MimeMessageInputStream.java
##########
@@ -40,19 +40,13 @@
      *            the message to wrap
      * @param tryCast
      *            try to cast the {@link MimeMessage} to
-     *            {@link MimeMessageCopyOnWriteProxy} /
      *            {@link MimeMessageWrapper} to do some optimized processing if
      *            possible
      * @throws MessagingException
      */
     public MimeMessageInputStream(MimeMessage message, boolean tryCast) throws MessagingException {
         MimeMessage m = message;
 
-        // check if we need to use the wrapped message
-        if (tryCast && m instanceof MimeMessageCopyOnWriteProxy) {
-            m = ((MimeMessageCopyOnWriteProxy) m).getWrappedMessage();
-        }
-
         // check if we can use optimized operations
         if (tryCast && m instanceof MimeMessageWrapper) {

Review comment:
       That is a good question.
   
   In a shared context likely not however if this MimeMessage is assumed not to be thread safe, and that each thread gets its own copy, we should be good, no?
   
   Maybe we can remove the `synchronized` blocks in MimeMessageWrapper, and state in the Javadoc that it is not thread safe?




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org