@Test void shouldNotTryToEscapeNullNames() { assertThat(RenderingVisitor.escapeName(null)).isEmpty(); }
static Optional<String> escapeName(CharSequence unescapedName) { if (unescapedName == null) { return Optional.empty(); } Matcher matcher = LABEL_AND_TYPE_QUOTATION.matcher(unescapedName); return Optional.of(String.format(Locale.ENGLISH, "`%s`", matcher.replaceAll("``"))); }
RenderingVisitor extends ReflectiveVisitor { static Optional<String> escapeName(CharSequence unescapedName) { if (unescapedName == null) { return Optional.empty(); } Matcher matcher = LABEL_AND_TYPE_QUOTATION.matcher(unescapedName); return Optional.of(String.format(Locale.ENGLISH, "`%s`", matcher.replaceAll("``"))); } }
RenderingVisitor extends ReflectiveVisitor { static Optional<String> escapeName(CharSequence unescapedName) { if (unescapedName == null) { return Optional.empty(); } Matcher matcher = LABEL_AND_TYPE_QUOTATION.matcher(unescapedName); return Optional.of(String.format(Locale.ENGLISH, "`%s`", matcher.replaceAll("``"))); }  }
RenderingVisitor extends ReflectiveVisitor { static Optional<String> escapeName(CharSequence unescapedName) { if (unescapedName == null) { return Optional.empty(); } Matcher matcher = LABEL_AND_TYPE_QUOTATION.matcher(unescapedName); return Optional.of(String.format(Locale.ENGLISH, "`%s`", matcher.replaceAll("``"))); }  String getRenderedContent(); }
RenderingVisitor extends ReflectiveVisitor { static Optional<String> escapeName(CharSequence unescapedName) { if (unescapedName == null) { return Optional.empty(); } Matcher matcher = LABEL_AND_TYPE_QUOTATION.matcher(unescapedName); return Optional.of(String.format(Locale.ENGLISH, "`%s`", matcher.replaceAll("``"))); }  String getRenderedContent();  }