Package com.perfectcorp.annotation
Annotation Type GuardedBy
-
@Target({FIELD,METHOD}) @Retention(SOURCE) public @interface GuardedByDenotes that the annotated method or field can only be accessed when holding the referenced lock.Example:
final Object objectLock = new Object(); @GuardedBy("objectLock") volatile Object object; Object getObject() { synchronized (objectLock) { if (object == null) { object = new Object(); } } return object; }
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.Stringvalue
-