You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org> on 2014/08/27 21:07:58 UTC

[jira] [Closed] (TAP5-2186) Null Boolean values passed from component to the variable are changed to "false"

     [ https://issues.apache.org/jira/browse/TAP5-2186?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship closed TAP5-2186.
--------------------------------------

    Resolution: Won't Fix

There's a lot of ambiguity that gets introduced by object coercion. The coercion of nulls to false is extremely useful throughout the framework and in applications.  

Unfortunately, it is not good for you.  A workaround would be to define the parameter or other coercion target type as Object, not Boolean, then case to Boolean. This will allow a null to pass though unchanged.

> Null Boolean values passed from component to the variable are changed to "false"
> --------------------------------------------------------------------------------
>
>                 Key: TAP5-2186
>                 URL: https://issues.apache.org/jira/browse/TAP5-2186
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>            Reporter: Radek Terber
>
> We have component that contains Boolean (= object) variable annotated as @Parameter - it is designed to be passed on this component from outside and should return the Boolean value to the caller.
> When we set null value for this variable, the caller gets "false". I was not able to pass null value to the caller any way.
> I did not verify it, but I guess this situation is the same for another Primitive/Object pairs (int/Integer, long/Long ... etc). 
> Such conversion is neccessary when parameter is primitive, but in case Object values it is harmfull since null is proper value and has meaning. 
> So it would be usefull to avoid this conversion in case Object parameters, especially if in case another onjects it acts as expected (nulls are passed as nulls). 



--
This message was sent by Atlassian JIRA
(v6.2#6252)