|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.findbugs.ResourceCreationPoint
edu.umd.cs.findbugs.detect.Stream
public class Stream
A Stream object marks the location in the code where a stream is created. It also is responsible for determining some aspects of how the stream state is tracked by the ResourceValueAnalysis, such as when the stream is opened or closed, and whether implicit exception edges are significant.
TODO: change streamClass and streamBase to ObjectType
TODO: isStreamOpen() and isStreamClose() should probably be abstract, so we can customize how they work for different kinds of streams
Field Summary | |
---|---|
private java.lang.String |
bugType
|
private boolean |
ignoreImplicitExceptions
|
private int |
instanceParam
|
private boolean |
isClosed
|
private boolean |
isOpenOnCreation
|
private boolean |
isUninteresting
|
private Location |
openLocation
|
private java.lang.String |
streamBase
|
Constructor Summary | |
---|---|
Stream(Location location,
java.lang.String streamClass,
java.lang.String streamBase)
Constructor. |
Method Summary | |
---|---|
int |
compareTo(Stream other)
|
java.lang.String |
getBugType()
|
int |
getInstanceParam()
|
private ResourceValue |
getInstanceValue(ResourceValueFrame frame,
org.apache.bcel.generic.InvokeInstruction inv,
org.apache.bcel.generic.ConstantPoolGen cpg)
|
Location |
getOpenLocation()
|
java.lang.String |
getStreamBase()
|
boolean |
ignoreImplicitExceptions()
|
boolean |
isClosed()
Return whether or not the Stream is closed on all paths out of the method. |
boolean |
isOpenOnCreation()
|
boolean |
isStreamClose(BasicBlock basicBlock,
org.apache.bcel.generic.InstructionHandle handle,
org.apache.bcel.generic.ConstantPoolGen cpg,
ResourceValueFrame frame,
RepositoryLookupFailureCallback lookupFailureCallback)
|
boolean |
isStreamOpen(BasicBlock basicBlock,
org.apache.bcel.generic.InstructionHandle handle,
org.apache.bcel.generic.ConstantPoolGen cpg,
ResourceValueFrame frame)
|
boolean |
isUninteresting()
|
private boolean |
matchMethod(org.apache.bcel.generic.InvokeInstruction inv,
org.apache.bcel.generic.ConstantPoolGen cpg,
java.lang.String className,
java.lang.String methodName)
|
void |
setClosed()
Set this Stream has having been closed on all paths out of the method. |
Stream |
setIgnoreImplicitExceptions(boolean enable)
Mark whether or not implicit exception edges should be ignored by ResourceValueAnalysis when determining whether or not stream is closed on all paths out of method. |
void |
setInstanceParam(int instanceParam)
Set the number of the parameter which passes the stream instance. |
Stream |
setInteresting(java.lang.String bugType)
Mark this Stream as interesting. |
Stream |
setIsOpenOnCreation(boolean enable)
Mark whether or not Stream is open as soon as it is created, or whether a later method or constructor must explicitly open it. |
void |
setOpenLocation(Location openLocation)
|
Methods inherited from class edu.umd.cs.findbugs.ResourceCreationPoint |
---|
getLocation, getResourceClass |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String streamBase
private boolean isUninteresting
private boolean isOpenOnCreation
private Location openLocation
private boolean ignoreImplicitExceptions
private java.lang.String bugType
private int instanceParam
private boolean isClosed
Constructor Detail |
---|
public Stream(Location location, java.lang.String streamClass, java.lang.String streamBase)
location
- where the stream is createdstreamClass
- type of StreamstreamBase
- highest class in the class hierarchy through which
stream's close() method could be calledMethod Detail |
---|
public Stream setInteresting(java.lang.String bugType)
bugType
- the bug type that should be reported if
the stream is not closed on all paths out of the methodpublic Stream setIgnoreImplicitExceptions(boolean enable)
public Stream setIsOpenOnCreation(boolean enable)
public void setInstanceParam(int instanceParam)
instanceParam
- number of the parameter passing the stream instancepublic void setClosed()
public java.lang.String getStreamBase()
public boolean isUninteresting()
public boolean isOpenOnCreation()
public void setOpenLocation(Location openLocation)
public Location getOpenLocation()
public boolean ignoreImplicitExceptions()
public int getInstanceParam()
public java.lang.String getBugType()
public boolean isClosed()
public boolean isStreamOpen(BasicBlock basicBlock, org.apache.bcel.generic.InstructionHandle handle, org.apache.bcel.generic.ConstantPoolGen cpg, ResourceValueFrame frame)
public boolean isStreamClose(BasicBlock basicBlock, org.apache.bcel.generic.InstructionHandle handle, org.apache.bcel.generic.ConstantPoolGen cpg, ResourceValueFrame frame, RepositoryLookupFailureCallback lookupFailureCallback)
private ResourceValue getInstanceValue(ResourceValueFrame frame, org.apache.bcel.generic.InvokeInstruction inv, org.apache.bcel.generic.ConstantPoolGen cpg)
private boolean matchMethod(org.apache.bcel.generic.InvokeInstruction inv, org.apache.bcel.generic.ConstantPoolGen cpg, java.lang.String className, java.lang.String methodName)
public int compareTo(Stream other)
compareTo
in interface java.lang.Comparable<Stream>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |