You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Henning Schmiedehausen (JIRA)" <de...@velocity.apache.org> on 2007/03/08 01:08:25 UTC

[jira] Closed: (VELOCITY-254) in #foreach: if nulls are encountered last value is returned instead of null

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

Henning Schmiedehausen closed VELOCITY-254.
-------------------------------------------


> in #foreach: if nulls are encountered last value is returned instead of null
> ----------------------------------------------------------------------------
>
>                 Key: VELOCITY-254
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-254
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5
>         Environment: Operating System: All
> Platform: PC
>            Reporter: Indra Polak
>         Assigned To: Velocity-Dev List
>         Attachments: foreach.allow.null.patch, Foreach.java.diff
>
>
> I put an object having a method that returns an array of Integers in the context
> with contents
> [100,100,NULL,NULL,...]
> Then looping over the contents using
> #foreach ($elt in $Object.List) $!elt #end
> ALL entries become 100 with output: 
> 100 100 100 100 (...)
> instead of the expected
> 100 100 
> When converting all null objects to say new Integer(0) in the 
> getList() body before returning the list, output becomes
> 100 100 0 0 0 0 0 
> Apparently null values are not treated as first citizens,
> Cheers,
> Indra

-- 
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: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org