lovubuntu / checker-framework

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

Inherit annotations from overridden methods #333

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, it is necessary to explicitly write annotations on each method, 
including overriding ones; the overriding method must at least as strong as the 
overridden method.

A positive (which is noted by the manual) is that someone reading the source 
code can understand the annotations on a method by reading that method alone.

A negative is that a programmer must write a large number of annotations on 
implementations of hashCode, toString, equals, and other overridden methods 
before getting to the work the user cares about.  This is an irritating way to 
be introduced to the Checker Framework.  Furthermore, stub files become bloated 
by all these annotations.

The negatives seem to outweigh the positives.

Therefore, the Checker Framework should default to inheriting annotations from 
superclasses, for overriding methods.  Optionally, it could have a mode to turn 
this off for people who want explicit annotations, but I'm not sure that is 
even needed.

Original issue reported on code.google.com by michael.ernst@gmail.com on 27 May 2014 at 1:56

GoogleCodeExporter commented 9 years ago

Original comment by wdi...@gmail.com on 27 May 2014 at 3:55