Proposal: Automatic Resource Management (original) (raw)
Stephen Colebourne scolebourne at joda.org
Wed Mar 4 15:54:49 PST 2009
- Previous message: Proposal: Automatic Resource Management
- Next message: Proposal: Automatic Resource Management
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
interface Disposable { void close() throws Exception; } interface Destroyable { void dispose() throws Exception; } interface Kloseable { void destroy() throws Exception; }
Er, no. If its to be an interface it needs to be just one.
A single interface - Disposable defining close() covers most use cases, and API writers would adapt in the future.
public finally void release() { ... }
I think this works well, and opens up more options. Are there any specific grammer objections?
It would be possible to add a marker interface Finally which enforces the presence of the finally modifier, but that seems to have little obvious benefit, and be a bit magical.
Stephen
- Previous message: Proposal: Automatic Resource Management
- Next message: Proposal: Automatic Resource Management
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]