[jsr-314-open] Coercion in the EL

Dan Allen dan.j.allen at gmail.com
Wed Oct 14 16:45:03 EDT 2009


On Wed, Oct 14, 2009 at 4:35 PM, Martin Marinschek
<mmarinschek at apache.org>wrote:

> Hi Dan,
>
> fact is that the spec says this:
>
> Coerce A to Boolean
>
>    * If A is null or "", return false
>    * Otherwise, if A is a Boolean, return A
>    * Otherwise, if A is a String, and Boolean.valueOf(A) does not
> throw an exception, return it
>
> so it DOES touch the nulls. I don't know either who came up with this.
>

Right, I agree with you. I'm saying that this is silly behavior. Either it
should leave null alone or choose to convert it only *if* the expected-type
is a primitive (in this case a primitive boolean).

-Dan

-- 
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597

http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://www.google.com/profiles/dan.j.allen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jsr-314-open-mirror/attachments/20091014/5555169c/attachment.html 


More information about the jsr-314-open-mirror mailing list