[ http://issues.apache.org/jira/browse/VELOCITY-379?page=comments#action_12413659 ]
Trejkaz commented on VELOCITY-379: ---------------------------------- I'd be curious to know how to work around this on the current Velocity. Our application needs to output a large amount of text, which we have to generate on the fly because it's too big to store in memory. As we can't seem to simply insert a Reader into the output, we're planning to do this via an Iterator<String>. Problem is, if I use an Iterator, I get a warning in the logs for every document I output. Using an Iterable<String> would be much better, so in the meantime is there a way to add support for that without having to modify Velocity itself? > foreach should generalise for Iterable, not just Collection > ----------------------------------------------------------- > > Key: VELOCITY-379 > URL: http://issues.apache.org/jira/browse/VELOCITY-379 > Project: Velocity > Type: Bug > Components: Source > Versions: 1.5 > Environment: Operating System: All > Platform: All > Reporter: David Blaikie > Fix For: 2.0 > > As of Java 1.5 the java.lang.Iterable interface is the general contract that > should be used when looking for things that provide Iterators. This allows for > user defined non collection types to be generally usable by things that just > need iteration such as the Java Language's for(X x : y) looping construct and > seems perfectly applicable to the velocity Foreach directive. > I'm not sure of the versioning policy (which java version) of Velocity so if > you > are deliberately not creating a 1.5 dependency then this is not a bug. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
