Update SuppressWarnings hint with full set of diag keys - #9578
Conversation
d0326b5 to
847555a
Compare
lahodaj
left a comment
There was a problem hiding this comment.
I like this. We could, theoretically, either read the values at runtime, or using an AP at compile time, but given the overall context, it feels unnecessarily heavy/complicated. This is relatively straightforward code, that will fail once when we upgrade javac, we fix the code (by copying what the test prints), and all will be fine.
In theory, we could read the data from LintWarnings, rather than parsing the properties, but I think it is easier to parse the properties.
Thanks for fixing this!
|
yeah, originally I hoped to do that at runtime but there was no clean way to grab the mapping. I think its better to have the ugly bits in the junit test - the idea is that this should be easy to maintain on nb-javac updates. Since I am going to forget within 6 month where the keys are from but the test remembers ;) Going to fix a typo and add a few comments + merge. Thanks for review! |
unfortunately there doesn't seem to be a good way to get the diagnostics keys from javac directly and map them to category keys. junit test will check for updates and suggest a code snippet on failure
847555a to
a3cca5d
Compare
unfortunately there doesn't seem to be a good way to get the diagnostics keys from javac directly and map them to category keys.
junit test will check for updates and suggest a code snippet on failure
fixes #9444
fixes #9474