| Summary: | Resource leak warning should be 'potential' if reader/writer is passed | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Dani Megert <daniel_megert> |
| Component: | Core | Assignee: | Stephan Herrmann <stephan.herrmann> |
| Status: | VERIFIED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | srikanth_sankaran, stephan.herrmann |
| Version: | 3.8 | ||
| Target Milestone: | 3.8 M6 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
Had we based bug 358903 on a general heuristic it would be exactly as you expected. However, the agreement in bug 358903 comment 10 was to use explicit white lists. HTML2TextReader is not on our white list, so all the compiler sees is: - reader is passed to some constructor, so the fresh object may / may not take over the responsibility - the assignment drops the binding to the first reader so at this point we no longer have a direct reference Ergo: we rank it equally to, e.g., this snippet: other.readSome(reader); return; Do you still want this (as an enhancement)? If so, based on which heuristic, exactly? Or can we close as WONTFIX? (In reply to comment #1) Fair enough. |
3.8 M5. See org.eclipse.jdt.internal.ui.util.JavadocHelpContext.retrieveText(IJavaElement) reader= new HTML2TextReader(reader, null); Adding reader.close() does not get rid of the problem. I would expect that this would now only be reported as potential problem since normally, if a Writer/Reader takes another reader, the close() ripples through.