RFR: 8344942: Template-Based Testing Framework [v16]

Emanuel Peter epeter at openjdk.org
Wed May 14 14:51:58 UTC 2025


On Wed, 14 May 2025 13:20:00 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:

>> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   more documentation fixes
>
> test/hotspot/jtreg/compiler/lib/template_framework/Template.java line 394:
> 
>> 392:      * @throws RendererException if there is a duplicate hashtag {@code key}.
>> 393:      */
>> 394:     static <T> TemplateBody let(String key, T value, Function<T, TemplateBody> function) {
> 
> I found it a bit confusing to find two methods called `let` that are pretty different in nature. Maybe you could rename this one to e.g. `letIn`?

@robcasloz They do pretty much the same though, they allow you to set a hashtag replacement. It is just a question of where you can place it, and if it captures the value in a Java variable as well.

What do you mean to suggest with the name `setIn`?

> test/hotspot/jtreg/compiler/lib/template_framework/Template.java line 461:
> 
>> 459:      * @param name The {@link Name} to be added to the current code frame.
>> 460:      * @return The token that performs the defining action.
>> 461:      */
> 
> The concept of "code frame" is not clear here, maybe you can introduce it or replace it by a concept that is already defined?

I specified it a little:

~ 453      * Add a {@link Name} in the current scope, i.e. the innermost of either
+ 454      * {@link Template#body} or {@link Hook#set}.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24217#discussion_r2089135773
PR Review Comment: https://git.openjdk.org/jdk/pull/24217#discussion_r2089132856


More information about the hotspot-compiler-dev mailing list