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

Galder Zamarreño galder at openjdk.org
Fri May 16 05:30:03 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.

Thanks for the clarification. Given that explanation `TemplateBuilder` is not right. What about `PartialTemplate` instead of `UnfilledTemplate`? It's a template that is not yet complete since it has holes that need to be filled in, so it sound like a partially built template, hence `PartialTemplate`. To me it sounds better than `UnfilledTemplate`. Then, I would just rename `FilledTemplate` to `Template` since it's a complete template with all it needs so I don't think there's a need to add `Filled` to it. And I don't think `CompleteTemplate` is a good name either. Simply `Template`.

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

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


More information about the hotspot-compiler-dev mailing list