james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r682221 - /james/server/trunk/core-library/src/main/java/org/apache/james/core/MailImpl.java
Date Sun, 03 Aug 2008 21:37:51 GMT
Author: rdonkin
Date: Sun Aug  3 14:37:51 2008
New Revision: 682221

URL: http://svn.apache.org/viewvc?rev=682221&view=rev
Log:
Revert mistakenly committed code.

Modified:
    james/server/trunk/core-library/src/main/java/org/apache/james/core/MailImpl.java

Modified: james/server/trunk/core-library/src/main/java/org/apache/james/core/MailImpl.java
URL: http://svn.apache.org/viewvc/james/server/trunk/core-library/src/main/java/org/apache/james/core/MailImpl.java?rev=682221&r1=682220&r2=682221&view=diff
==============================================================================
--- james/server/trunk/core-library/src/main/java/org/apache/james/core/MailImpl.java (original)
+++ james/server/trunk/core-library/src/main/java/org/apache/james/core/MailImpl.java Sun
Aug  3 14:37:51 2008
@@ -28,7 +28,6 @@
 import org.apache.mailet.RFC2822Headers;
 
 import javax.mail.MessagingException;
-import javax.mail.SendFailedException;
 import javax.mail.internet.InternetAddress;
 import javax.mail.internet.MimeMessage;
 import javax.mail.internet.ParseException;
@@ -159,19 +158,16 @@
         setRemoteAddr(mail.getRemoteAddr());
         setLastUpdated(mail.getLastUpdated());
         try {
-            HashMap attribs = new HashMap();
-            for (Iterator i = mail.getAttributeNames(); i.hasNext(); ) {
-                String hashKey = (String) i.next();
-                final Serializable attribute = mail.getAttribute(hashKey);
-                if (attribute instanceof SendFailedException) {
-                    SendFailedException ex = (SendFailedException) attribute;
-                    Throwable t = ex.getNextException();
-                    debug(t); 
+            if (mail instanceof MailImpl) {
+                setAttributesRaw((HashMap) cloneSerializableObject(((MailImpl) mail).getAttributesRaw()));
+            } else {
+                HashMap attribs = new HashMap();
+                for (Iterator i = mail.getAttributeNames(); i.hasNext(); ) {
+                    String hashKey = (String) i.next();
+                    attribs.put(hashKey,cloneSerializableObject(mail.getAttribute(hashKey)));
                 }
-                final Object cloneSerializableObject = cloneSerializableObject(attribute);
-                attribs.put(hashKey,cloneSerializableObject);
+                setAttributesRaw(attribs);
             }
-            setAttributesRaw(attribs);
         } catch (IOException e) {
             // should never happen for in memory streams
             setAttributesRaw(new HashMap());
@@ -180,28 +176,6 @@
             setAttributesRaw(new HashMap());
         }
     }
-    private void debug(Throwable t) {
-        if (t == null) {
-            System.err.println("[END]");
-        } else {
-            System.err.println("NEXT@" + System.identityHashCode(t)  + t );
-            if (t instanceof MessagingException) {
-                MessagingException e = (MessagingException) t;
-                System.err.println("NEXT@" + System.identityHashCode(e)  + e );
-                t = e.getNextException();
-                if (t == null) {
-                    t = e.getCause();
-                }
-                debug(t);
-            } else {
-                System.err.println("NEXT@" + System.identityHashCode(t)  + t );
-                Throwable next = t.getCause();
-                if (next != t) {
-                    debug(next);
-                }
-            }
-        }
-    }
 
     /**
      * A constructor that creates a MailImpl with the specified name,
@@ -634,7 +608,7 @@
      * @throws IOException
      * @throws ClassNotFoundException
      */
-    public static Object cloneSerializableObject(Object o) throws IOException, ClassNotFoundException
{
+    private static Object cloneSerializableObject(Object o) throws IOException, ClassNotFoundException
{
         ByteArrayOutputStream b = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream(b);
         out.writeObject(o);



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


Mime
View raw message