biddyweb / checker-framework

Automatically exported from code.google.com/p/checker-framework
Other
0 stars 1 forks source link

Warning "Annotation value ... may be a parameter name" #413

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by jtha...@cs.washington.edu on 16 Apr 2015 at 9:24

GoogleCodeExporter commented 9 years ago

Original comment by jtha...@cs.washington.edu on 18 Apr 2015 at 6:42