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

Roberto Castañeda Lozano rcastanedalo at openjdk.org
Thu May 15 08:37:59 UTC 2025


On Wed, 14 May 2025 14:49:24 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> 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`?

Note that I suggest the name `letIn`, not `setIn`. My intuition is that the variant with a third argument binds `key` to `value` **in** the scope of a `function` that is given explicitly, hence the suggestion to call it `letIn` instead of just `let`. But it's just a suggestion, feel free to disregard if you don't think it fits.

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

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


More information about the hotspot-compiler-dev mailing list