commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <>
Subject Re: [pool] close(). Closeable, and AutoCloseable
Date Tue, 31 Oct 2017 09:42:50 GMT
On 31/10/2017 00:49, Gary Gregory wrote:
> Hi All:
> Several [pool] interfaces implement close() but do not extend Closeable.
> Should they?

I'm tempted. close() is part of the ObjectPool interface so it isn't as
if we are adding new functionality.

My only concern is that the Javadoc for Closeable is written as if
Closeable is for I/O streams rather than the more general resource case.
Looking at the Javadoc further, URLClassLoader implements Closeable so
if it is good enough for the JRE...

+1 to having all the Pool implementations implement Closeable in 2.4.x

> Now that we are on Java 7, AutoCloseable is also available.
> Thoughts? Pros, Cons?

If we implement Closeable then we get AutoCloseable for free.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message