Many annotations are referentially @Opaque
By jglick on Sep 24, 2008
Often Java elements (such as classes or methods) have meaning beyond their "denotational semantics": the name (or, occasionally, just presence) of the element itself is significant to how the application runs, beyond simple references from other Java source code. For example, a field marked with
@javax.persistence.Column cannot be freely renamed or shuffled around according to traditional refactoring tools.
It would be great if there were a consistent way to mark these kinds of annotations. Authors of Java frameworks could then indicate to tools that Java elements marked with them need to be treated conservatively.
My suggestion is to introduce a meta-annotation (i.e. annotation placed on other annotations):
@Opaque. Here is source code for the annotation and some possible example usages.