commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1606710 - in /commons/proper/email/trunk/src: main/java/org/apache/commons/mail/ main/java/org/apache/commons/mail/util/ test/java/org/apache/commons/mail/
Date Mon, 30 Jun 2014 12:29:14 GMT
Author: ggregory
Date: Mon Jun 30 12:29:13 2014
New Revision: 1606710

URL: http://svn.apache.org/r1606710
Log:
Remove extra parens (for example, this is not C we do not have to worry about mixing ints
and booleans).

Modified:
    commons/proper/email/trunk/src/main/java/org/apache/commons/mail/MultiPartEmail.java
    commons/proper/email/trunk/src/main/java/org/apache/commons/mail/util/MimeMessageParser.java
    commons/proper/email/trunk/src/test/java/org/apache/commons/mail/AbstractEmailTest.java
    commons/proper/email/trunk/src/test/java/org/apache/commons/mail/InvalidInternetAddressTest.java

Modified: commons/proper/email/trunk/src/main/java/org/apache/commons/mail/MultiPartEmail.java
URL: http://svn.apache.org/viewvc/commons/proper/email/trunk/src/main/java/org/apache/commons/mail/MultiPartEmail.java?rev=1606710&r1=1606709&r2=1606710&view=diff
==============================================================================
--- commons/proper/email/trunk/src/main/java/org/apache/commons/mail/MultiPartEmail.java (original)
+++ commons/proper/email/trunk/src/main/java/org/apache/commons/mail/MultiPartEmail.java Mon
Jun 30 12:29:13 2014
@@ -196,7 +196,7 @@ public class MultiPartEmail extends Emai
         {
             final BodyPart primary = getPrimaryBodyPart();
 
-            if ((primary instanceof MimePart) && EmailUtils.isNotEmpty(charset))
+            if (primary instanceof MimePart && EmailUtils.isNotEmpty(charset))
             {
                 ((MimePart) primary).setText(msg, charset);
             }
@@ -418,7 +418,7 @@ public class MultiPartEmail extends Emai
         // verify that the DataSource is valid
         try
         {
-            final InputStream is = (ds != null) ? ds.getInputStream() : null;
+            final InputStream is = ds != null ? ds.getInputStream() : null;
             if (is != null)
             {
                 // close the input stream to prevent file locking on windows

Modified: commons/proper/email/trunk/src/main/java/org/apache/commons/mail/util/MimeMessageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/email/trunk/src/main/java/org/apache/commons/mail/util/MimeMessageParser.java?rev=1606710&r1=1606709&r2=1606710&view=diff
==============================================================================
--- commons/proper/email/trunk/src/main/java/org/apache/commons/mail/util/MimeMessageParser.java
(original)
+++ commons/proper/email/trunk/src/main/java/org/apache/commons/mail/util/MimeMessageParser.java
Mon Jun 30 12:29:13 2014
@@ -126,7 +126,7 @@ public class MimeMessageParser
     public String getFrom() throws Exception
     {
         final javax.mail.Address[] addresses = this.mimeMessage.getFrom();
-        if ((addresses == null) || (addresses.length == 0))
+        if (addresses == null || addresses.length == 0)
         {
             return null;
         }
@@ -143,7 +143,7 @@ public class MimeMessageParser
     public String getReplyTo() throws Exception
     {
         final javax.mail.Address[] addresses = this.mimeMessage.getReplyTo();
-        if ((addresses == null) || (addresses.length == 0))
+        if (addresses == null || addresses.length == 0)
         {
             return null;
         }
@@ -173,15 +173,15 @@ public class MimeMessageParser
     protected void parse(final Multipart parent, final MimePart part)
         throws MessagingException, IOException
     {
-        if (isMimeType(part, "text/plain") && (plainContent == null)
-                && (!MimePart.ATTACHMENT.equalsIgnoreCase(part.getDisposition())))
+        if (isMimeType(part, "text/plain") && plainContent == null
+                && !MimePart.ATTACHMENT.equalsIgnoreCase(part.getDisposition()))
         {
             plainContent = (String) part.getContent();
         }
         else
         {
-            if (isMimeType(part, "text/html") && (htmlContent == null)
-                    && (!MimePart.ATTACHMENT.equalsIgnoreCase(part.getDisposition())))
+            if (isMimeType(part, "text/html") && htmlContent == null
+                    && !MimePart.ATTACHMENT.equalsIgnoreCase(part.getDisposition()))
             {
                 htmlContent = (String) part.getContent();
             }

Modified: commons/proper/email/trunk/src/test/java/org/apache/commons/mail/AbstractEmailTest.java
URL: http://svn.apache.org/viewvc/commons/proper/email/trunk/src/test/java/org/apache/commons/mail/AbstractEmailTest.java?rev=1606710&r1=1606709&r2=1606710&view=diff
==============================================================================
--- commons/proper/email/trunk/src/test/java/org/apache/commons/mail/AbstractEmailTest.java
(original)
+++ commons/proper/email/trunk/src/test/java/org/apache/commons/mail/AbstractEmailTest.java
Mon Jun 30 12:29:13 2014
@@ -206,7 +206,7 @@ public abstract class AbstractEmailTest
                 }
 
                 // test for timeout
-                if ((dtStartWait.getTime() + EmailConfiguration.TIME_OUT)
+                if (dtStartWait.getTime() + EmailConfiguration.TIME_OUT
                     <= new Date().getTime())
                 {
                     fail("Mail server failed to start");
@@ -469,7 +469,7 @@ public abstract class AbstractEmailTest
             throw ise;
         }
 
-        return (messageBody != null) ? (new String(messageBody).intern()) : "";
+        return messageBody != null ? new String(messageBody).intern() : "";
     }
 
     /**

Modified: commons/proper/email/trunk/src/test/java/org/apache/commons/mail/InvalidInternetAddressTest.java
URL: http://svn.apache.org/viewvc/commons/proper/email/trunk/src/test/java/org/apache/commons/mail/InvalidInternetAddressTest.java?rev=1606710&r1=1606709&r2=1606710&view=diff
==============================================================================
--- commons/proper/email/trunk/src/test/java/org/apache/commons/mail/InvalidInternetAddressTest.java
(original)
+++ commons/proper/email/trunk/src/test/java/org/apache/commons/mail/InvalidInternetAddressTest.java
Mon Jun 30 12:29:13 2014
@@ -154,8 +154,8 @@ public class InvalidInternetAddressTest 
             // N.B. validate() doesn't check addresses containing quotes or '['
             final boolean quoted = ARR_INVALID_EMAILS[i].contains("\"");
             final int atIndex    = ARR_INVALID_EMAILS[i].indexOf("@");
-            final boolean domainBracket  = (atIndex >= 0)
-                && (ARR_INVALID_EMAILS[i].indexOf("[", atIndex)  >= 0);
+            final boolean domainBracket  = atIndex >= 0
+                && ARR_INVALID_EMAILS[i].indexOf("[", atIndex)  >= 0;
             try
             {
                 validateMethod.invoke(address, (Object[]) null);
@@ -208,8 +208,8 @@ public class InvalidInternetAddressTest 
             // N.B. validate() doesn't check addresses containing quotes or '['
             final boolean quoted = ARR_INVALID_EMAILS[i].contains("\"");
             final int atIndex    = ARR_INVALID_EMAILS[i].indexOf("@");
-            final boolean domainBracket  = (atIndex >= 0)
-                && (ARR_INVALID_EMAILS[i].indexOf("[", atIndex)  >= 0);
+            final boolean domainBracket  = atIndex >= 0
+                && ARR_INVALID_EMAILS[i].indexOf("[", atIndex)  >= 0;
 
             try
             {



Mime
View raw message