当前位置: 首页>>代码示例>>Java>>正文


Java ClassContext.getDepthFirstSearch方法代码示例

本文整理汇总了Java中edu.umd.cs.findbugs.ba.ClassContext.getDepthFirstSearch方法的典型用法代码示例。如果您正苦于以下问题:Java ClassContext.getDepthFirstSearch方法的具体用法?Java ClassContext.getDepthFirstSearch怎么用?Java ClassContext.getDepthFirstSearch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在edu.umd.cs.findbugs.ba.ClassContext的用法示例。


在下文中一共展示了ClassContext.getDepthFirstSearch方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: PatternMatcher

import edu.umd.cs.findbugs.ba.ClassContext; //导入方法依赖的package包/类
/**
 * Constructor.
 * 
 * @param pattern
 *            the ByteCodePattern to look for examples of
 * @param classContext
 *            ClassContext for the class to analyze
 * @param method
 *            the Method to analyze
 */
public PatternMatcher(ByteCodePattern pattern, ClassContext classContext, Method method) throws CFGBuilderException,
        DataflowAnalysisException {
    this.pattern = pattern;
    this.cfg = classContext.getCFG(method);
    this.cpg = classContext.getConstantPoolGen();
    this.dfs = classContext.getDepthFirstSearch(method);
    this.vnaDataflow = classContext.getValueNumberDataflow(method);
    this.domAnalysis = classContext.getNonExceptionDominatorsAnalysis(method);
    this.workList = new LinkedList<BasicBlock>();
    this.visitedBlockMap = new IdentityHashMap<BasicBlock, BasicBlock>();
    this.resultList = new LinkedList<ByteCodePatternMatch>();
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:23,代码来源:PatternMatcher.java

示例2: analyzeMethod

import edu.umd.cs.findbugs.ba.ClassContext; //导入方法依赖的package包/类
public void analyzeMethod(ClassContext classContext, Method method, ResourceTrackerType resourceTracker,
        ResourceCollection<Resource> resourceCollection) throws CFGBuilderException, DataflowAnalysisException {

    MethodGen methodGen = classContext.getMethodGen(method);
    if (methodGen == null)
        return;
    try {
        CFG cfg = classContext.getCFG(method);
        DepthFirstSearch dfs = classContext.getDepthFirstSearch(method);

        if (DEBUG)
            System.out.println(SignatureConverter.convertMethodSignature(methodGen));

        for (Iterator<Resource> i = resourceCollection.resourceIterator(); i.hasNext();) {
            Resource resource = i.next();

            ResourceValueAnalysis<Resource> analysis = new ResourceValueAnalysis<Resource>(methodGen, cfg, dfs,
                    resourceTracker, resource);
            Dataflow<ResourceValueFrame, ResourceValueAnalysis<Resource>> dataflow = new Dataflow<ResourceValueFrame, ResourceValueAnalysis<Resource>>(
                    cfg, analysis);

            Profiler profiler = Global.getAnalysisCache().getProfiler();
            profiler.start(resourceTracker.getClass());
            try {
                dataflow.execute();
            } finally {
                profiler.end(resourceTracker.getClass());
            }
            inspectResult(classContext, methodGen, cfg, dataflow, resource);
        }
    } catch (RuntimeException e) {
        AnalysisContext.logError("Exception while analyzing " + methodGen.getClassName() + "." + methodGen.getName() + ":"
                + methodGen.getSignature(), e);
    }
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:36,代码来源:ResourceTrackingDetector.java


注:本文中的edu.umd.cs.findbugs.ba.ClassContext.getDepthFirstSearch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。