|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=SOURCE) public @interface ImplementationAssumption
States an assumption made by the annotated element's implementation. Assumptions are statements that are considered true for the purpose of writing code but whose truth is unknown.
The long term vision is that an automatic tool can process the source code to collect the assumptions made, permitting efficient review in case requirements change. Even in the absence of such a tool, source code information systems such as eclipse can efficiently search assumptions.
Assumption bear some similarity with "to do" items, but differ in that they are conditional: An assumption only needs to be removed if it is false. In contrast, a "to do" item needs to be taken care of unconditionally.
Assumptions that can easily be formulated as Java expressions should be stated as assertions/preconditions instead (to enable runtime checking).
Assumptions document code, not behavior, and are therefore not included in the API documentation. Like comments, they are discarded by the compiler.
@assumes("the name uniquely identifies a person") Object getKey() {return this.name;}
Reject
Required Element Summary | |
---|---|
String |
value
text describing the assumption. |
Element Detail |
---|
public abstract String value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |