Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 89880 invoked from network); 24 Jun 2007 11:29:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Jun 2007 11:29:59 -0000 Received: (qmail 83294 invoked by uid 500); 24 Jun 2007 11:29:58 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 83275 invoked by uid 500); 24 Jun 2007 11:29:58 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 83259 invoked by uid 500); 24 Jun 2007 11:29:58 -0000 Delivered-To: apmail-jakarta-tomcat-dev@jakarta.apache.org Received: (qmail 83256 invoked by uid 99); 24 Jun 2007 11:29:58 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Jun 2007 04:29:58 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Jun 2007 04:29:54 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 130421A981A; Sun, 24 Jun 2007 04:29:34 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r550209 - /tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/compiler/JavacErrorDetail.java Date: Sun, 24 Jun 2007 11:29:33 -0000 To: tomcat-dev@jakarta.apache.org From: markt@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070624112934.130421A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: markt Date: Sun Jun 24 04:29:33 2007 New Revision: 550209 URL: http://svn.apache.org/viewvc?view=rev&rev=550209 Log: Close streams as noted in bug 42314. Modified: tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/compiler/JavacErrorDetail.java Modified: tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/compiler/JavacErrorDetail.java URL: http://svn.apache.org/viewvc/tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/compiler/JavacErrorDetail.java?view=diff&rev=550209&r1=550208&r2=550209 ============================================================================== --- tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/compiler/JavacErrorDetail.java (original) +++ tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/compiler/JavacErrorDetail.java Sun Jun 24 04:29:33 2007 @@ -93,13 +93,15 @@ this.jspBeginLineNum = jspBeginLineNum; if (jspBeginLineNum > 0 && ctxt != null) { + InputStream is = null; + FileInputStream fis = null; try { // Read both files in, so we can inspect them - String[] jspLines = readFile - (ctxt.getResourceAsStream(jspFileName)); + is = ctxt.getResourceAsStream(jspFileName); + String[] jspLines = readFile(is); - String[] javaLines = readFile - (new FileInputStream(ctxt.getServletJavaFileName())); + fis = new FileInputStream(ctxt.getServletJavaFileName()); + String[] javaLines = readFile(fis); // If the line contains the opening of a multi-line scriptlet // block, then the JSP line number we got back is probably @@ -133,6 +135,21 @@ } catch (IOException ioe) { // Can't read files - ignore + } finally { + if (is != null) { + try { + is.close(); + } catch (IOException ioe) { + // Ignore + } + } + if (fis != null) { + try { + fis.close(); + } catch (IOException ioe) { + // Ignore + } + } } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org