commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Muldoon <...@firstbest.com>
Subject [jxpath 1.2] Why does InfoSetUtil.booleanValue method handle strings in the manner that it does???
Date Thu, 10 Apr 2008 13:59:25 GMT
Can anyone explain why the InfoSetUtil.booleanValue(Object object) method returns true when
the object is a String if and only if it is a non-zero length string? Here's a code excerpt
...

        else if (object instanceof String) {
            return ((String) object).length() != 0;
        }
Is this a bug? Shouldn't it return true if and only if the string is equal to "true" (ignoring
case, of course)?

Thanks in advance, Tom

PS. Is this message better suited for the dev list?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message