Package edu.umd.cs.findbugs.detect
Class StaticFieldLoadStreamFactory
- java.lang.Object
-
- edu.umd.cs.findbugs.detect.StaticFieldLoadStreamFactory
-
- All Implemented Interfaces:
StreamFactory
public class StaticFieldLoadStreamFactory extends java.lang.Object implements StreamFactory
Stream factory for streams created by loading a value from a static field. This is mainly to handle System.in, System.out, and System.err.
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.String
className
java.lang.String
fieldName
java.lang.String
fieldSig
java.lang.String
streamBaseClass
-
Constructor Summary
Constructors Constructor Description StaticFieldLoadStreamFactory(java.lang.String streamBaseClass, java.lang.String className, java.lang.String fieldName, java.lang.String fieldSig)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stream
createStream(Location location, org.apache.bcel.generic.ObjectType type, org.apache.bcel.generic.ConstantPoolGen cpg, RepositoryLookupFailureCallback lookupFailureCallback)
Determine if a Stream is created at given location.
-
-
-
Constructor Detail
-
StaticFieldLoadStreamFactory
public StaticFieldLoadStreamFactory(java.lang.String streamBaseClass, java.lang.String className, java.lang.String fieldName, java.lang.String fieldSig)
Constructor. Created Stream objects will be marked as uninteresting.- Parameters:
streamBaseClass
- the base class of the stream objects created by the factoryclassName
- name of the class containing the static fieldfieldName
- name of the static fieldfieldSig
- signature of the static field
-
-
Method Detail
-
createStream
public Stream createStream(Location location, org.apache.bcel.generic.ObjectType type, org.apache.bcel.generic.ConstantPoolGen cpg, RepositoryLookupFailureCallback lookupFailureCallback)
Description copied from interface:StreamFactory
Determine if a Stream is created at given location.- Specified by:
createStream
in interfaceStreamFactory
- Parameters:
location
- the Locationtype
- the ObjectType associated with the instruction at the location; the StreamResourceTracker prescreens for TypedInstructions that are associated with ObjectTypes, since they are the only instructions that could conceivably create a stream objectcpg
- the ConstantPoolGen for the methodlookupFailureCallback
- used to report missing classes in the class hierarchy- Returns:
- a Stream created at the Location, or null if no stream is created there
-
-