// Write module-info.class
if (moduleInfoClass != null) {
- Path moduleInfoClassP = compiled.resolve("module-info.class");
+ Path moduleInfoClassP = binP.resolve("module-info.class");
Files.createDirectories(moduleInfoClassP.getParent());
try (OutputStream out = Files.newOutputStream(moduleInfoClassP)) {
moduleInfoClass.write(out);
- logger.log(INFO, "Wrote " + moduleInfoClassP);
+// logger.log(INFO, "Wrote " + moduleInfoClassP);
} catch (Exception e) {
throw new RuntimeException("Cannot write module-info.class");
}
Map<String, Path> listLegalFilesToInclude(Path bundleBase) throws IOException {
Map<String, Path> toInclude = new HashMap<>();
if (!noSdkLegal) {
- DirectoryStream<Path> sdkSrcLegal = Files.newDirectoryStream(sdkSrcBase, (p) -> {
+ try (DirectoryStream<Path> sdkSrcLegal = Files.newDirectoryStream(sdkSrcBase, (p) -> {
String fileName = p.getFileName().toString();
return switch (fileName) {
case "NOTICE":
default:
yield false;
};
- });
- for (Path p : sdkSrcLegal)
- toInclude.put(p.getFileName().toString(), p);
+ });) {
+ for (Path p : sdkSrcLegal)
+ toInclude.put(p.getFileName().toString(), p);
+ }
}
for (Iterator<Map.Entry<String, Path>> entries = toInclude.entrySet().iterator(); entries.hasNext();) {
Map.Entry<String, Path> entry = entries.next();