From 0945bc95ad1eb147c1ddf3d2069ad9a531838649 Mon Sep 17 00:00:00 2001 From: jhh Date: Mon, 14 Jun 2021 17:20:51 -0500 Subject: Use re2j pattern for sonar vulnerabilities Issue-ID: POLICY-3289 Signed-off-by: jhh Change-Id: Id6d58b5c8ac5f7715286f21274ccf5eea9155fd2 --- .../src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'feature-lifecycle/src/main') diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java index 5882025a..0e602ec5 100644 --- a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java +++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java @@ -21,6 +21,7 @@ package org.onap.policy.drools.lifecycle; +import com.google.re2j.Pattern; import java.lang.reflect.InvocationTargetException; import java.time.Instant; import java.util.ArrayList; @@ -82,6 +83,7 @@ public class LifecycleFsm implements Startable { public static final long DEFAULT_STATUS_TIMER_SECONDS = 120L; private static final Logger logger = LoggerFactory.getLogger(LifecycleFsm.class); + private static final Pattern COMMA_SPACE_PAT = Pattern.compile("\\s*,\\s*"); protected static final String CONFIGURATION_PROPERTIES_NAME = "feature-lifecycle"; protected static final String GROUP_NAME = "lifecycle.pdp.group"; @@ -171,7 +173,7 @@ public class LifecycleFsm implements Startable { String commaSeparatedPolicyTypes = properties.getProperty(MANDATORY_POLICY_TYPES); if (!StringUtils.isBlank(commaSeparatedPolicyTypes)) { - Collections.addAll(mandatoryPolicyTypes, commaSeparatedPolicyTypes.split("\\s*,\\s*")); + Collections.addAll(mandatoryPolicyTypes, COMMA_SPACE_PAT.split(commaSeparatedPolicyTypes)); } logger.info("The mandatory Policy Types are {}. Compliance is {}", -- cgit 1.2.3-korg