@Documented @Retention(value=RUNTIME) @Target(value=FIELD) public @interface BorrowedInRegion
trueand we have write access to its complete state. A @BorrowedInRegion field must be
finaland cannot be
This annotation differs from
Borrowed only with regard to the region
the state referenced by the annotated field is mapped into. This annotation
declares that the
Instance region of the object referenced by the
annotated field is mapped into a named region of the object that contains the
Borrowed maps the state into the
region of the object that contains the annotated field.
Therefore, the two
annotations below on the
friends field are equivalent.
@Borrowed private final Set<Person> friends; // initialized in constructor @BorrowedInRegion("Instance") private final Set<Person> friends; // initialized in constructorIn addition, a more complex syntax is allowed where regions of the object referenced by the annotated field are explicitly mapped to regions of the object that contains the annotated field. Using this syntax the annotation below is equivalent to the two previous examples.
@BorrowedInRegion("Instance into Instance") private final Set<Person> friends; // initialized in constructorThis syntax should be rare in practice, however we show an example of its use in the Examples section below.
Borrowed fields are not currently assured by analysis.
public abstract String value
value = regionSpecification / regionMapping *("," regionMapping) regionMapping = simpleRegionSpecification "into" regionSpecification regionSpecification = simpleRegionSpecificaion / qualifiedRegionName simpleRegionSpecification = IDENTIFIER ; Region of the class being annotated qualifedRegionName = IDENTIFIER *("." IDENTIFIER) : IDENTIFER ; Static region from the named, optionally qualified, class IDENTIFIER = Legal Java Identifier
A into B, the first RegionSpecification is relative to the
object referenced by the field; the second is relative to the object that
contains the field.
Copyright © 2012 Surelogic, Inc.. All Rights Reserved.