This is an automated email from the ASF dual-hosted git repository. amichair pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/aries-rsa.git
commit f9b413a7a6c7db474173415ae5ce7e4aabc9ccae Author: Amichai Rothman <[email protected]> AuthorDate: Sun Mar 29 15:23:26 2026 +0300 Refactor RemoteServiceAdminCore property copying --- .../apache/aries/rsa/core/RemoteServiceAdminCore.java | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/rsa/src/main/java/org/apache/aries/rsa/core/RemoteServiceAdminCore.java b/rsa/src/main/java/org/apache/aries/rsa/core/RemoteServiceAdminCore.java index ad61786a..d89d8991 100644 --- a/rsa/src/main/java/org/apache/aries/rsa/core/RemoteServiceAdminCore.java +++ b/rsa/src/main/java/org/apache/aries/rsa/core/RemoteServiceAdminCore.java @@ -33,6 +33,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.stream.Collectors; import org.apache.aries.rsa.core.event.EventProducer; import org.apache.aries.rsa.spi.DistributionProvider; @@ -559,8 +560,9 @@ public class RemoteServiceAdminCore implements RemoteServiceAdmin { protected Map<String, Object> createEndpointProps(Map<String, Object> effectiveProps, List<String> configTypes, Class<?>[] ifaces) { - Map<String, Object> props = new HashMap<>(); - copyEndpointProperties(effectiveProps, props); + Map<String, Object> props = effectiveProps.entrySet().stream() + .filter(e -> !e.getKey().startsWith(".")) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); props.remove(Constants.SERVICE_ID); props.put(RemoteConstants.SERVICE_EXPORTED_CONFIGS, configTypes); String[] inames = Arrays.stream(ifaces).map(Class::getName).toArray(String[]::new); @@ -576,16 +578,6 @@ public class RemoteServiceAdminCore implements RemoteServiceAdmin { return props; } - private void copyEndpointProperties(Map<String, Object> sd, Map<String, Object> endpointProps) { - Set<Map.Entry<String, Object>> keys = sd.entrySet(); - for (Map.Entry<String, Object> entry : keys) { - String skey = entry.getKey(); - if (!skey.startsWith(".")) { - endpointProps.put(skey, entry.getValue()); - } - } - } - private void checkPermission(EndpointPermission permission) { SecurityManager sm = System.getSecurityManager(); if (sm != null) {
