org.eclipse.jdt.internal.compiler.flow
Class NullInfoRegistry

java.lang.Object
  extended by org.eclipse.jdt.internal.compiler.flow.FlowInfo
      extended by org.eclipse.jdt.internal.compiler.flow.UnconditionalFlowInfo
          extended by org.eclipse.jdt.internal.compiler.flow.NullInfoRegistry

public class NullInfoRegistry
extends UnconditionalFlowInfo

A degenerate form of UnconditionalFlowInfo explicitly meant to capture the effects of null related operations within try blocks. Given the fact that a try block might exit at any time, a null related operation that occurs within such a block mitigates whatever we know about the previous null status of involved variables. NullInfoRegistry handles that by negating upstream definite information that clashes with what a given statement contends about the same variable. It also implements mitigateNullInfo so as to elaborate the flow info presented in input of finally blocks.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jdt.internal.compiler.flow.UnconditionalFlowInfo
UnconditionalFlowInfo.AssertionFailedException
 
Field Summary
 
Fields inherited from class org.eclipse.jdt.internal.compiler.flow.UnconditionalFlowInfo
BitCacheSize, COVERAGE_TEST_FLAG, CoverageTestId, definiteInits, extra, extraLength, maxFieldCount, nullBit1, nullBit2, nullBit3, nullBit4, nullStatusChangedInAssert, potentialInits
 
Fields inherited from class org.eclipse.jdt.internal.compiler.flow.FlowInfo
DEAD_END, NON_NULL, NULL, NULL_FLAG_MASK, POTENTIALLY_NON_NULL, POTENTIALLY_NULL, POTENTIALLY_UNKNOWN, REACHABLE, tagBits, UNKNOWN, UNREACHABLE, UNREACHABLE_BY_NULLANALYSIS, UNREACHABLE_OR_DEAD
 
Constructor Summary
NullInfoRegistry(UnconditionalFlowInfo upstream)
          Make a new null info registry, using an upstream flow info.
 
Method Summary
 NullInfoRegistry add(NullInfoRegistry other)
          Add the information held by another NullInfoRegistry instance to this, then return this.
 void markAsComparedEqualToNonNull(LocalVariableBinding local)
          Record that a local variable got checked to be non null.
 void markAsDefinitelyNonNull(LocalVariableBinding local)
          Record a local got definitely assigned to a non-null value.
 void markAsDefinitelyNull(LocalVariableBinding local)
          Record a local got definitely assigned to null.
 void markAsDefinitelyUnknown(LocalVariableBinding local)
          Mark a local as having been assigned to an unknown value.
 void markPotentiallyNonNullBit(LocalVariableBinding local)
          Record a local may have got assigned to non-null (set the bit on existing info).
 void markPotentiallyNullBit(LocalVariableBinding local)
          Record a local may have got assigned to null (set the bit on existing info).
 void markPotentiallyUnknownBit(LocalVariableBinding local)
          Mark a local as potentially having been assigned to an unknown value.
 UnconditionalFlowInfo mitigateNullInfoOf(FlowInfo flowInfo)
          Mitigate the definite and protected info of flowInfo, depending on what this null info registry knows about potential assignments and messages sends involving locals.
 String toString()
           
 
Methods inherited from class org.eclipse.jdt.internal.compiler.flow.UnconditionalFlowInfo
addInitializationsFrom, addNullInfoFrom, addPotentialInitializationsFrom, addPotentialNullInfoFrom, cannotBeDefinitelyNullOrNonNull, cannotBeNull, canOnlyBeNull, copy, discardInitializationInfo, discardNonFieldInitializations, initsWhenFalse, initsWhenTrue, isDefinitelyAssigned, isDefinitelyAssigned, isDefinitelyNonNull, isDefinitelyNull, isDefinitelyUnknown, isMarkedAsNullOrNonNullInAssertExpression, isPotentiallyAssigned, isPotentiallyAssigned, isPotentiallyNonNull, isPotentiallyNull, isPotentiallyUnknown, isProtectedNonNull, isProtectedNull, isTrue, markAsComparedEqualToNull, markAsDefinitelyAssigned, markAsDefinitelyAssigned, markedAsNullOrNonNullInAssertExpression, mergedWith, nullInfoLessUnconditionalCopy, resetAssignmentInfo, resetAssignmentInfo, resetNullInfo, safeInitsWhenTrue, setReachMode, unconditionalCopy, unconditionalFieldLessCopy, unconditionalInits, unconditionalInitsWithoutSideEffect
 
Methods inherited from class org.eclipse.jdt.internal.compiler.flow.FlowInfo
asNegatedCondition, conditional, initial, markNullStatus, mergedOptimizedBranches, mergedOptimizedBranchesIfElse, nullStatus, reachMode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NullInfoRegistry

public NullInfoRegistry(UnconditionalFlowInfo upstream)
Make a new null info registry, using an upstream flow info. All definite assignments of the upstream are carried forward, since a try block may exit before its first statement.

Parameters:
upstream - - UnconditionalFlowInfo: the flow info before we enter the try block; only definite assignments are considered; this parameter is not modified by this constructor
Method Detail

add

public NullInfoRegistry add(NullInfoRegistry other)
Add the information held by another NullInfoRegistry instance to this, then return this.

Parameters:
other - - NullInfoRegistry: the information to add to this
Returns:
this, modified to carry the information held by other

markAsComparedEqualToNonNull

public void markAsComparedEqualToNonNull(LocalVariableBinding local)
Description copied from class: FlowInfo
Record that a local variable got checked to be non null.

Overrides:
markAsComparedEqualToNonNull in class UnconditionalFlowInfo
Parameters:
local - the checked local variable

markAsDefinitelyNonNull

public void markAsDefinitelyNonNull(LocalVariableBinding local)
Description copied from class: FlowInfo
Record a local got definitely assigned to a non-null value.

Overrides:
markAsDefinitelyNonNull in class UnconditionalFlowInfo

markAsDefinitelyNull

public void markAsDefinitelyNull(LocalVariableBinding local)
Description copied from class: FlowInfo
Record a local got definitely assigned to null.

Overrides:
markAsDefinitelyNull in class UnconditionalFlowInfo

markAsDefinitelyUnknown

public void markAsDefinitelyUnknown(LocalVariableBinding local)
Description copied from class: UnconditionalFlowInfo
Mark a local as having been assigned to an unknown value.

Overrides:
markAsDefinitelyUnknown in class UnconditionalFlowInfo
Parameters:
local - the local to mark

mitigateNullInfoOf

public UnconditionalFlowInfo mitigateNullInfoOf(FlowInfo flowInfo)
Mitigate the definite and protected info of flowInfo, depending on what this null info registry knows about potential assignments and messages sends involving locals. May return flowInfo unchanged, or a modified, fresh copy of flowInfo.

Parameters:
flowInfo - - FlowInfo: the flow information that this null info registry may mitigate
Returns:
a copy of flowInfo carrying mitigated information, or else flowInfo unchanged

toString

public String toString()
Overrides:
toString in class UnconditionalFlowInfo

markPotentiallyUnknownBit

public void markPotentiallyUnknownBit(LocalVariableBinding local)
Mark a local as potentially having been assigned to an unknown value.

Overrides:
markPotentiallyUnknownBit in class UnconditionalFlowInfo
Parameters:
local - the local to mark

markPotentiallyNullBit

public void markPotentiallyNullBit(LocalVariableBinding local)
Description copied from class: FlowInfo
Record a local may have got assigned to null (set the bit on existing info).

Overrides:
markPotentiallyNullBit in class UnconditionalFlowInfo

markPotentiallyNonNullBit

public void markPotentiallyNonNullBit(LocalVariableBinding local)
Description copied from class: FlowInfo
Record a local may have got assigned to non-null (set the bit on existing info).

Overrides:
markPotentiallyNonNullBit in class UnconditionalFlowInfo


Copyright © 2012. All Rights Reserved.