You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by "woj-tek (via GitHub)" <gi...@apache.org> on 2023/01/20 18:39:21 UTC

[GitHub] [james-project] woj-tek opened a new pull request, #1406: JAMES-3878 - Remove icu4j dependency

woj-tek opened a new pull request, #1406:
URL: https://github.com/apache/james-project/pull/1406

   Remove icu4j dependency and replace required functionality with other dependencies
   
   https://issues.apache.org/jira/projects/JAMES/issues/JAMES-3878


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


[GitHub] [james-project] chibenwa merged pull request #1406: JAMES-3878 - Remove icu4j dependency

Posted by "chibenwa (via GitHub)" <gi...@apache.org>.
chibenwa merged PR #1406:
URL: https://github.com/apache/james-project/pull/1406


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


[GitHub] [james-project] woj-tek commented on a diff in pull request #1406: JAMES-3878 - Remove icu4j dependency

Posted by "woj-tek (via GitHub)" <gi...@apache.org>.
woj-tek commented on code in PR #1406:
URL: https://github.com/apache/james-project/pull/1406#discussion_r1084321128


##########
mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxAnnotationKey.java:
##########
@@ -25,21 +25,18 @@
 
 import com.google.common.base.Objects;
 import com.google.common.base.Preconditions;
-import com.ibm.icu.text.UnicodeSet;
+import com.google.re2j.Pattern;
 
 public class MailboxAnnotationKey {
 
     public static final String SLASH_CHARACTER = "/";
     public static final String TWO_SLASH_CHARACTER = "//";
 
-    private static final UnicodeSet NAME_ANNOTATION_PATTERN = new UnicodeSet("[[a-z][A-Z][0-9]]")
-            .add(SLASH_CHARACTER)
-            .freeze();
+    private static final Pattern NAME_ANNOTATION_PATTERN = Pattern.compile("^([\\w\\d/]*)$");

Review Comment:
   Switched to CharMatcher



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


[GitHub] [james-project] chibenwa commented on a diff in pull request #1406: JAMES-3878 - Remove icu4j dependency

Posted by "chibenwa (via GitHub)" <gi...@apache.org>.
chibenwa commented on code in PR #1406:
URL: https://github.com/apache/james-project/pull/1406#discussion_r1083246218


##########
mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxAnnotationKey.java:
##########
@@ -25,21 +25,18 @@
 
 import com.google.common.base.Objects;
 import com.google.common.base.Preconditions;
-import com.ibm.icu.text.UnicodeSet;
+import com.google.re2j.Pattern;
 
 public class MailboxAnnotationKey {
 
     public static final String SLASH_CHARACTER = "/";
     public static final String TWO_SLASH_CHARACTER = "//";
 
-    private static final UnicodeSet NAME_ANNOTATION_PATTERN = new UnicodeSet("[[a-z][A-Z][0-9]]")
-            .add(SLASH_CHARACTER)
-            .freeze();
+    private static final Pattern NAME_ANNOTATION_PATTERN = Pattern.compile("^([\\w\\d/]*)$");

Review Comment:
   My preference goes to relying on Guava CharMatcher and avoid REGEX alltogether if that works.



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


[GitHub] [james-project] chibenwa commented on a diff in pull request #1406: JAMES-3878 - Remove icu4j dependency

Posted by "chibenwa (via GitHub)" <gi...@apache.org>.
chibenwa commented on code in PR #1406:
URL: https://github.com/apache/james-project/pull/1406#discussion_r1083248767


##########
mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxAnnotationKey.java:
##########
@@ -25,21 +25,18 @@
 
 import com.google.common.base.Objects;
 import com.google.common.base.Preconditions;
-import com.ibm.icu.text.UnicodeSet;
+import com.google.re2j.Pattern;
 
 public class MailboxAnnotationKey {
 
     public static final String SLASH_CHARACTER = "/";
     public static final String TWO_SLASH_CHARACTER = "//";
 
-    private static final UnicodeSet NAME_ANNOTATION_PATTERN = new UnicodeSet("[[a-z][A-Z][0-9]]")
-            .add(SLASH_CHARACTER)
-            .freeze();
+    private static final Pattern NAME_ANNOTATION_PATTERN = Pattern.compile("^([\\w\\d/]*)$");

Review Comment:
   For instance:
   
   ```
       private static final CharMatcher NAME_ANNOTATION_PATTERN = CharMatcher.inRange('a', 'z')
           .or(CharMatcher.inRange('A', 'Z'))
           .or(CharMatcher.inRange('0', '9'))
           .or(CharMatcher.is('/'));
   ```
   
   Passes the unit tests



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