cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Bowman" <Pete.Bow...@btopenworld.com>
Subject RE: JXTemplate forEach problem
Date Sat, 10 Jan 2004 10:59:00 GMT
Hi Antonio,

Thanks for your quick reply.

I spent some time investigating this by adding lots of logging to
JXTemplateGenerator.java. 

The problem appeared to be in the loop in execute() that dealt with forEach.
I could get it to work by changing the "for (; i <= end && iter.hasNext())"
to a straightforward "while (iter.hasNext())", though as far as I can see
the original loop should have worked ok. In fact, adding debug logging to
the class showed that "i <= end && iter.hasNext()" was true just before the
end of the loop, yet the loop still exited after one iteration, as though it
evaluated to false in the for statement.

for (; i <= end && iter.hasNext(); i++) {
...
  System.out.println("Condition is ", new Boolean(i <= end &&
iter.hasNext()).toString());
}

This would say "Condition is true", and then exit the loop!

There was no obvious reason why it would work at first and then stop working
permanently after 5-20 impressions. Perhaps it's a problem with Java on my
platform (Linux), though I tried several versions and I would expect
failures elsewhere too if that were the case.

I checked out the CVS version, and that seems to work ok. I notice that from
version 1.22, the way the loop is framed is different.

Thanks,
Pete.

> -----Original Message-----
> From: Antonio Gallardo [mailto:agallardo@agsoftware.dnsalias.com] 
> Sent: 10 January 2004 00:24
> To: users@cocoon.apache.org
> Subject: Re: JXTemplate forEach problem
> 
> 
> Hi Peter,
> 
> Can you upgrade to Cocoon CVS version. And check if there is 
> the problem too?
> 
> Another question. Can you provide the cca. number of 
> impresions before you start to have problems. It would help 
> people to reproduce the error.
> 
> Also are you looking on the logs? Are there any exceptions? 
> What about the catalina.out?
> 
> Best Regards,
> 
> Antonio Gallardo.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message