|
FindBugs™ 1.3.9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.findbugs.detect.StreamResourceTracker
public class StreamResourceTracker
Resource tracker which determines where streams are created, and how they are used within the method.
Constructor Summary | |
---|---|
StreamResourceTracker(StreamFactory[] streamFactoryList,
RepositoryLookupFailureCallback lookupFailureCallback)
Constructor. |
Method Summary | |
---|---|
void |
addStreamEscape(Stream source,
Location target)
Indicate that a stream escapes at the given target Location. |
void |
addStreamOpenLocation(Location streamOpenLocation,
Stream stream)
Indicate that a stream is constructed at this Location. |
ResourceValueFrameModelingVisitor |
createVisitor(Stream resource,
org.apache.bcel.generic.ConstantPoolGen cpg)
Create a ResourceValueFrameModelingVisitor to model the effect of instructions on the state of the resource. |
StreamEquivalenceClass |
getStreamEquivalenceClass(Stream stream)
Get the equivalence class for given stream. |
boolean |
ignoreExceptionEdge(Edge edge,
Stream resource,
org.apache.bcel.generic.ConstantPoolGen cpg)
Determine whether the analysis should ignore given exception edge. |
boolean |
ignoreImplicitExceptions(Stream resource)
Determine whether the analysis should ignore exception edges on which only implicit exceptions are propagated. |
boolean |
isParamInstance(Stream resource,
int slot)
Return if the given parameter slot contains the resource instance upon entry to the method. |
boolean |
isResourceClose(BasicBlock basicBlock,
org.apache.bcel.generic.InstructionHandle handle,
org.apache.bcel.generic.ConstantPoolGen cpg,
Stream resource,
ResourceValueFrame frame)
Determine if the given instruction is the site where a resource is closed. |
Stream |
isResourceCreation(BasicBlock basicBlock,
org.apache.bcel.generic.InstructionHandle handle,
org.apache.bcel.generic.ConstantPoolGen cpg)
Determine if the given instruction is the site where a resource is created. |
boolean |
isResourceOpen(BasicBlock basicBlock,
org.apache.bcel.generic.InstructionHandle handle,
org.apache.bcel.generic.ConstantPoolGen cpg,
Stream resource,
ResourceValueFrame frame)
|
boolean |
isUninterestingStreamEscape(Stream stream)
Determine if an uninteresting stream escapes at given location. |
void |
markTransitiveUninterestingStreamEscapes()
Transitively mark all streams into which uninteresting streams (such as System.out) escape. |
boolean |
mightCloseResource(BasicBlock basicBlock,
org.apache.bcel.generic.InstructionHandle handle,
org.apache.bcel.generic.ConstantPoolGen cpg)
Determine if the given instruction is the site where a resource is closed. |
void |
setResourceCollection(ResourceCollection<Stream> resourceCollection)
Set the precomputed ResourceCollection for the method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StreamResourceTracker(StreamFactory[] streamFactoryList, RepositoryLookupFailureCallback lookupFailureCallback)
streamFactoryList
- array of StreamFactory objects which determine
where streams are createdlookupFailureCallback
- used when class hierarchy lookups failMethod Detail |
---|
public void setResourceCollection(ResourceCollection<Stream> resourceCollection)
public void addStreamEscape(Stream source, Location target)
source
- the Stream that is escapingtarget
- the target Location (where the stream escapes)public void markTransitiveUninterestingStreamEscapes()
public boolean isUninterestingStreamEscape(Stream stream)
stream
- the stream
public void addStreamOpenLocation(Location streamOpenLocation, Stream stream)
streamOpenLocation
- the Locationstream
- the Stream opened at this Locationpublic StreamEquivalenceClass getStreamEquivalenceClass(Stream stream)
stream
- the stream
public Stream isResourceCreation(BasicBlock basicBlock, org.apache.bcel.generic.InstructionHandle handle, org.apache.bcel.generic.ConstantPoolGen cpg)
ResourceTracker
isResourceCreation
in interface ResourceTracker<Stream>
basicBlock
- basic block containing the instructionhandle
- the instructioncpg
- the ConstantPoolGen for the method
public boolean isResourceOpen(BasicBlock basicBlock, org.apache.bcel.generic.InstructionHandle handle, org.apache.bcel.generic.ConstantPoolGen cpg, Stream resource, ResourceValueFrame frame)
public boolean isResourceClose(BasicBlock basicBlock, org.apache.bcel.generic.InstructionHandle handle, org.apache.bcel.generic.ConstantPoolGen cpg, Stream resource, ResourceValueFrame frame)
ResourceTracker
isResourceClose
in interface ResourceTracker<Stream>
basicBlock
- basic block containing the instructionhandle
- the instructioncpg
- the ConstantPoolGen for the methodresource
- the resource, as returned by isResourceCreation()frame
- the ResourceValueFrame representing the stack prior to executing
the instruction
public boolean mightCloseResource(BasicBlock basicBlock, org.apache.bcel.generic.InstructionHandle handle, org.apache.bcel.generic.ConstantPoolGen cpg) throws DataflowAnalysisException
ResourceTracker
mightCloseResource
in interface ResourceTracker<Stream>
basicBlock
- basic block containing the instructionhandle
- the instructioncpg
- the ConstantPoolGen for the method
DataflowAnalysisException
public ResourceValueFrameModelingVisitor createVisitor(Stream resource, org.apache.bcel.generic.ConstantPoolGen cpg)
ResourceTracker
createVisitor
in interface ResourceTracker<Stream>
resource
- the resource we are trackingcpg
- the ConstantPoolGen of the method
public boolean ignoreImplicitExceptions(Stream resource)
ResourceTracker
ignoreImplicitExceptions
in interface ResourceTracker<Stream>
resource
- the resource being tracked
public boolean ignoreExceptionEdge(Edge edge, Stream resource, org.apache.bcel.generic.ConstantPoolGen cpg)
ResourceTracker
ignoreExceptionEdge
in interface ResourceTracker<Stream>
edge
- the exception edgeresource
- the resourcecpg
- the ConstantPoolGen
public boolean isParamInstance(Stream resource, int slot)
ResourceTracker
isParamInstance
in interface ResourceTracker<Stream>
resource
- the resourceslot
- the local variable slot
|
FindBugs™ 1.3.9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |