Or if it cannot easily be prevented, add Javadoc to warn against doing it.

On 13 August 2013 00:31, James Carman <ja...@carmanconsulting.com> wrote:
> Agreed.  +1
>
> On Monday, August 12, 2013, Matt Benson wrote:
>
>> As someone with no prior involvement with this component, and at risk of
>> being hit by the digital tomatoes of the group, this seems to indicate to
>> me that once a parser definition has been joined to a source of input, the
>> resulting object *is* the record iterator.  If there's no way to twist that
>> into a comfortable API, I would tend to agree with Benedikt:  calling
>> #iterator() a second time should do something like triggering an
>> IllegalStateException().
>>
>> $0.02,
>> Matt
>>
>>
>> On Mon, Aug 12, 2013 at 4:43 PM, Gary Gregory 
>> <garydgreg...@gmail.com<javascript:;>
>> >wrote:
>>
>> > On Mon, Aug 12, 2013 at 3:26 PM, Benedikt Ritter 
>> > <brit...@apache.org<javascript:;>
>> >
>> > 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 <javascript:;> | 
>> > ggreg...@apache.org<javascript:;>
>> > 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
>> >
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to