Project Coin: Trying out try-with-resources in the JDK
By Darcy-Oracle on Feb 22, 2011
As part of the "coinification" the JDK libraries, after first forging some diamonds, Stuart has been working on introducing systematic usage of
try-with-resources into the JDK code base.
Initially, this effort introduced
URLJarFile.java and in
javax.sql; more changes are on the way.
Besides directly improving the code base, these efforts also help inform design decisions about how to make the feature more useful in practice.
try-with-resources statement can also be helpful in new code. In a recent update to the file system API portion of JSR 203,
try-with-resources is used throughout the utility methods in
java.nio.file.Files and in other portions of the code and tests for JSR 203.
There is a limited amount of time remaining to make adjustments to
try-with-resources in JDK 7.
Additional reports on experiences using
try-with-resources, and other Project Coin features, would be helpful, either to report issues or validate the current design and implementation.
For widest discussion, feedback can be sent to the