Class StaticFieldLoadStreamFactory

java.lang.Object
edu.umd.cs.findbugs.detect.StaticFieldLoadStreamFactory
All Implemented Interfaces:
StreamFactory

public class StaticFieldLoadStreamFactory extends 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 Details

    • streamBaseClass

      public String streamBaseClass
    • className

      public String className
    • fieldName

      public String fieldName
    • fieldSig

      public String 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 factory
      className - name of the class containing the static field
      fieldName - name of the static field
      fieldSig - 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 interface StreamFactory
      Parameters:
      location - the Location
      type - 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 object
      cpg - the ConstantPoolGen for the method
      lookupFailureCallback - used to report missing classes in the class hierarchy
      Returns:
      a Stream created at the Location, or null if no stream is created there