Closed GoogleCodeExporter closed 9 years ago
Hi Clovis,
this is not a problem with the Checker Framework.
The @NonNull annotation from org.eclipse.jdt.annotation is a declaration
annotation and cannot be used in that syntactic location.
You will get the same error message if you use the standard Java 8 compiler
with this source code.
You must use a type annotation in that location.
Does this help?
cu, WMD.
Original comment by wdi...@gmail.com
on 25 Sep 2014 at 6:56
I have added the following text to the "Troubleshooting" chapter of the manual.
The error
error: annotation type not applicable to this kind of declaration
... List<@NonNull String> ...
indicates that you are using a definition of @NonNull that is a declaration
annotation, which cannot be used in that syntactic location. For example, many
legacy annotations such as those listed in Figure 3.2 are declaration
annotations. You can fix the problem by instead using a definition of @NonNull
that is a type annotation, such as the Checker Framework’s annotations; often
this only requires changing an import statement. Alternately, if you wish to
continue using the legacy annotations in declaration locations, see Section
22.3.5.
Original comment by michael.ernst@gmail.com
on 29 Sep 2014 at 9:21
Original issue reported on code.google.com by
ClovisSe...@gmail.com
on 25 Sep 2014 at 6:42