Although there is a bit of speculative language scattered in the JSR 308 materials about runtime enforcement of the rules associated with various annotations, no enforcement mechanism is currently available. That is, JSR 308 (at least in its current incarnation) is all about compiletime, and not about runtime.
Besides the immutability-related annotations of Javari, the JSR 308 kit includes an alternative immutabilty checker, IGJ, and some other annotations for checking:
- Nullness:
@NonNull
and@Nullable
- Interning (whether two objects of which equals is true may be distinct instances):
@Interned
- Locks:
@GuardedBy
and@Holding
No comments:
Post a Comment