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

Emanuel Peter epeter at openjdk.org
Sun Jun 1 05:45:08 UTC 2025


On Fri, 30 May 2025 08:08:20 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> Emanuel Peter has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Merge branch 'JDK-8344942-TemplateFramework-v3' of https://github.com/eme64/jdk into JDK-8344942-TemplateFramework-v3
>>  - move verification
>
> test/hotspot/jtreg/testlibrary_tests/template_framework/examples/TestTutorial.java line 258:
> 
>> 256: 
>> 257:         // Render templateClass to String.
>> 258:         return templateClass.render();
> 
> When printing this, it starts at `var_2` and not `var_1`. Why is that?

The `nextTemplateFrameId` starts at zero, and is incremented for every Template instantiation.
The `templateClass` has `nextTemplateFrameId=1`. If there was any use of `$`, it would append `_1`.
For `template1.asToken(1)` we have  `nextTemplateFrameId=2` -> produces the `var_2`.
Generally, the API does not make any guarantees about what id we give, it is just unique.

Is that ok for you?

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

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


More information about the hotspot-compiler-dev mailing list