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 2019/11/01 20:33:48 UTC

[GitHub] [commons-lang] verhas commented on a change in pull request #416: Add support of lambda value evaluation for defaulting methods

verhas commented on a change in pull request #416: Add support of lambda value evaluation for defaulting methods
URL: https://github.com/apache/commons-lang/pull/416#discussion_r341740827
 
 

 ##########
 File path: src/test/java/org/apache/commons/lang3/StringUtilsTest.java
 ##########
 @@ -676,45 +677,45 @@ public void testDefaultIfBlank_StringString() {
         assertEquals("NULL", StringUtils.defaultIfBlank("", "NULL"));
         assertEquals("NULL", StringUtils.defaultIfBlank(" ", "NULL"));
         assertEquals("abc", StringUtils.defaultIfBlank("abc", "NULL"));
-        assertNull(StringUtils.defaultIfBlank("", (String) null));
+        assertNull(StringUtils.defaultIfBlank("", null));
         // Tests compatibility for the API return type
         final String s = StringUtils.defaultIfBlank("abc", "NULL");
         assertEquals("abc", s);
     }
 
 
     @Test
-    public void testDefaultIfBlank_StringStringSupplier() {
-        assertEquals("NULL", StringUtils.<String>defaultIfBlank(null, () -> "NULL"));
-        assertEquals("NULL", StringUtils.<String>defaultIfBlank("", () -> "NULL"));
-        assertEquals("NULL", StringUtils.<String>defaultIfBlank(" ", () -> "NULL"));
-        assertEquals("abc", StringUtils.<String>defaultIfBlank("abc", () -> "NULL"));
-        assertNull(StringUtils.<String>defaultIfBlank("", () -> null));
-        assertNull(StringUtils.defaultIfBlank("", (Supplier<String>) null));
+    public void testGetIfBlank_StringStringSupplier() {
+        assertEquals("NULL", StringUtils.getIfBlank(null, () -> "NULL"));
+        assertEquals("NULL", StringUtils.getIfBlank("",  () -> "NULL"));
 
 Review comment:
   There is an extra space on the line.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services