[string-templates] Automatically imported template processors
Daniel Jarabek
jarabekit at gmail.com
Sat Nov 12 02:36:48 UTC 2022
Hi,
JEP-430 states that "FMT is a public static final automatically imported
in every Java source file". However, this seems to contradict the
javadoc of ValidatingProcessor, which says "The Java compiler
automatically imports StringTemplate#STR" and the current
implementation, which only automatically imports STR.
I assume this was a change made because FMT is more subjective (it uses
Locale.ROOT, which isn't always what is desired) so users should
explicitly choose to use it or use their own instance with a different
Locale.
Assuming this is an intentional change, the incorrect statement should
be removed from the JEP.
-DJ
P.S. I am working on a TemplateProcessor for constructing JavaPoet's
(https://github.com/square/javapoet) CodeBlock object. Would it be
appropriate and/or appreciated if I posted my results/experiences here?
More information about the amber-dev
mailing list