@Documented @Retention(value=RUNTIME) @Target(value={CONSTRUCTOR,METHOD}) public @interface Starts
Thread.start(),
during the execution of the method or constructor to which this annotation is
applied. We refer to this as the thread effects of the method or constructor.
Presently this annotation has only one legal form,
@Starts("nothing"), that indicates that the
method/constructor does not cause any threads to be started. It is a modeling
error if value() is not "nothing".
Methods that override a method annotated with
@Starts("nothing") must also be explicitly annotated
@Starts("nothing"). It is a modeling error if they are not.
start() to be invoked on any
java.lang.Thread object.
init that promises to start no threads. Because
init() calls the method internalInit() that method must also
promise to start no threads.
class Example {
private Object state;
@Starts("nothing")
public void init() {
internalInit();
}
@Starts("nothing")
private void internalInit() {
state = new Object();
}
}
@annotate tag.
class Example {
private Object state;
/**
* @annotate Starts("nothing")
*/
public void init() {
internalInit();
}
/**
* @annotate Starts("nothing")
*/
private void internalInit() {
state = new Object();
}
}
public abstract String value
"nothing". Additional values are reserved for future use.
The value of this attribute must conform to the following grammar (in Augmented Backus–Naur Form):
value = "nothing"
Copyright © 2012 Surelogic, Inc.. All Rights Reserved.