Summary: | FUP of bug 349326: Resource leak on non-Closeable resource. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Ayushman Jain <amj87.iitr> | ||||||
Component: | Core | Assignee: | Stephan Herrmann <stephan.herrmann> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | major | ||||||||
Priority: | P3 | CC: | deepakazad, srikanth_sankaran | ||||||
Version: | 3.8 | ||||||||
Target Milestone: | 3.8 M3 | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Ayushman Jain
2011-09-29 04:19:15 EDT
In the snippet, 'T' is not a resource of type 'Closeable', yet we get the warning. Stephan, can you take a look? Thanks! Created attachment 204267 [details]
proposed fix
Stephan, can you check if this fix is ok? The tests pass with this. Thanks!
Created attachment 204285 [details] enhanced fix (In reply to comment #2) > Created attachment 204267 [details] > proposed fix > > Stephan, can you check if this fix is ok? The tests pass with this. Thanks! The location and idea of your fix is perfect. The underlying issue is that super types of a type variable may have their typeBits still uninitialized at this point. Thus we were passing -1 (marking state uninitialized) down. Rather than filtering out -1 in the end my patch ensures that all super types properly initialized their typeBits before merging bits. For this purpose I changed -1 for uninitialized to an explicit new bit: TypeIds.BitUninitialized. I also changed the corresponding method for WildcardBinding, yet I wouldn't know how to create a test for this, as concrete expressions should never have the type of a wildcard, but rather a capture binding. Also included in this patch: I added close() calls to the class VerifyTests (string constant in TestVerifier) to avoid the new warning in the console output of compiler tests. I'm currently re-running the model tests. Tests pass with the enhanced fix. Released as commit 247dd2da1a649afa18a4b7387fd9cbdf69c251eb for 3.8 M3. (In reply to comment #3) Thanks Stephan! For fixing this and the VerifyTests issue. I noticed it recently and was going to fix it :) Verified for 3.8 M3 using build id: N20111022-2000 |