database.getActions(receiverType, methodName, signature, isStatic, actionList);
if (actionList.isEmpty()) {
try {
TypeFrame factAtLocation = null;
SignatureParser sigParser = new SignatureParser(signature);
// int startIndex = 0;
// if (!xmethod.isStatic())
// startIndex = 1;
Iterator<String> signatureIterator = sigParser.parameterSignatureIterator();
int parameters = sigParser.getNumParameters();
for (int i = 0; i < parameters; i++) {
String sig = signatureIterator.next();
Collection<ClassDescriptor> annotations = invokedMethod.getParameterAnnotationDescriptors(i);
if (annotations.contains(WILL_CLOSE) || sig.equals("Ljava/io/Closeable;") || methodName.startsWith("close")) {
// closing this value
if (factAtLocation == null) {
factAtLocation = typeDataflow.getFactAtLocation( new Location(handle, block));
}
Type argumentType = factAtLocation.getArgument(inv, cpg, i, sigParser);
if (argumentType instanceof ObjectType) {
Obligation obligation = database.getFactory().getObligationByType((ObjectType) argumentType);
if (obligation != null) {
actionList.add(new ObligationPolicyDatabaseAction(ObligationPolicyDatabaseActionType.DEL, obligation));
}
}
}
}
} catch (CheckedAnalysisException e) {
AnalysisContext.logError("Error checking " + invokedMethod, e);
} catch (ClassNotFoundException e) {
AnalysisContext.reportMissingClass(e);
} finally { }
}
if (DEBUG_LOOKUP && !actionList.isEmpty()) {
System.out.println(" At " + handle + ": " + actionList);
}
}
} else if (ins instanceof PUTFIELD || ins instanceof PUTSTATIC || ins instanceof ARETURN) {
Location loc = new Location(handle, block);
try {
TypeFrame typeFrame = typeDataflow.getFactAtLocation(loc);
if (typeFrame.isValid()) {
Type tosType = typeFrame.getTopValue();
if (tosType instanceof ObjectType) {
ObligationFactory factory = database.getFactory();
Obligation obligation = factory.getObligationByType((ObjectType) tosType);
if (obligation != null) {
if (obligation.getClassName().equals("java.sql.ResultSet")) {