Synchronized access to config.properties when downloading custom distro's libraries
@@ -52,9 +52,7 @@ import java.util.TreeSet;
import java.util.UUID;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
-import java.util.function.BiPredicate;
import java.util.function.Function;
-import java.util.function.Predicate;
import java.util.jar.Attributes;
import java.util.jar.Manifest;
import java.util.regex.Pattern;
@@ -1568,7 +1566,7 @@ public class Builder {
default: path = "lib"; break;
}
downloader.download(library, provider -> {
- synchronized (provider) {
+ synchronized (downloader) {
Path input = provider.getFile().toPath();
String name = filename != null ? filename : input.getFileName().toString();
Path libOutput = homeDirectory.resolve(path).resolve(name);
@@ -1603,7 +1601,9 @@ public class Builder {
}
boolean export = Boolean.parseBoolean(clause.getDirective(LIBRARY_CLAUSE_EXPORT));
boolean delegate = Boolean.parseBoolean(clause.getDirective(LIBRARY_CLAUSE_DELEGATE));
+
if (export || delegate) {
+ synchronized (config) {
Map<String, String> headers = getHeaders(provider);
String packages = headers.get(Constants.EXPORT_PACKAGE);
if (packages != null) {
@@ -1624,6 +1624,7 @@ public class Builder {
}
}
}
+ }
});
}
}
