assert true;
}
UnresolvedXMethod xmethod = new UnresolvedXMethod(originalDescriptor);
ObligationPolicyDatabase database = Global.getAnalysisCache().getOptionalDatabase(ObligationPolicyDatabase.class);
if (BuildObligationPolicyDatabase.INFER_CLOSE_METHODS && database != null
&& !xmethod.getClassName().startsWith("java")) {
boolean methodHasCloseInName = false;
String methodName = xmethod.getName();
SplitCamelCaseIdentifier splitter = new SplitCamelCaseIdentifier(methodName);
methodHasCloseInName = splitter.split().contains("close");
Obligation[] paramObligationTypes = database.getFactory().getParameterObligationTypes(xmethod);
for (int i = 0; i < xmethod.getNumParams(); i++) {
Obligation obligationType = paramObligationTypes[i];
if (obligationType == null) {
continue;
}
if (methodHasCloseInName) {
// Method has "close" in its name.
// Assume that it deletes the obligation.
ObligationPolicyDatabaseEntry entry = database.addParameterDeletesObligationDatabaseEntry(xmethod,
obligationType, ObligationPolicyDatabaseEntryType.STRONG);
} else {
/*
* // Interesting case: we have a parameter which is // an
* Obligation type, but no annotation or other indication //
* what is done by the method with the obligation. // We'll
* create a "weak" database entry deleting the //
* obligation. If strict checking is performed, // weak
* entries are ignored.
*/
if (methodName.equals("<init>") || methodName.startsWith("access$") || xmethod.isStatic()
|| methodName.toLowerCase().indexOf("close") >= 0
|| xmethod.getSignature().toLowerCase().indexOf("Closeable") >= 0) {
ObligationPolicyDatabaseEntry entry = database.addParameterDeletesObligationDatabaseEntry(xmethod,
obligationType, ObligationPolicyDatabaseEntryType.WEAK);
}
}
}