Return-Path: Delivered-To: apmail-hc-dev-archive@www.apache.org Received: (qmail 91973 invoked from network); 22 Dec 2007 14:49:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Dec 2007 14:49:07 -0000 Received: (qmail 1203 invoked by uid 500); 22 Dec 2007 14:48:56 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 1038 invoked by uid 500); 22 Dec 2007 14:48:55 -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 1029 invoked by uid 99); 22 Dec 2007 14:48:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Dec 2007 06:48:55 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Dec 2007 14:48:51 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 6FF357141EB for ; Sat, 22 Dec 2007 06:48:43 -0800 (PST) Message-ID: <1632067.1198334923456.JavaMail.jira@brutus> Date: Sat, 22 Dec 2007 06:48:43 -0800 (PST) From: "Roland Weber (JIRA)" To: dev@hc.apache.org Subject: [jira] Resolved: (HTTPCLIENT-717) NPE in SimpleHttpConnectionManager.shutdown() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HTTPCLIENT-717?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Roland Weber resolved HTTPCLIENT-717. ------------------------------------- Resolution: Fixed I've added null checks to both methods. If anybody wants to contribute unit tests, you're welcome. cheers, Roland > NPE in SimpleHttpConnectionManager.shutdown() > --------------------------------------------- > > Key: HTTPCLIENT-717 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-717 > Project: HttpComponents HttpClient > Issue Type: Bug > Affects Versions: 3.1 Final > Reporter: Sebb > Fix For: 3.1.1 > > > SimpleHttpConnectionManager.shutdown() causes NPE if no connection has been created, whereas MultiThreadedHttpConnectionManager.shutdown() does not. > Simple test case: > MultiThreadedHttpConnectionManager cm = new MultiThreadedHttpConnectionManager(); > cm.shutdown(); // OK > > SimpleHttpConnectionManager sm = new SimpleHttpConnectionManager(); > sm.shutdown(); // NPE > I came across this in JMeter - a sample was using Post with AutoRedirect, which (correctly) caused an IllegalArgumentException, and so the connection was not created. > The JMeter code could try to keep track of this, but it would be tedious, and it seems to me that SimpleHttpConnectionManager should ignore the shutdown() if the connection is null. > The problem does not arise when using closeIdleConnections(timeout) - unless one uses the special value: > closeIdleConnections(System.currentTimeMillis() - Long.MAX_VALUE) > but it would probably be sensible to protect against this as well. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org