Class ParameterProperty

java.lang.Object
edu.umd.cs.findbugs.ba.interproc.ParameterProperty

public class ParameterProperty extends Object
Method property recording which parameters are have some property (originally, which were required to be nonnull, now made more generic)
Author:
David Hovemeyer
  • Field Details

    • MAX_PARAMS

      public static final int MAX_PARAMS
      Maximum number of parameters that can be represented by a ParameterProperty.
      See Also:
  • Constructor Details

    • ParameterProperty

      public ParameterProperty()
      Constructor. Parameters are all assumed not to be non-null.
    • ParameterProperty

      public ParameterProperty(int bits)
      Constructor. Parameters are all assumed not to be non-null.
  • Method Details

    • getParamsWithProperty

      public int getParamsWithProperty()
      Get the non-null param bitset.
      Returns:
      the non-null param bitset
    • iterable

      public Iterable<Integer> iterable()
    • setParamsWithProperty

      public void setParamsWithProperty(int nonNullParamSet)
      Set the non-null param bitset.
      Parameters:
      nonNullParamSet - the non-null param bitset
    • setParamsWithProperty

      public void setParamsWithProperty(BitSet nonNullSet)
      Set the non-null param set from given BitSet.
      Parameters:
      nonNullSet - BitSet indicating which parameters are non-null
    • setParamWithProperty

      public void setParamWithProperty(int param, boolean hasProperty)
      Set whether or not a parameter might be non-null.
      Parameters:
      param - the parameter index
      hasProperty - true if the parameter might be non-null, false otherwise
    • hasProperty

      public boolean hasProperty(int param)
      Return whether or not a parameter might be non-null.
      Parameters:
      param - the parameter index
      Returns:
      true if the parameter might be non-null, false otherwise
    • getMatchingParameters

      public BitSet getMatchingParameters(BitSet nullArgSet)
      Given a bitset of null arguments passed to the method represented by this property, return a bitset indicating which null arguments correspond to an non-null param.
      Parameters:
      nullArgSet - bitset of null arguments
      Returns:
      bitset intersecting null arguments and non-null params
    • getAsBitSet

      public BitSet getAsBitSet()
    • isEmpty

      public boolean isEmpty()
      Return whether or not the set of non-null parameters is empty.
      Returns:
      true if the set is empty, false if it contains at least one parameter
    • toString

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

      public void intersectWith(ParameterProperty targetDerefParamSet)
      Intersect this set with the given set. Useful for summarizing the properties of multiple methods.
      Parameters:
      targetDerefParamSet - another set
    • copyFrom

      public void copyFrom(ParameterProperty other)
      Make this object the same as the given one.
      Parameters:
      other - another ParameterNullnessProperty