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

Daniel Fuchs daniel.fuchs at oracle.com
Thu Apr 16 11:05:43 UTC 2020


Hi Johannes,

On 16/04/2020 08:28, Alan Bateman wrote:
> java/util/logging/Handler

That's already logged as 
https://bugs.openjdk.java.net/browse/JDK-8025709 (assigned to me)

I have never got to the point to start working on it
because it seems to be a very niche case: Handler
are usually attached to loggers, so unless you're
writing a test or using the API in ways that it was not
designed for (though they might still be legitimate), then
it's very unlikely that you would use a Handler in a
try with resource statement.

The java.logging module is mainly in maintenance mode these
days and any changes we do there have a tendency to ripple
out of control and come back to bite us - so we usually
tend to exercise caution.

best regards,

-- daniel

> 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.




More information about the core-libs-dev mailing list