Bug 565709 - JRTUtil.hasClassFile() fails to close Stream returned by Files.list()
Summary: JRTUtil.hasClassFile() fails to close Stream returned by Files.list()
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.9.5   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-30 10:05 EDT by Adam Rauch CLA
Modified: 2020-07-30 10:05 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Rauch CLA 2020-07-30 10:05:38 EDT
Files.list() JavaDoc states "This method must be used within a try-with-resources statement or similar control structure to ensure that the stream's open directory is closed promptly after the stream's operations have completed."

JRTUtil.hasClassFile() calls this method without closing the returned Stream. This can result in files or directories being left open.