hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (HTTPCORE-363) Unnecessary call to isOpen() before calling close
Date Fri, 24 Jan 2014 11:58:38 GMT

     [ https://issues.apache.org/jira/browse/HTTPCORE-363?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Oleg Kalnichevski resolved HTTPCORE-363.
----------------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 4.4)
                   4.4-alpha1

Patch committed to SVN trunk 

(I botched the commit though and the change got mixed with two other changes)

Oleg

> Unnecessary call to isOpen() before calling close
> -------------------------------------------------
>
>                 Key: HTTPCORE-363
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-363
>             Project: HttpComponents HttpCore
>          Issue Type: Improvement
>          Components: HttpCore NIO
>            Reporter: Sebb
>            Priority: Minor
>             Fix For: 4.4-alpha1
>
>
> There are some instances of the following code:
> final Channel channel = this.key.channel();
> if (channel.isOpen()) {
>     try {
>         channel.close();
>     } catch (final IOException ignore) {}
> }
> Eclipse generates a warning that the channel might not be closed.
> Obviously that is a false positive, but why bother checking the state?
> Surely channel.close() can be repeated without harm?



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message