Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 41518 invoked from network); 31 Dec 2004 21:43:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 31 Dec 2004 21:43:16 -0000 Received: (qmail 15717 invoked by uid 500); 31 Dec 2004 21:43:13 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 15672 invoked by uid 500); 31 Dec 2004 21:43:12 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 15651 invoked by uid 99); 31 Dec 2004 21:43:12 -0000 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=SPF_HELO_PASS,SPF_PASS,SUBJ_HAS_SPACES X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of joerg.heinicke@gmx.de designates 213.165.64.20 as permitted sender) Received: from pop.gmx.net (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.28) with SMTP; Fri, 31 Dec 2004 13:43:09 -0800 Received: (qmail invoked by alias); 31 Dec 2004 21:43:07 -0000 Received: from p50880433.dip0.t-ipconnect.de (EHLO [192.168.122.254]) (80.136.4.51) by mail.gmx.net (mp018) with SMTP; 31 Dec 2004 22:43:07 +0100 X-Authenticated: #3483660 Message-ID: <41D5C861.3040609@gmx.de> Date: Fri, 31 Dec 2004 22:45:05 +0100 From: Joerg Heinicke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: de-de, de, en-us, en-gb, en MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: svn commit: r123799 - /cocoon/branches/BRANCH_2_1_X/src/blocks/repository/java/org/apache/co coon/components/repository/SourceRepositoryImpl.java References: <20041231151259.90977.qmail@minotaur.apache.org> <41D58936.7030906@gmx.de> <34443.10.0.0.5.1104515215.squirrel@www.agssa.net> In-Reply-To: <34443.10.0.0.5.1104515215.squirrel@www.agssa.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On 31.12.2004 18:46, Antonio Gallardo wrote: >>> while (iter.hasNext()) { >>>- Source child = null; >>>- try { >>>- status = remove((Source) iter.next()); >>>- if (status != STATUS_OK) { >>>- return status; >>>- } >>>- } >>>- finally { >>>- if (child != null) { >>>- m_resolver.release(child); >> >>------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^ >> >> >>>- } >>>+ status = remove((Source) iter.next()); >>>+ if (status != STATUS_OK) { >>>+ return status; >>> } >>> } >>> } >> >>What about releasing the Source's?? > > > 'child' is always = null. The condition never happen to be true. Then it > is unnecesary code. Ah, yes, from the code it does not behave differently than before. But I guess it has been buggy before too. It should probably read: while (iter.hasNext()) { Source child = null; try { child = (Source) iter.next(); status = remove(child); if (status != STATUS_OK) { return status; } } finally { if (child != null) { m_resolver.release(child); } } } This was what I had in mind when claiming about the missing release of the sources. Maybe somebody else (the original author?) can review it. Joerg