Automatic Resource Management, V.2

Rémi Forax forax at
Mon Apr 20 03:43:45 PDT 2009

Joshua Bloch a écrit :
> Rémi,
> Good question. We did it to eliminate the possibility of name clashes 
> in existing programs. JBoss actually uses the name AutoCloseable. 
> Types in java.lang are automatically imported, and putting 
> AutoCloseable in avoids this issue. It doesn't make the 
> construct any less usable, as you don't have to mention AutoCloseable 
> explicitly to use the construct.
> Josh

I don't like the fact that the JDK will contains a package with only one 
just to avoid name clash that is hypothetical because classes of the 
current package are imported
before java.lang ones and everybody should avoid to use import *.

In my opinion, (which is biased) , I prefer sacrificing  source backward 
compatibility to having to take
15 minutes each year because I will have to explain to my students why 
the package with one interface exists.

Else what about renaming (yes again) AutoCloseable to ARMCloseable ?


More information about the coin-dev mailing list