commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (IO-480) IOUtils.closeQuietly can throw NullPointerException
Date Sat, 16 Jul 2016 09:29:20 GMT


ASF GitHub Bot commented on IO-480:

GitHub user rajivpjs opened a pull request:

    [IO-480] Removed the deprectaed method closeQuietly from the Java doc…

    As the closeQuietly method has been deprecated, I thought I would use this ticket IO-480
to remove the Java documentation.

You can merge this pull request into a Git repository by running:

    $ git pull IO-480

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #14
commit 2c801149cbb6fabcef569ac301e9933b169a5fac
Author: Rajiv Jain <>
Date:   2016-07-16T09:27:03Z

    [IO-480] Removed the deprectaed method closeQuietly from the Java documentation


> IOUtils.closeQuietly can throw NullPointerException
> ---------------------------------------------------
>                 Key: IO-480
>                 URL:
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 2.4
>            Reporter: Matt Kusnierz
>   Original Estimate: 10m
>  Remaining Estimate: 10m
> The IOUtils#closeQuietly method in its javadoc suggests that ANY exceptions will be ignored.
This is not the case, as the code only catches IOExceptions. As this example stack trace shows,
it is possible for some InputStreams to throw NullPointerExceptions during close:
> java.lang.NullPointerException: null
> 	at ~[na:1.6.0_35]
> 	at$JarURLInputStream.close(
> 	at ~[commons-io-2.1.jar:2.1]
> 	at ~[commons-io-2.1.jar:2.1]
> Close quietly should do as advertised/suggested and catch all Exceptions.

This message was sent by Atlassian JIRA

View raw message