Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8290316: Ensure that all directory streams are closed in java.base #9518

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -259,7 +259,7 @@ private void initNodes() throws IOException {
contentsStream.filter(Files::isDirectory).forEach((p) -> {
p = module.relativize(p);
String pkgName = slashesToDots(p.toString());
// skip META-INFO and empty strings
// skip META-INF and empty strings
if (!pkgName.isEmpty() && !pkgName.startsWith("META-INF")) {
List<String> moduleNames = packageToModules.get(pkgName);
if (moduleNames == null) {
@@ -269,6 +269,7 @@ private void initNodes() throws IOException {
moduleNames.add(moduleName);
}
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a missing closing curly brace here (which should come on the next line), but otherwise looks fine.

}
}
}
}
Original file line number Diff line number Diff line change
@@ -134,8 +134,8 @@ public ModuleReference patchIfNeeded(ModuleReference mref) {
try (Stream<Path> stream = Files.find(top, Integer.MAX_VALUE,
((path, attrs) -> attrs.isRegularFile()))) {
stream.filter(path -> (!isAutomatic
|| path.toString().endsWith(".class"))
&& !isHidden(path))
|| path.toString().endsWith(".class"))
&& !isHidden(path))
.map(path -> toPackageName(top, path))
.filter(Checks::isPackageName)
.forEach(packages::add);