RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v3]
Jim Laskey
jlaskey at openjdk.org
Mon Oct 31 13:54:44 UTC 2022
On Fri, 28 Oct 2022 19:26:20 GMT, Rémi Forax <forax at openjdk.org> wrote:
>> Jim Laskey has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Update TemplateRuntime::combine
>
> src/java.base/share/classes/java/lang/template/TemplateRuntime.java line 79:
>
>> 77: MethodType processorGetterType = MethodType.methodType(ValidatingProcessor.class);
>> 78: ValidatingProcessor<?, ? extends Throwable> processor =
>> 79: (ValidatingProcessor<?, ? extends Throwable>)processorGetter.asType(processorGetterType).invokeExact();
>
> `ValidatingProcessor<?, ?>` should be enough ? No ?
> Using a "? extends Throwable" here make the type unchecked.
That works. Changing.
> src/java.base/share/classes/java/lang/template/TemplateRuntime.java line 88:
>
>> 86: * Manages the boostrapping of {@link ProcessorLinkage} callsites.
>> 87: */
>> 88: private static class TemplateBootstrap {
>
> This class should be `final`
Changing.
> src/java.base/share/classes/java/lang/template/TemplateRuntime.java line 117:
>
>> 115: * Static final processor.
>> 116: */
>> 117: private final ValidatingProcessor<?, ? extends Throwable> processor;
>
> Use `ValidatingProcessor<?, ?>` here
That works. Changing.
> src/java.base/share/classes/java/lang/template/TemplateRuntime.java line 145:
>
>> 143: private TemplateBootstrap(MethodHandles.Lookup lookup, String name, MethodType type,
>> 144: List<String> fragments,
>> 145: ValidatingProcessor<?, ? extends Throwable> processor) {
>
> Use ValidatingProcessor<?, ?> here
That works. Changing.
-------------
PR: https://git.openjdk.org/jdk/pull/10889
More information about the compiler-dev
mailing list