ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 52738] New: An incomplete fix for the resource leak bug in XMLResultAggregator.java
Date Thu, 23 Feb 2012 04:13:04 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=52738

             Bug #: 52738
           Summary: An incomplete fix for the resource leak bug in
                    XMLResultAggregator.java
           Product: Ant
           Version: unspecified
          Platform: PC
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Core
        AssignedTo: notifications@ant.apache.org
        ReportedBy: lianggt08@sei.pku.edu.cn
    Classification: Unclassified


The fix revision 272185 was aimed to remove resource leak bugs on the
OutputStream object "out" (created in line 232), the PrintWriter object "wri"
(line 234) in the method "writeDOMTree"of the file 
"/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java"
, but it is incomplete.

There are some problems: 
1. when "inReader" isn't created successfully but the temp OutputStreamWriter
object is created successfully (at line 233), the temp OutputStreamWriter
object will be leaked. 

The best way to close such resource objects is putting such close operations
for all resource objects in the finaly block of a try-catch-finally structure
and then putting all other code in a try block.

The problem still exists in the head revision (the temp OutputStreamWriter
object created at 233 can be leaked).

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message