You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by no...@apache.org on 2003/06/02 08:19:41 UTC

cvs commit: jakarta-james/src/java/org/apache/james/transport LinearProcessor.java

noel        2003/06/01 23:19:41

  Modified:    src/java/org/apache/james/transport LinearProcessor.java
  Log:
  Improved performance when recipient matching is all or nothing.
  
  Revision  Changes    Path
  1.19      +11 -7     jakarta-james/src/java/org/apache/james/transport/LinearProcessor.java
  
  Index: LinearProcessor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/LinearProcessor.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- LinearProcessor.java	8 Mar 2003 21:14:08 -0000	1.18
  +++ LinearProcessor.java	2 Jun 2003 06:19:41 -0000	1.19
  @@ -65,7 +65,6 @@
   import java.util.Iterator;
   import java.util.List;
   import java.util.Random;
  -import java.util.Vector;
   
   import javax.mail.MessagingException;
   
  @@ -371,18 +370,23 @@
                   recipients = matcher.match(mail);
                   if (recipients == null) {
                       //In case the matcher returned null, create an empty Vector
  -                    recipients = new Vector();
  +                    recipients = new ArrayList(0);
  +                } else if (recipients != mail.getRecipients()) {
  +                    //Make sure all the objects are MailAddress objects
  +                    verifyMailAddresses(recipients);
                   }
  -                //Make sure all the objects are MailAddress objects
  -                verifyMailAddresses(recipients);
               } catch (MessagingException me) {
                   handleException(me, mail, matcher.getMatcherConfig().getMatcherName());
               }
               // Split the recipients into two pools.  notRecipients will contain the
               // recipients on the message that the matcher did not return.
  -            Collection notRecipients = new Vector();
  -            notRecipients.addAll(mail.getRecipients());
  -            notRecipients.removeAll(recipients);
  +            Collection notRecipients;
  +            if (recipients == mail.getRecipients() || recipients.size() == 0) {
  +                notRecipients = new ArrayList(0);
  +            } else {
  +                notRecipients = new ArrayList(mail.getRecipients());
  +                notRecipients.removeAll(recipients);
  +            }
   
               if (recipients.size() == 0) {
                   //Everything was not a match... store it in the next spot in the array
  
  
  

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