You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Yiannis Mavroukakis <yi...@jaguarfreight.com> on 2004/02/10 11:52:16 UTC

Odd ArrayList behaviour

I've noticed something peculiar while using #foreach to 
iterate over an ArrayList. Once the iteration
over the ArrayList object has finished, it seems that
the object is emptied! Has anyone else experienced this
or is it me doing something silly?

Thank you,

Yiannis


Note:__________________________________________________________________
This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please immediately delete it and
all copies of it from your system, destroy any hard copies of it and
notify the sender. You must not, directly or indirectly, use, disclose,
distribute, print, or copy any part of this message if you are not the
intended recipient. Jaguar Freight Services and any of its subsidiaries
each reserve the right to monitor all e-mail communications through its
networks.
Any views expressed in this message are those of the individual sender,
except where the message states otherwise and the sender is authorized
to state them to be the views of any such entity.
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs.

Re: Odd ArrayList behaviour

Posted by Geir Magnusson Jr <ge...@4quarters.com>.
On Feb 10, 2004, at 5:52 AM, Yiannis Mavroukakis wrote:

>
> I've noticed something peculiar while using #foreach to
> iterate over an ArrayList. Once the iteration
> over the ArrayList object has finished, it seems that
> the object is emptied! Has anyone else experienced this
> or is it me doing something silly?

I suspect silliness.

How are you working with the ArrayList?

The only way I can imagine this happening is if you put an iterator for  
the ArrayList into the context, and tried to just use that.  It would  
then appear, on next usage in the same template, that it was empty, as  
you can't reset an Iterator.

geir

>
> Thank you,
>
> Yiannis
>
>
> Note:__________________________________________________________________
> This message is for the named person's use only. It may contain
> confidential, proprietary or legally privileged information. No
> confidentiality or privilege is waived or lost by any mistransmission.
> If you receive this message in error, please immediately delete it and
> all copies of it from your system, destroy any hard copies of it and
> notify the sender. You must not, directly or indirectly, use, disclose,
> distribute, print, or copy any part of this message if you are not the
> intended recipient. Jaguar Freight Services and any of its subsidiaries
> each reserve the right to monitor all e-mail communications through its
> networks.
> Any views expressed in this message are those of the individual sender,
> except where the message states otherwise and the sender is authorized
> to state them to be the views of any such entity.
> _______________________________________________________________________ 
> _
> This e-mail has been scanned for all viruses by Star Internet. The
> service is powered by MessageLabs.
>
-- 
Geir Magnusson Jr                                   203-247-1713(m)
geir@4quarters.com


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org