Return-Path: Delivered-To: apmail-jakarta-httpcomponents-dev-archive@www.apache.org Received: (qmail 50411 invoked from network); 10 Jul 2007 00:38:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Jul 2007 00:38:32 -0000 Received: (qmail 74431 invoked by uid 500); 10 Jul 2007 00:38:35 -0000 Delivered-To: apmail-jakarta-httpcomponents-dev-archive@jakarta.apache.org Received: (qmail 74235 invoked by uid 500); 10 Jul 2007 00:38:34 -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 74226 invoked by uid 99); 10 Jul 2007 00:38:34 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Jul 2007 17:38:34 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of sebbaz@gmail.com designates 64.233.162.232 as permitted sender) Received: from [64.233.162.232] (HELO nz-out-0506.google.com) (64.233.162.232) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Jul 2007 17:38:31 -0700 Received: by nz-out-0506.google.com with SMTP id l8so765980nzf for ; Mon, 09 Jul 2007 17:38:10 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=T51QN7bkcHTk3AGvqI/e2yGfwN4jwI34kYaTYS6NJPrWmqQViQu/sY2aq4PoshU/gYDWYEnotFncnqOeL2TaE4td4Up5eGY5i3fgfYOKXIuLeljCJY6HODjd1inNjl0SSIf0jSZXWgE2hHEFpsYWnAaXjZeNW+Ry3ApBnPor3Dk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=X79jb0Nw5LPXfkzTHXqHi4Ie6oItWjWruW07zTU9swfbUxkjBMr9/W/QBuiyXKW4f+Rj3hMeY3Ydo3NuRXaik3/0R9GM2Ehv2X6c8cAYYNoeZkiWWo2EW5Np+cN17buVMCQjrE4cCZV5xoS5gyFLPMPB4OQfO5JOh5GW571vXOs= Received: by 10.115.77.1 with SMTP id e1mr3634781wal.1184027889920; Mon, 09 Jul 2007 17:38:09 -0700 (PDT) Received: by 10.114.168.12 with HTTP; Mon, 9 Jul 2007 17:38:09 -0700 (PDT) Message-ID: <25aac9fc0707091738j142bcc6es9787120f136034de@mail.gmail.com> Date: Tue, 10 Jul 2007 01:38:09 +0100 From: sebb To: "HttpComponents Project" Subject: Re: svn commit: r554367 - in /jakarta/httpcomponents/httpcore/trunk: ./ module-main/src/main/java/org/apache/http/protocol/ module-main/src/test/java/org/apache/http/protocol/ In-Reply-To: <1184016539.5789.7.camel@okhost> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070708134022.6BE571A981A@eris.apache.org> <4690EBE2.7020204@dubioso.net> <1183903489.12362.40.camel@okhost> <4691F9B2.7070709@dubioso.net> <25aac9fc0707090434j49ee35d0h116610497f4e485d@mail.gmail.com> <46922285.7080800@dubioso.net> <1184016539.5789.7.camel@okhost> X-Virus-Checked: Checked by ClamAV on apache.org On 09/07/07, Oleg Kalnichevski wrote: > On Mon, 2007-07-09 at 13:56 +0200, Roland Weber wrote: > > Hi Sebastian, > > > > > But in theory, one still has to use something like Integer.MAX_VALUE > > > to absolutely guarantee that the entry will be added at the end... > > > > True. Now I remember why I wanted -1 to map to the end of the list. > > > > > If you don't want to use a magic number, why not have an addAtEnd() method? > > > > Because we already have too many methods in the interface to > > manage two simple lists. *sigh* > > > > Add constants AT_END to the interfaces? > > Or the extra methods? Or leave it as it is? > > > > Roland, > > _Personally_ I do not simply see a legitimate use case for wanting to > add a protocol interceptor at position three, five or three hundred and > one. I just do not. One may legitimately want to have an interceptor > executed first _before_ all other or last _after_ all others. That is > it. To me #addXXXInterceptor(HttpXXXInterceptor itcp, int index) is > pointless for all but two cases (0 or Integer.MAX_VALUE). > > Leave it as it is. It is good enough. > I'm inclined to agree with Oleg's use cases. Though if you did want to get fancy with ordering, then I'd suggest doing something like XStream which uses priorities. For the simpler before/after case, perhaps use a two-valued indicator, such as a boolean? I think it is a bad idea to have to write calling code using 0 and Integer.MAX_VALUE as actual values. There should be named constants. S. > Cheers, > > Oleg > > > > > cheers, > > Roland > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org