X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=appc-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fappc%2Futil%2FMessageFormatter.java;h=ba56867a0430fafb361e4cf6175af20e39b6673a;hb=f6f366b5532c51d9166ed68073f611097aec1db4;hp=71ef40641342266568ef4ecb5780ed997e8cc269;hpb=51d88e957a81396a26c909dda6ab05d48decc643;p=appc.git diff --git a/appc-common/src/main/java/org/onap/appc/util/MessageFormatter.java b/appc-common/src/main/java/org/onap/appc/util/MessageFormatter.java index 71ef40641..ba56867a0 100644 --- a/appc-common/src/main/java/org/onap/appc/util/MessageFormatter.java +++ b/appc-common/src/main/java/org/onap/appc/util/MessageFormatter.java @@ -32,13 +32,11 @@ import java.util.regex.Pattern; public class MessageFormatter { private final static String paramNameRegexGroupName = "paramName"; - private final static String paramRegex = "\\$\\{(?[^}$]+)\\}"; // start with ${ and - // after there is one - // or more characters - // that are not $ and - // not } and ended - // with } + /** + * start with ${ and after there is one or more characters that are not $ and not } and ended with } + */ + private final static String paramRegex = "\\$\\{(?[^}$]+)\\}"; public static String format(String messageTemplate, Map params) { if (StringUtils.isEmpty(messageTemplate)) @@ -69,7 +67,7 @@ public class MessageFormatter { public static List getParamsNamesList(String messageTemplate) { List paramsNames = null; if (!StringUtils.isEmpty(messageTemplate)) { - paramsNames = new ArrayList(); + paramsNames = new ArrayList<>(); Matcher m = Pattern.compile(paramRegex).matcher(messageTemplate); while (m.find()) { String paramName = m.group(paramNameRegexGroupName);