commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Benson (JIRA)" <>
Subject [jira] Commented: (JXPATH-80) boolean conversion of javabean getter values returning NULL fails
Date Wed, 18 Apr 2007 21:57:15 GMT


Matt Benson commented on JXPATH-80:

Hmm, I had missed the isCollection() method.  The meat of your change--i.e. the part needed
to make the testcase pass--is at the end of getLength():

-        return ValueUtils.getLength(getBaseValue());
+        return isCollection() ? ValueUtils.getLength(getBaseValue()) : 1;

Because isCollection() already returns false when the base value is null, I would feel okay
about this change.  However, it breaks another testcase that tests whether the expression
[1] returns a value relative to null.  The proposed change makes null have a size of 1, when
the existing test expects no result due to null having a size of 0.  This still requires research
into XPATH dogma.

> boolean conversion of javabean getter values returning NULL fails
> -----------------------------------------------------------------
>                 Key: JXPATH-80
>                 URL:
>             Project: Commons JXPath
>          Issue Type: Bug
>    Affects Versions: 1.2 Final
>         Environment: SE Runtime Environment
> java.runtime.version=1.6.0-b105
> Platform API Specification
> java.specification.vendor=Sun Microsystems Inc.
> mode
> HotSpot(TM) Client VM
>            Reporter: Nico Max
>            Priority: Minor
>         Attachments: patch.patch, patch.patch,
> According to the JXPath User Guide a Javabean Getter returning NULL, regadless of the
type, will be converted bo Boolean FALSE. But trying to build a boolean expression from this
fails as the attached testcase shows.
> It seems that the type the bean getter returns matters, as a NULL String for example
works as expected.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message