<i18n dev> RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v28]

Jim Laskey jlaskey at openjdk.org
Wed Nov 23 12:58:04 UTC 2022


On Tue, 22 Nov 2022 19:09:12 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Jim Laskey has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Seal Digits
>
> src/java.base/share/classes/java/lang/template/StringTemplate.java line 319:
> 
>> 317:      * This {@link StringProcessor} instance is conventionally used for the string interpolation
>> 318:      * of a supplied {@link StringTemplate}.
>> 319:      * <p>
> 
> It should be mentioned that the string representations are created as if invoking {@link String#valueOf}.
> An perhaps a link/@see to `FMT` for control over formatting.  
> 
> Also include it in the javadoc for `interpolate`.

Changing.

> src/java.base/share/classes/java/util/FormatProcessor.java line 64:
> 
>> 62:  *
>> 63:  * @implSpec Since, values are found within the string template, argument indexing
>> 64:  * specifiers are unsupported.
> 
> What is the behavior of a format that references an index?  Ignored, throw?
> I can see an argument for simplicity, but the values are a sequential list similar to that of a varargs call to format("xx", x, y, z, ...) so it can be well defined to what value an index in the format refers.

Kind of blows the whole concept of embedded expressions. This is one of those, just because you can, doesn't mean you should.

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

PR: https://git.openjdk.org/jdk/pull/10889


More information about the i18n-dev mailing list