Package edu.umd.cs.findbugs.detect
Class StaticFieldLoadStreamFactory
java.lang.Object
edu.umd.cs.findbugs.detect.StaticFieldLoadStreamFactory
- All Implemented Interfaces:
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 -
Constructor Summary
ConstructorsConstructorDescriptionStaticFieldLoadStreamFactory
(String streamBaseClass, String className, String fieldName, String fieldSig) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncreateStream
(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.
-
Field Details
-
streamBaseClass
-
className
-
fieldName
-
fieldSig
-
-
Constructor Details
-
StaticFieldLoadStreamFactory
public StaticFieldLoadStreamFactory(String streamBaseClass, String className, String fieldName, 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 Details
-
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
-