/**
*
*/
private void sawMethodCallWithIgnoredReturnValue() {
{
CheckReturnValueAnnotation annotation = checkReturnAnnotationDatabase.getResolvedAnnotation(callSeen, false);
if (annotation == null) {
XFactory xFactory = AnalysisContext.currentXFactory();
if (xFactory.isFunctionshatMightBeMistakenForProcedures(callSeen.getMethodDescriptor())) {
annotation = CheckReturnValueAnnotation.CHECK_RETURN_VALUE_INFERRED;
}
}
if (annotation != null && annotation.getPriority() <= LOW_PRIORITY) {
int popPC = getPC();
if (DEBUG) {
System.out.println("Saw POP @" + popPC);
}
int catchSize = getSizeOfSurroundingTryBlock(popPC);
int priority = annotation.getPriority();
if (catchSize <= 1) {
priority += 2;
} else if (catchSize <= 2) {
priority += 1;
}
if (!checkReturnAnnotationDatabase.annotationIsDirect(callSeen)
&& !callSeen.getSignature().endsWith(callSeen.getClassName().replace('.', '/') + ";")) {
priority++;
}
if (callSeen.isPrivate()) {
priority++;
}
if (callSeen.getName().equals("clone") || callSeen.getName().startsWith("get")) {
priority++;
}
String pattern = annotation.getPattern();
if (callSeen.getName().equals("<init>")
&& (callSeen.getClassName().endsWith("Exception") || callSeen.getClassName().endsWith("Error"))) {
pattern = "RV_EXCEPTION_NOT_THROWN";
}
BugInstance warning = new BugInstance(this, pattern, priority).addClassAndMethod(this).addMethod(callSeen)