juneau-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clr-apache <...@git.apache.org>
Subject [GitHub] incubator-juneau pull request #2: related to JUNEAU-49 and its inclusion via...
Date Tue, 30 May 2017 01:34:46 GMT
Github user clr-apache commented on a diff in the pull request:

    --- Diff: juneau-core/src/main/java/org/apache/juneau/internal/StringUtils.java ---
    @@ -618,7 +618,9 @@ public static boolean isEmpty(String s) {
     	 * @return <jk>true</jk> if specified string is <jk>null</jk>
or it's {@link #toString()} method returns an empty string.
     	public static boolean isEmpty(Object s) {
    -		return s == null || s.toString().isEmpty();
    +		if( s == null ) return true;
    +		if( s instanceof List ) return ((List) s).size() == 0;
    --- End diff --
    Of course, I missed the semantic that you want to return true if s is null. So you need
the null check in addition to the equals or isEmpty check.
    Too much javascript for me I guess. :(

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message