RFR: 8344942: Template-Based Testing Framework [v57]
Manuel Hässig
mhaessig at openjdk.org
Fri May 23 09:30:15 UTC 2025
On Fri, 23 May 2025 08:51:09 GMT, Manuel Hässig <mhaessig at openjdk.org> wrote:
>> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Apply suggestions from code review
>>
>> Co-authored-by: Roberto Castañeda Lozano <robcasloz at users.noreply.github.com>
>
> test/hotspot/jtreg/compiler/lib/template_framework/Template.java line 150:
>
>> 148: * {@link Template#make(String, Function)}. For each number of arguments there is an implementation
>> 149: * (e.g. {@link Template.TwoArgs} for two arguments). This allows the use of Generics for the
>> 150: * Template argument types which enables type checking of the Template arguments.
>
> Suggestion:
>
> * (e.g. {@link Template.TwoArgs} for two arguments). This allows the use of generics for the
> * {@link Template} argument types which enables type checking of the {@link Template} arguments.
Perhaps `s/ Template / {@link Template} /g` might be good for consistency.
> test/hotspot/jtreg/testlibrary_tests/template_framework/examples/TestTutorial.java line 627:
>
>> 625: // the current scope.
>> 626: var templateSample = Template.make("type", (DataName.Type type) -> body(
>> 627: let("name", dataNames(MUTABLE).exactOf(type).sample().name()),
>
> Suggestion:
>
> let("name", dataNames(MUTABLE_OR_IMMUTABLE).exactOf(type).sample().name()),
>
> To get all available names you also need immutable names. There is no difference in this case, but this being a tutorial, the semantics should match the explanations.
Then again, the mutability concept is introduced further down. I'm a bit torn...
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24217#discussion_r2104139554
PR Review Comment: https://git.openjdk.org/jdk/pull/24217#discussion_r2104195281
More information about the hotspot-compiler-dev
mailing list