[IO] Don't deprecate IOUtils#closeQuietly()

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[IO] Don't deprecate IOUtils#closeQuietly()

garydgregory
Hi All:

I propose that we do NOT deprecate IOUtils#closeQuietly(). There are
use-cases for this method outside of try-with-resources blocks.

For example, I have some wrapper objects that contain Closeable objects.
When the wrapper is closed, I do and want to add calls to
IOUtils#closeQuietly() to avoid null checks in call sites.

Gary
Reply | Threaded
Open this post in threaded view
|

Re: [IO] Don't deprecate IOUtils#closeQuietly()

garydgregory
In this vein, I'd also like to add a null-safe close(Closeable) method.

Gary

On Tue, Nov 5, 2019 at 10:10 AM Gary Gregory <[hidden email]> wrote:

> Hi All:
>
> I propose that we do NOT deprecate IOUtils#closeQuietly(). There are
> use-cases for this method outside of try-with-resources blocks.
>
> For example, I have some wrapper objects that contain Closeable objects.
> When the wrapper is closed, I do and want to add calls to
> IOUtils#closeQuietly() to avoid null checks in call sites.
>
> Gary
>
Reply | Threaded
Open this post in threaded view
|

Re: [IO] Don't deprecate IOUtils#closeQuietly()

Claude Warren
+1 I have similar use cases.

On Tue, Nov 5, 2019 at 3:12 PM Gary Gregory <[hidden email]> wrote:

> In this vein, I'd also like to add a null-safe close(Closeable) method.
>
> Gary
>
> On Tue, Nov 5, 2019 at 10:10 AM Gary Gregory <[hidden email]>
> wrote:
>
> > Hi All:
> >
> > I propose that we do NOT deprecate IOUtils#closeQuietly(). There are
> > use-cases for this method outside of try-with-resources blocks.
> >
> > For example, I have some wrapper objects that contain Closeable objects.
> > When the wrapper is closed, I do and want to add calls to
> > IOUtils#closeQuietly() to avoid null checks in call sites.
> >
> > Gary
> >
>


--
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren
Reply | Threaded
Open this post in threaded view
|

Re: [IO] Don't deprecate IOUtils#closeQuietly()

Pascal Schumacher
In reply to this post by garydgregory
+1, for removing the deprecatio

Am 05.11.2019 um 16:10 schrieb Gary Gregory:

> Hi All:
>
> I propose that we do NOT deprecate IOUtils#closeQuietly(). There are
> use-cases for this method outside of try-with-resources blocks.
>
> For example, I have some wrapper objects that contain Closeable objects.
> When the wrapper is closed, I do and want to add calls to
> IOUtils#closeQuietly() to avoid null checks in call sites.
>
> Gary
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [IO] Don't deprecate IOUtils#closeQuietly()

David Mollitor
Here is a discussion about this topic @ Guava.

https://github.com/google/guava/issues/1118

On Tue, Nov 5, 2019 at 1:14 PM Pascal Schumacher <[hidden email]>
wrote:

> +1, for removing the deprecatio
>
> Am 05.11.2019 um 16:10 schrieb Gary Gregory:
> > Hi All:
> >
> > I propose that we do NOT deprecate IOUtils#closeQuietly(). There are
> > use-cases for this method outside of try-with-resources blocks.
> >
> > For example, I have some wrapper objects that contain Closeable objects.
> > When the wrapper is closed, I do and want to add calls to
> > IOUtils#closeQuietly() to avoid null checks in call sites.
> >
> > Gary
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>