Class UnconditionalDualFlowInfo
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.flow.FlowInfo
org.aspectj.org.eclipse.jdt.internal.compiler.flow.UnconditionalFlowInfo
org.aspectj.org.eclipse.jdt.internal.compiler.flow.UnconditionalDualFlowInfo
A wrapper for two flow infos being co-maintained side-by-side.
Dispatch all modifications to both variant infos.
Where copying is involved wrap the result in a new DualFlowInfo or
UnconditionalDualFlowInfo.
-
Nested Class Summary
Nested classes/interfaces inherited from class UnconditionalFlowInfo
UnconditionalFlowInfo.AssertionFailedExceptionModifier and TypeClassDescriptionstatic classException raised when unexpected behavior is detected. -
Field Summary
Fields inherited from class UnconditionalFlowInfo
BitCacheSize, COVERAGE_TEST_FLAG, CoverageTestId, DEFIN, definiteInits, DEFINN, extra, extraLength, iDefNBit, iDefNNBit, IN, iNBit, INN, iNNBit, maxFieldCount, nullBit1, nullBit2, nullBit3, nullBit4, potentialInitsModifier and TypeFieldDescriptionstatic final intstatic final booleanstatic intstatic final intlongstatic final intlong[][]static final intlonglongstatic final intlongstatic final intlongintlonglonglonglonglongFields inherited from class 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, UNROOTEDModifier and TypeFieldDescriptionstatic final UnconditionalFlowInfostatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intintstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
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.booleanisDefinitelyAssigned(FieldBinding field) Check status of definite assignment for a field.booleanCheck status of definite assignment for a local.booleanCheck status of potential assignment for a field.voidRecord that a local variable got checked to be non null.voidRecord that a local variable got checked to be null.voidRecord a field got definitely assigned.voidRecord a local got definitely assigned.voidRecord a local got definitely assigned to a non-null value.voidRecord a local got definitely assigned to null.voidMark a local as having been assigned to an unknown value.voidRecord a local may have got assigned to non-null (set the bit on existing info).voidRecord a local may have got assigned to null (set the bit on existing info).voidMark a local as potentially having been assigned to an unknown value.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.voidResets the definite and potential initialization info for the given local variablevoidReset all null-information about a given local.setReachMode(int reachMode) Set this flow info reach mode and return this.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 tounconditionalInitsfollowed by the erasure of fields specific information, but leaving this flow info unaffected.Methods inherited from class UnconditionalFlowInfo
acceptAllIncomingNullness, acceptIncomingNullnessFrom, addPotentialNullInfoFrom, cannotBeDefinitelyNullOrNonNull, cannotBeNull, canOnlyBeNull, discardInitializationInfo, discardNonFieldInitializations, fakeInitializedFlowInfo, growSpace, hasInits, hasNullInfoFor, initsWhenFalse, initsWhenTrue, isDefinitelyNonNull, isDefinitelyNull, isDefinitelyUnknown, isPotentiallyAssigned, isPotentiallyNonNull, isPotentiallyNull, isPotentiallyUnknown, isProtectedNonNull, isProtectedNull, isTrue, resetAssignmentInfo, safeInitsWhenTrue, toString, unconditionalInits, unconditionalInitsWithoutSideEffectModifier and TypeMethodDescriptionvoidvoidIf current info sits within a loop and where (non)nullness is known to reach this point, then corresponding (non)nullness from other should override existing state.addPotentialNullInfoFrom(UnconditionalFlowInfo otherInits) Compose other inits over this flow info, then return this.final booleanCheck whether a given local variable is known to be unable to gain a definite non null or definite null status by the use of an enclosing flow info.final booleancannotBeNull(LocalVariableBinding local) Check whether a given local variable is known to be non null, either because it is definitely non null, or because is has been tested against non null.final booleanCheck whether a given local variable is known to be null, either because it is definitely null, or because is has been tested against null.Discard definite inits and potential inits from this, then return this.Remove local variables information from this flow info and return this.static UnconditionalFlowInfofakeInitializedFlowInfo(int localsCount, int maxFieldCount) voidgrowSpace(int newLength, int copyStart, int copyLength) booleanhasInits()Check if this flow info has any relevant inits.final booleanCheck 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.final booleanCheck status of definite non-null value for a given local variable.final booleanCheck status of definite null value for a given local variable.final booleanCheck status of definite unknown value for a given local variable.final booleanCheck status of potential assignment for a local variable.final booleanCheck status of potential null assignment for a local.final booleanCheck status of potential null assignment for a local.final booleanReturn true if the given local may have been assigned to an unknown value.final booleanReturn true if the given local is protected by a test against a non null value.final booleanReturn true if the given local is protected by a test against null.protected static booleanAsserts that the given boolean istrue.voidresetAssignmentInfo(int position) 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.toString()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 FlowInfo
conditional, initial, markNullStatus, mergedOptimizedBranches, mergedOptimizedBranchesIfElse, mergeNullStatus, nullInverse, nullStatus, reachMode, tagBitsToNullStatusModifier and TypeMethodDescriptionstatic FlowInfoconditional(FlowInfo initsWhenTrue, FlowInfo initsWhenFalse) static UnconditionalFlowInfoinitial(int maxFieldCount) voidmarkNullStatus(LocalVariableBinding local, int nullStatus) Mark the null status of the given local according to the given statusstatic UnconditionalFlowInfomergedOptimizedBranches(FlowInfo initsWhenTrue, boolean isOptimizedTrue, FlowInfo initsWhenFalse, boolean isOptimizedFalse, boolean allowFakeDeadBranch) Merge branches using optimized boolean conditionsstatic UnconditionalFlowInfomergedOptimizedBranchesIfElse(FlowInfo initsWhenTrue, boolean isOptimizedTrue, FlowInfo initsWhenFalse, boolean isOptimizedFalse, boolean allowFakeDeadBranch, FlowInfo flowInfo, IfStatement ifStatement, boolean reportDeadCodeInKnownPattern) Merge if-else branches using optimized boolean conditionsstatic intmergeNullStatus(int nullStatus1, int nullStatus2) Merge two single bits (NULL, NON_NULL, POTENTIALLY*..) into one.static intnullInverse(int status) intnullStatus(LocalVariableBinding local) Answer the null status of the given localintFind out the reachability mode of this flowInfo.static inttagBitsToNullStatus(long tagBits) Check whether 'tagBits' contains eitherTagBits.AnnotationNonNullorTagBits.AnnotationNullable, and answer the corresponding null status (FlowInfo.NON_NULLetc.).
-
Constructor Details
-
UnconditionalDualFlowInfo
-
-
Method Details
-
getMainInits
-
addInitializationsFrom
Description copied from class:FlowInfoAdd 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.- Overrides:
addInitializationsFromin classUnconditionalFlowInfo- Parameters:
otherInits- other inits to add to this- Returns:
- this, modified according to otherInits information
-
addNullInfoFrom
Description copied from class:FlowInfoAdd 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.- Overrides:
addNullInfoFromin classUnconditionalFlowInfo
-
addPotentialInitializationsFrom
Description copied from class:FlowInfoCompose 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.- Overrides:
addPotentialInitializationsFromin classUnconditionalFlowInfo- Parameters:
otherInits- other inits to compose over this- Returns:
- this, modified according to otherInits information
-
asNegatedCondition
- Overrides:
asNegatedConditionin classFlowInfo
-
copy
Description copied from class:FlowInfoReturn a deep copy of the current instance.- Overrides:
copyin classUnconditionalFlowInfo- Returns:
- a deep copy of this flow info
-
isDefinitelyAssigned
Description copied from class:FlowInfoCheck status of definite assignment for a field.- Overrides:
isDefinitelyAssignedin classUnconditionalFlowInfo
-
isDefinitelyAssigned
Description copied from class:FlowInfoCheck status of definite assignment for a local.- Overrides:
isDefinitelyAssignedin classUnconditionalFlowInfo
-
isPotentiallyAssigned
Description copied from class:FlowInfoCheck status of potential assignment for a field.- Overrides:
isPotentiallyAssignedin classUnconditionalFlowInfo
-
markAsComparedEqualToNonNull
Description copied from class:FlowInfoRecord that a local variable got checked to be non null.- Overrides:
markAsComparedEqualToNonNullin classUnconditionalFlowInfo- Parameters:
local- the checked local variable
-
markAsComparedEqualToNull
Description copied from class:FlowInfoRecord that a local variable got checked to be null.- Overrides:
markAsComparedEqualToNullin classUnconditionalFlowInfo- Parameters:
local- the checked local variable
-
markAsDefinitelyAssigned
Description copied from class:FlowInfoRecord a field got definitely assigned.- Overrides:
markAsDefinitelyAssignedin classUnconditionalFlowInfo
-
markAsDefinitelyAssigned
Description copied from class:FlowInfoRecord a local got definitely assigned.- Overrides:
markAsDefinitelyAssignedin classUnconditionalFlowInfo
-
markAsDefinitelyNonNull
Description copied from class:FlowInfoRecord a local got definitely assigned to a non-null value.- Overrides:
markAsDefinitelyNonNullin classUnconditionalFlowInfo
-
markAsDefinitelyNull
Description copied from class:FlowInfoRecord a local got definitely assigned to null.- Overrides:
markAsDefinitelyNullin classUnconditionalFlowInfo
-
markAsDefinitelyUnknown
Description copied from class:UnconditionalFlowInfoMark a local as having been assigned to an unknown value.- Overrides:
markAsDefinitelyUnknownin classUnconditionalFlowInfo- Parameters:
local- the local to mark
-
markPotentiallyUnknownBit
Description copied from class:UnconditionalFlowInfoMark a local as potentially having been assigned to an unknown value.- Overrides:
markPotentiallyUnknownBitin classUnconditionalFlowInfo- Parameters:
local- the local to mark
-
markPotentiallyNullBit
Description copied from class:FlowInfoRecord a local may have got assigned to null (set the bit on existing info).- Overrides:
markPotentiallyNullBitin classUnconditionalFlowInfo
-
markPotentiallyNonNullBit
Description copied from class:FlowInfoRecord a local may have got assigned to non-null (set the bit on existing info).- Overrides:
markPotentiallyNonNullBitin classUnconditionalFlowInfo
-
mergedWith
Description copied from class:FlowInfoReturn 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.
- Overrides:
mergedWithin classUnconditionalFlowInfo- Parameters:
otherInits- the flow info to merge with this- Returns:
- the intersection of this and otherInits.
- the receiver updated in the following way:
-
mergeDefiniteInitsWith
- Overrides:
mergeDefiniteInitsWithin classUnconditionalFlowInfo
-
nullInfoLessUnconditionalCopy
Description copied from class:FlowInfoReturn a copy of this unconditional flow info, deprived from its null info.DEAD_ENDis returned unmodified.- Overrides:
nullInfoLessUnconditionalCopyin classUnconditionalFlowInfo- Returns:
- a copy of this unconditional flow info deprived from its null info
-
resetNullInfo
Description copied from class:FlowInfoReset all null-information about a given local.- Overrides:
resetNullInfoin classUnconditionalFlowInfo
-
resetAssignmentInfo
Description copied from class:FlowInfoResets the definite and potential initialization info for the given local variable- Overrides:
resetAssignmentInfoin classUnconditionalFlowInfo
-
setReachMode
Description copied from class:FlowInfoSet this flow info reach mode and return this.- Overrides:
setReachModein classUnconditionalFlowInfo- Parameters:
reachMode- one ofREACHABLE,UNREACHABLE_OR_DEAD,UNREACHABLE_BY_NULLANALYSISorUNREACHABLE- Returns:
- this, with the reach mode set to reachMode
-
unconditionalCopy
Description copied from class:FlowInfoReturn 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.- Overrides:
unconditionalCopyin classUnconditionalFlowInfo- Returns:
- a new flow info carrying this unconditional flow info
-
unconditionalFieldLessCopy
Description copied from class:FlowInfoReturn a new flow info that holds the same information as this would after a call tounconditionalInitsfollowed by the erasure of fields specific information, but leaving this flow info unaffected.- Overrides:
unconditionalFieldLessCopyin classUnconditionalFlowInfo- Returns:
- a new flow info carrying the unconditional flow info for local variables
-