But the security problems that string interpolation introduces are one of the reasons why Java has decided to reject string interpolation as a language feature in favour of string templates (you can use string templates for interpolation as a special case of a template processor, but that's not the feature's raison d'être). The reason for string templates is to improve the convenience and (very poor) security of string manipulation.
The JEP explains why Java is getting string templates and is not getting string interpolation (as a language feature).
The JEP explains why Java is getting string templates and is not getting string interpolation (as a language feature).