amendments according to code-review - COMMA_RIGHT_BEFORE_CLOSING_BRACE

This commit is contained in:
Michael Hoennig 2024-11-15 11:34:23 +01:00
parent eca01a2f9b
commit 054bff4355

View File

@ -62,7 +62,7 @@ public class TemplateResolver {
abstract String convert(final Object value, final Resolver resolver); 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 static final String IF_NOT_FOUND_SYMBOL = "???";
private final String template; private final String template;
@ -86,7 +86,7 @@ public class TemplateResolver {
} }
private static String removeDanglingCommas(final String withoutDroppedLines) { 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) { private String dropLinesWithNullProperties(final String text) {