package <%=packageName%>.web.rest.errors;

import java.util.HashMap;
import java.util.Map;

/**
 * Custom, parameterized exception, which can be translated on the client side.
 * For example:
 *
 * <pre>
 * throw new CustomParameterizedException(&quot;myCustomError&quot;, &quot;hello&quot;, &quot;world&quot;);
 * </pre>
 *
 * Can be translated with:
 *
 * <pre>
 * "error.myCustomError" :  "The server says {{param0}} to {{param1}}"
 * </pre>
 */
public class CustomParameterizedException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private static final String PARAM = "param";

    private final String message;
    private Map<String, String> paramMap;

    public CustomParameterizedException(String message, String... params) {
        super(message);
        this.message = message;
        if (params != null && params.length > 0) {
            this.paramMap = new HashMap<>();
            for (int i = 0; i < params.length; i++) {
                paramMap.put(PARAM + i, params[i]);
            }
        }
    }

    public CustomParameterizedException(String message, Map<String, String> paramMap) {
        super(message);
        this.message = message;
        this.paramMap = paramMap;
    }

    public ParameterizedErrorVM getErrorVM() {
        return new ParameterizedErrorVM(message, paramMap);
    }

}

@@ -646,24 +646,25 @@
 ng message;%0A
+%0A
     private 
@@ -663,16 +663,22 @@
 private 
+final 
 Map%3CStri
@@ -697,16 +697,34 @@
 paramMap
+ = new HashMap%3C%3E()
 ;%0A%0A    p
@@ -905,53 +905,8 @@
 ) %7B%0A
-            this.paramMap = new HashMap%3C%3E();%0A
     
@@ -1207,19 +1207,24 @@
 mMap
- = 
+.putAll(
 paramMap
 ;%0A  
@@ -1219,16 +1219,17 @@
 paramMap
+)
 ;%0A    %7D%0A
@@ -1336,17 +1336,16 @@
 amMap);%0A
+
     %7D%0A
-%0A
 %7D%0A

Change code to make Sonar happy