```map.put(UNSUPPORTED, "{0}", TO_STRING)``` <Some...
# compiler
m
Copy code
map.put(UNSUPPORTED, "{0}", TO_STRING)
Some diagnostic messages enclose interpolation argument indices in curly brackets,
Copy code
map.put(NESTED_CLASS_NOT_ALLOWED, "''{0}'' is prohibited here.", TO_STRING)
Some add two pairs of single quotes. What gives? I cannot find any documentation on how to format diagnostic messages.
Oh it’s
java.text.MessageFormat
. I missed the comment, I was expecting there to be an article on it in the docs.
d
It's just a convention, that names in diagnostic messages should be quoted with
''
(which transforms to regular
'
during rendering).
> I was expecting there to be an article on it in the docs Currently the docs about compiler API is in state "it's good if something is there" rather than "it's bad if something isn't there".