As noted previously (Dec 29th, 2000), it was proposed that we change the
return of an object array ( ["a","b","c"]) from Object[] to something
else, that something else was proposed to be an ArrayList.

I made the change this morning, because Kasper Nielsen seemed to want to
use an ObjectArray in a more complicated manner than just in a
#foreach().

So, this is a warning : if you have objects that you are passing the
ObjectArray to, and are expecting an Object[] (like the Velocity testbed
was....), fix it.

Or if there is a big problem, we can back this out, but we should just
try and put this to bed for good. The IntegerRange returns an ArrayList
(  [1..5] ), so it's good to make them match.

To summarise :

Like the IntegerRange, the ObjectArray in VTL is instantiated as an
ArrayList :

#set($foo = ["a","b",c"]) -> $foo will point to an ArrayList

And for passing directly to an object in the context :

$provider.concat( [ "<", $foo , ">" ] )

concat() should be something like :
   
  public String concat( List o)

Note also that you get your own ArrayList when you #set() or just pass
one to a method, so there should be no fear of inter-thread problems. 
Muck with it to your hearts content.

geir


-- 
Geir Magnusson Jr.                               [EMAIL PROTECTED]
Velocity : it's not just a good idea. It should be the law.
http://jakarta.apache.org/velocity

Reply via email to