public void foundRedundantNullCheck(Location location, RedundantBranch redundantBranch) {  } }; NullDerefAndRedundantComparisonFinder worker = new NullDerefAndRedundantComparisonFinder( classContext, method, invDataflow, collector); worker.execute();  if (!property.isEmpty()) { database.setProperty( XMethodFactory.createXMethod(classContext.getJavaClass(), method), property);
XMethod xmethod = XMethodFactory.createXMethod(classContext.getJavaClass(), method); database.setProperty(xmethod, property);
	private void analyzeMethod(ClassContext classContext, Method method) {				try {			// Perform null-value analysis with all parameters set to null.			// Then see where possibly-null parameters are dereferenced.						IsNullValueAnalysis invAnalysis = new IsNullValueAnalysis(					classContext.getMethodGen(method),					classContext.getCFG(method),					classContext.getValueNumberDataflow(method),					classContext.getDepthFirstSearch(method),					classContext.getAssertionMethods());						invAnalysis.setParamValue(IsNullValue.nullValue());						IsNullValueDataflow invDataflow = new IsNullValueDataflow(					classContext.getCFG(method),					invAnalysis);			invDataflow.execute();						final ValueNumberAnalysis valueNumberAnalysis = classContext.getValueNumberDataflow(method).getAnalysis();			final Map<ValueNumber, Integer> valueNumberToParamMap = buildValueNumberToParamMap(					classContext, method);						final UnconditionalDerefProperty property = new UnconditionalDerefProperty();			// Find null derefs			NullDerefAndRedundantComparisonCollector collector = new NullDerefAndRedundantComparisonCollector() {				public void foundNullDeref(Location location, ValueNumber valueNumber, IsNullValue refValue) {										// Only consider dereferences of values which are definitely null.					if (!refValue.isDefinitelyNull()) {						return;					}										BitSet inputValueNumberSet = new BitSet();					inputValueNumberSet.set(valueNumber.getNumber());					// If we have a merge tree for the value number analysis,					// then we can find all dataflow values that contributed to this					// one as input.					if (valueNumberAnalysis.getMergeTree() != null) {						if (MergeTree.DEBUG) {							System.out.println("Unconditional deref of " + valueNumber.getNumber());						}						inputValueNumberSet.or(valueNumberAnalysis.getMergeTree().getTransitiveInputSet(valueNumber));						if (MergeTree.DEBUG) {							System.out.println("Input set is " + inputValueNumberSet);						}					}										// For all input value numbers contributing to the dereferenced					// value, see which ones are params and mark them as					// unconditionally dereferenced.					for (int i = 0; i < valueNumberAnalysis.getFactory().getNumValuesAllocated(); ++i) {						if (!inputValueNumberSet.get(i))							continue;						ValueNumber inputValueNumber = valueNumberAnalysis.getFactory().forNumber(i);						Integer param = valueNumberToParamMap.get(inputValueNumber);						if (param != null) {							property.setUnconditionalDeref(param.intValue(), true);						}					}				}								public void foundRedundantNullCheck(Location location, RedundantBranch redundantBranch) {					// Don't care about these				}			};			NullDerefAndRedundantComparisonFinder worker = new NullDerefAndRedundantComparisonFinder(					classContext, method, invDataflow, collector);			worker.execute();						if (!property.isEmpty()) {				database.setProperty(						XMethodFactory.createXMethod(classContext.getJavaClass(), method),						property);			}				} catch (CFGBuilderException e) {			bugReporter.logError("Error analyzing " + method + " for unconditional deref training", e);		} catch (DataflowAnalysisException e) {			bugReporter.logError("Error analyzing " + method + " for unconditional deref training", e);		}	}