@Language annotation for JDK 13 text blocks

John Rose john.r.rose at oracle.com
Sat Feb 8 00:28:04 UTC 2020


On Feb 7, 2020, at 4:23 PM, John Rose <john.r.rose at oracle.com> wrote:
> 
> For now, I think the sweet spot is List.of, Map.of, SQLString.of.

P.S.  If you add some kind of a compile-time checking to SQLString.of,
you can even check for potential injection weaknesses, and issue warnings
or errors at javac time.  In other words, doing things via methods puts
you in the position of receiving more benefits when methods themselves
are enhanced, with extra special treatment at compile time, link time,
etc.  Consider current explorations to do early binding of String.format
based on the format string:  Those are likely to expand into mechanisms
that other types like SQLString can use, IMO.

(The same point goes for any kind of “programmable literal”:  It should
probably be sugar for method calls of some sort.)

Doing a one-off annotation thing on expressions is a dead end by
comparison.


More information about the amber-dev mailing list