If format argument is variable access, generated replacement will be without curly braces.
For example,
String params = "Params";
String result = String.format("%s123", params);
Such code will be transformed into
String params = "Params";
String result = s("$params123");
As you can see, it's wrong way. Variable name with remaining string can be valid java literal. In such cases, generated code is wrong and doesn't compile.
The simplest way to fix it, insert curly braces in any case.
If format argument is variable access, generated replacement will be without curly braces. For example,
Such code will be transformed into
As you can see, it's wrong way. Variable name with remaining string can be valid java literal. In such cases, generated code is wrong and doesn't compile.
The simplest way to fix it, insert curly braces in any case.