Skip to content

Commit

Permalink
fix the logic that marks distributionSet as complete
Browse files Browse the repository at this point in the history
DistributionSets without SoftwareModules shall not be marked as
complete, when no Software Module is assigned

Signed-off-by: Ravindranath Sandeep (INST-IOT/ESW-Imb) <Sandeep.Ravindranath@bosch-si.com>
  • Loading branch information
SandeepAsSmy4kor committed May 9, 2019
1 parent b4ec347 commit fde5b94
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -209,8 +210,12 @@ public void setKey(final String key) {

@Override
public boolean checkComplete(final DistributionSet distributionSet) {
return distributionSet.getModules().stream().map(SoftwareModule::getType).collect(Collectors.toList())
.containsAll(getMandatoryModuleTypes());
List<SoftwareModuleType> smTypes = distributionSet.getModules().stream().map(SoftwareModule::getType)
.collect(Collectors.toList());
if (smTypes.isEmpty()) {
return false;
}
return smTypes.containsAll(getMandatoryModuleTypes());
}

@Override
Expand Down

0 comments on commit fde5b94

Please sign in to comment.