Close cursor after use in RestoreDbTaskTest.
Change-Id: I799fe29ecd602141cac61314c087e3154e12b102
This commit is contained in:
parent
fe5008c997
commit
692aeec287
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue