[code-reflection] RFR: Model String Template [v3]

Mourad Abbay mabbay at openjdk.org
Wed Feb 28 18:34:56 UTC 2024


On Wed, 28 Feb 2024 17:36:54 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

>> Mourad Abbay has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update model of String Template
>
> src/java.base/share/classes/java/lang/reflect/code/op/ExtendedOps.java line 3195:
> 
>> 3193:             TypeDefinition processorReturnType = processorValue.type().toTypeDefinition().arguments().get(0);
>> 3194:             return CoreTypeFactory.JAVA_TYPE_FACTORY.constructType(processorReturnType);
>> 3195:         }
> 
> That's a clever way to do it, but for now i recommend passing in the result type to the factory and constructor.
> 
> The other, and more preferred, way to operate on types is to check if the processor value's type is an instance of `JavaType` and then access as that type to obtain the argument type. We will probably revisit this whole area after we have decided how to model Java types.

If we pass resultType, result type will be fixed even if we do transformation that change the processor, e.g. RAW -> STR

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

PR Review Comment: https://git.openjdk.org/babylon/pull/30#discussion_r1506403825


More information about the babylon-dev mailing list