Details
-
Type:
Enhancement
-
Status: Closed
-
Priority:
P4
-
Resolution: Won't Fix
-
Affects Version/s: 16
-
Fix Version/s: None
-
Component/s: core-libs
-
Labels:
-
Subcomponent:
-
CPU:generic
-
OS:generic
Description
A DESCRIPTION OF THE PROBLEM :
java.util.AutoClosableIterator: An interface that implement Iterator and AutoClosable. It is automatically closed by a for-each loop in the case of break, return, exception, and completion (and any other scenario in which the loop exits that I have not thought of).
Of course it would be closed by a try-with-resources block as well since it implements AutoClosable.
This feature would make possible, iterators which use non heap resources like files or threads.
java.util.AutoClosableIterator: An interface that implement Iterator and AutoClosable. It is automatically closed by a for-each loop in the case of break, return, exception, and completion (and any other scenario in which the loop exits that I have not thought of).
Of course it would be closed by a try-with-resources block as well since it implements AutoClosable.
This feature would make possible, iterators which use non heap resources like files or threads.