MAILET-122 RecipientIsRegex should match our standards

Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/0430a90a
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/0430a90a
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/0430a90a

Branch: refs/heads/master
Commit: 0430a90acb84f9f0f31f482ead5e4d89ca9fb7cb
Parents: 3136f5b
Author: Benoit Tellier <[email protected]>
Authored: Wed Aug 31 15:25:18 2016 +0700
Committer: Benoit Tellier <[email protected]>
Committed: Mon Oct 10 11:36:00 2016 +0200

----------------------------------------------------------------------
 .../org/apache/james/transport/matchers/RecipientIsRegex.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/0430a90a/mailet/standard/src/main/java/org/apache/james/transport/matchers/RecipientIsRegex.java
----------------------------------------------------------------------
diff --git 
a/mailet/standard/src/main/java/org/apache/james/transport/matchers/RecipientIsRegex.java
 
b/mailet/standard/src/main/java/org/apache/james/transport/matchers/RecipientIsRegex.java
index ed06611..2ee1b16 100755
--- 
a/mailet/standard/src/main/java/org/apache/james/transport/matchers/RecipientIsRegex.java
+++ 
b/mailet/standard/src/main/java/org/apache/james/transport/matchers/RecipientIsRegex.java
@@ -17,8 +17,6 @@
  * under the License.                                           *
  ****************************************************************/
 
-
-
 package org.apache.james.transport.matchers;
 
 import java.util.regex.Pattern;
@@ -29,6 +27,8 @@ import org.apache.mailet.MailAddress;
 
 import javax.mail.MessagingException;
 
+import com.google.common.base.Strings;
+
 /**
  * <P>Matches recipients whose address matches a regular expression.</P>
  * <P>Is equivalent to the {@link SenderIsRegex} matcher but matching on the 
recipient.</P>
@@ -50,7 +50,7 @@ public class RecipientIsRegex extends GenericRecipientMatcher 
{
 
     public void init() throws javax.mail.MessagingException {
         String patternString = getCondition();
-        if ((patternString == null) || (patternString.equals("")) ) {
+        if (Strings.isNullOrEmpty(patternString)) {
             throw new MessagingException("Pattern is missing");
         }
         


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to