servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lh...@apache.org
Subject svn commit: r720034 - in /servicemix/components/bindings/servicemix-mail/trunk/src/main/java/org/apache/servicemix/mail: marshaler/DefaultMailMarshaler.java utils/MailConnectionConfiguration.java
Date Sun, 23 Nov 2008 19:12:12 GMT
Author: lhein
Date: Sun Nov 23 11:12:12 2008
New Revision: 720034

URL: http://svn.apache.org/viewvc?rev=720034&view=rev
Log:
fixed SM-1700
fixed some additional stuff

Modified:
    servicemix/components/bindings/servicemix-mail/trunk/src/main/java/org/apache/servicemix/mail/marshaler/DefaultMailMarshaler.java
    servicemix/components/bindings/servicemix-mail/trunk/src/main/java/org/apache/servicemix/mail/utils/MailConnectionConfiguration.java

Modified: servicemix/components/bindings/servicemix-mail/trunk/src/main/java/org/apache/servicemix/mail/marshaler/DefaultMailMarshaler.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-mail/trunk/src/main/java/org/apache/servicemix/mail/marshaler/DefaultMailMarshaler.java?rev=720034&r1=720033&r2=720034&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-mail/trunk/src/main/java/org/apache/servicemix/mail/marshaler/DefaultMailMarshaler.java
(original)
+++ servicemix/components/bindings/servicemix-mail/trunk/src/main/java/org/apache/servicemix/mail/marshaler/DefaultMailMarshaler.java
Sun Nov 23 11:12:12 2008
@@ -23,6 +23,8 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.text.DateFormat;
+import java.text.ParseException;
+import java.util.Date;
 import java.util.Enumeration;
 import java.util.Iterator;
 
@@ -366,7 +368,12 @@
         if (nmsg.getProperty(AbstractMailMarshaler.MSG_TAG_SENTDATE) != null) {
             String sentDate = nmsg.getProperty(AbstractMailMarshaler.MSG_TAG_SENTDATE).toString();
             if (sentDate != null) {
-                mimeMessage.setSentDate(DateFormat.getInstance().parse(sentDate));
+            	try {
+            		mimeMessage.setSentDate(DateFormat.getInstance().parse(sentDate));
+            	} catch (ParseException ex) {
+            		// unparsable date
+            		mimeMessage.setSentDate(new Date());
+            	}
             }
         }
 

Modified: servicemix/components/bindings/servicemix-mail/trunk/src/main/java/org/apache/servicemix/mail/utils/MailConnectionConfiguration.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-mail/trunk/src/main/java/org/apache/servicemix/mail/utils/MailConnectionConfiguration.java?rev=720034&r1=720033&r2=720034&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-mail/trunk/src/main/java/org/apache/servicemix/mail/utils/MailConnectionConfiguration.java
(original)
+++ servicemix/components/bindings/servicemix-mail/trunk/src/main/java/org/apache/servicemix/mail/utils/MailConnectionConfiguration.java
Sun Nov 23 11:12:12 2008
@@ -37,7 +37,7 @@
      * @return the host
      */
     public String getHost() {
-        return this.host;
+        return this.host == null ? "" : this.host;
     }
 
     /**
@@ -51,7 +51,7 @@
      * @return the password
      */
     public String getPassword() {
-        return this.password;
+        return this.password == null ? "" : this.password;
     }
 
     /**
@@ -65,7 +65,7 @@
      * @return the protocol
      */
     public String getProtocol() {
-        return this.protocol.toLowerCase();
+        return this.protocol == null ? "" : this.protocol.toLowerCase();
     }
 
     /**
@@ -79,7 +79,7 @@
      * @return the username
      */
     public String getUsername() {
-        return this.username;
+        return this.username == null ? "" : this.username;
     }
 
     /**
@@ -93,7 +93,7 @@
      * @return the folderName
      */
     public String getFolderName() {
-        return this.folderName;
+        return this.folderName == null ? "" : this.folderName;
     }
 
     /**



Mime
View raw message