On Fri, Jul 21, 2023 at 5:17 AM Elliotte Rusty Harold <elh...@ibiblio.org>
wrote:

> On Thu, Jul 20, 2023 at 8:27 PM Phil Steitz <phil.ste...@gmail.com> wrote:
> >
> > We have a minor source compat break still in 2.x
> >
> > The change to have BaseGenericObjectPool implement Autocloseable forced
> > addition of an abstract close method.  Technically, that could break
> > subclass implementations that don't implement close.  I see three options
> > here.  Maybe someone else has a better idea.
> >
> > 0) Ignore the problem.  Unlikely to actually impact anyone.
> > 1) Add a default implementation that
> >     a) throws UnsupportedOperationException
> >     b) No-Ops
> >     c) does <fill in more clever thing>
> > 2) Add Implements Autocloseable to the subclasses (GOP, GKOP, ...)
> instead
> > 3) Revert the change for 2.x
> >
>
> Weak vote for 1b. That maintains source compatibility and the API you
> want and doesn't seem likely to cause problems in any situation I can
> think of.
>

Thanks, Elliot.  The use case that I was worried about there was someone
assumes autoclosing for a pool that has not implemented close but uses some
other thing (like clear) to clean up resources and the no-op is
misleading.  I would rather get an exception in that case.  But it is kind
of far-fetched, so I am OK with the no-op default.

Phil

>
> --
> Elliotte Rusty Harold
> elh...@ibiblio.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>

Reply via email to