In the attached code, this warning is issued:
warning: [keyfor.value.parameter.variable.name] The @KeyFor annotation value
someField on parameter 1 of method hasBody may be a parameter name. If so, to
avoid ambiguity please replace it with # followed by the parameter number
corresponding to it. For fields, please use the format this.fieldName or
classname.fieldName.
There are three problems with this:
1. If a warning message is produced, it should be produced at most once. This
message is 4 times for method hasBody, but zero times for method noBody, even
though it refers to the declaration of the parameter.
2. The Checker Framework should not require programmers to write a long name
when a shorter one is unambiguous, as in this case.
3. The Checker Framework should not use the ambiguous wording "may be a
parameter name". The Checker Framework can definitively determine whether the
annotation name is a parameter name or not. If it isn't, then the Checker
Framework should not issue the warning.
Original issue reported on code.google.com by michael.ernst@gmail.com on 19 Mar 2015 at 2:39
Original issue reported on code.google.com by
michael.ernst@gmail.com
on 19 Mar 2015 at 2:39Attachments: