Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 6517A200D2E for ; Tue, 31 Oct 2017 10:42:54 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 63D901609EC; Tue, 31 Oct 2017 09:42:54 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CF5F41609EB for ; Tue, 31 Oct 2017 10:42:53 +0100 (CET) Received: (qmail 56084 invoked by uid 500); 31 Oct 2017 09:42:52 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 56073 invoked by uid 99); 31 Oct 2017 09:42:52 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Oct 2017 09:42:52 +0000 Received: from s2laptop.homeinbox.net (host81-156-41-218.range81-156.btcentralplus.com [81.156.41.218]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 675651A0117 for ; Tue, 31 Oct 2017 09:42:52 +0000 (UTC) Subject: Re: [pool] close(). Closeable, and AutoCloseable To: Commons Developers List References: From: Mark Thomas Message-ID: <15ea7401-7635-0030-d631-de2f7a405183@apache.org> Date: Tue, 31 Oct 2017 09:42:50 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit archived-at: Tue, 31 Oct 2017 09:42:54 -0000 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 onwards. > Now that we are on Java 7, AutoCloseable is also available. > > Thoughts? Pros, Cons? If we implement Closeable then we get AutoCloseable for free. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org