/** * 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(); }
/** * 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(); }