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

Emanuel Peter epeter at openjdk.org
Fri May 16 07:14:00 UTC 2025


On Thu, 15 May 2025 14:48:39 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:
>> 
>>   fix typo
>
> Thank you for the refactoring and your patience. I like the result and its simplicity a lot.
> 
> I found a few typos, but otherwise it looks excellent.

@mhaessig @galderz @robcasloz @chhagedorn 
Just again about the naming: I'm really happy with the names now. So thanks 🙏  for pushing me on that, even though it was a little frustrating in the meantime 😅 

- `Template`: the template as your create it with `Template.make`, with zero or more arguments. I was always thinking of this as the true template. It is not in any sense "incomplete" at all, it having free arguments is the core feature, not some kind of "deficiency".
- `template.asToken(..args..)` -> `TemplateToken`. This `TemplateToken` can now only be used as a `Token` inside other `Templates`. This makes a lot of sense, because `Template.body` expects a list of tokens.
- `template.render(..args..)` -> `String`. Going directly from the `Template` with free args, and not exposing the "intermediate state" (with applied args) side-steps the discussion on how this "intermediate state" should be called. We were going on and on about that, and now we don't have to any more :) It is a good lesson for me: try to avoid exposing "intermediate states" to the public API, unless it is really strictly necessary. Good naming for "intermediate states" is tricky.

Anyway: looking forward to your reviews ☺

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

PR Comment: https://git.openjdk.org/jdk/pull/24217#issuecomment-2885850441


More information about the hotspot-compiler-dev mailing list