Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 370702

Summary: Unexpected resource leak exception in case of caught exception
Product: [Eclipse Project] JDT Reporter: Dani Megert <daniel_megert>
Component: CoreAssignee: Stephan Herrmann <stephan.herrmann>
Status: VERIFIED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: amj87.iitr, srikanth_sankaran, stephan.herrmann
Version: 3.8   
Target Milestone: 3.8 M6   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Dani Megert CLA 2012-02-06 06:10:45 EST
3.8 M5

http://git.eclipse.org/c/platform/eclipse.platform.releng.git/tree/bundles/org.eclipse.test/src/org/eclipse/test/EclipseTestRunner.java


        if (outfile != null) {
            try {
                out = new FileOutputStream(outfile);
            } catch (java.io.IOException e) {
                throw new BuildException(e);
            }
        }
        r.setOutput(out);
        return r;

reports a leak on 'out' inside the catch block. However, 'out' can only be 'null' at this location.
Comment 1 Dani Megert CLA 2012-02-06 06:12:34 EST
For a second instance of this, see

org.eclipse.jdt.internal.ui.preferences.formatter.ProfileStore.writeProfilesToFile(Collection<Profile>, File, String)
Comment 2 Stephan Herrmann CLA 2012-02-06 19:31:18 EST
I don't see these warnings in HEAD, I'm pretty sure they've been fixed
as part of bug 368546 (M6).

Let me know if you still see problems in builds >= N20120205-2000.

*** This bug has been marked as a duplicate of bug 368546 ***
Comment 3 Dani Megert CLA 2012-02-07 02:05:39 EST
Verified in N20120206-2000 that the errors are gone.