Return-Path: Delivered-To: apmail-jakarta-httpclient-dev-archive@www.apache.org Received: (qmail 23801 invoked from network); 2 Aug 2006 18:50:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Aug 2006 18:50:49 -0000 Received: (qmail 5492 invoked by uid 500); 2 Aug 2006 18:50:48 -0000 Delivered-To: apmail-jakarta-httpclient-dev-archive@jakarta.apache.org Received: (qmail 5460 invoked by uid 500); 2 Aug 2006 18:50:48 -0000 Mailing-List: contact httpclient-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "HttpClient Project" Reply-To: "HttpClient Project" Delivered-To: mailing list httpclient-dev@jakarta.apache.org Received: (qmail 5449 invoked by uid 99); 2 Aug 2006 18:50:48 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Aug 2006 11:50:48 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Aug 2006 11:50:47 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 4EB8E41000D for ; Wed, 2 Aug 2006 18:48:14 +0000 (GMT) Message-ID: <6439687.1154544494304.JavaMail.jira@brutus> Date: Wed, 2 Aug 2006 11:48:14 -0700 (PDT) From: "Oleg Kalnichevski (JIRA)" To: httpclient-dev@jakarta.apache.org Subject: [jira] Updated: (HTTPCLIENT-593) ProtocolSocketFactory equals and hashCode don't support subclassing In-Reply-To: <2542346.1154535436542.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HTTPCLIENT-593?page=all ] Oleg Kalnichevski updated HTTPCLIENT-593: ----------------------------------------- Fix Version/s: 3.1 Beta 1 (was: 4.0 Alpha 1) Oh, and by the way, did I mention we would happily accept a patch? ;-) Oleg > ProtocolSocketFactory equals and hashCode don't support subclassing > ------------------------------------------------------------------- > > Key: HTTPCLIENT-593 > URL: http://issues.apache.org/jira/browse/HTTPCLIENT-593 > Project: HttpComponents HttpClient > Issue Type: Bug > Components: HttpClient > Affects Versions: Nightly Builds, 3.1 Alpha 1 > Reporter: Chris Audley > Priority: Minor > Fix For: 3.1 Beta 1 > > > In the implemenation of equals and hashCode for the classes > org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory > org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory > The implementation of equals and hashCode attempts to make all instances of the classes equal. However, the manner in which the methods are coded makes it necessary for any subclass to implement equals and hashCode themselves. A minor change to the methods in these classes will make possible to subclass these factories without re-implementing the equals and hashCode. The method equals should be written as > return ((obj != null) && obj.getClass().equals(getClass())); > rather than > return ((obj != null) && obj.getClass().equals(DefaultProtocolSocketFactory.class)); > And similarly, the hashCode method should be > return getClass().hashCode(); > rather than > return DefaultProtocolSocketFactory.class.hashCode(); -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org