On Fri, 20 Oct 2023 08:52:04 GMT, Raffaello Giulietti <rgiulie...@openjdk.org> 
wrote:

>> Shaojin Wen has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   fix FormatterBuilder testcase handle lineSeparator on windows
>
> src/java.base/share/classes/java/util/FormatProcessor.java line 247:
> 
>> 245:                 throw new MissingFormatArgumentException(group + " is 
>> not immediately followed by an embedded expression");
>> 246:             } else {
>> 247:                 throw new 
>> UnknownFormatConversionException(String.valueOf(c));
> 
> I don't think this exception is thrown by the original code.

I added these tests to show that the exceptions and messages thrown are the 
same as before.


// test/jdk/java/lang/template/FormatterBuilder.java
assertThrows(
        MissingFormatArgumentException.class,
        () -> fmt. "%10ba{ false }",
        "Format specifier '%10b is not immediately followed by an embedded 
expression'");

assertThrows(
        MissingFormatArgumentException.class,
        () ->fmt. "%ba{ false }",
        "Format specifier '%b is not immediately followed by an embedded 
expression'");

assertThrows(
        MissingFormatArgumentException.class,
        () ->fmt. "%b",
        "Format specifier '%b is not immediately followed by an embedded 
expression'");
assertThrows(
        UnknownFormatConversionException.class,
        () ->fmt. "%0",
        "Conversion = '0'");

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/15776#discussion_r1366829200

Reply via email to