[ https://issues.apache.org/jira/browse/HTTPCORE-363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13830959#comment-13830959 ]
Sebb commented on HTTPCORE-363: ------------------------------- ListenerEndpointImpl.java SessionRequestImpl.java > 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 > Reporter: Sebb > Priority: Minor > > 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#6144) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org