@Documented @Retention(value=RUNTIME) @Target(value={TYPE,CONSTRUCTOR,METHOD}) public @interface Assumes
Assume annotations. It is a
modeling error for an entity to have both an Assumes and an
Assume annotation.
Assume annotations without imposing any
further constraint on the program's implementation.
Assume annotations for the same declaration. The first
places a Starts annotation the no-argument constructor for the IllegalArgumentExcpetion in java.lang. The second places a
Starts annotation on the constructor that takes a single argument of
type long for the WaiterPreferenceSemaphore class in any
package.
package EDU.oswego.cs.dl.util.concurrent;
public class Rendezvous implements Barrier {
@Starts("nothing")
@Assumes( {
@Assume("Starts(nothing) for new() in IllegalArgumentException in java.lang"),
@Assume("Starts(nothing) for new(long) in WaiterPreferenceSemaphore")
})
public Rendezvous(int parties, RendezvousFunction function) {
if (parties <= 0)
throw new IllegalArgumentException();
parties_ = parties;
rendezvousFunction_ = function;
entryGate_ = new WaiterPreferenceSemaphore(parties);
slots_ = new Object[parties];
}
...
}
@annotate tags of the same type (see the example below).
Javadoc annotation can be useful for Java 1.4 code which does not include
language support for annotations.
/**
* @annotate Assume("Starts(nothing) for new() in IllegalArgumentException in java.lang")
* @annotate Assume("Starts(nothing) for new(long) in WaiterPreferenceSemaphore")
*/
public Rendezvous(int parties, RendezvousFunction function) { ... }
AssumeCopyright © 2012 Surelogic, Inc.. All Rights Reserved.