I'm going to investigate the Spring code as well and probably will open an additional PR for Spring Framework.
Ah, no need to bother. It was simply my oversight. The docs state it clearly:
Note: If the object is typed to String upfront, prefer hasLength(String) or hasText(String) instead.
See https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/util/StringUtils.html#isEmpty-java.lang.Object- And hasLenght is equivalent to your nonNullAndIsEmpty |