Skip to main content

Joseph Darcy - Project Coin: Bringing it to a Close(able)

Joseph Darcy posted Project Coin: Bringing it to a Close(able) -

As a follow-up to the title="Project Coin: ARM API">initial API changes to support automatic resource management (ARM) I wrote an annotation processor, CloseableFinder, to programmatically look for types that were candidates to be retrofitted as Closeable or AutoCloseable. The processor issues a note for a type that has a public no-args instance method returning void whose name is "close" where the type does not already implement/extend Closeable or AutoCloseable. Based on the exceptions a close method is declared to throw, the processor outputs whether the type is a candidate to be retrofitting to just AutoCloseable or to either of Closeable and AutoCloseable...

Community: OpenJDK