Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 76776 invoked from network); 31 Dec 2005 22:46:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 31 Dec 2005 22:46:47 -0000 Received: (qmail 79631 invoked by uid 500); 31 Dec 2005 22:46:46 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 79502 invoked by uid 500); 31 Dec 2005 22:46:46 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 79491 invoked by uid 99); 31 Dec 2005 22:46:46 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 31 Dec 2005 14:46:46 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 31 Dec 2005 14:46:45 -0800 Received: (qmail 76525 invoked by uid 65534); 31 Dec 2005 22:46:25 -0000 Message-ID: <20051231224625.76524.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r360457 - /cocoon/trunk/src/java/org/apache/cocoon/generation/XPathDirectoryGenerator.java Date: Sat, 31 Dec 2005 22:46:25 -0000 To: cvs@cocoon.apache.org From: antonio@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: antonio Date: Sat Dec 31 14:46:22 2005 New Revision: 360457 URL: http://svn.apache.org/viewcvs?rev=360457&view=rev Log: Close streams. Modified: cocoon/trunk/src/java/org/apache/cocoon/generation/XPathDirectoryGenerator.java Modified: cocoon/trunk/src/java/org/apache/cocoon/generation/XPathDirectoryGenerator.java URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/generation/XPathDirectoryGenerator.java?rev=360457&r1=360456&r2=360457&view=diff ============================================================================== --- cocoon/trunk/src/java/org/apache/cocoon/generation/XPathDirectoryGenerator.java (original) +++ cocoon/trunk/src/java/org/apache/cocoon/generation/XPathDirectoryGenerator.java Sat Dec 31 14:46:22 2005 @@ -318,7 +318,7 @@ } /** - * The MappingInfo class to reolve namespace prefixes to their namespace URI + * The MappingInfo class to resolve namespace prefixes to their namespace URI * * @version $Id$ */ @@ -352,17 +352,29 @@ this.mappingSource = mappingSource; this.reload = reload; prefixMap = new HashMap(); + InputStreamReader input = null; + BufferedReader br = null; - final BufferedReader br = new BufferedReader(new InputStreamReader(mappingSource.getInputStream())); - - for (String line = br.readLine(); line != null; line = br.readLine()) { - final int i = line.indexOf('='); - - if (i > 0) { - final String prefix = line.substring(0, i); - final String namespace = line.substring(i + 1); - prefixMap.put(prefix, namespace); - logger.debug("added mapping: '" + prefix + "'='" + namespace + "'"); + try { + input = new InputStreamReader(mappingSource.getInputStream()); + br = new BufferedReader(input); + + for (String line = br.readLine(); line != null; line = br.readLine()) { + final int i = line.indexOf('='); + + if (i > 0) { + final String prefix = line.substring(0, i); + final String namespace = line.substring(i + 1); + prefixMap.put(prefix, namespace); + logger.debug("added mapping: '" + prefix + "'='" + namespace + "'"); + } + } + } finally { + if (br != null) { + br.close(); + } + if (input != null) { + input.close(); } } }