You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by GitBox <gi...@apache.org> on 2022/03/16 09:28:25 UTC

[GitHub] [james-project] Arsnael commented on a change in pull request #909: JAMES-3722 Tests and fixes for IMAP QRESYNC

Arsnael commented on a change in pull request #909:
URL: https://github.com/apache/james-project/pull/909#discussion_r827783530



##########
File path: protocols/imap/src/main/java/org/apache/james/imap/decode/parser/FetchCommandParser.java
##########
@@ -81,39 +81,40 @@ private FetchData fetchRequest(ImapRequestLineReader request, boolean useUid) th
             }
             request.consumeChar(')');
             
-            
             next = nextNonSpaceChar(request);
             if (next == '(') {
                 request.consumeChar('(');
-
-                next = request.nextChar();
-                switch (next) {
-                case 'C':
-                    // Now check for the CHANGEDSINCE option which is part of CONDSTORE
-                    request.consumeWord(StringMatcherCharacterValidator.ignoreCase(CHANGEDSINCE));
-                    fetch.changedSince(request.number(true));
-                    break;
-                case 'V':
-                    // Check for the VANISHED option which is part of QRESYNC
-                    request.consumeWord(StringMatcherCharacterValidator.ignoreCase(VANISHED));
-                    fetch.vanished(true);
-                    break;
-                default:
-                    break;
-                }
-               
-                
+                parseModifier(request, fetch);
+                nextNonSpaceChar(request);
+                parseModifier(request, fetch);
+                nextNonSpaceChar(request);

Review comment:
       I get there is only maybe 2 options but that seems very arbitrary code to me.
   
   How about sth like:
   ```
   while (parseModifier(request, fetch)) {
     nextNonSpaceChar(request);
   }
   ``` 
   with `parseModifier` return a boolean, true as long as it finds an option and false if nothing? If no options, you would not parse twice either?
   
   I'm not sure though, let me know what you think




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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