Skip to content
Open
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 @@ -675,7 +675,13 @@ private static Predicate<ServiceComponent> distinctServicesByIdentity(
final var identitiesSeen = new HashSet<ComponentIdentity>();
return service -> {
final var componentIdentity = new ComponentIdentity(service);
identitiesByBomRef.putIfAbsent(service.getBomRef(), componentIdentity);
final boolean isBomRefUnique = identitiesByBomRef.putIfAbsent(service.getBomRef(), componentIdentity) == null;
if (!isBomRefUnique) {
LOGGER.warn("""
BOM ref %s is associated with multiple services in the BOM; \
BOM refs are required to be unique; Please report this to the vendor \
of the tool that generated the BOM""".formatted(service.getBomRef()));
Comment thread
Zureno marked this conversation as resolved.
}
bomRefsByIdentity.put(componentIdentity, service.getBomRef());
final boolean isSeenBefore = !identitiesSeen.add(componentIdentity);
if (LOGGER.isDebugEnabled() && isSeenBefore) {
Expand Down Expand Up @@ -715,7 +721,7 @@ private String resolveDirectDependenciesJson(
LOGGER.warn("""
Unable to resolve BOM ref %s to a component identity while processing direct \
dependencies of BOM ref %s; As a result, the dependency graph will likely be incomplete\
""".formatted(dependencyBomRef, directDependencyBomRef));
""".formatted(directDependencyBomRef, dependencyBomRef));
}
}

Expand Down
Loading