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 @@ -8,6 +8,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.TreeSet;
import java.util.function.Predicate;
Expand Down Expand Up @@ -73,7 +74,22 @@ void splitPackageDetection(ApplicationArchivesBuildItem archivesBuildItem,
String packageName = DotNames.packageName(classInfo.name());
packageToArchiveMap.compute(packageName, (key, val) -> {
Set<ApplicationArchive> returnValue = val == null ? new HashSet<>() : val;
returnValue.add(archive);
boolean add = true;

// this special case essentially ensures that no archive which is built from an indexed dependency is added twice
// the primary use case for this is to avoid duplicate warnings for dependencies that use multiple languages
if (archive.getResolvedDependency() != null) {
if (returnValue.stream().map(ApplicationArchive::getResolvedDependency).filter(Objects::nonNull)
.collect(
Collectors.toSet())
.contains(archive.getResolvedDependency())) {
add = false;
}
}

if (add) {
returnValue.add(archive);
}
return returnValue;
});
}
Expand Down
Loading