Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 49360 invoked from network); 25 Mar 2009 16:27:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Mar 2009 16:27:16 -0000 Received: (qmail 93718 invoked by uid 500); 25 Mar 2009 16:27:16 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 93643 invoked by uid 500); 25 Mar 2009 16:27:16 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 93633 invoked by uid 99); 25 Mar 2009 16:27:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Mar 2009 16:27:16 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Mar 2009 16:27:15 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D2B25234C003 for ; Wed, 25 Mar 2009 09:26:54 -0700 (PDT) Message-ID: <830924352.1237998414681.JavaMail.jira@brutus> Date: Wed, 25 Mar 2009 09:26:54 -0700 (PDT) From: "Laszlo Sas (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (JCI-58) EclipseJavaCompiler fails to close inputstream In-Reply-To: <1910495500.1228277324362.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JCI-58?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12689149#action_12689149 ] Laszlo Sas commented on JCI-58: ------------------------------- On Windows it's a critical bug. The memory leaks. Thanks for the fix. > EclipseJavaCompiler fails to close inputstream > ---------------------------------------------- > > Key: JCI-58 > URL: https://issues.apache.org/jira/browse/JCI-58 > Project: Commons JCI > Issue Type: Bug > Components: compiler eclipse > Affects Versions: 1.1 > Environment: Java 1.5, WinXP > Reporter: Michael Gannon > > The method isPackage(final String pClaszzName) calls classLoader.getResourceAsStream() but fails to close the stream if it is opened successfully. On Windows this means all other file access to this file is not permitted. The inputstream should be closed. Here is a replacement method: > private boolean isPackage( final String pClazzName ) { > final InputStream is = pClassLoader.getResourceAsStream(ConversionUtils.convertClassToResourcePath(pClazzName)); > if (is != null) { > log.debug("found the class for " + pClazzName + "- no package"); > try { > is.close(); > } catch (final IOException ie) { > log.error("could not close input stream", ie); > } > return false; > } > // FIXME: this should not be tied to the extension > final String source = pClazzName.replace('.', '/') + ".java"; > if (pReader.isAvailable(source)) { > log.debug("found the source " + source + " for " + pClazzName + " - no package "); > return false; > } > return true; > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.