commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitri Blinov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JEXL-162) empty() function throws an exception : unsupported type
Date Sat, 11 Jul 2015 13:49:04 GMT

    [ https://issues.apache.org/jira/browse/JEXL-162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14623401#comment-14623401
] 

Dmitri Blinov commented on JEXL-162:
------------------------------------

You are right that JEXL documentation does not clearly state that empty() operator will ever
return *false*, but from experience with EL, in which spec clearly defines "otherwise return
false", and from behaviour of JEXL 2.1, I was kind of expecting this behaviour. I understand
your point about 'emptiness' which must have special meaning for objects like maps and collections
etc, but in EL and JEXL we are get used to little nifty things like type coercions, so for
me personally it's not obvious why in that case we must be so strict.

And you are right, I'm getting this exception in lenient mode, which I hope will be fixed.

And thanks for suggesting how to implement empty() for XML nodes, I'll definitly play with
it.

> empty() function throws an exception : unsupported type
> -------------------------------------------------------
>
>                 Key: JEXL-162
>                 URL: https://issues.apache.org/jira/browse/JEXL-162
>             Project: Commons JEXL
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Dmitri Blinov
>
> empty() : unsupported type : class com.sun.org.apache.xerces.internal.dom.ElementImpl.
> Exepected behaviour - just return false if neither:
>     Object is null
>     Object is an empty string
>     Object is an array of length zero
>     Object is a collection of size zero
>     Object is an empty map
> .....



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message