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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to