Class ConditionalFlowInfo
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.flow.FlowInfo
org.aspectj.org.eclipse.jdt.internal.compiler.flow.ConditionalFlowInfo
Record conditional initialization status during definite assignment analysis
-
Field Summary
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.flow.FlowInfo
DEAD_END, FREE_TYPEVARIABLE, NON_NULL, NULL, NULL_FLAG_MASK, POTENTIALLY_NON_NULL, POTENTIALLY_NULL, POTENTIALLY_UNKNOWN, REACHABLE, tagBits, UNKNOWN, UNREACHABLE, UNREACHABLE_BY_NULLANALYSIS, UNREACHABLE_OR_DEAD, UNROOTED
-
Method Summary
Modifier and TypeMethodDescriptionaddInitializationsFrom(FlowInfo otherInits)
Add other inits to this flow info, then return this.addNullInfoFrom(FlowInfo otherInits)
Add all null information from otherInits to this flow info and return this.addPotentialInitializationsFrom(FlowInfo otherInits)
Compose other inits over this flow info, then return this.copy()
Return a deep copy of the current instance.boolean
hasNullInfoFor(LocalVariableBinding local)
Check if any null info has been recorded for a given local variable.Return the flow info that would result from the path associated to the value false for the condition expression that generated this flow info.Return the flow info that would result from the path associated to the value true for the condition expression that generated this flow info.boolean
isDefinitelyAssigned(FieldBinding field)
Check status of definite assignment for a field.boolean
Check status of definite assignment for a local.boolean
Check status of definite non-null value for a given local variable.boolean
isDefinitelyNull(LocalVariableBinding local)
Check status of definite null value for a given local variable.boolean
Check status of definite unknown value for a given local variable.boolean
isPotentiallyAssigned(FieldBinding field)
Check status of potential assignment for a field.boolean
Check status of potential assignment for a local variable.boolean
Check status of potential null assignment for a local.boolean
Check status of potential null assignment for a local.boolean
Return true if the given local may have been assigned to an unknown value.boolean
Return true if the given local is protected by a test against a non null value.boolean
isProtectedNull(LocalVariableBinding local)
Return true if the given local is protected by a test against null.void
Record that a local variable got checked to be non null.void
Record that a local variable got checked to be null.void
markAsDefinitelyAssigned(FieldBinding field)
Record a field got definitely assigned.void
Record a local got definitely assigned.void
Record a local got definitely assigned to a non-null value.void
Record a local got definitely assigned to null.void
Record a local got definitely assigned to an unknown value.void
Record a local may have got assigned to non-null (set the bit on existing info).void
Record a local may have got assigned to null (set the bit on existing info).void
Record a local may have got assigned to unknown (set the bit on existing info).mergeDefiniteInitsWith(UnconditionalFlowInfo otherInits)
mergedWith(UnconditionalFlowInfo otherInits)
Return the intersection of this and otherInits, that is one of: the receiver updated in the following way: intersection of definitely assigned variables, union of potentially assigned variables, similar operations for null, or the receiver or otherInits if the other one is non reachable. otherInits is not affected, and is not returned either (no need to protect the result).Return a copy of this unconditional flow info, deprived from its null info.void
Resets the definite and potential initialization info for the given local variablevoid
resetNullInfo(LocalVariableBinding local)
Reset all null-information about a given local.Return a flow info that carries the same information as the result ofinitsWhenTrue
, but warrantied to be different from this.
Caveat: side effects on the result may affect components of this.setReachMode(int reachMode)
Set this flow info reach mode and return this.toString()
Return a new flow info that holds the same information as this would after a call to unconditionalInits, but leaving this info unaffected.Return a new flow info that holds the same information as this would after a call tounconditionalInits
followed by the erasure of fields specific information, but leaving this flow info unaffected.Return a flow info that merges the possible paths of execution described by this flow info.Return a new flow info that holds the same information as this would after a call tounconditionalInits
, but leaving this info unaffected.Methods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.flow.FlowInfo
cannotBeDefinitelyNullOrNonNull, cannotBeNull, canOnlyBeNull, conditional, initial, markNullStatus, mergedOptimizedBranches, mergedOptimizedBranchesIfElse, mergeNullStatus, nullStatus, reachMode, tagBitsToNullStatus
-
Field Details
-
initsWhenTrue
-
initsWhenFalse
-
-
Method Details
-
addInitializationsFrom
Description copied from class:FlowInfo
Add other inits to this flow info, then return this. The operation semantics are to match as closely as possible the application to this flow info of all the operations that resulted into otherInits.- Specified by:
addInitializationsFrom
in classFlowInfo
- Parameters:
otherInits
- other inits to add to this- Returns:
- this, modified according to otherInits information
-
addNullInfoFrom
Description copied from class:FlowInfo
Add all null information from otherInits to this flow info and return this. The operation models the effect of an unconditional sequence of this flow info and otherInits.- Specified by:
addNullInfoFrom
in classFlowInfo
-
addPotentialInitializationsFrom
Description copied from class:FlowInfo
Compose other inits over this flow info, then return this. The operation semantics are to wave into this flow info the consequences of a possible path into the operations that resulted into otherInits. The fact that this path may be left unexecuted under peculiar conditions results into less specific results thanaddInitializationsFrom
.- Specified by:
addPotentialInitializationsFrom
in classFlowInfo
- Parameters:
otherInits
- other inits to compose over this- Returns:
- this, modified according to otherInits information
-
asNegatedCondition
- Overrides:
asNegatedCondition
in classFlowInfo
-
copy
Description copied from class:FlowInfo
Return a deep copy of the current instance. -
initsWhenFalse
Description copied from class:FlowInfo
Return the flow info that would result from the path associated to the value false for the condition expression that generated this flow info. May be this flow info if it is not an instance ofConditionalFlowInfo
. May have a side effect on subparts of this flow info (subtrees get merged).- Specified by:
initsWhenFalse
in classFlowInfo
- Returns:
- the flow info associated to the false branch of the condition that generated this flow info
-
initsWhenTrue
Description copied from class:FlowInfo
Return the flow info that would result from the path associated to the value true for the condition expression that generated this flow info. May be this flow info if it is not an instance ofConditionalFlowInfo
. May have a side effect on subparts of this flow info (subtrees get merged).- Specified by:
initsWhenTrue
in classFlowInfo
- Returns:
- the flow info associated to the true branch of the condition that generated this flow info
-
isDefinitelyAssigned
Description copied from class:FlowInfo
Check status of definite assignment for a field.- Specified by:
isDefinitelyAssigned
in classFlowInfo
-
isDefinitelyAssigned
Description copied from class:FlowInfo
Check status of definite assignment for a local.- Specified by:
isDefinitelyAssigned
in classFlowInfo
-
isDefinitelyNonNull
Description copied from class:FlowInfo
Check status of definite non-null value for a given local variable.- Specified by:
isDefinitelyNonNull
in classFlowInfo
- Parameters:
local
- the variable to ckeck- Returns:
- true iff local is definitely non null for this flow info
-
isDefinitelyNull
Description copied from class:FlowInfo
Check status of definite null value for a given local variable.- Specified by:
isDefinitelyNull
in classFlowInfo
- Parameters:
local
- the variable to ckeck- Returns:
- true iff local is definitely null for this flow info
-
isDefinitelyUnknown
Description copied from class:FlowInfo
Check status of definite unknown value for a given local variable.- Specified by:
isDefinitelyUnknown
in classFlowInfo
- Parameters:
local
- the variable to ckeck- Returns:
- true iff local is definitely unknown for this flow info
-
hasNullInfoFor
Description copied from class:FlowInfo
Check if any null info has been recorded for a given local variable. Here even recording of 'UNKNOWN' is considered as null info.- Specified by:
hasNullInfoFor
in classFlowInfo
-
isPotentiallyAssigned
Description copied from class:FlowInfo
Check status of potential assignment for a field.- Specified by:
isPotentiallyAssigned
in classFlowInfo
-
isPotentiallyAssigned
Description copied from class:FlowInfo
Check status of potential assignment for a local variable.- Specified by:
isPotentiallyAssigned
in classFlowInfo
-
isPotentiallyNonNull
Description copied from class:FlowInfo
Check status of potential null assignment for a local. Return true if there is a reasonable expectation that the variable be non null at this point.- Specified by:
isPotentiallyNonNull
in classFlowInfo
- Parameters:
local
- LocalVariableBinding - the binding for the checked local- Returns:
- true if there is a reasonable expectation that local be non null at this point
-
isPotentiallyNull
Description copied from class:FlowInfo
Check status of potential null assignment for a local. Return true if there is a reasonable expectation that the variable be null at this point. This includes the protected null case, so as to augment diagnostics, but does not really check that someone deliberately assigned to null on any specific path- Specified by:
isPotentiallyNull
in classFlowInfo
- Parameters:
local
- LocalVariableBinding - the binding for the checked local- Returns:
- true if there is a reasonable expectation that local be null at this point
-
isPotentiallyUnknown
Description copied from class:FlowInfo
Return true if the given local may have been assigned to an unknown value.- Specified by:
isPotentiallyUnknown
in classFlowInfo
- Parameters:
local
- the local to check- Returns:
- true if the given local may have been assigned to an unknown value
-
isProtectedNonNull
Description copied from class:FlowInfo
Return true if the given local is protected by a test against a non null value.- Specified by:
isProtectedNonNull
in classFlowInfo
- Parameters:
local
- the local to check- Returns:
- true if the given local is protected by a test against a non null
-
isProtectedNull
Description copied from class:FlowInfo
Return true if the given local is protected by a test against null.- Specified by:
isProtectedNull
in classFlowInfo
- Parameters:
local
- the local to check- Returns:
- true if the given local is protected by a test against null
-
markAsComparedEqualToNonNull
Description copied from class:FlowInfo
Record that a local variable got checked to be non null.- Specified by:
markAsComparedEqualToNonNull
in classFlowInfo
- Parameters:
local
- the checked local variable
-
markAsComparedEqualToNull
Description copied from class:FlowInfo
Record that a local variable got checked to be null.- Specified by:
markAsComparedEqualToNull
in classFlowInfo
- Parameters:
local
- the checked local variable
-
markAsDefinitelyAssigned
Description copied from class:FlowInfo
Record a field got definitely assigned.- Specified by:
markAsDefinitelyAssigned
in classFlowInfo
-
markAsDefinitelyAssigned
Description copied from class:FlowInfo
Record a local got definitely assigned.- Specified by:
markAsDefinitelyAssigned
in classFlowInfo
-
markAsDefinitelyNonNull
Description copied from class:FlowInfo
Record a local got definitely assigned to a non-null value.- Specified by:
markAsDefinitelyNonNull
in classFlowInfo
-
markAsDefinitelyNull
Description copied from class:FlowInfo
Record a local got definitely assigned to null.- Specified by:
markAsDefinitelyNull
in classFlowInfo
-
resetNullInfo
Description copied from class:FlowInfo
Reset all null-information about a given local.- Specified by:
resetNullInfo
in classFlowInfo
-
markPotentiallyNullBit
Description copied from class:FlowInfo
Record a local may have got assigned to null (set the bit on existing info).- Specified by:
markPotentiallyNullBit
in classFlowInfo
-
markPotentiallyNonNullBit
Description copied from class:FlowInfo
Record a local may have got assigned to non-null (set the bit on existing info).- Specified by:
markPotentiallyNonNullBit
in classFlowInfo
-
markAsDefinitelyUnknown
Description copied from class:FlowInfo
Record a local got definitely assigned to an unknown value.- Specified by:
markAsDefinitelyUnknown
in classFlowInfo
-
markPotentiallyUnknownBit
Description copied from class:FlowInfo
Record a local may have got assigned to unknown (set the bit on existing info).- Specified by:
markPotentiallyUnknownBit
in classFlowInfo
-
setReachMode
Description copied from class:FlowInfo
Set this flow info reach mode and return this.- Specified by:
setReachMode
in classFlowInfo
- Parameters:
reachMode
- one ofREACHABLE
,UNREACHABLE_OR_DEAD
,UNREACHABLE_BY_NULLANALYSIS
orUNREACHABLE
- Returns:
- this, with the reach mode set to reachMode
-
mergedWith
Description copied from class:FlowInfo
Return the intersection of this and otherInits, that is one of:- the receiver updated in the following way:
- intersection of definitely assigned variables,
- union of potentially assigned variables,
- similar operations for null,
- or the receiver or otherInits if the other one is non reachable.
- Specified by:
mergedWith
in classFlowInfo
- Parameters:
otherInits
- the flow info to merge with this- Returns:
- the intersection of this and otherInits.
- the receiver updated in the following way:
-
mergeDefiniteInitsWith
- Specified by:
mergeDefiniteInitsWith
in classFlowInfo
-
nullInfoLessUnconditionalCopy
Description copied from class:FlowInfo
Return a copy of this unconditional flow info, deprived from its null info.DEAD_END
is returned unmodified.- Specified by:
nullInfoLessUnconditionalCopy
in classFlowInfo
- Returns:
- a copy of this unconditional flow info deprived from its null info
-
toString
-
safeInitsWhenTrue
Description copied from class:FlowInfo
Return a flow info that carries the same information as the result ofinitsWhenTrue
, but warrantied to be different from this.
Caveat: side effects on the result may affect components of this.- Specified by:
safeInitsWhenTrue
in classFlowInfo
- Returns:
- the result of initsWhenTrue or a copy of it
-
unconditionalCopy
Description copied from class:FlowInfo
Return a new flow info that holds the same information as this would after a call to unconditionalInits, but leaving this info unaffected. Moreover, the result can be modified without affecting this.- Specified by:
unconditionalCopy
in classFlowInfo
- Returns:
- a new flow info carrying this unconditional flow info
-
unconditionalFieldLessCopy
Description copied from class:FlowInfo
Return a new flow info that holds the same information as this would after a call tounconditionalInits
followed by the erasure of fields specific information, but leaving this flow info unaffected.- Specified by:
unconditionalFieldLessCopy
in classFlowInfo
- Returns:
- a new flow info carrying the unconditional flow info for local variables
-
unconditionalInits
Description copied from class:FlowInfo
Return a flow info that merges the possible paths of execution described by this flow info. In case of an unconditional flow info, return this. In case of a conditional flow info, merge branches recursively. Caveat: this may be affected, and modifying the result may affect this.- Specified by:
unconditionalInits
in classFlowInfo
- Returns:
- a flow info that merges the possible paths of execution described by this
-
unconditionalInitsWithoutSideEffect
Description copied from class:FlowInfo
Return a new flow info that holds the same information as this would after a call tounconditionalInits
, but leaving this info unaffected. Side effects on the result might affect this though (consider it as read only).- Specified by:
unconditionalInitsWithoutSideEffect
in classFlowInfo
- Returns:
- a flow info carrying this unconditional flow info
-
resetAssignmentInfo
Description copied from class:FlowInfo
Resets the definite and potential initialization info for the given local variable- Specified by:
resetAssignmentInfo
in classFlowInfo
-