Merge "Close cursor after use in RestoreDbTaskTest." into ub-launcher3-dorval-polish
This commit is contained in:
commit
67058f2009
|
@ -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