Bug 568708 - [compiler][resource] Potential resource leak flagged twice for unassigned case
Summary: [compiler][resource] Potential resource leak flagged twice for unassigned case
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.17   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2020-11-11 01:55 EST by Manoj N Palat CLA
Modified: 2023-03-11 20:20 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manoj N Palat CLA 2020-11-11 01:55:23 EST
while testing bug 499037, found this issue (unrelated to the fix in that bug),

Given the following with resource leak error flagging enabled:

class X {
	void test(boolean b) throws Exception {
		Y y = new Y();
		if (b) {
			try (y) {}
		} else {
			bar(y); // Potential resource leak: '<unassigned Closeable value>' may not be closed
			y.close();
		}
	}
} 
class Y implements AutoCloseable {
	@Override
	public void close() throws Exception {
		// TODO Auto-generated method stub
		
	}
}

results in this error of Potential resouce Leak being flagged twice instead of once
Comment 1 Manoj N Palat CLA 2021-02-10 08:32:43 EST
bulk move out of 4.19 - retarget once an owner is assigned
Comment 2 Eclipse Genie CLA 2023-03-11 20:20:03 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.