Package edu.umd.cs.findbugs.ba.interproc
Class ParameterProperty
java.lang.Object
edu.umd.cs.findbugs.ba.interproc.ParameterProperty
Method property recording which parameters are have some property
(originally, which were required to be nonnull, now made more generic)
- Author:
- David Hovemeyer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMaximum number of parameters that can be represented by a ParameterProperty. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcopyFrom(ParameterProperty other) Make this object the same as the given one.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.intGet the non-null param bitset.booleanhasProperty(int param) Return whether or not a parameter might be non-null.voidintersectWith(ParameterProperty targetDerefParamSet) Intersect this set with the given set.booleanisEmpty()Return whether or not the set of non-null parameters is empty.iterable()voidsetParamsWithProperty(int nonNullParamSet) Set the non-null param bitset.voidsetParamsWithProperty(BitSet nonNullSet) Set the non-null param set from given BitSet.voidsetParamWithProperty(int param, boolean hasProperty) Set whether or not a parameter might be non-null.toString()
-
Field Details
-
MAX_PARAMS
public static final int MAX_PARAMSMaximum 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
-
setParamsWithProperty
public void setParamsWithProperty(int nonNullParamSet) Set the non-null param bitset.- Parameters:
nonNullParamSet- the non-null param bitset
-
setParamsWithProperty
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 indexhasProperty- 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
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
-
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
-
intersectWith
Intersect this set with the given set. Useful for summarizing the properties of multiple methods.- Parameters:
targetDerefParamSet- another set
-
copyFrom
Make this object the same as the given one.- Parameters:
other- another ParameterNullnessProperty
-