A shallow analysis that determines for each new object that is created within a method
if it escapes the scope of the method.
An object escapes the scope of a method if:
... it is assigned to a field,
... it is passed to a method,
... it is stored in an array,
... it is returned,
... the object itself leaks it's self reference (this) by:
... storing this in some static field or,
... storing it's self reference in a data-structure (another object or array)
passed to it (by assigning to a field or calling a method),
... if a superclass leaks the self reference.
This analysis can be used as a foundation for an analysis that determines whether
all instances created for a specific class never escape the creating method and,
hence, respective types cannot occur.
A shallow analysis that determines for each new object that is created within a method if it escapes the scope of the method.
An object escapes the scope of a method if:
this) by:thisin some static field or,This analysis can be used as a foundation for an analysis that determines whether all instances created for a specific class never escape the creating method and, hence, respective types cannot occur.