Community
Participate
Working Groups
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.