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

Emanuel Peter epeter at openjdk.org
Wed May 14 08:24:01 UTC 2025


On Wed, 7 May 2025 11:59:48 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> Emanuel Peter has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 16 commits:
>> 
>>  - Merge branch 'master' into JDK-8344942-TemplateFramework-v3
>>  - Whitespace
>>  - Suggestions by Christian
>>    
>>    Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
>>  - typo
>>  - For Christian: example and more intro
>>  - fix hashtag
>>  - manual merge
>>  - Apply suggestions from code review
>>    
>>    Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
>>  - move library
>>  - Merge branch 'master' into JDK-8344942-TemplateFramework-v3
>>  - ... and 6 more: https://git.openjdk.org/jdk/compare/0844745e...fae7ced6
>
> Next batch of comments. Will probably resume tomorrow :-)

> > @chhagedorn Ok, I tried my best with the `(Un)FilledTemplate` refactoring. I'm still not sure if I want to rename `FilledTemplate` to `RenderableTemplate`, it is not super satisfying for a beginner either. Naming is hard. If anybody else has a better idea than `(Un)FilledTemplate`, please let me know ;)
> > I think one can continue reviewing this now!
> 
> I've just quickly skimmed through this hierarchy. `(Un)FilledTemplate` reminds me a bit of the builder pattern. What about renaming `UnFilledTemplate` to `TemplateBuilder` and `FilledTemplate` to just `Template`?

@galderz Thanks for the comment!

For me both `UnfilledTemplate` and `FilledTemplate` are Templates. The unfilled one has the arguments not yet applied, the filled one has the argument applied. Calling the `UnfilledTemplate` a `TemplateBuilder` seems a little odd, because it is basically already Template, it just has some holes that need to be filled with arguments. In that sense, it is really similar to what the Java String Template was supposed to be.

Personally, I like the explicit naming of `(Un)FilledTemplate`, together with the `fillWith`. This makes it very clear what the "pipeline" is supposed to be.

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

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


More information about the hotspot-compiler-dev mailing list