Some Classes with a public void close() don't implement AutoCloseable

Alan Bateman Alan.Bateman at oracle.com
Thu Apr 16 07:28:22 UTC 2020


On 16/04/2020 01:28, Johannes Kuhn wrote:
> :
>
> I did not restrict my enumeration to public and exported types - it 
> was easier not to do that and I'm lazy.
Most of the candidates that you've identified are JDK internal classes 
and there are several non-public classes in exported packages. There are 
also a few cases where the sub-classes of the likely candidate are 
showing up too (e.g. all the public sub-classes of 
java.util.logging.Handler). I skimmed through your list and filtered it 
down to the public classes in exported packages to following:

com/sun/jdi/connect/spi/Connection
java/awt/SplashScreen
java/util/logging/Handler
javax/naming/Context
javax/naming/NamingEnumeration
javax/naming/ldap/StartTlsResponse
javax/smartcardio/CardChannel
javax/sql/PooledConnection
javax/swing/ProgressMonitor
javax/xml/stream/XMLEventReader
javax/xml/stream/XMLEventWriter
javax/xml/stream/XMLStreamReader
javax/xml/stream/XMLStreamWriter

As Joe points out, some of these may have been looked at already. I was 
surprised to see the java.xml.stream reader/writers so it might be worth 
digging into those to see why they were not retrofitted.

-Alan.





More information about the core-libs-dev mailing list