Proposal: Automatic Resource Management

Sean R. Drucker sean.drucker at frameworkplus.com
Tue Sep 1 09:30:38 PDT 2009


Automatic Resource Management should also apply to an Iterator<?> that 
implements Disposable<?> and is used in the enhanced for-each.  So, if 
an Iterator is connected to JDBC, once iteration ends, the close method 
is called:


for (Row row: database.getIterable()) {
   ...
}

So, when the iterator() method is called on database, if it implements 
Disposable<?>, then it should be disposed.

Thanks... Sean





More information about the coin-dev mailing list