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


Java FindBugsAnalysisFeatures类代码示例

本文整理汇总了Java中edu.umd.cs.findbugs.FindBugsAnalysisFeatures的典型用法代码示例。如果您正苦于以下问题:Java FindBugsAnalysisFeatures类的具体用法?Java FindBugsAnalysisFeatures怎么用?Java FindBugsAnalysisFeatures使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: reportNullDeref

import edu.umd.cs.findbugs.FindBugsAnalysisFeatures; //导入依赖的package包/类
private void reportNullDeref(WarningPropertySet<WarningProperty> propertySet, Location location, String type, int priority,
        BugAnnotation cause, @CheckForNull BugAnnotation variable) {

    BugInstance bugInstance = new BugInstance(this, type, priority).addClassAndMethod(classContext.getJavaClass(), method);
    bugInstance.add(cause);
    if (variable != null)
        bugInstance.add(variable);
    else
        bugInstance.add(new LocalVariableAnnotation("?", -1, -1));
    bugInstance.addSourceLine(classContext, method, location).describe("SOURCE_LINE_DEREF");

    if (FindBugsAnalysisFeatures.isRelaxedMode()) {
        WarningPropertyUtil.addPropertiesForDataMining(propertySet, classContext, method, location);
    }
    addPropertiesForDereferenceLocations(propertySet, Collections.singleton(location));

    propertySet.decorateBugInstance(bugInstance);

    bugReporter.reportBug(bugInstance);
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:21,代码来源:NoiseNullDeref.java

示例2: reportNullDeref

import edu.umd.cs.findbugs.FindBugsAnalysisFeatures; //导入依赖的package包/类
private void reportNullDeref(WarningPropertySet<WarningProperty> propertySet, Location location, String type, int priority,
        @CheckForNull
        BugAnnotation variable) {

    BugInstance bugInstance = new BugInstance(this, type, priority).addClassAndMethod(classContext.getJavaClass(), method);
    if (variable != null)
        bugInstance.add(variable);
    else
        bugInstance.add(new LocalVariableAnnotation("?", -1, -1));
    bugInstance.addSourceLine(classContext, method, location).describe("SOURCE_LINE_DEREF");

    if (FindBugsAnalysisFeatures.isRelaxedMode()) {
        WarningPropertyUtil.addPropertiesForDataMining(propertySet, classContext, method, location);
    }
    addPropertiesForDereferenceLocations(propertySet, Collections.singleton(location), false);

    propertySet.decorateBugInstance(bugInstance);

    bugReporter.reportBug(bugInstance);
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:21,代码来源:FindNullDeref.java

示例3: visitClassContext

import edu.umd.cs.findbugs.FindBugsAnalysisFeatures; //导入依赖的package包/类
public void visitClassContext(ClassContext classContext) {
    boolean fullAnalysis = AnalysisContext.currentAnalysisContext().getBoolProperty(
            FindBugsAnalysisFeatures.INTERPROCEDURAL_ANALYSIS_OF_REFERENCED_CLASSES);
    if (!fullAnalysis && !AnalysisContext.currentAnalysisContext()./*
                                                                    * getSubtypes
                                                                    * ().
                                                                    */isApplicationClass(classContext.getJavaClass()))
        return;
    if (VERBOSE_DEBUG)
        System.out.println("Visiting class " + classContext.getJavaClass().getClassName());

    for (Method m : classContext.getMethodsInCallOrder())
        considerMethod(classContext, m);
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:15,代码来源:BuildNonnullReturnDatabase.java

示例4: visitClassContext

import edu.umd.cs.findbugs.FindBugsAnalysisFeatures; //导入依赖的package包/类
public void visitClassContext(ClassContext classContext) {
    boolean fullAnalysis = AnalysisContext.currentAnalysisContext().getBoolProperty(
            FindBugsAnalysisFeatures.INTERPROCEDURAL_ANALYSIS_OF_REFERENCED_CLASSES);
    if (!fullAnalysis && !AnalysisContext.currentAnalysisContext().isApplicationClass(classContext.getJavaClass()))
        return;
    if (VERBOSE_DEBUG)
        System.out.println("Visiting class " + classContext.getJavaClass().getClassName());

    for (Method m : classContext.getMethodsInCallOrder())
        considerMethod(classContext, m);
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:12,代码来源:BuildUnconditionalParamDerefDatabase.java

示例5: decorateWarning

import edu.umd.cs.findbugs.FindBugsAnalysisFeatures; //导入依赖的package包/类
private void decorateWarning(Location location, WarningPropertySet<WarningProperty> propertySet, BugInstance warning) {
    if (FindBugsAnalysisFeatures.isRelaxedMode()) {
        WarningPropertyUtil.addPropertiesForDataMining(propertySet, classContext, method, location);
    }
    propertySet.decorateBugInstance(warning);
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:7,代码来源:FindNullDeref.java


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