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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]