edu.umd.cs.findbugs.detect

Class InstanceFieldLoadStreamFactory

public class InstanceFieldLoadStreamFactory extends Object implements StreamFactory

StreamFactory for stream objects loaded from instance fields.

Author: David Hovemeyer

Constructor Summary
InstanceFieldLoadStreamFactory(String streamBaseClass)
Constructor.
Method Summary
StreamcreateStream(Location location, ObjectType type, ConstantPoolGen cpg, RepositoryLookupFailureCallback lookupFailureCallback)
InstanceFieldLoadStreamFactorysetBugPatternType(String bugPatternType)
Set the bug pattern type reported for unclosed streams loaded from this field.

Constructor Detail

InstanceFieldLoadStreamFactory

public InstanceFieldLoadStreamFactory(String streamBaseClass)
Constructor. By default, Streams created by this factory will not be marked as interesting. The setBugPatternType() method should be called to make the factory produce interesting streams.

Parameters: streamBaseClass the base class of the streams produced by the factory

Method Detail

createStream

public Stream createStream(Location location, ObjectType type, ConstantPoolGen cpg, RepositoryLookupFailureCallback lookupFailureCallback)

setBugPatternType

public InstanceFieldLoadStreamFactory setBugPatternType(String bugPatternType)
Set the bug pattern type reported for unclosed streams loaded from this field. This makes the created streams "interesting".

Parameters: bugPatternType the bug pattern type

FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.