/** * Constructor. * * @param reporter * the BugReporter to which warnings should eventually be * reported */ public BugAccumulator(BugReporter reporter) { this.reporter = reporter; performAccumulation = AnalysisContext.currentAnalysisContext().getBoolProperty(AnalysisFeatures.MERGE_SIMILAR_WARNINGS); }
static boolean getProperty(@AnalysisFeature int property) { return AnalysisContext.currentAnalysisContext().getBoolProperty(property); }
/** * Constructor. * * @param classContext * the ClassContext * @param method * the method to analyze * @param collector * the NullDerefAndRedundantComparisonCollector used to report * null derefs and redundant null comparisons */ public NullDerefAndRedundantComparisonFinder(ClassContext classContext, Method method, NullDerefAndRedundantComparisonCollector collector) { this.classContext = classContext; this.method = method; this.collector = collector; this.findGuaranteedDerefs = classContext.getAnalysisContext().getBoolProperty( AnalysisFeatures.TRACK_GUARANTEED_VALUE_DEREFS_IN_NULL_POINTER_ANALYSIS); this.lineMentionedMultipleTimes = classContext.linesMentionedMultipleTimes(method); this.redundantBranchList = new LinkedList<>(); this.definitelySameBranchSet = new BitSet(); this.definitelyDifferentBranchSet = new BitSet(); this.undeterminedBranchSet = new BitSet(); this.assertionMethods = classContext.getAssertionMethods(); }
public IsNullValueAnalysis(MethodDescriptor descriptor, MethodGen methodGen, CFG cfg, ValueNumberDataflow vnaDataflow, TypeDataflow typeDataflow, DepthFirstSearch dfs, AssertionMethods assertionMethods) { super(dfs); this.trackValueNumbers = AnalysisContext.currentAnalysisContext().getBoolProperty( AnalysisFeatures.TRACK_VALUE_NUMBERS_IN_NULL_POINTER_ANALYSIS); this.methodGen = methodGen; this.visitor = new IsNullValueFrameModelingVisitor(methodGen.getConstantPool(), assertionMethods, vnaDataflow, typeDataflow, trackValueNumbers); this.vnaDataflow = vnaDataflow; this.cfg = cfg; this.locationWhereValueBecomesNullSet = new HashSet<>(); this.pointerEqualityCheck = getForPointerEqualityCheck(cfg, vnaDataflow); if (DEBUG) { System.out.println("IsNullValueAnalysis for " + methodGen.getClassName() + "." + methodGen.getName() + " : " + methodGen.getSignature()); } }
@Override 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); } }
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); } }
public void execute() throws DataflowAnalysisException { AnalysisContext currentAnalysisContext = AnalysisContext.currentAnalysisContext(); if (currentAnalysisContext.getBoolProperty(AnalysisFeatures.CONSERVE_SPACE)) { throw new IllegalStateException("This should not happen");
if (!(FORCE_ACCURATE_EXCEPTIONS || AnalysisContext.currentAnalysisContext().getBoolProperty( AnalysisFeatures.ACCURATE_EXCEPTIONS))) { return;
if (!AnalysisContext.currentAnalysisContext().getBoolProperty(FindBugsAnalysisFeatures.INTERPROCEDURAL_ANALYSIS) && factory.isDetectorClassSubtypeOf(InterproceduralFirstPassDetector.class)) { return false;
return null; if (analysisContext.getBoolProperty(AnalysisFeatures.SKIP_HUGE_METHODS)) { if (codeLength > 6000 || (Const.STATIC_INITIALIZER_NAME.equals(methodName) || "getContents".equals(methodName)) && codeLength > 2000) { analysisContext.getLookupFailureCallback().reportSkippedAnalysis(
final boolean PRUNE_INFEASIBLE_EXCEPTION_EDGES = AnalysisContext.currentAnalysisContext().getBoolProperty( AnalysisFeatures.ACCURATE_EXCEPTIONS); final boolean PRUNE_UNCONDITIONAL_EXCEPTION_THROWER_EDGES = !AnalysisContext.currentAnalysisContext().getBoolProperty( AnalysisFeatures.CONSERVE_SPACE);
.getLookupFailureCallback(), exceptionSetFactory); if (AnalysisContext.currentAnalysisContext().getBoolProperty(AnalysisFeatures.MODEL_INSTANCEOF)) { typeAnalysis.setValueNumberDataflow(getValueNumberDataflow(analysisCache, descriptor));
|| AnalysisContext.currentAnalysisContext().getBoolProperty(AnalysisFeatures.ACCURATE_EXCEPTIONS)) { try {
if (AnalysisContext.currentAnalysisContext().getBoolProperty(AnalysisFeatures.ACCURATE_EXCEPTIONS) && ignoreImplicitExceptions && !edge.isFlagSet(EXPLICIT_EXCEPTIONS_FLAG)) { return;
/** * Constructor. * * @param reporter * the BugReporter to which warnings should eventually be * reported */ public BugAccumulator(BugReporter reporter) { this.reporter = reporter; performAccumulation = AnalysisContext.currentAnalysisContext().getBoolProperty(AnalysisFeatures.MERGE_SIMILAR_WARNINGS); }
static boolean getProperty(@AnalysisFeature int property) { return AnalysisContext.currentAnalysisContext().getBoolProperty(property); }
/** * Constructor. * * @param classContext * the ClassContext * @param method * the method to analyze * @param collector * the NullDerefAndRedundantComparisonCollector used to report * null derefs and redundant null comparisons */ public NullDerefAndRedundantComparisonFinder(ClassContext classContext, Method method, NullDerefAndRedundantComparisonCollector collector) { this.classContext = classContext; this.method = method; this.collector = collector; this.findGuaranteedDerefs = classContext.getAnalysisContext().getBoolProperty( AnalysisFeatures.TRACK_GUARANTEED_VALUE_DEREFS_IN_NULL_POINTER_ANALYSIS); this.lineMentionedMultipleTimes = classContext.linesMentionedMultipleTimes(method); this.redundantBranchList = new LinkedList<RedundantBranch>(); this.definitelySameBranchSet = new BitSet(); this.definitelyDifferentBranchSet = new BitSet(); this.undeterminedBranchSet = new BitSet(); this.assertionMethods = classContext.getAssertionMethods(); }
public IsNullValueAnalysis(MethodDescriptor descriptor, MethodGen methodGen, CFG cfg, ValueNumberDataflow vnaDataflow, TypeDataflow typeDataflow, DepthFirstSearch dfs, AssertionMethods assertionMethods) { super(dfs); this.trackValueNumbers = AnalysisContext.currentAnalysisContext().getBoolProperty( AnalysisFeatures.TRACK_VALUE_NUMBERS_IN_NULL_POINTER_ANALYSIS); this.methodGen = methodGen; this.visitor = new IsNullValueFrameModelingVisitor(methodGen.getConstantPool(), assertionMethods, vnaDataflow, typeDataflow, trackValueNumbers); this.vnaDataflow = vnaDataflow; this.cfg = cfg; this.locationWhereValueBecomesNullSet = new HashSet<LocationWhereValueBecomesNull>(); this.pointerEqualityCheck = getForPointerEqualityCheck(cfg, vnaDataflow); if (DEBUG) { System.out.println("IsNullValueAnalysis for " + methodGen.getClassName() + "." + methodGen.getName() + " : " + methodGen.getSignature()); } }
@Override 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); } }
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); } }