diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java b/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java index 3b84660972..d73a66d310 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java @@ -112,18 +112,15 @@ public final class ComponentConfig { return entityInfos; } + /** + * Provides the list of all the keystore information available in components. + * + * @return a list of keystore information + */ public static List getAllKeystoreInfos() { - return getAllKeystoreInfos(null); - } - - public static List getAllKeystoreInfos(String componentName) { - List keystoreInfos = new ArrayList<>(); - for (ComponentConfig cc : getAllComponents()) { - if (componentName == null || componentName.equals(cc.getComponentName())) { - keystoreInfos.addAll(cc.getKeystoreInfos()); - } - } - return keystoreInfos; + return getAllComponents().stream() + .flatMap(cc -> cc.getKeystoreInfos().stream()) + .collect(Collectors.toList()); } public static List getAllServiceResourceInfos(String type) {