edu.umd.cs.findbugs.ba.bcp

Class PatternMatcher

public class PatternMatcher extends Object implements DFSEdgeTypes

Match a ByteCodePattern against the code of a method, represented by a CFG. Produces some number of ByteCodePatternMatch objects, which indicate how the pattern matched the bytecode instructions in the method.

This code is a hack and should probably be rewritten.

Author: David Hovemeyer

See Also: ByteCodePattern

Constructor Summary
PatternMatcher(ByteCodePattern pattern, ClassContext classContext, Method method)
Constructor.
Method Summary
Iterator<ByteCodePatternMatch>byteCodePatternMatchIterator()
Return an Iterator over the ByteCodePatternMatch objects representing successful matches of the ByteCodePattern.
PatternMatcherexecute()
Search for examples of the ByteCodePattern.

Constructor Detail

PatternMatcher

public PatternMatcher(ByteCodePattern pattern, ClassContext classContext, Method method)
Constructor.

Parameters: pattern the ByteCodePattern to look for examples of classContext ClassContext for the class to analyze method the Method to analyze

Method Detail

byteCodePatternMatchIterator

public Iterator<ByteCodePatternMatch> byteCodePatternMatchIterator()
Return an Iterator over the ByteCodePatternMatch objects representing successful matches of the ByteCodePattern.

execute

public PatternMatcher execute()
Search for examples of the ByteCodePattern.

Returns: this object

Throws: DataflowAnalysisException if the ValueNumberAnalysis did not produce useful values for the method

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