RFR: 7903727: Remove the reliance on String Templates feature

Maurizio Cimadamore mcimadamore at openjdk.org
Mon May 20 10:16:24 UTC 2024


On Mon, 20 May 2024 09:17:22 GMT, Nizar Benalla <nbenalla at openjdk.org> wrote:

> This PR aims to replace the usage of string templates with `String::format`, since there will be no string template feature in JDK 23.
> I tried to keep similar indentation and convert them in-place, to make reviewing the changes easier.

This is a good like-for-like refactoring. I've left comments to improve readability of the code a bit. I think the comments are of two kinds:
* we could move String::format deeper in the call chain, so that call sites could look "cleaner"
* we could use a different way to format messages, more similar to `MessageFormat` where arguments have indices that can be used in the format message (so they can be repeated, reordered, etc.).

Addressing the latter comment is not strictly required as part of this PR, but I believe we might need to do something along these lines to restore at least some level of readability.

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

PR Review: https://git.openjdk.org/jextract/pull/244#pullrequestreview-2065867189


More information about the jextract-dev mailing list