MAILBOX-310 Mailbox query refactoring: Slightly improve isExpressionMatch
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/07ee106c Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/07ee106c Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/07ee106c Branch: refs/heads/master Commit: 07ee106c5aa46136ddde9b6d2119eb6ee25c78a7 Parents: 6607c69 Author: benwa <btell...@linagora.com> Authored: Wed Oct 4 09:48:29 2017 +0700 Committer: Matthieu Baechler <matth...@apache.org> Committed: Thu Oct 5 20:00:38 2017 +0200 ---------------------------------------------------------------------- .../org/apache/james/mailbox/model/MailboxQuery.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/07ee106c/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxQuery.java ---------------------------------------------------------------------- diff --git a/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxQuery.java b/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxQuery.java index 7332ec1..c6e2ebc 100644 --- a/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxQuery.java +++ b/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxQuery.java @@ -207,17 +207,12 @@ public final class MailboxQuery { * @return true if the given name matches this expression, false otherwise */ public boolean isExpressionMatch(String name) { - final boolean result; if (isWild()) { - if (name == null) { - result = false; - } else { - result = pattern.matcher(name).matches(); - } + return name != null + && pattern.matcher(name).matches(); } else { - result = expression.equals(name); + return expression.equals(name); } - return result; } public boolean isPathMatch(MailboxPath mailboxPath) { --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org