Fix request handler class error
[appc.git] / appc-common / src / main / java / org / onap / appc / util / MessageFormatter.java
index 71ef406..a46047e 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP : APPC
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Copyright (C) 2017 Amdocs
  * =============================================================================
@@ -18,7 +18,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * 
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
 
@@ -32,13 +31,11 @@ import java.util.regex.Pattern;
 
 public class MessageFormatter {
     private final static String paramNameRegexGroupName = "paramName";
-    private final static String paramRegex = "\\$\\{(?<paramName>[^}$]+)\\}"; // 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 = "\\$\\{(?<paramName>[^}$]+)\\}";
 
     public static String format(String messageTemplate, Map<String, Object> params) {
         if (StringUtils.isEmpty(messageTemplate))
@@ -69,7 +66,7 @@ public class MessageFormatter {
     public static List<String> getParamsNamesList(String messageTemplate) {
         List<String> paramsNames = null;
         if (!StringUtils.isEmpty(messageTemplate)) {
-            paramsNames = new ArrayList<String>();
+            paramsNames = new ArrayList<>();
             Matcher m = Pattern.compile(paramRegex).matcher(messageTemplate);
             while (m.find()) {
                 String paramName = m.group(paramNameRegexGroupName);