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

Emanuel Peter epeter at openjdk.org
Mon May 12 09:50:36 UTC 2025


On Wed, 7 May 2025 20:37:27 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> test/hotspot/jtreg/testlibrary_tests/template_framework/examples/TestTutorial.java line 143:
>> 
>>> 141:                 public static void main() {
>>> 142:             """,
>>> 143:                     templateHello.withArgs(),
>> 
>> `withArgs()` looks strange when there are no args. Could we find a better name for it? But maybe I'm missing a pattern here.
>
> Hmm, yeah, that is a slight concern. But it does return a `TemplateWithArgs`, which means a template that knows all the arguments already. This one happens to be a zero-arg version.
> 
> I suppose I could rename it to `withArgsNone()` or `withZeroArgs` or `withNoArgs` for the zero-args version? Would that be an improvement?

I will do the refactoring we discussed offline, with `UnfilledTemplate` and `FilledTemplate`. And `Template.make` with zero args directly generates a FilledTemplate.

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

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


More information about the hotspot-compiler-dev mailing list