Class AccessPathFragment

java.lang.Object
soot.jimple.infoflow.data.AccessPathFragment

public class AccessPathFragment extends Object
A fragment inside an access path
Author:
Steven Arzt
  • Constructor Details

    • AccessPathFragment

      public AccessPathFragment(soot.SootField field)
      Creates a new AccessPathFragment without a context and using the fields type
      Parameters:
      field - The field that is dereferenced
    • AccessPathFragment

      public AccessPathFragment(soot.SootField field, soot.Type fieldType)
      Creates a new AccessPathFragment without a context
      Parameters:
      field - The field that is dereferenced
      fieldType - The propagated type of the field that is dereferenced
    • AccessPathFragment

      public AccessPathFragment(soot.SootField field, soot.Type fieldType, ContainerContext[] context)
      Creates a new AccessPathFragment with a specific context
      Parameters:
      field - The field that is dereferenced
      fieldType - The propagated type of the field that is dereferenced
      context - The context under which the access path is tainted
  • Method Details

    • getField

      public soot.SootField getField()
      Gets the field referenced by this access path fragment
      Returns:
      The field referenced by this access path fragment
    • getFieldType

      public soot.Type getFieldType()
      Gets the propagated type of the field referenced by this access path fragment. If no type information has been propagated, the declared type is used.
      Returns:
      The propagated type of the field referenced by this access path fragment
    • getContext

      public ContainerContext[] getContext()
      Gets the context in which the access path is tainted, or null if the access path is tainted in all contexts
      Returns:
      The context in which the access path is tainted
    • hasContext

      public boolean hasContext()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isValid

      public boolean isValid()
      Gets whether this access path fragment is valid
      Returns:
      True if this access path fragment is valid, false otherwise
    • createFragmentArray

      public static AccessPathFragment[] createFragmentArray(soot.SootField[] fields, soot.Type[] fieldTypes, ContainerContext[][] contexts)
      Creates a sequence of access path fragments from an array of fields and field types
      Parameters:
      fields - A sequence of field dereferences
      fieldTypes - The types of the fields in the sequence of dereferences
      Returns:
      The sequence of access path fragments
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • hashCodeWithoutContext

      public int hashCodeWithoutContext()
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsWithoutContext

      public boolean equalsWithoutContext(Object obj)
    • copyWithNewType

      public AccessPathFragment copyWithNewType(soot.Type newType)
      Copies this access path fragment with a new propagated type. All other data is kept as-is.
      Parameters:
      newType - The new type
      Returns:
      The new access path fragment
    • copyWithNewContext

      public AccessPathFragment copyWithNewContext(ContainerContext[] newContext)