int parameterNumber = -1;
if (derefLocationSet.size() == 1) {
Location loc = derefLocationSet.iterator().next();
PointerUsageRequiringNonNullValue pu = null;
try {
UsagesRequiringNonNullValues usages = classContext.getUsagesRequiringNonNullValues(method);
pu = usages.get(loc, refValue, vnaDataflow);
} catch (DataflowAnalysisException e) {
AnalysisContext.logError("Error getting UsagesRequiringNonNullValues for " + method, e);
} catch (CFGBuilderException e) {
AnalysisContext.logError("Error getting UsagesRequiringNonNullValues for " + method, e);
}
if (pu == null) {
assert true; // nothing to do
} else if (deref.isReadlineValue()) {
bugType = "NP_DEREFERENCE_OF_READLINE_VALUE";
priority = NORMAL_PRIORITY;
} else if (deref.isMethodReturnValue() && !deref.isReadlineValue()) {
bugType = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE";
priority = NORMAL_PRIORITY;
} else if (pu.isReturnFromNonNullMethod()) {
bugType = "NP_NONNULL_RETURN_VIOLATION";
String methodName = method.getName();
String methodSig = method.getSignature();
if (methodName.equals("clone") && methodSig.equals("()Ljava/lang/Object;")) {
bugType = "NP_CLONE_COULD_RETURN_NULL";
priority = NORMAL_PRIORITY;
} else if (methodName.equals("toString") && methodSig.equals("()Ljava/lang/String;")) {
bugType = "NP_TOSTRING_COULD_RETURN_NULL";
priority = NORMAL_PRIORITY;
}
} else {
XField f = pu.getNonNullField();
if (f != null) {
storedField = FieldAnnotation.fromXField(f);
bugType = "NP_STORE_INTO_NONNULL_FIELD";
} else {
XMethodParameter mp = pu.getNonNullParameter();
if (mp != null) {
invokedXMethod = mp.getMethod();
for (Location derefLoc : derefLocationSet) {
if (safeCallToPrimateParseMethod(invokedXMethod, derefLoc)) {
return;