Bug 1352608 - Close a cursor after we're done with it r=eoger

Removed "final" because "safeQuery" provides terrible developer ergonomics.

MozReview-Commit-ID: 2F0XZnBM3Yv

--HG--
extra : rebase_source : 634c6f8cfc14cce8d15e2911d474086dc85c6db4
This commit is contained in:
Grigory Kruglov 2017-03-31 20:22:06 -04:00
parent becf618cc2
commit a8810d8865

View File

@ -186,13 +186,18 @@ public class FennecTabsRepository extends Repository {
private long getLocalClientLastModified() {
final String localClientSelection = Clients.GUID + " IS NULL";
final String[] localClientSelectionArgs = null;
Cursor cursor = null;
try {
final Cursor cursor = clientsHelper.safeQuery(tabsProvider, ".fetchLocalClient()", null,
cursor = clientsHelper.safeQuery(tabsProvider, ".fetchLocalClient()", null,
localClientSelection, localClientSelectionArgs, null);
cursor.moveToFirst();
return RepoUtils.getLongFromCursor(cursor, Clients.LAST_MODIFIED);
} catch (Exception e) {
return 0;
} finally {
if (cursor != null) {
cursor.close();
}
}
}