From c21c1f99854f978ef8cdb74aa26b86aad911ce54 Mon Sep 17 00:00:00 2001 From: Benjamin Weder Date: Mon, 20 Nov 2023 12:46:34 +0100 Subject: [PATCH] Fix checkstyle --- .../winery/repository/splitting/Splitting.java | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/splitting/Splitting.java b/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/splitting/Splitting.java index 650d890027..49e340b967 100644 --- a/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/splitting/Splitting.java +++ b/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/splitting/Splitting.java @@ -1732,7 +1732,6 @@ public ServiceTemplateId completeNextRequirement(ServiceTemplateId id, List blacklist, Map policies) throws - SplittingException { + public TTopologyTemplate getMatchingTopology(TServiceTemplate serviceTemplate, List blacklist, Map policies) throws SplittingException { ProviderRepository repository = new ProviderRepository(); List lowLevelNodeTemplates = getNodeTemplatesWithoutOutgoingHostedOnRelationships(serviceTemplate); List nodesToCheck = new ArrayList<>(); - //Find lowest level nodes with open requirements which means they can be hosted by an other component for (TNodeTemplate nodeTemplateCandidate : lowLevelNodeTemplates) { @@ -1812,12 +1809,12 @@ public TTopologyTemplate getMatchingTopology(TServiceTemplate serviceTemplate, L //get NodeType of NodeTemplate TNodeType matchingType = nodeTypes.get(nt.getType()); - if (matchingType.getTags() == null){ + if (matchingType.getTags() == null) { return true; } // check if NodeType has given Tag -> If it does have the tag it must be set as desrcibed by the policy, otherwise it is ignored List filteredTagList = matchingType.getTags().stream().filter(tag -> tag.getName().equalsIgnoreCase(entry.getKey())).toList(); - if (filteredTagList.size() > 0){ + if (filteredTagList.size() > 0) { return entry.getValue().equalsIgnoreCase(filteredTagList.get(0).getValue()); } return true; @@ -1829,16 +1826,15 @@ public TTopologyTemplate getMatchingTopology(TServiceTemplate serviceTemplate, L // check if suitable nodetemplate already exists in topology, if so reuse it instead of creating new one. assert topologyToComplete != null; boolean suitableNodeTemplateAlreadyExists = false; - for( TNodeTemplate nt: topologyToComplete.getNodeTemplates()){ - if (nt.getType().equals(selectedTemplate.getType())){ + for (TNodeTemplate nt: topologyToComplete.getNodeTemplates()) { + if (nt.getType().equals(selectedTemplate.getType())) { selectedTemplate = nt; suitableNodeTemplateAlreadyExists = true; } } - if (!suitableNodeTemplateAlreadyExists){ + if (!suitableNodeTemplateAlreadyExists) { topologyToComplete.addNodeTemplate(selectedTemplate); } - TRelationshipTemplate newHostedOnRelationship = new TRelationshipTemplate(); String id = UUID.randomUUID().toString(); @@ -1874,6 +1870,4 @@ public TTopologyTemplate getMatchingTopology(TServiceTemplate serviceTemplate, L } return topologyToComplete; } - - }