Author: tn
Date: Tue Dec 11 20:28:35 2012
New Revision: 1420388

URL: http://svn.apache.org/viewvc?rev=1420388&view=rev
Log:
Fix PMD warnings.

Modified:
    commons/proper/email/trunk/src/main/java/org/apache/commons/mail/Email.java
    
commons/proper/email/trunk/src/main/java/org/apache/commons/mail/util/MimeMessageUtils.java

Modified: 
commons/proper/email/trunk/src/main/java/org/apache/commons/mail/Email.java
URL: 
http://svn.apache.org/viewvc/commons/proper/email/trunk/src/main/java/org/apache/commons/mail/Email.java?rev=1420388&r1=1420387&r2=1420388&view=diff
==============================================================================
--- commons/proper/email/trunk/src/main/java/org/apache/commons/mail/Email.java 
(original)
+++ commons/proper/email/trunk/src/main/java/org/apache/commons/mail/Email.java 
Tue Dec 11 20:28:35 2012
@@ -540,12 +540,9 @@ public abstract class Email implements E
                 properties.setProperty(MAIL_SMTP_SOCKET_FACTORY_FALLBACK, 
"false");
             }
 
-            if (isSSLOnConnect() || isStartTLSEnabled())
+            if ((isSSLOnConnect() || isStartTLSEnabled()) && 
isSSLCheckServerIdentity())
             {
-                if (isSSLCheckServerIdentity())
-                {
-                    properties.setProperty(MAIL_SMTP_SSL_CHECKSERVERIDENTITY, 
"true");
-                }
+                properties.setProperty(MAIL_SMTP_SSL_CHECKSERVERIDENTITY, 
"true");
             }
 
             if (this.bounceAddress != null)

Modified: 
commons/proper/email/trunk/src/main/java/org/apache/commons/mail/util/MimeMessageUtils.java
URL: 
http://svn.apache.org/viewvc/commons/proper/email/trunk/src/main/java/org/apache/commons/mail/util/MimeMessageUtils.java?rev=1420388&r1=1420387&r2=1420388&view=diff
==============================================================================
--- 
commons/proper/email/trunk/src/main/java/org/apache/commons/mail/util/MimeMessageUtils.java
 (original)
+++ 
commons/proper/email/trunk/src/main/java/org/apache/commons/mail/util/MimeMessageUtils.java
 Tue Dec 11 20:28:35 2012
@@ -157,14 +157,11 @@ public final class MimeMessageUtils
 
         try
         {
-            if (!resultFile.getParentFile().exists())
+            if (!resultFile.getParentFile().exists() && 
!resultFile.getParentFile().mkdirs())
             {
-                if (!resultFile.getParentFile().mkdirs())
-                {
-                    throw new IOException(
-                            "Failed to create the following parent 
directories: "
-                                    + resultFile.getParentFile());
-                }
+                throw new IOException(
+                        "Failed to create the following parent directories: "
+                                + resultFile.getParentFile());
             }
 
             fos = new FileOutputStream(resultFile);


Reply via email to