Skip to content

Commit

Permalink
Fully consider composite requirements & provisions for composite borders
Browse files Browse the repository at this point in the history
  • Loading branch information
FloBoJa committed Aug 18, 2024
1 parent 3080d45 commit 31f0dc3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ public Composite construct(final Collection<Component> allComponents, final Requ
.warn("Chose name " + chosenPrefix + " supported by " + maxSupport + "/" + parts.size() + " parts.");

final Set<OperationInterface> externalRequirements = requirements.stream()
.filter(x -> compositeRequirements.containsEntire(x))
.filter(x -> compositeRequirements.containsEntire(x) || compositeProvisions.containsEntire(x))
.collect(Collectors.toSet());

final Set<OperationInterface> externalProvisions = MapMerger.merge(provisions)
.entrySet()
.stream()
.filter(entry -> entry.getValue()
.stream()
.anyMatch(operation -> compositeProvisions.containsEntire(operation)))
.anyMatch(operation -> compositeRequirements.containsEntire(operation) || compositeProvisions.containsEntire(operation)))
.map(entry -> entry.getKey())
.collect(Collectors.toSet());

Expand Down

0 comments on commit 31f0dc3

Please sign in to comment.