Close cursor after use in RestoreDbTaskTest.

Change-Id: I799fe29ecd602141cac61314c087e3154e12b102
This commit is contained in:
Rajeev Kumar 2017-06-27 17:05:19 -07:00
parent fe5008c997
commit 692aeec287
1 changed files with 2 additions and 5 deletions

View File

@ -47,11 +47,8 @@ public class RestoreDbTaskTest extends AndroidTestCase {
}
private int getCount(SQLiteDatabase db, String sql) {
Cursor c = db.rawQuery(sql, null);
try {
try (Cursor c = db.rawQuery(sql, null)) {
return c.getCount();
} finally {
c.getCount();
}
}
@ -59,7 +56,7 @@ public class RestoreDbTaskTest extends AndroidTestCase {
private final long mProfileId;
public MyDatabaseHelper(long profileId) {
MyDatabaseHelper(long profileId) {
super(getContext(), null, null);
mProfileId = profileId;
}