RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v53]
Jim Laskey
jlaskey at openjdk.org
Tue Apr 4 16:01:42 UTC 2023
On Tue, 4 Apr 2023 15:31:12 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:
>>
>> RuntimeException is the only exception type that can is deduced from a lambda.
>
> src/java.base/share/classes/java/lang/StringTemplate.java line 577:
>
>> 575: */
>> 576: static <R> Processor<R, RuntimeException> of(Function<StringTemplate, R> process) {
>> 577: return process::apply;
>
> The wildcards are missing :)
>
> static <R> Processor<R, RuntimeException> of(Function<? super StringTemplate, ? extends R> process) {
Changing
> src/java.base/share/classes/java/lang/runtime/StringTemplateImpl.java line 100:
>
>> 98: try {
>> 99: return (List<Object>)valuesMH.invokeExact(this);
>> 100: } catch (Throwable ex) {
>
> Errors likes OutOfMemoryError and runtime exception should be rethrown instead of being wrapped
Changing
> src/java.base/share/classes/java/lang/runtime/StringTemplateImpl.java line 109:
>
>> 107: try {
>> 108: return (String)interpolateMH.invokeExact(this);
>> 109: } catch (Throwable ex) {
>
> see above
Changing
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/10889#discussion_r1157464394
PR Review Comment: https://git.openjdk.org/jdk/pull/10889#discussion_r1157459830
PR Review Comment: https://git.openjdk.org/jdk/pull/10889#discussion_r1157460255
More information about the core-libs-dev
mailing list