ConstantPoolGen cpg = methodGen.getConstantPool();
CFG cfg = classContext.getCFG(method);
StringAppendState stringAppendState = getStringAppendState(cfg, cpg);
ConstantDataflow dataflow = classContext.getConstantDataflow(method);
for (Iterator<Location> i = cfg.locationIterator(); i.hasNext();) {
Location location = i.next();
Instruction ins = location.getHandle().getInstruction();
if (!(ins instanceof InvokeInstruction)) {
continue;
}
InvokeInstruction invoke = (InvokeInstruction) ins;
if (isDatabaseSink(invoke, cpg)) {
ConstantFrame frame = dataflow.getFactAtLocation(location);
int numArguments = frame.getNumArguments(invoke, cpg);
Constant value = frame.getStackValue(numArguments - 1);
if (!value.isConstantString()) {
// TODO: verify it's the same string represented by