I would mimic the interaction of a file handle and expect an IOException
when trying to interact with a reader that has been closed.

Given the iterator.hasNext() expectation I would expect:
- hasNext() to return false if it can no upfront that no more features are
available (so being closed is an easy way to know). It is still capable of
throwing an IOException (say when reading from a network service and
communication is interrupted)
- next() to throw an exception


--
Jody Garnett

On 14 January 2015 at 16:29, Torben Barsballe <tbarsba...@boundlessgeo.com>
wrote:

> As part of our deprecation of AbstracDataStore, I am migrating
> MemoryDataStore to extend ContentDataStore.
>
> While working on the test cases, I ran into some glaring inconsistencies
> in the implementation of FeatureWriter.hasNext():
>
>    - The javadoc for FeatureWriter.hasNext() indicates it may throw an
>    IOExeption, but not when.
>    - The current implementation of MemoryDataStore's inline writer throws
>    an IOExeption if hasNext() is called when the writer is closed.
>    - Other implementations of FeatureWriter.hasNext() (Such as
>    FilteringFeatureWriter) return false it the writer has been closed
>    - EventContentFeatureWriter.hasNext() returns a NullPointerException
>    if the writer has been closed (this is definately an error).
>
> What is the expected behavior of FeatureWriter.hasNext() when the writer
> is closed?
>
> Thanks,
> Torben
>
>
> ------------------------------------------------------------------------------
> New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> GigeNET is offering a free month of service with a new server in Ashburn.
> Choose from 2 high performing configs, both with 100TB of bandwidth.
> Higher redundancy.Lower latency.Increased capacity.Completely compliant.
> http://p.sf.net/sfu/gigenet
> _______________________________________________
> GeoTools-Devel mailing list
> GeoTools-Devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>
>
------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to