You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2021/09/18 17:58:52 UTC

[GitHub] [commons-lang] akalexus opened a new pull request #806: Add methods to enhance joins: joinNotEmptyWith, joinNotBlankWith

akalexus opened a new pull request #806:
URL: https://github.com/apache/commons-lang/pull/806


   Add method to enhance joins with filtering and deduplicating delimiters:
   - joinNotEmptyWith
   - joinNotBlankWith


-- 
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: issues-unsubscribe@commons.apache.org

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



[GitHub] [commons-lang] akalexus commented on a change in pull request #806: Add methods to enhance joins: joinNotEmptyWith, joinNotBlankWith

Posted by GitBox <gi...@apache.org>.
akalexus commented on a change in pull request #806:
URL: https://github.com/apache/commons-lang/pull/806#discussion_r711778263



##########
File path: src/test/java/org/apache/commons/lang3/StringUtilsTest.java
##########
@@ -1384,6 +1384,40 @@ public void testJoinWith() {
         assertEquals("ab", StringUtils.joinWith(null, "a", "b"));
     }
 
+    @Test
+    public void testJoinNotEmptyWith() {
+        assertEquals("", StringUtils.joinNotEmptyWith(","));        // empty array
+        assertEquals("", StringUtils.joinNotEmptyWith(",", (Object[]) NULL_ARRAY_LIST));
+        assertEquals("", StringUtils.joinNotEmptyWith(",", NULL_TO_STRING_LIST));
+
+        assertEquals("a,b", StringUtils.joinNotEmptyWith(",", "a", "b"));
+        assertEquals("a,b, ", StringUtils.joinNotEmptyWith(",", "a", "b", " "));
+        assertEquals("a,b", StringUtils.joinNotEmptyWith(",", "", "a", null, "b"));
+        assertEquals("ab", StringUtils.joinNotEmptyWith(null, "a", "b"));
+        assertEquals("a b", StringUtils.joinNotEmptyWith(null, "a", " ", "b"));
+    }
+
+    @Test
+    public void testJoinNotBlankWith() {
+        assertEquals("", StringUtils.joinNotBlankWith(","));        // empty array
+        assertEquals("", StringUtils.joinNotBlankWith(",", (Object[]) NULL_ARRAY_LIST));
+        assertEquals("", StringUtils.joinNotBlankWith(",", NULL_TO_STRING_LIST));
+
+        /*

Review comment:
       Done.




-- 
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: issues-unsubscribe@commons.apache.org

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



[GitHub] [commons-lang] akalexus commented on a change in pull request #806: Add methods to enhance joins: joinNotEmptyWith, joinNotBlankWith

Posted by GitBox <gi...@apache.org>.
akalexus commented on a change in pull request #806:
URL: https://github.com/apache/commons-lang/pull/806#discussion_r711771885



##########
File path: src/test/java/org/apache/commons/lang3/StringUtilsTest.java
##########
@@ -1384,6 +1384,40 @@ public void testJoinWith() {
         assertEquals("ab", StringUtils.joinWith(null, "a", "b"));
     }
 
+    @Test
+    public void testJoinNotEmptyWith() {
+        assertEquals("", StringUtils.joinNotEmptyWith(","));        // empty array
+        assertEquals("", StringUtils.joinNotEmptyWith(",", (Object[]) NULL_ARRAY_LIST));
+        assertEquals("", StringUtils.joinNotEmptyWith(",", NULL_TO_STRING_LIST));
+
+        assertEquals("a,b", StringUtils.joinNotEmptyWith(",", "a", "b"));
+        assertEquals("a,b, ", StringUtils.joinNotEmptyWith(",", "a", "b", " "));
+        assertEquals("a,b", StringUtils.joinNotEmptyWith(",", "", "a", null, "b"));
+        assertEquals("ab", StringUtils.joinNotEmptyWith(null, "a", "b"));
+        assertEquals("a b", StringUtils.joinNotEmptyWith(null, "a", " ", "b"));
+    }
+
+    @Test
+    public void testJoinNotBlankWith() {
+        assertEquals("", StringUtils.joinNotBlankWith(","));        // empty array
+        assertEquals("", StringUtils.joinNotBlankWith(",", (Object[]) NULL_ARRAY_LIST));
+        assertEquals("", StringUtils.joinNotBlankWith(",", NULL_TO_STRING_LIST));
+
+        /*

Review comment:
       Remove this comment, pls




-- 
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: issues-unsubscribe@commons.apache.org

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