You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2019/11/13 03:06:58 UTC

[james-project] 09/21: [Refactoring] ListProcessor isRelative is not used in namespace branch

This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit e67d625aeff7237bf45c8674d50b18a7760efe6d
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Tue Nov 12 14:17:34 2019 +0700

    [Refactoring] ListProcessor isRelative is not used in namespace branch
---
 .../main/java/org/apache/james/imap/processor/ListProcessor.java   | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/ListProcessor.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/ListProcessor.java
index 717a96b..e8dfdd6 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/ListProcessor.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/ListProcessor.java
@@ -84,8 +84,6 @@ public class ListProcessor extends AbstractMailboxProcessor<ListRequest> {
         String user = ImapSessionUtils.getUserName(session);
         final MailboxSession mailboxSession = ImapSessionUtils.getMailboxSession(session);
         try {
-            // Should the namespace section be returned or not?
-            final boolean isRelative;
 
             if (mailboxName.length() == 0) {
                 // An empty mailboxName signifies a request for the hierarchy
@@ -94,7 +92,6 @@ public class ListProcessor extends AbstractMailboxProcessor<ListRequest> {
                 String referenceRoot;
                 if (referenceName.length() > 0 && referenceName.charAt(0) == MailboxConstants.NAMESPACE_PREFIX_CHAR) {
                     // A qualified reference name - get the root element
-                    isRelative = false;
                     int firstDelimiter = referenceName.indexOf(mailboxSession.getPathDelimiter());
                     if (firstDelimiter == -1) {
                         referenceRoot = referenceName;
@@ -106,7 +103,6 @@ public class ListProcessor extends AbstractMailboxProcessor<ListRequest> {
                     // A relative reference name, return "" to indicate it is
                     // non-rooted
                     referenceRoot = "";
-                    isRelative = true;
                 }
 
                 responder.respond(createResponse(
@@ -123,7 +119,8 @@ public class ListProcessor extends AbstractMailboxProcessor<ListRequest> {
                     finalReferencename = "";
                 }
                 // Is the interpreted (combined) pattern relative?
-                isRelative = ((finalReferencename + mailboxName).charAt(0) != MailboxConstants.NAMESPACE_PREFIX_CHAR);
+                // Should the namespace section be returned or not?
+                boolean isRelative = ((finalReferencename + mailboxName).charAt(0) != MailboxConstants.NAMESPACE_PREFIX_CHAR);
 
                 finalReferencename = ModifiedUtf7.decodeModifiedUTF7(finalReferencename);
 


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org