<i18n dev> RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v7]
Jim Laskey
jlaskey at openjdk.org
Wed Nov 2 18:20:39 UTC 2022
On Tue, 1 Nov 2022 12:50:52 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Jim Laskey has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Add @SafeVarargs declarations
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransLiterals.java line 555:
>
>> 553: if (varSym.flags() == (PUBLIC | FINAL | STATIC) &&
>> 554: varSym.name == names.str &&
>> 555: types.isSameType(varSym.owner.type, syms.stringTemplateType)) {
>
> Are you 100% sure that this test works? When we see a statically imported member in Resolve, which is referred to by unqualified name, we "clone" its symbol into the importing class. That is, Resolve will set STR symbol as a symbol whose owner is the class that did the importing, possibly defeating this check. See Resolve::findVar (near the end):
>
>
> if (bestSoFar.kind == VAR && bestSoFar.owner.type != origin.type)
> return bestSoFar.clone(origin);
Absolutely certain.
-------------
PR: https://git.openjdk.org/jdk/pull/10889
More information about the i18n-dev
mailing list