ctolkmit / checker-framework

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

Warn if @DefaultQualifier is used where @DefaultQualifierInHierarchy should be used #305

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The @DefaultQualifier and @DefaultQualifierInHierarchy annotations have very 
similar names, so it is easy to misuse one where the other is necessary.

It would be good for the Checker Framework to issue an error message if 
@DefaultQualifier is written on an annotation definition.

Here are two ways this could be done:

 * when compiling an annotation (@interface) definition, issue a warning if it is meta-annotated with @DefaultQualifier.  This is the most direct approach, but an annotation definition is not necessarily compiled using a pluggable type-checker.

 * when using a pluggable type-checker, whenever an annotation is used, determine its meta-annotations and issue a warning if those include @DefaultQualifier.

Original issue reported on code.google.com by mer...@cs.washington.edu on 24 Mar 2014 at 4:50