Return-Path: Delivered-To: apmail-jakarta-httpcomponents-dev-archive@www.apache.org Received: (qmail 71559 invoked from network); 13 Dec 2007 15:21:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Dec 2007 15:21:06 -0000 Received: (qmail 72721 invoked by uid 500); 13 Dec 2007 15:20:55 -0000 Delivered-To: apmail-jakarta-httpcomponents-dev-archive@jakarta.apache.org Received: (qmail 72687 invoked by uid 500); 13 Dec 2007 15:20:55 -0000 Mailing-List: contact httpcomponents-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list httpcomponents-dev@jakarta.apache.org Received: (qmail 72678 invoked by uid 99); 13 Dec 2007 15:20:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Dec 2007 07:20:54 -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; Thu, 13 Dec 2007 15:21:04 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 1D339714201 for ; Thu, 13 Dec 2007 07:20:43 -0800 (PST) Message-ID: <19996746.1197559243116.JavaMail.jira@brutus> Date: Thu, 13 Dec 2007 07:20:43 -0800 (PST) From: "Sebb (JIRA)" To: httpcomponents-dev@jakarta.apache.org Subject: [jira] Created: (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 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 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: httpcomponents-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org