From 375b75639bac90d155f4d3b354c33f0188e24ac0 Mon Sep 17 00:00:00 2001 From: Rhys Williams <170514543+Viii3@users.noreply.github.com> Date: Fri, 29 Nov 2024 17:19:02 +0000 Subject: [PATCH] FISH-10146: Apply suggestions. --- .../config/support/DomainXmlPreParser.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/nucleus/admin/config-api/src/main/java/org/glassfish/config/support/DomainXmlPreParser.java b/nucleus/admin/config-api/src/main/java/org/glassfish/config/support/DomainXmlPreParser.java index 1e5c16e80ec..22afbdf17c1 100644 --- a/nucleus/admin/config-api/src/main/java/org/glassfish/config/support/DomainXmlPreParser.java +++ b/nucleus/admin/config-api/src/main/java/org/glassfish/config/support/DomainXmlPreParser.java @@ -48,6 +48,7 @@ import java.util.*; import java.util.logging.Level; import java.util.logging.Logger; +import java.util.stream.Collectors; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; @@ -141,13 +142,11 @@ final List getDGServerNames() { return Collections.emptyList(); } - Set deploymentGroupNeighbours = new HashSet<>(); - deploymentGroups.forEach(groupData -> { - if (groupData.dgServerRefs.contains(instanceName)) { - deploymentGroupNeighbours.addAll(groupData.dgServerRefs); - } - }); - return new ArrayList<>(deploymentGroupNeighbours); + return deploymentGroups + .stream() + .filter(groupData -> groupData.dgServerRefs.contains(instanceName)) + .flatMap(groupData -> groupData.dgServerRefs.stream()) + .collect(Collectors.toList()); } public Map getMapServerConfig() {