Summary: | [resource] closing inner resource of wrapper chain causes warning out outer resource | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Stephan Herrmann <stephan.herrmann> |
Component: | Core | Assignee: | Stephan Herrmann <stephan.herrmann> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | Ed.Merks, manoj.palat |
Version: | 4.15 | Keywords: | regression |
Target Milestone: | 4.16 M1 | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://git.eclipse.org/r/159725 https://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=07329519f5ac8fd8379eab265d25b2c09a24fd96 |
||
Whiteboard: |
Description
Stephan Herrmann
2020-03-19 10:32:54 EDT
While the change is triggered by one of the [resource] related fixes in 4.15M1 (not sure which one exactly), the bug appears to be in method FakedTrackingVariable.pickMoreUnsafe(..) which has not been touched in that time frame. Sorry, I should up updated my other development environments more often. :-( For what it's worth, I have a similar problem in an Oomph method: public static String getContents(IFile file) throws CoreException, IOException { InputStream contents = null; try { contents = file.getContents(); BufferedReader reader = new BufferedReader(new InputStreamReader(contents, file.getCharset())); CharArrayWriter caw = new CharArrayWriter(); int c; while ((c = reader.read()) != -1) { caw.write(c); } return caw.toString(); } finally { IOUtil.closeSilent(contents); } } New Gerrit change created: https://git.eclipse.org/r/159725 (In reply to Eclipse Genie from comment #3) > New Gerrit change created: https://git.eclipse.org/r/159725 Test & fix. The problem is triggered by code added via bug 519740, the buggy code location, however, is from bug 411098 (Jan 2014). Gerrit change https://git.eclipse.org/r/159725 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=07329519f5ac8fd8379eab265d25b2c09a24fd96 (In reply to Eclipse Genie from comment #5) > Gerrit change https://git.eclipse.org/r/159725 was merged to [master]. > Commit: > http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/ > ?id=07329519f5ac8fd8379eab265d25b2c09a24fd96 Released to master for 4.16 M1 Thanks, Ed. (Yes, comment 2 is essentially the same pattern, except that IOUtil.closeSilent() is not among the well-known ways of invoking close() - I don't even know which library provides it). Verified for Eclipse Version: 2020-06 (4.16) M1 with Build id: I20200406-0600 |