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/05/04 08:03:32 UTC

[GitHub] [james-project] quantranhong1999 commented on a diff in pull request #980: JAMES-1489 Fix decoding for complex UTF-8 searches

quantranhong1999 commented on code in PR #980:
URL: https://github.com/apache/james-project/pull/980#discussion_r864552221


##########
protocols/imap/src/main/java/org/apache/james/imap/decode/parser/SearchCommandParser.java:
##########
@@ -49,6 +50,18 @@
  * Parse SEARCH commands
  */
 public class SearchCommandParser extends AbstractUidCommandParser {
+    private static class Context {
+        private Optional<Charset> previousCharset = Optional.empty();
+
+        public void setCharset(Charset charset) {
+            previousCharset = Optional.of(charset);
+        }
+
+        public Charset getCharset() {
+            return previousCharset.orElse(null);
+        }
+    }

Review Comment:
   Q: Why do we use Optional when directly returning null?



-- 
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