commons-issues mailing list archives

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


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

> empty() function throws an exception : unsupported type
> -------------------------------------------------------
>                 Key: JEXL-162
>                 URL:
>             Project: Commons JEXL
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Dmitri Blinov
> empty() : unsupported type : class
> 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

View raw message