Merge "Close cursor after use in RestoreDbTaskTest." into ub-launcher3-dorval-polish

This commit is contained in:
Rajeev Kumar 2017-07-05 16:23:15 +00:00 committed by Android (Google) Code Review
commit 67058f2009
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;
}