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
Modifier and TypeFieldDescriptionstatic final int
Maximum number of parameters that can be represented by a ParameterProperty. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
copyFrom
(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.int
Get the non-null param bitset.boolean
hasProperty
(int param) Return whether or not a parameter might be non-null.void
intersectWith
(ParameterProperty targetDerefParamSet) Intersect this set with the given set.boolean
isEmpty()
Return whether or not the set of non-null parameters is empty.iterable()
void
setParamsWithProperty
(int nonNullParamSet) Set the non-null param bitset.void
setParamsWithProperty
(BitSet nonNullSet) Set the non-null param set from given BitSet.void
setParamWithProperty
(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
-