From 054bff4355eef0538f52595a059a1cd59ddb84ca Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Fri, 15 Nov 2024 11:34:23 +0100 Subject: [PATCH] amendments according to code-review - COMMA_RIGHT_BEFORE_CLOSING_BRACE --- .../hsadminng/hs/office/scenarios/TemplateResolver.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) {