java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.flow.FlowInfo
Bekannte direkte Unterklassen:
ConditionalFlowInfo, UnconditionalFlowInfo

public abstract class FlowInfo extends Object
  • Felddetails

  • Konstruktordetails

    • FlowInfo

      public FlowInfo()
  • Methodendetails

    • addInitializationsFrom

      public abstract FlowInfo addInitializationsFrom(FlowInfo otherInits)
      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.
      Parameter:
      otherInits - other inits to add to this
      Gibt zurück:
      this, modified according to otherInits information
    • addNullInfoFrom

      public abstract FlowInfo addNullInfoFrom(FlowInfo otherInits)
      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.
    • addPotentialInitializationsFrom

      public abstract FlowInfo addPotentialInitializationsFrom(FlowInfo otherInits)
      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 than addInitializationsFrom.
      Parameter:
      otherInits - other inits to compose over this
      Gibt zurück:
      this, modified according to otherInits information
    • asNegatedCondition

      public FlowInfo asNegatedCondition()
    • conditional

      public static FlowInfo conditional(FlowInfo initsWhenTrue, FlowInfo initsWhenFalse)
    • cannotBeDefinitelyNullOrNonNull

      public boolean cannotBeDefinitelyNullOrNonNull(LocalVariableBinding local)
      Check 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. The semantics are that if the current flow info marks the variable as potentially unknown or else as being both potentially null and potentially non null, then it won't ever be promoted as definitely null or definitely non null. (It could still get promoted to definite unknown).
      Parameter:
      local - the variable to check
      Gibt zurück:
      true iff this flow info prevents local from being promoted to definite non null or definite null against an enclosing flow info
    • cannotBeNull

      public boolean cannotBeNull(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.
      Parameter:
      local - the variable to ckeck
      Gibt zurück:
      true iff local cannot be null for this flow info
    • canOnlyBeNull

      public boolean canOnlyBeNull(LocalVariableBinding local)
      Check whether a given local variable is known to be null, either because it is definitely null, or because is has been tested against null.
      Parameter:
      local - the variable to ckeck
      Gibt zurück:
      true iff local can only be null for this flow info
    • copy

      public abstract FlowInfo copy()
      Return a deep copy of the current instance.
      Gibt zurück:
      a deep copy of this flow info
    • initial

      public static UnconditionalFlowInfo initial(int maxFieldCount)
    • initsWhenFalse

      public abstract FlowInfo initsWhenFalse()
      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 of ConditionalFlowInfo. May have a side effect on subparts of this flow info (subtrees get merged).
      Gibt zurück:
      the flow info associated to the false branch of the condition that generated this flow info
    • initsWhenTrue

      public abstract FlowInfo initsWhenTrue()
      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 of ConditionalFlowInfo. May have a side effect on subparts of this flow info (subtrees get merged).
      Gibt zurück:
      the flow info associated to the true branch of the condition that generated this flow info
    • isDefinitelyAssigned

      public abstract boolean isDefinitelyAssigned(FieldBinding field)
      Check status of definite assignment for a field.
    • isDefinitelyAssigned

      public abstract boolean isDefinitelyAssigned(LocalVariableBinding local)
      Check status of definite assignment for a local.
    • isDefinitelyNonNull

      public abstract boolean isDefinitelyNonNull(LocalVariableBinding local)
      Check status of definite non-null value for a given local variable.
      Parameter:
      local - the variable to ckeck
      Gibt zurück:
      true iff local is definitely non null for this flow info
    • isDefinitelyNull

      public abstract boolean isDefinitelyNull(LocalVariableBinding local)
      Check status of definite null value for a given local variable.
      Parameter:
      local - the variable to ckeck
      Gibt zurück:
      true iff local is definitely null for this flow info
    • isDefinitelyUnknown

      public abstract boolean isDefinitelyUnknown(LocalVariableBinding local)
      Check status of definite unknown value for a given local variable.
      Parameter:
      local - the variable to ckeck
      Gibt zurück:
      true iff local is definitely unknown for this flow info
    • hasNullInfoFor

      public abstract boolean hasNullInfoFor(LocalVariableBinding local)
      Check if any null info has been recorded for a given local variable. Here even recording of 'UNKNOWN' is considered as null info.
    • isPotentiallyAssigned

      public abstract boolean isPotentiallyAssigned(FieldBinding field)
      Check status of potential assignment for a field.
    • isPotentiallyAssigned

      public abstract boolean isPotentiallyAssigned(LocalVariableBinding field)
      Check status of potential assignment for a local variable.
    • isPotentiallyNonNull

      public abstract boolean isPotentiallyNonNull(LocalVariableBinding local)
      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.
      Parameter:
      local - LocalVariableBinding - the binding for the checked local
      Gibt zurück:
      true if there is a reasonable expectation that local be non null at this point
    • isPotentiallyNull

      public abstract boolean isPotentiallyNull(LocalVariableBinding local)
      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
      Parameter:
      local - LocalVariableBinding - the binding for the checked local
      Gibt zurück:
      true if there is a reasonable expectation that local be null at this point
    • isPotentiallyUnknown

      public abstract boolean isPotentiallyUnknown(LocalVariableBinding local)
      Return true if the given local may have been assigned to an unknown value.
      Parameter:
      local - the local to check
      Gibt zurück:
      true if the given local may have been assigned to an unknown value
    • isProtectedNonNull

      public abstract boolean isProtectedNonNull(LocalVariableBinding local)
      Return true if the given local is protected by a test against a non null value.
      Parameter:
      local - the local to check
      Gibt zurück:
      true if the given local is protected by a test against a non null
    • isProtectedNull

      public abstract boolean isProtectedNull(LocalVariableBinding local)
      Return true if the given local is protected by a test against null.
      Parameter:
      local - the local to check
      Gibt zurück:
      true if the given local is protected by a test against null
    • markAsComparedEqualToNonNull

      public abstract void markAsComparedEqualToNonNull(LocalVariableBinding local)
      Record that a local variable got checked to be non null.
      Parameter:
      local - the checked local variable
    • markAsComparedEqualToNull

      public abstract void markAsComparedEqualToNull(LocalVariableBinding local)
      Record that a local variable got checked to be null.
      Parameter:
      local - the checked local variable
    • markAsDefinitelyAssigned

      public abstract void markAsDefinitelyAssigned(FieldBinding field)
      Record a field got definitely assigned.
    • markAsDefinitelyNonNull

      public abstract void markAsDefinitelyNonNull(LocalVariableBinding local)
      Record a local got definitely assigned to a non-null value.
    • markAsDefinitelyNull

      public abstract void markAsDefinitelyNull(LocalVariableBinding local)
      Record a local got definitely assigned to null.
    • resetNullInfo

      public abstract void resetNullInfo(LocalVariableBinding local)
      Reset all null-information about a given local.
    • markPotentiallyUnknownBit

      public abstract void markPotentiallyUnknownBit(LocalVariableBinding local)
      Record a local may have got assigned to unknown (set the bit on existing info).
    • markPotentiallyNullBit

      public abstract void markPotentiallyNullBit(LocalVariableBinding local)
      Record a local may have got assigned to null (set the bit on existing info).
    • markPotentiallyNonNullBit

      public abstract void markPotentiallyNonNullBit(LocalVariableBinding local)
      Record a local may have got assigned to non-null (set the bit on existing info).
    • markAsDefinitelyAssigned

      public abstract void markAsDefinitelyAssigned(LocalVariableBinding local)
      Record a local got definitely assigned.
    • markAsDefinitelyUnknown

      public abstract void markAsDefinitelyUnknown(LocalVariableBinding local)
      Record a local got definitely assigned to an unknown value.
    • markNullStatus

      public void markNullStatus(LocalVariableBinding local, int nullStatus)
      Mark the null status of the given local according to the given status
      Parameter:
      local -
      nullStatus - bitset of FLowInfo.UNKNOWN ... FlowInfo.POTENTIALLY_NON_NULL
    • nullStatus

      public int nullStatus(LocalVariableBinding local)
      Answer the null status of the given local
      Parameter:
      local -
      Gibt zurück:
      bitset of FlowInfo.UNKNOWN ... FlowInfo.POTENTIALLY_NON_NULL
    • mergeNullStatus

      public static int mergeNullStatus(int nullStatus1, int nullStatus2)
      Merge two single bits (NULL, NON_NULL, POTENTIALLY*..) into one. This method implements a simpler logic than the 4-bit encoding used in FlowInfo instances.
    • mergedOptimizedBranches

      public static UnconditionalFlowInfo mergedOptimizedBranches(FlowInfo initsWhenTrue, boolean isOptimizedTrue, FlowInfo initsWhenFalse, boolean isOptimizedFalse, boolean allowFakeDeadBranch)
      Merge branches using optimized boolean conditions
    • mergedOptimizedBranchesIfElse

      public static UnconditionalFlowInfo mergedOptimizedBranchesIfElse(FlowInfo initsWhenTrue, boolean isOptimizedTrue, FlowInfo initsWhenFalse, boolean isOptimizedFalse, boolean allowFakeDeadBranch, FlowInfo flowInfo, IfStatement ifStatement, boolean reportDeadCodeInKnownPattern)
      Merge if-else branches using optimized boolean conditions
    • reachMode

      public int reachMode()
      Find out the reachability mode of this flowInfo.
      Gibt zurück:
      REACHABLE if this flow info is reachable, otherwise either UNREACHABLE_OR_DEAD or UNREACHABLE_BY_NULLANALYSIS.
    • safeInitsWhenTrue

      public abstract FlowInfo safeInitsWhenTrue()
      Return a flow info that carries the same information as the result of initsWhenTrue, but warrantied to be different from this.
      Caveat: side effects on the result may affect components of this.
      Gibt zurück:
      the result of initsWhenTrue or a copy of it
    • setReachMode

      public abstract FlowInfo setReachMode(int reachMode)
      Set this flow info reach mode and return this.
      Parameter:
      reachMode - one of REACHABLE, UNREACHABLE_OR_DEAD, UNREACHABLE_BY_NULLANALYSIS or UNREACHABLE
      Gibt zurück:
      this, with the reach mode set to reachMode
    • mergedWith

      public abstract UnconditionalFlowInfo 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).
      Parameter:
      otherInits - the flow info to merge with this
      Gibt zurück:
      the intersection of this and otherInits.
    • mergeDefiniteInitsWith

      public abstract UnconditionalFlowInfo mergeDefiniteInitsWith(UnconditionalFlowInfo otherInits)
    • nullInfoLessUnconditionalCopy

      public abstract UnconditionalFlowInfo nullInfoLessUnconditionalCopy()
      Return a copy of this unconditional flow info, deprived from its null info. DEAD_END is returned unmodified.
      Gibt zurück:
      a copy of this unconditional flow info deprived from its null info
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
    • unconditionalCopy

      public abstract UnconditionalFlowInfo unconditionalCopy()
      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.
      Gibt zurück:
      a new flow info carrying this unconditional flow info
    • unconditionalFieldLessCopy

      public abstract UnconditionalFlowInfo unconditionalFieldLessCopy()
      Return a new flow info that holds the same information as this would after a call to unconditionalInits followed by the erasure of fields specific information, but leaving this flow info unaffected.
      Gibt zurück:
      a new flow info carrying the unconditional flow info for local variables
    • unconditionalInits

      public abstract UnconditionalFlowInfo unconditionalInits()
      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.
      Gibt zurück:
      a flow info that merges the possible paths of execution described by this
    • unconditionalInitsWithoutSideEffect

      public abstract UnconditionalFlowInfo unconditionalInitsWithoutSideEffect()
      Return a new flow info that holds the same information as this would after a call to unconditionalInits, but leaving this info unaffected. Side effects on the result might affect this though (consider it as read only).
      Gibt zurück:
      a flow info carrying this unconditional flow info
    • resetAssignmentInfo

      public abstract void resetAssignmentInfo(LocalVariableBinding local)
      Resets the definite and potential initialization info for the given local variable
      Parameter:
      local -
    • tagBitsToNullStatus

      public static int tagBitsToNullStatus(long tagBits)
      Check whether 'tagBits' contains either TagBits.AnnotationNonNull or TagBits.AnnotationNullable, and answer the corresponding null status (NON_NULL etc.).