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 0148B11499 for ; Thu, 7 Aug 2014 20:14:10 +0000 (UTC) Received: (qmail 77220 invoked by uid 500); 7 Aug 2014 20:14:09 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 77185 invoked by uid 500); 7 Aug 2014 20:14:09 -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 77155 invoked by uid 99); 7 Aug 2014 20:14:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Aug 2014 20:14:09 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sebbaz@gmail.com designates 74.125.82.51 as permitted sender) Received: from [74.125.82.51] (HELO mail-wg0-f51.google.com) (74.125.82.51) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Aug 2014 20:14:03 +0000 Received: by mail-wg0-f51.google.com with SMTP id b13so4643640wgh.34 for ; Thu, 07 Aug 2014 13:13:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=bd2mHDreClmWuF7z0UOaUAnIF086oqjVMtGf2QvamXg=; b=QfgEaXYm8VGthL76mo4KjuPdBga9+o3g7iayo47B44uW9cRrCZHImY21gpJM3XEj7n zY4IFaxMFrnMrr5ECzeF0NzOZEFA3BvsG6FfoWPQUHTmWghczarDNKlLajdwRLu4xBKi xSWnJS/VhHh2cMPewU3xpDQ5xosmIDQL/ATLzuTbZK0lhQ1T8ASeKc97X78hvwwSCUc8 +ObZkYM3DaSPPFIfPeqchRG7TrkXCBG/9u8Py6ip1+l4PkoUAmtobGerxer3d8aPnwmQ ZBaHD1cNS3XfU5GYGUIMV4VI1BXSuCQ39AnvkYXQfuYKxQwy8zofuadjKDwHb/WEsgLv x/bQ== MIME-Version: 1.0 X-Received: by 10.194.192.201 with SMTP id hi9mr27272344wjc.28.1407442422681; Thu, 07 Aug 2014 13:13:42 -0700 (PDT) Received: by 10.194.162.231 with HTTP; Thu, 7 Aug 2014 13:13:42 -0700 (PDT) In-Reply-To: <53E3C4F5.7020900@apache.org> References: <20140806092940.690902389262@eris.apache.org> <53E3C4F5.7020900@apache.org> Date: Thu, 7 Aug 2014 21:13:42 +0100 Message-ID: Subject: Re: Fwd: svn commit: r1616136 - in /httpcomponents/httpclient/trunk/httpclient/src: main/java/org/apache/http/conn/ssl/DistinguishedNameParser.java test/java/org/apache/http/conn/ssl/TestDistinguishedNameParser.java From: sebb To: HttpComponents Project Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org On 7 August 2014 19:27, Oleg Kalnichevski wrote: > On 07/08/14 17:26 , sebb wrote: >> >> Again, looks generally OK. >> >> Some comments below. >> >> On 6 August 2014 10:29, wrote: >>> >>> +@Immutable >> >> >> Are we sure it's immutable? >> >>> +final class DistinguishedNameParser { >>> + >>> + public final static DistinguishedNameParser INSTANCE = new >>> DistinguishedNameParser(); >>> + >>> + private static final BitSet EQUAL_OR_COMMA_OR_PLUS = >>> TokenParser.INIT_BITSET('=', ',', '+'); >>> + private static final BitSet COMMA_OR_PLUS = >>> TokenParser.INIT_BITSET(',', '+'); >> >> >> BitSet is not immutable, so using a shared static field relies on the >> code never calling any of the mutation methods after creation. >> > > True, but these static variables are private and their state does not mutate > post construction. At present. > >> Perhaps consider using a simple delegation wrapper to provide only read >> access? >> Otherwise we need to document the non-mutability assumption. >> > > We could but given those static variables are private I see no real need to > do so. It still needs to be documented for future maintainers. > >>> + >>> + static class InternalTokenParser extends TokenParser { >>> + >> >> >> Do we really need this? >> Perhaps escape processing should be merged into the super-class. >> > > Yes, we do. HTTP spec states that escaped chars are valid only when enclosed > in double quotes. It is quite different from RFC 4514 and earlier RFCs > superseded by it. > > >> But if it is kept, it needs to have Javadoc. >> > > It is a package private class. Does this make any sense? I know it is a local class, but that does not mean it should not be documented. You have explained (above) why the super-class does not allow escapes in unquoted text, but we need to document why the InternalTokenParser needs to override that behaviour. > Oleg > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org > For additional commands, e-mail: dev-help@hc.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org