<i18n dev> RFR: JDK-8315457 Implementation of String Templates (Second Preview) [v2]

Jim Laskey jlaskey at openjdk.org
Mon Oct 16 16:54:13 UTC 2023


On Mon, 16 Oct 2023 15:17:10 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

>> Jim Laskey has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Revert source
>>  - Revert @since 22
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java line 1691:
> 
>> 1689:         }
>> 1690: 
>> 1691:         private Type getProcessMethodType(JCStringTemplate tree, Type processorType) {
> 
> This method is basically the same as in `Attr`, correct? I wonder if there's a way to avoid the duplication? One possibility would be to compute the type in `Attr`, and store it in a field on `JCStringTemplate`, and just use it in `Flow`. Alternatively, it could be shared in some class, although only `TreeInfo` and `Resolve` come to mind, and neither seem particularly suitable for that.

I thought of the TreeInfo and Resolve idea but the number of arguments required made it messy. Hanging off of JCStringTemplate seemed like clutter to me.

> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransLiterals.java line 257:
> 
>> 255: 
>> 256:         boolean isNamedProcessor(Name name) {
>> 257:             Symbol sym = switch (processor) {
> 
> Maybe `TreeInfo.symbol(processor)` here?

Only want to allow JCIdent and and JCFieldAcesss. Other expressions can't produce the STR/RAW symbols, but ...

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16202#discussion_r1360965274
PR Review Comment: https://git.openjdk.org/jdk/pull/16202#discussion_r1360962420


More information about the i18n-dev mailing list