diff --git a/components/apimgt/org.wso2.carbon.apimgt.common.analytics/src/main/java/org/wso2/carbon/apimgt/common/analytics/publishers/impl/AnalyticsDataPublisher.java b/components/apimgt/org.wso2.carbon.apimgt.common.analytics/src/main/java/org/wso2/carbon/apimgt/common/analytics/publishers/impl/AnalyticsDataPublisher.java index 08cc952ad984..7257fa58c939 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.common.analytics/src/main/java/org/wso2/carbon/apimgt/common/analytics/publishers/impl/AnalyticsDataPublisher.java +++ b/components/apimgt/org.wso2.carbon.apimgt.common.analytics/src/main/java/org/wso2/carbon/apimgt/common/analytics/publishers/impl/AnalyticsDataPublisher.java @@ -30,7 +30,6 @@ import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -61,14 +60,10 @@ private List getReporterTypesOrNull(String typeConfig) { if (typeConfig == null || typeConfig.isEmpty()) { return null; } - if (typeConfig.startsWith("[") && typeConfig.endsWith("]")) { - return Arrays.stream(typeConfig.substring(1, typeConfig.length() - 1).split(",")) - .map(String::trim) - .filter(s -> !s.isEmpty()) - .collect(Collectors.toList()); - } else { - return Collections.singletonList(typeConfig); - } + return Arrays.stream(typeConfig.replaceAll("[\\[\\]]", "").split(",")) + .map(String::trim) + .filter(s -> !s.isEmpty()) + .collect(Collectors.toList()); } private List getReportersClassesOrNull(Map configs) {