On Mon, Aug 12, 2013 at 3:26 PM, Benedikt Ritter <brit...@apache.org> wrote:

> Hi,
>
> I've added a new test to CSVParser test case that shows what happens if
> CSVParser.iterator() is called twice [1].
>
> This looks pretty strange to me. One iterator can eat up records of the
> other.
> Would it be better to throw an exception if iterator() is called more than
> once?
>

Yeah, there is something odd about the current impl. Wouldn't it be obvious
what can be done if there is an iterator ivar and the accessor just returns
it? It does not even have to be lazy initialized.

Gary


>
> Benedikt
>
> [1] http://svn.apache.org/r1513228
>
>
> --
> http://people.apache.org/~britter/
> http://www.systemoutprintln.de/
> http://twitter.com/BenediktRitter
> http://github.com/britter
>



-- 
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Reply via email to