Could give some details please?
I have tried some things out and they don't give a warning unless close
is explicitly present, unlike InputStream.
Current guess: because ExtendedIterator.close is not the same as
AutoCloseable.close due to throws.
It's a multi-facet area. Is this primarily for exceptions? Early exit of
a loop? Within jena-permissions - obviously you can do what you think is
the right thing.
What about ExtendedIterator.forEach? That closes on exception.
Have you seen the "org.apache.jena.riot.other.G" library which is
functions to work with graphs that do the close thing. That was my
solution to making sure lcose was called. We could move (some of) that
to jena-core.
Is there an interaction with "var"?
Andy
On 06/03/2021 17:56, Claude Warren wrote:
I know that we had discussed adding autoclosable to the iterators but
decided not to. I find that I am doing a lot of try/finally-close
manipulation with extended iterators. Rather than rehashing the previous
discussion (I'll assume we made the correct decision before), I would like
to suggest an AutoClosableExtendedIterator that extends both
ExtendedIterator and AutoClosable.
Is there a reason not to do this?
Claude