diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/TemplateResolver.java b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/TemplateResolver.java index 14fdcbc8..002d0512 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/TemplateResolver.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/TemplateResolver.java @@ -62,7 +62,7 @@ public class TemplateResolver { abstract String convert(final Object value, final Resolver resolver); } - private final static Pattern pattern = Pattern.compile(",(\\s*})", Pattern.MULTILINE); + private static final Pattern COMMA_RIGHT_BEFORE_CLOSING_BRACE = Pattern.compile(",(\\s*})", Pattern.MULTILINE); private static final String IF_NOT_FOUND_SYMBOL = "???"; private final String template; @@ -86,7 +86,7 @@ public class TemplateResolver { } private static String removeDanglingCommas(final String withoutDroppedLines) { - return pattern.matcher(withoutDroppedLines).replaceAll("$1"); + return COMMA_RIGHT_BEFORE_CLOSING_BRACE.matcher(withoutDroppedLines).replaceAll("$1"); } private String dropLinesWithNullProperties(final String text) {