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


Java ClassContext.DUMP_DATAFLOW_ANALYSIS属性代码示例

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


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

示例1: analyze

public LiveLocalStoreDataflow analyze(IAnalysisCache analysisCache, MethodDescriptor descriptor)
        throws CheckedAnalysisException {
    MethodGen methodGen = getMethodGen(analysisCache, descriptor);
    if (methodGen == null) {
        return null;
    }
    CFG cfg = getCFG(analysisCache, descriptor);

    ReverseDepthFirstSearch rdfs = getReverseDepthFirstSearch(analysisCache, descriptor);

    LiveLocalStoreAnalysis analysis = new LiveLocalStoreAnalysis(methodGen, rdfs, getDepthFirstSearch(analysisCache,
            descriptor));
    LiveLocalStoreDataflow dataflow = new LiveLocalStoreDataflow(cfg, analysis);

    dataflow.execute();
    if (ClassContext.DUMP_DATAFLOW_ANALYSIS) {
        ClassContext.dumpLiveLocalStoreDataflow(descriptor, cfg, dataflow);

    }
    return dataflow;
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:21,代码来源:LiveLocalStoreDataflowFactory.java

示例2: getDataflow

@Override
protected BackwardTypeQualifierDataflow getDataflow(DepthFirstSearch dfs, XMethod xmethod, CFG cfg,
        ValueNumberDataflow vnaDataflow, ConstantPoolGen cpg, IAnalysisCache analysisCache,
        MethodDescriptor methodDescriptor, TypeQualifierValue typeQualifierValue) throws CheckedAnalysisException {
    ReverseDepthFirstSearch rdfs = analysisCache.getMethodAnalysis(ReverseDepthFirstSearch.class, methodDescriptor);

    BackwardTypeQualifierDataflowAnalysis analysis = new BackwardTypeQualifierDataflowAnalysis(dfs, rdfs, xmethod, cfg,
            vnaDataflow, cpg, typeQualifierValue);

    // Get the corresponding forward dataflow.
    // We use it to halt tracking of backwards values once we know
    // that they encounter a conflicting forward value.
    ForwardTypeQualifierDataflowFactory forwardFactory = analysisCache.getMethodAnalysis(
            ForwardTypeQualifierDataflowFactory.class, methodDescriptor);
    ForwardTypeQualifierDataflow forwardDataflow = forwardFactory.getDataflow(typeQualifierValue);
    analysis.setForwardTypeQualifierDataflow(forwardDataflow);
    analysis.registerSourceSinkLocations();

    BackwardTypeQualifierDataflow dataflow = new BackwardTypeQualifierDataflow(cfg, analysis);

    dataflow.execute();
    if (ClassContext.DUMP_DATAFLOW_ANALYSIS) {
        dataflow.dumpDataflow(analysis);
    }
    return dataflow;
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:26,代码来源:BackwardTypeQualifierDataflowFactory.java

示例3: getDataflow

@Override
protected BackwardTypeQualifierDataflow getDataflow(DepthFirstSearch dfs, XMethod xmethod, CFG cfg,
        ValueNumberDataflow vnaDataflow, ConstantPoolGen cpg, IAnalysisCache analysisCache,
        MethodDescriptor methodDescriptor, TypeQualifierValue<?> typeQualifierValue) throws CheckedAnalysisException {
    ReverseDepthFirstSearch rdfs = analysisCache.getMethodAnalysis(ReverseDepthFirstSearch.class, methodDescriptor);

    BackwardTypeQualifierDataflowAnalysis analysis = new BackwardTypeQualifierDataflowAnalysis(dfs, rdfs, xmethod, cfg,
            vnaDataflow, cpg, typeQualifierValue);

    // Get the corresponding forward dataflow.
    // We use it to halt tracking of backwards values once we know
    // that they encounter a conflicting forward value.
    ForwardTypeQualifierDataflowFactory forwardFactory = analysisCache.getMethodAnalysis(
            ForwardTypeQualifierDataflowFactory.class, methodDescriptor);
    ForwardTypeQualifierDataflow forwardDataflow = forwardFactory.getDataflow(typeQualifierValue);
    analysis.setForwardTypeQualifierDataflow(forwardDataflow);
    analysis.registerSourceSinkLocations();

    BackwardTypeQualifierDataflow dataflow = new BackwardTypeQualifierDataflow(cfg, analysis);

    dataflow.execute();
    if (ClassContext.DUMP_DATAFLOW_ANALYSIS) {
        dataflow.dumpDataflow(analysis);
    }
    return dataflow;
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:26,代码来源:BackwardTypeQualifierDataflowFactory.java

示例4: analyze

public IsNullValueDataflow analyze(IAnalysisCache analysisCache, MethodDescriptor descriptor) throws CheckedAnalysisException {
    MethodGen methodGen = getMethodGen(analysisCache, descriptor);
    if (methodGen == null) {
        throw new MethodUnprofitableException(descriptor);
    }
    CFG cfg = getCFG(analysisCache, descriptor);
    ValueNumberDataflow vnaDataflow = getValueNumberDataflow(analysisCache, descriptor);
    DepthFirstSearch dfs = getDepthFirstSearch(analysisCache, descriptor);
    AssertionMethods assertionMethods = getAssertionMethods(analysisCache, descriptor.getClassDescriptor());
    TypeDataflow typeDataflow = getTypeDataflow(analysisCache, descriptor);

    IsNullValueAnalysis invAnalysis = new IsNullValueAnalysis(descriptor, methodGen, cfg, vnaDataflow, typeDataflow, dfs,
            assertionMethods);

    // Set return value and parameter databases

    invAnalysis.setClassAndMethod(new JavaClassAndMethod(getJavaClass(analysisCache, descriptor.getClassDescriptor()),
            getMethod(analysisCache, descriptor)));

    IsNullValueDataflow invDataflow = new IsNullValueDataflow(cfg, invAnalysis);
    invDataflow.execute();
    if (ClassContext.DUMP_DATAFLOW_ANALYSIS) {
        invDataflow.dumpDataflow(invAnalysis);
    }
    return invDataflow;

}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:27,代码来源:IsNullValueDataflowFactory.java

示例5: analyze

public UnconditionalValueDerefDataflow analyze(IAnalysisCache analysisCache, MethodDescriptor descriptor)
        throws CheckedAnalysisException {
    MethodGen methodGen = getMethodGen(analysisCache, descriptor);
    if (methodGen == null) {
        throw new MethodUnprofitableException(descriptor);
    }

    CFG cfg = getCFG(analysisCache, descriptor);

    ValueNumberDataflow vnd = getValueNumberDataflow(analysisCache, descriptor);

    UnconditionalValueDerefAnalysis analysis = new UnconditionalValueDerefAnalysis(getReverseDepthFirstSearch(analysisCache,
            descriptor), getDepthFirstSearch(analysisCache, descriptor), cfg, getMethod(analysisCache, descriptor),
            methodGen, vnd, getAssertionMethods(analysisCache, descriptor.getClassDescriptor()));

    IsNullValueDataflow inv = getIsNullValueDataflow(analysisCache, descriptor);
    // XXX: hack to clear derefs on not-null branches
    analysis.clearDerefsOnNonNullBranches(inv);

    TypeDataflow typeDataflow = getTypeDataflow(analysisCache, descriptor);
    // XXX: type analysis is needed to resolve method calls for
    // checking whether call targets unconditionally dereference parameters
    analysis.setTypeDataflow(typeDataflow);

    UnconditionalValueDerefDataflow dataflow = new UnconditionalValueDerefDataflow(cfg, analysis);
    dataflow.execute();
    if (ClassContext.DUMP_DATAFLOW_ANALYSIS) {
        dataflow.dumpDataflow(analysis);
    }
    if (UnconditionalValueDerefAnalysis.DEBUG) {
        ClassContext.dumpDataflowInformation(getMethod(analysisCache, descriptor), cfg, vnd, inv, dataflow, typeDataflow);
    }

    return dataflow;
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:35,代码来源:UnconditionalValueDerefDataflowFactory.java

示例6: analyze

public TypeDataflow analyze(IAnalysisCache analysisCache, MethodDescriptor descriptor) throws CheckedAnalysisException {
    MethodGen methodGen = getMethodGen(analysisCache, descriptor);
    if (methodGen == null) {
        throw new MethodUnprofitableException(descriptor);
    }
    CFG cfg = getCFG(analysisCache, descriptor);
    DepthFirstSearch dfs = getDepthFirstSearch(analysisCache, descriptor);
    ExceptionSetFactory exceptionSetFactory = getExceptionSetFactory(analysisCache, descriptor);
    Method method = getMethod(analysisCache, descriptor);

    TypeAnalysis typeAnalysis = new TypeAnalysis(method, methodGen, cfg, dfs, AnalysisContext.currentAnalysisContext()
            .getLookupFailureCallback(), exceptionSetFactory);

    if (AnalysisContext.currentAnalysisContext().getBoolProperty(AnalysisFeatures.MODEL_INSTANCEOF)) {
        typeAnalysis.setValueNumberDataflow(getValueNumberDataflow(analysisCache, descriptor));
    }

    // Field store type database.
    // If present, this can give us more accurate type information
    // for values loaded from fields.
    typeAnalysis.setFieldStoreTypeDatabase(AnalysisContext.currentAnalysisContext().getFieldStoreTypeDatabase());

    TypeDataflow typeDataflow = new TypeDataflow(cfg, typeAnalysis);
    try {
        typeDataflow.execute();
    } catch (CheckedAnalysisException e) {
        AnalysisContext.logError("Error performing type dataflow analysis of " + descriptor, e);
        throw e;
    }
    if (TypeAnalysis.DEBUG || ClassContext.DUMP_DATAFLOW_ANALYSIS) {
        ClassContext.dumpTypeDataflow(method, cfg, typeDataflow);
    }

    return typeDataflow;
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:35,代码来源:TypeDataflowFactory.java

示例7: getDataflow

@Override
protected ForwardTypeQualifierDataflow getDataflow(DepthFirstSearch dfs, XMethod xmethod, CFG cfg,
        ValueNumberDataflow vnaDataflow, ConstantPoolGen cpg, IAnalysisCache analysisCache,
        MethodDescriptor methodDescriptor, TypeQualifierValue typeQualifierValue) throws DataflowAnalysisException {
    ForwardTypeQualifierDataflowAnalysis analysis = new ForwardTypeQualifierDataflowAnalysis(dfs, xmethod, cfg, vnaDataflow,
            cpg, typeQualifierValue);
    analysis.registerSourceSinkLocations();

    ForwardTypeQualifierDataflow dataflow = new ForwardTypeQualifierDataflow(cfg, analysis);
    dataflow.execute();
    if (ClassContext.DUMP_DATAFLOW_ANALYSIS) {
        dataflow.dumpDataflow(analysis);
    }
    return dataflow;
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:15,代码来源:ForwardTypeQualifierDataflowFactory.java

示例8: getDataflow

@Override
protected ForwardTypeQualifierDataflow getDataflow(DepthFirstSearch dfs, XMethod xmethod, CFG cfg,
        ValueNumberDataflow vnaDataflow, ConstantPoolGen cpg, IAnalysisCache analysisCache,
        MethodDescriptor methodDescriptor, TypeQualifierValue<?> typeQualifierValue) throws DataflowAnalysisException {
    ForwardTypeQualifierDataflowAnalysis analysis = new ForwardTypeQualifierDataflowAnalysis(dfs, xmethod, cfg, vnaDataflow,
            cpg, typeQualifierValue);
    analysis.registerSourceSinkLocations();

    ForwardTypeQualifierDataflow dataflow = new ForwardTypeQualifierDataflow(cfg, analysis);
    dataflow.execute();
    if (ClassContext.DUMP_DATAFLOW_ANALYSIS) {
        dataflow.dumpDataflow(analysis);
    }
    return dataflow;
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:15,代码来源:ForwardTypeQualifierDataflowFactory.java


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