@Test public void testTrailingFormatNotSupportedInBraceFormat() { try { PARSER.parseBraceFormatTerm(null, 0, "{0:x}", 0, 3, 5); fail("expected ParseException"); } catch (ParseException expected) { assertThat(expected.getMessage()).contains("[:x]"); } }
@Override public void parseBraceFormatTerm( MessageBuilder<?> builder, int index, String message, int termStart, int formatStart, int termEnd) throws ParseException { if (formatStart != -1) { throw ParseException.withBounds( "the default brace style parser does not allow trailing format specifiers", message, formatStart - 1, termEnd - 1); } builder.addParameter(termStart, termEnd, BraceStyleParameter.of(index)); }
DefaultBraceStyleMessageParser extends BraceStyleMessageParser { @Override public void parseBraceFormatTerm( MessageBuilder<?> builder, int index, String message, int termStart, int formatStart, int termEnd) throws ParseException { if (formatStart != -1) { throw ParseException.withBounds( "the default brace style parser does not allow trailing format specifiers", message, formatStart - 1, termEnd - 1); } builder.addParameter(termStart, termEnd, BraceStyleParameter.of(index)); } }
DefaultBraceStyleMessageParser extends BraceStyleMessageParser { @Override public void parseBraceFormatTerm( MessageBuilder<?> builder, int index, String message, int termStart, int formatStart, int termEnd) throws ParseException { if (formatStart != -1) { throw ParseException.withBounds( "the default brace style parser does not allow trailing format specifiers", message, formatStart - 1, termEnd - 1); } builder.addParameter(termStart, termEnd, BraceStyleParameter.of(index)); } private  DefaultBraceStyleMessageParser(); }
DefaultBraceStyleMessageParser extends BraceStyleMessageParser { @Override public void parseBraceFormatTerm( MessageBuilder<?> builder, int index, String message, int termStart, int formatStart, int termEnd) throws ParseException { if (formatStart != -1) { throw ParseException.withBounds( "the default brace style parser does not allow trailing format specifiers", message, formatStart - 1, termEnd - 1); } builder.addParameter(termStart, termEnd, BraceStyleParameter.of(index)); } private  DefaultBraceStyleMessageParser(); static BraceStyleMessageParser getInstance(); @Override void parseBraceFormatTerm(
      MessageBuilder<?> builder,
      int index,
      String message,
      int termStart,
      int formatStart,
      int termEnd); }
DefaultBraceStyleMessageParser extends BraceStyleMessageParser { @Override public void parseBraceFormatTerm( MessageBuilder<?> builder, int index, String message, int termStart, int formatStart, int termEnd) throws ParseException { if (formatStart != -1) { throw ParseException.withBounds( "the default brace style parser does not allow trailing format specifiers", message, formatStart - 1, termEnd - 1); } builder.addParameter(termStart, termEnd, BraceStyleParameter.of(index)); } private  DefaultBraceStyleMessageParser(); static BraceStyleMessageParser getInstance(); @Override void parseBraceFormatTerm(
      MessageBuilder<?> builder,
      int index,
      String message,
      int termStart,
      int formatStart,
      int termEnd);  }