01: package tide.annotations;
02:
03: import java.lang.annotation.*;
04:
05: /** Marks the fact that a passed argument is also returned, as in
06: <code>
07: @ReturnAPassedArg("a")
08: public double[] multInPlace(double[] a, double fact)
09: {
10: // ...
11: return a; //same ref!
12: }
13: </code>
14:
15: <br>
16: This is an important hint and contract that may (CURRENTLY NOT IMPL) be verified by static checkers.
17:
18: <br>
19: Note that this has no sense for basic types as {int, double, ...} and String, and immutable classes.
20: */
21: @Retention(RetentionPolicy.RUNTIME)
22: @Target(ElementType.METHOD)
23: public @interface ReturnAPassedArg {
24: /** Name of the passed argument.
25: */
26: String value();
27: }
|