public class Stream extends ResourceCreationPoint implements java.lang.Comparable<Stream>
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
Constructor and Description |
---|
Stream(Location location,
java.lang.String streamClass,
java.lang.String streamBase)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Stream other) |
boolean |
equals(java.lang.Object o) |
java.lang.String |
getBugType() |
int |
getInstanceParam() |
Location |
getOpenLocation() |
java.lang.String |
getStreamBase() |
int |
hashCode() |
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() |
static boolean |
mightCloseStream(BasicBlock basicBlock,
org.apache.bcel.generic.InstructionHandle handle,
org.apache.bcel.generic.ConstantPoolGen cpg) |
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) |
java.lang.String |
toString() |
getLocation, getResourceClass
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 calledpublic java.lang.String toString()
toString
in class java.lang.Object
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 static boolean mightCloseStream(BasicBlock basicBlock, org.apache.bcel.generic.InstructionHandle handle, org.apache.bcel.generic.ConstantPoolGen cpg)
public boolean isStreamClose(BasicBlock basicBlock, org.apache.bcel.generic.InstructionHandle handle, org.apache.bcel.generic.ConstantPoolGen cpg, ResourceValueFrame frame, RepositoryLookupFailureCallback lookupFailureCallback)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.