Index: LinearProcessor.java
===================================================================
RCS file: /home/cvspublic/jakarta-james/src/java/org/apache/james/transport/LinearProcessor.java,v
retrieving revision 1.6
diff -u -r1.6 LinearProcessor.java
--- LinearProcessor.java	1 Mar 2002 15:58:40 -0000	1.6
+++ LinearProcessor.java	30 Jul 2002 18:08:35 -0000
@@ -40,16 +40,13 @@
  *
  * Note that the 'onerror' attribute is not yet supported.
  */
-public class LinearProcessor 
+public class LinearProcessor
     extends AbstractLogEnabled
     implements Initializable, Disposable {
 
     private List mailets;
     private List matchers;
-    private List[] unprocessed;
-    private Collection tempUnprocessed;
     private Random random;
-    private Logger logger;
     private SpoolRepository spool;
 
     public void setSpool(SpoolRepository spool) {
@@ -60,8 +57,6 @@
     public void initialize() {
         this.matchers = new Vector();
         this.mailets = new Vector();
-        tempUnprocessed = new Vector();
-        tempUnprocessed.add(new Vector(2, 2));
         random = new Random();
     }
 
@@ -78,12 +73,10 @@
     public void add(Matcher matcher, Mailet mailet) {
         matchers.add(matcher);
         mailets.add(mailet);
-        //Make the collections array one larger
-        tempUnprocessed.add(new Vector(2, 2));
     }
 
 
-    public synchronized void service(MailImpl mail) throws MessagingException {
+    public void service(MailImpl mail) throws MessagingException {
         getLogger().debug("Servicing mail: " + mail.getName());
         //unprocessed is an array of Lists of Mail objects
         //  the array indicates which matcher/mailet (stage in the linear
@@ -94,15 +87,11 @@
         //It is a List of Mail objects at each array spot as multiple Mail
         //  objects could be at the same stage.
 
-        //make sure we have the array built
-        if (unprocessed == null) {
-            //Need to construct that object
-            unprocessed = (List[])tempUnprocessed.toArray(new List[0]);
-            tempUnprocessed = null;
-        }
-        //Wipe all the data (just to be sure)
+	List[] unprocessed = new List[matchers.size() + 1];
+
+        //Set up all the Lists
         for (int i = 0; i < unprocessed.length; i++) {
-            unprocessed[i].clear();
+	    unprocessed[i] = new Vector(2, 2);
         }
 
         //Add the object to the bottom of the list
@@ -200,7 +189,9 @@
 
                 //Note we need to store this with a new mail name, otherwise it
                 //  will get deleted upon leaving this processor
-                mail.setName(newName(mail));
+                //mail.setName(newName(mail));
+                //We do not need to rename the message now as the spool manager
+                //will delete from the spool only if the processing is done.
                 spool.store(mail);
                 mail = null;
                 continue;
