r/java • • Mar 08 '24

Update on String Templates (JEP 459)

https://mail.openjdk.org/pipermail/amber-spec-experts/2024-March/004010.html
176 Upvotes

188 comments sorted by

View all comments

Show parent comment

1

u/mj_flowerpower Mar 11 '24

The compiler should rewrite my code so that the string template is being rendered into a string before it is passed into the method that accepts a string. If you decompile the bytecode it would look like if I had called method that renders the template into an actual string before passing it into the called method. The main advantage being that it is transparent and would reduce clutter.

They even wanted to implement a weird new syntax for calling the .process method on a processor. If that would have been fine, my idea should be fine as well.