On Tue, 1 Nov 2022 12:50:52 GMT, Maurizio Cimadamore <mcimadam...@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

Reply via email to