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 2022/08/10 19:50:00 UTC

[GitHub] [commons-lang] garydgregory commented on a diff in pull request #933: Lang 1689 add optional to objectutils isempty

garydgregory commented on code in PR #933:
URL: https://github.com/apache/commons-lang/pull/933#discussion_r942847619


##########
src/main/java/org/apache/commons/lang3/ObjectUtils.java:
##########
@@ -1051,6 +1052,10 @@ public static boolean isEmpty(final Object object) {
         if (object instanceof Map<?, ?>) {
             return ((Map<?, ?>) object).isEmpty();
         }
+        if (object instanceof Optional<?>) {
+        	return !((Optional<?>) object).isPresent();
+        }
+        

Review Comment:
   What if it's an Optional with an empty string in it?



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