Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 330A7102F5 for ; Fri, 24 Jan 2014 11:58:45 +0000 (UTC) Received: (qmail 33935 invoked by uid 500); 24 Jan 2014 11:58:44 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 33898 invoked by uid 500); 24 Jan 2014 11:58:43 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 33663 invoked by uid 99); 24 Jan 2014 11:58:39 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Jan 2014 11:58:39 +0000 Date: Fri, 24 Jan 2014 11:58:38 +0000 (UTC) From: "Oleg Kalnichevski (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (HTTPCORE-363) Unnecessary call to isOpen() before calling close MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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