Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 50278 invoked from network); 29 Jun 2005 15:15:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Jun 2005 15:15:27 -0000 Received: (qmail 39131 invoked by uid 500); 29 Jun 2005 15:15:24 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 39070 invoked by uid 500); 29 Jun 2005 15:15:23 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 39056 invoked by uid 99); 29 Jun 2005 15:15:23 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jun 2005 08:15:23 -0700 Received: by ajax.apache.org (Postfix, from userid 99) id B280413; Wed, 29 Jun 2005 17:15:20 +0200 (CEST) From: bugzilla@apache.org To: dev@ant.apache.org Subject: DO NOT REPLY [Bug 35544] New: - ReaderInputStream.close() should not set members to null X-Bugzilla-Reason: AssignedTo Message-Id: <20050629151520.B280413@ajax.apache.org> Date: Wed, 29 Jun 2005 17:15:20 +0200 (CEST) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG� RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND� INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=35544 Summary: ReaderInputStream.close() should not set members to null Product: Ant Version: unspecified Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Core AssignedTo: dev@ant.apache.org ReportedBy: smarc@gmx.net This is the code of close() in org.apache.tools.ant.util.ReaderInputStream: public synchronized void close() throws IOException { in.close(); slack = null; in = null; } The problem comes from setting in to null (in = null, third statement). If one call the close() method twice, a NullPointerException is thrown the second time! This should not happen according to the contract of InputStream.close(). Following scenario shows a situation where this is problematic: public void example( ) { InputStream ins = null; try { // do something with ins // ... ins.close(); // further processing // ... } catch( IOException e ) { e.printStackTrace(); } finally { // here comes the problem: a NullPointerException is thrown!!! IOUtils.closeQuietly( ins ); } } -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org