Return-Path: Delivered-To: apmail-mina-dev-archive@www.apache.org Received: (qmail 93008 invoked from network); 17 Feb 2011 10:41:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Feb 2011 10:41:38 -0000 Received: (qmail 83534 invoked by uid 500); 17 Feb 2011 10:41:37 -0000 Delivered-To: apmail-mina-dev-archive@mina.apache.org Received: (qmail 83388 invoked by uid 500); 17 Feb 2011 10:41:35 -0000 Mailing-List: contact dev-help@mina.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mina.apache.org Delivered-To: mailing list dev@mina.apache.org Received: (qmail 83380 invoked by uid 99); 17 Feb 2011 10:41:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Feb 2011 10:41:34 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of elecharny@gmail.com designates 209.85.161.43 as permitted sender) Received: from [209.85.161.43] (HELO mail-fx0-f43.google.com) (209.85.161.43) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Feb 2011 10:41:26 +0000 Received: by fxm18 with SMTP id 18so2513517fxm.2 for ; Thu, 17 Feb 2011 02:41:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:reply-to:user-agent :mime-version:to:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=CoUDXwkB74wYfUl+4rhwbS1Z0N6S/4IkOeZmwMXL6Oo=; b=XzL26K5NRc2b/cktrIRc11mc+W1fWfriDoTbBpWn3eUVpw+kNbgRgptDxqHReQi6Ui IBxuNAV2Tj9UmpO7WgcU0MEnOwH9nkRE6G3/EVCZRgnCqhLYaHe3yZ3+X3pK8iobLbAH v1DL3tNnqtEazQ5j6XIUViciZYyQp9UCz+b1A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; b=i1sDeAkdUW2aiw7J904BmuufkJjNuDzvXuPrd/qlV2qnThj6NMTDjZNtitWNuwhpog zUlt8jQBANRANKzt50NVB6rj2EO4GkVDul0CngPQYFnLdeEOW6NOjDEE/p0j72QJU1Sq XN9Y7IV8VKt9ptAM+aSB05S3ay+A9sY8jmraE= Received: by 10.223.120.193 with SMTP id e1mr2146147far.106.1297939266155; Thu, 17 Feb 2011 02:41:06 -0800 (PST) Received: from emmanuel-lecharnys-MacBook-Pro.local (ran75-1-78-192-106-184.fbxo.proxad.net [78.192.106.184]) by mx.google.com with ESMTPS id z1sm346984fau.45.2011.02.17.02.41.04 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 Feb 2011 02:41:05 -0800 (PST) Message-ID: <4D5CFB40.3020005@gmail.com> Date: Thu, 17 Feb 2011 11:41:04 +0100 From: Emmanuel Lecharny Reply-To: elecharny@apache.org User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: dev@mina.apache.org Subject: Re: Is that a bug in ReferenceCountingFilter? References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org On 2/17/11 11:07 AM, 占翼 wrote: > hello > > It's seem like a bug in org.apache.mina.filter.util.ReferenceCountingFilter > > * public synchronized void onPreAdd(IoFilterChain parent, String name,* > * NextFilter nextFilter) throws Exception {* > * if (0 == count) {* > * filter.init();* > *++count;* > ** > * }* > ** > * * > * filter.onPreAdd(parent, name, nextFilter);* > * }* > it cause the filter not work well. > > I think the code should be > *public synchronized void onPreAdd(IoFilterChain parent, String name,* > * NextFilter nextFilter) throws Exception {* > * if (0 == count) {* > * filter.init();* > ** > * }* > *++count;* > ** > * * > * filter.onPreAdd(parent, name, nextFilter);* > * }* > ** > Is that a bug ? > Ok, got it. The ugly formatting made me think that the count++ was outside the { }. Good catch. Will fix it in 2.0.3. Can you still create a JIRA so that I can close it ? It will be listed in the released bug fixed when the release will be issued. Many thanks ! -- Regards, Cordialement, Emmanuel Lécharny www.iktek.com