warning.setPriority(propertySet.computePriority(NORMAL_PRIORITY));  if (AnalysisContext.currentAnalysisContext().getBoolProperty( FindBugsAnalysisProperties.RELAXED_REPORTING_MODE)) { WarningPropertyUtil.addPropertiesForLocation(propertySet, classContext, method, location); propertySet.decorateBugInstance(warning); }
	private void examineLocation(Location location, ConstantPoolGen cpg, TypeDataflow typeDataflow, UnconditionalDerefPropertyDatabase database)			throws DataflowAnalysisException, CFGBuilderException, ClassNotFoundException {		if (!(location.getHandle().getInstruction() instanceof InvokeInstruction))			return;				InvokeInstruction invokeInstruction = (InvokeInstruction)			location.getHandle().getInstruction();				if (DEBUG_NULLARG) {			System.out.println("Examining call site: " + location.getHandle());		}				String signature = invokeInstruction.getSignature(cpg); 		int returnTypeStart = signature.indexOf(')');		if (returnTypeStart < 0)			return;		String paramList = signature.substring(0, returnTypeStart + 1);				if (paramList.equals("()") ||				(paramList.indexOf("L") < 0 && paramList.indexOf('[') < 0))			// Method takes no arguments, or takes no reference arguments			return;		// See if any null arguments are passed		IsNullValueFrame frame =			classContext.getIsNullValueDataflow(method).getFactAtLocation(location);		if (!frame.isValid())			return;		BitSet nullArgSet = frame.getArgumentSet(invokeInstruction, cpg, new DataflowValueChooser<IsNullValue>() {			public boolean choose(IsNullValue value) {				// Only choose non-exception values.				// Values null on an exception path might be due to				// infeasible control flow.				return value.mightBeNull() && !value.isException();			}		});		BitSet definitelyNullArgSet = frame.getArgumentSet(invokeInstruction, cpg, new DataflowValueChooser<IsNullValue>() {			public boolean choose(IsNullValue value) {				return value.isDefinitelyNull();			}		});		if (nullArgSet.isEmpty())			return;		if (DEBUG_NULLARG) {			System.out.println("Null arguments passed: " + nullArgSet);		}				// See what methods might be called here		TypeFrame typeFrame = typeDataflow.getFactAtLocation(location);		Set<XMethod> targetMethodSet = Hierarchy.resolveMethodCallTargets(invokeInstruction, typeFrame, cpg);		if (DEBUG_NULLARG) {			System.out.println("Possibly called methods: " + targetMethodSet);		}				// See if any call targets unconditionally dereference one of the null arguments		BitSet unconditionallyDereferencedNullArgSet = new BitSet();		List<CallTarget> dangerousCallTargetList = new LinkedList<CallTarget>();		for (XMethod targetMethod : targetMethodSet) {			if (DEBUG_NULLARG) {				System.out.println("For target method " + targetMethod);			}						UnconditionalDerefProperty property = database.getProperty(targetMethod);			if (property == null)				continue;			if (DEBUG_NULLARG) {				System.out.println("\tUnconditionally dereferenced params: " + property);			}						BitSet targetUnconditionallyDereferencedNullArgSet =				property.getUnconditionallyDereferencedNullArgSet(nullArgSet);						if (targetUnconditionallyDereferencedNullArgSet.isEmpty())				continue;						JavaClass targetClass = AnalysisContext.currentAnalysisContext().lookupClass(targetMethod.getClassName());			dangerousCallTargetList.add(new CallTarget(targetClass, targetMethod));						unconditionallyDereferencedNullArgSet.or(targetUnconditionallyDereferencedNullArgSet);		}				if (dangerousCallTargetList.isEmpty())			return;				MethodGen methodGen = classContext.getMethodGen(method);		String sourceFile = classContext.getJavaClass().getSourceFileName();		BugInstance warning = new BugInstance("NP_NULL_PARAM_DEREF", NORMAL_PRIORITY)				.addClassAndMethod(methodGen, sourceFile)				.addSourceLine(methodGen, sourceFile, location.getHandle());		for (int i = 0; i < 32; ++i) {			if (unconditionallyDereferencedNullArgSet.get(i)) {				// Note: we report params as being indexed starting from 1, not 0				warning.addInt(i + 1).describe(						definitelyNullArgSet.get(i) ? "INT_NULL_ARG" : "INT_MAYBE_NULL_ARG");			}		}		for (CallTarget dangerousCallTarget : dangerousCallTargetList) {			JavaClass targetClass = dangerousCallTarget.javaClass;			XMethod targetMethod = dangerousCallTarget.xmethod;			addMethodAnnotationForCalledMethod(warning, targetClass, targetMethod, "METHOD_DANGEROUS_TARGET");		}		if (REPORT_SAFE_METHOD_TARGETS) {			// This is useful to see which other call targets the analysis			// considered.			Set<XMethod> safeCallTargetSet = new HashSet<XMethod>();			safeCallTargetSet.addAll(targetMethodSet);			for (CallTarget dangerousCallTarget : dangerousCallTargetList) {				safeCallTargetSet.remove(dangerousCallTarget.xmethod);			}			for (XMethod safeMethod : safeCallTargetSet) {				JavaClass targetClass = AnalysisContext.currentAnalysisContext().lookupClass(safeMethod.getClassName());				addMethodAnnotationForCalledMethod(warning, targetClass, safeMethod, "METHOD_SAFE_TARGET");			}		}				bugReporter.reportBug(warning);	}