ALRubinger / shrinkwrap

Java API for Archive Manipulation
http://jboss.org/shrinkwrap
Apache License 2.0
9 stars 2 forks source link

ShrinkWrapDirectoryStream.iterator missing IllegalStateException cases #4

Closed undertheflowerpot closed 10 years ago

undertheflowerpot commented 10 years ago

Unfortunately the nio2 API was designed before Java8's stream library.

The documentation says that ShrinkWrapDirectoryStream.iterator must throw IllegalStateException if the Stream is closed OR if the iterator() has been accessed already.

From my reading of the DirectoryStream javadoc, the implementation of Iterator is otherwise fine. close() does not have to prematurely terminate the Iterator. iterator() should just comply with the precondition exceptions.

ShrinkWrapDirectoryStream is package protected, there is no reason to discuss any relationship to SecureDirectoryStream.

ALRubinger commented 10 years ago

Note: we do issue tracking for this project in https://issues.jboss.org/browse/SHRINKWRAP. Would you care to open an issue there and attempt a patch/pull request?

undertheflowerpot commented 10 years ago

I will do so

undertheflowerpot commented 10 years ago

https://issues.jboss.org/browse/SHRINKWRAP-469