01: /*
02: * FindBugs - Find Bugs in Java programs
03: * Copyright (C) 2003-2007 University of Maryland
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18: */
19:
20: package edu.umd.cs.findbugs.ba.jsr305;
21:
22: import org.apache.bcel.generic.ConstantPoolGen;
23:
24: import edu.umd.cs.findbugs.ba.CFG;
25: import edu.umd.cs.findbugs.ba.DataflowAnalysisException;
26: import edu.umd.cs.findbugs.ba.DepthFirstSearch;
27: import edu.umd.cs.findbugs.ba.XMethod;
28: import edu.umd.cs.findbugs.ba.vna.ValueNumberDataflow;
29: import edu.umd.cs.findbugs.classfile.IAnalysisCache;
30: import edu.umd.cs.findbugs.classfile.MethodDescriptor;
31:
32: /**
33: * Factory for producing ForwardTypeQualifierDataflow objects
34: * for various kinds of type qualifiers.
35: *
36: * @author David Hovemeyer
37: */
38: public class ForwardTypeQualifierDataflowFactory
39: extends
40: TypeQualifierDataflowFactory<ForwardTypeQualifierDataflowAnalysis, ForwardTypeQualifierDataflow> {
41:
42: /**
43: * Constructor.
44: *
45: * @param methodDescriptor MethodDescriptor of method being analyzed
46: */
47: public ForwardTypeQualifierDataflowFactory(
48: MethodDescriptor methodDescriptor) {
49: super (methodDescriptor);
50: }
51:
52: /* (non-Javadoc)
53: * @see edu.umd.cs.findbugs.ba.jsr305.TypeQualifierDataflowFactory#getDataflow(edu.umd.cs.findbugs.ba.DepthFirstSearch, edu.umd.cs.findbugs.ba.XMethod, edu.umd.cs.findbugs.ba.CFG, edu.umd.cs.findbugs.ba.vna.ValueNumberDataflow, org.apache.bcel.generic.ConstantPoolGen, edu.umd.cs.findbugs.classfile.IAnalysisCache, edu.umd.cs.findbugs.classfile.MethodDescriptor)
54: */
55: @Override
56: protected ForwardTypeQualifierDataflow getDataflow(
57: DepthFirstSearch dfs, XMethod xmethod, CFG cfg,
58: ValueNumberDataflow vnaDataflow, ConstantPoolGen cpg,
59: IAnalysisCache analysisCache,
60: MethodDescriptor methodDescriptor,
61: TypeQualifierValue typeQualifierValue)
62: throws DataflowAnalysisException {
63: ForwardTypeQualifierDataflowAnalysis analysis = new ForwardTypeQualifierDataflowAnalysis(
64: dfs, xmethod, cfg, vnaDataflow, cpg, typeQualifierValue);
65: analysis.registerSourceSinkLocations();
66:
67: ForwardTypeQualifierDataflow dataflow = new ForwardTypeQualifierDataflow(
68: cfg, analysis);
69: dataflow.execute();
70:
71: return dataflow;
72: }
73: }
|