Class ResourceCollection<Resource>
java.lang.Object
edu.umd.cs.findbugs.ResourceCollection<Resource>
A ResourceCollection defines all of the resources created and used in a
particular method. It serves two related purposes:
- Define all of the resources which exist in the method, and
- Record where resources created in the method are created
This distinction is important because some resources which exist in the method aren't created in the method: for example, resources passed in as parameters.
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCreatedResource(Location location, Resource resource) Add a resource created within the analyzed method.voidaddPreexistingResource(Resource resource) Add a preexisting resource.getCreatedResource(Location location) Get the resource that is created at given location.booleanisEmpty()Return whether or not there are any resources in the collection.Get an Iterator over all resources in the method.
-
Field Details
-
resourceList
-
locationToResourceMap
-
-
Constructor Details
-
ResourceCollection
public ResourceCollection()Constructor. Creates empty collection.
-
-
Method Details
-
addPreexistingResource
Add a preexisting resource. That is, one that is not created within the analyzed method. Resources passed to the method as parameters fall into this category.- Parameters:
resource- the preexisting resource
-
addCreatedResource
-
isEmpty
public boolean isEmpty()Return whether or not there are any resources in the collection. -
resourceIterator
-
getCreatedResource
-