Answer inline:

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Geir Magnusson Jr.
> 
> Paulo Gaspar wrote:
> > 
> > In Foreach.getIterator(), I don't "get" several things:
> >   - Why not accepting an object of type Iterator?
> 
> Where?  I don't understand.

Just accepting an Iterator as the object to iterate trough in the
#foreach.

> ........
> >   - Why caching the Introspection information based in the
> >     #foreach directive object as in
> >         IntrospectionCacheData icd = context.icacheGet( this );
> >     ???
> >     It makes more sense to cache what is the right iterator
> >     based on the listObject class, since the class of the
> >     listObject might change between uses of the same template,
> >     but the found iterator will always be the same for each
> >     listObject class.
> 
> You are missing something, I think.   That problem, the class changing,
> is recognized, so we cache what we find until the class of the object
> changes.  
> 
> There is even a test in the testbed to check this behavior,
> ContextSafetyTestCase.java.  I will doublecheck if you think it isn't
> working.

Yes, it works correctly but it would be more efficient to make the 
caching just using the listObject class as key.


> > I am putting my hands on this, but just want to check if I am
> > missing something.
> 
> What does "I am putting my hands on this..." mean?
 
Means that I will "give it a whack" as you also suggested.
=:o)

> Aside from the caching issue, which I think you missed, if there are
> real problems here, give it a whack.  Are there any use problems?  
> 
> geir

Not using yet. Just taking a look at the source.

I want to use this to make an export tool that will have to iterate 
over big JDBC ResultSet's and I was taking a look at how to do it.

That is a case where I would be better served with an Iterator as 
argument for the #foreach, since an Iterator over a ResultSet is so 
easy to implement. 
=:o)

Have fun,
Paulo

Reply via email to