Skip to content
Merged
Changes from all commits
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
Expand Up @@ -10,7 +10,6 @@
import java.io.IOException;
import java.io.UncheckedIOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collection;
Expand Down Expand Up @@ -668,8 +667,7 @@ void setFlags(byte walkingFlags) {
setChildFlags(walkingFlags);
}

private ExtensionDependency getExtensionDependencyOrNull()
throws BootstrapDependencyProcessingException {
private ExtensionDependency getExtensionDependencyOrNull() {
if (ext != null) {
return ext;
}
Expand Down Expand Up @@ -719,11 +717,8 @@ Artifact getResolvedArtifact() {

/**
* Collects information about the conditional dependencies and adds them to the processing queue.
*
* @throws BootstrapDependencyProcessingException in case of an error
*/
private void collectConditionalDependencies()
throws BootstrapDependencyProcessingException {
private void collectConditionalDependencies() {
if (ext == null || ext.info.conditionalDeps.length == 0 || ext.conditionalDepsQueued) {
return;
}
Expand Down Expand Up @@ -782,27 +777,26 @@ private static boolean isFlagOn(byte flags, byte flag) {
return (flags & flag) > 0;
}

private ExtensionInfo getExtensionInfoOrNull(Artifact artifact, List<RemoteRepository> repos)
throws BootstrapDependencyProcessingException {
private ExtensionInfo getExtensionInfoOrNull(Artifact artifact, List<RemoteRepository> repos) {
if (!artifact.getExtension().equals(ArtifactCoords.TYPE_JAR)) {
return null;
}
final ArtifactKey extKey = getKey(artifact);
ExtensionInfo ext = allExtensions.get(extKey);
if (ext != null) {
return ext == EXT_INFO_NONE ? null : ext;
}
ExtensionInfo ext = allExtensions.computeIfAbsent(getKey(artifact), k -> resolveExtensionInfo(artifact, repos));
return ext == EXT_INFO_NONE ? null : ext;
}

private ExtensionInfo resolveExtensionInfo(Artifact artifact, List<RemoteRepository> repos) {
artifact = resolve(artifact, repos);
final Path path = artifact.getFile().toPath();
final Properties descriptor = PathTree.ofDirectoryOrArchive(path).apply(BootstrapConstants.DESCRIPTOR_PATH,
ApplicationDependencyResolver::readExtensionProperties);
final Properties descriptor = PathTree.ofDirectoryOrArchive(artifact.getFile().toPath())
.apply(BootstrapConstants.DESCRIPTOR_PATH, ApplicationDependencyResolver::readExtensionProperties);
if (descriptor == null) {
allExtensions.put(extKey, EXT_INFO_NONE);
return null;
return EXT_INFO_NONE;
}
try {
return new ExtensionInfo(artifact, descriptor, devMode);
} catch (BootstrapDependencyProcessingException e) {
throw new RuntimeException("Failed to collect extension information for " + artifact, e);
}
ext = new ExtensionInfo(artifact, descriptor, devMode);
allExtensions.put(extKey, ext);
return ext;
}

private static Properties readExtensionProperties(PathVisit visit) {
Expand Down
Loading