funky = true;
}
}
//
XMethod m = getXMethod();
String sourceSig = m.getSourceSignature();
if (sourceSig != null) {
GenericSignatureParser sig = new GenericSignatureParser(sourceSig);
String genericReturnValue = sig.getReturnTypeSignature();
Type t = GenericUtilities.getType(genericReturnValue);
if (t instanceof GenericObjectType) {
funky = true;
}
// if (false) {
// XClass c = getXClass();
// String classSourceSig = c.getSourceSignature();
// if (!genericReturnValue.equals(classSourceSig))
// return;
// }
}
// System.out.println("Investigating " + getFullyQualifiedMethodName());
returnSelf = returnOther = updates = returnNew = returnUnknown = 0;
if (testingEnabled && REPORT_INFERRED_METHODS
&& AnalysisContext.currentAnalysisContext().isApplicationClass(getThisClass())) {
inferredMethod = new BugInstance("TESTING", NORMAL_PRIORITY).addClassAndMethod(this);
} else {
inferredMethod = null;
}
super.visit(code); // make callbacks to sawOpcode for all opcodes
// System.out.printf(" %3d %3d %3d %3d%n", returnSelf, updates, returnOther, returnNew);
if (returnSelf > 0 && returnOther == 0) {
okToIgnore.add(m);
} else if (funky) {
okToIgnore.add(m);
} else if (returnOther > 0 && returnOther >= returnSelf && returnNew > 0 && returnNew >= returnOther - 1) {
int priority = HIGH_PRIORITY;
if (returnSelf > 0 || updates > 0) {
priority++;
}
if (returnUnknown > 0) {
priority++;
}
if (returnNew > 0 && priority > NORMAL_PRIORITY) {
priority = NORMAL_PRIORITY;
}
if (updates > 0) {
priority = LOW_PRIORITY;
}
if (priority <= HIGH_PRIORITY) {
doNotIgnoreHigh.add(m);
}
if (priority <= NORMAL_PRIORITY) {
// System.out.printf(" adding %d %s%n", priority,
// MethodAnnotation.fromVisitedMethod(this).getSourceLines());
doNotIgnore.add(m);
if (!m.isStatic()) {
XFactory xFactory = AnalysisContext.currentXFactory();
xFactory.addFunctionThatMightBeMistakenForProcedures(getMethodDescriptor());
if (inferredMethod != null) {
inferredMethod.setPriority(priority);
inferredMethod.addString(String.format("%3d %3d %5d %3d", returnOther, returnSelf, returnNew, updates));