Dbrant has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362279 )
Change subject: Hygiene: remove redundant method. ...................................................................... Hygiene: remove redundant method. Change-Id: Iad051dc8b2bfd8c38e65d5569c5c003ae77916a0 --- M app/src/main/java/org/wikipedia/readinglist/AddToReadingListDialog.java M app/src/main/java/org/wikipedia/readinglist/ReadingListData.java M app/src/main/java/org/wikipedia/readinglist/page/database/ReadingListPageDao.java 3 files changed, 2 insertions(+), 17 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/79/362279/1 diff --git a/app/src/main/java/org/wikipedia/readinglist/AddToReadingListDialog.java b/app/src/main/java/org/wikipedia/readinglist/AddToReadingListDialog.java index 157c27f..bfdc248 100644 --- a/app/src/main/java/org/wikipedia/readinglist/AddToReadingListDialog.java +++ b/app/src/main/java/org/wikipedia/readinglist/AddToReadingListDialog.java @@ -22,7 +22,6 @@ import org.wikipedia.page.PageTitle; import org.wikipedia.readinglist.page.ReadingListPage; import org.wikipedia.readinglist.page.database.ReadingListDaoProxy; -import org.wikipedia.readinglist.page.database.ReadingListPageDao; import org.wikipedia.readinglist.sync.ReadingListSynchronizer; import org.wikipedia.settings.Prefs; import org.wikipedia.util.DimenUtil; @@ -232,7 +231,7 @@ } @NonNull private ReadingListPage findOrCreatePage(ReadingList readingList, PageTitle title) { - ReadingListPage page = ReadingListPageDao.instance().findPage(ReadingListDaoProxy.key(title)); + ReadingListPage page = ReadingListData.instance().findPageInAnyList(ReadingListDaoProxy.key(title)); if (page == null) { page = ReadingListDaoProxy.page(readingList, title); } diff --git a/app/src/main/java/org/wikipedia/readinglist/ReadingListData.java b/app/src/main/java/org/wikipedia/readinglist/ReadingListData.java index c6f970e..958b592 100644 --- a/app/src/main/java/org/wikipedia/readinglist/ReadingListData.java +++ b/app/src/main/java/org/wikipedia/readinglist/ReadingListData.java @@ -180,7 +180,7 @@ } @Nullable - private synchronized ReadingListPage findPageInAnyList(String key) { + public synchronized ReadingListPage findPageInAnyList(String key) { Cursor cursor = ReadingListPageDao.instance().page(key); try { if (cursor.getCount() != 0) { diff --git a/app/src/main/java/org/wikipedia/readinglist/page/database/ReadingListPageDao.java b/app/src/main/java/org/wikipedia/readinglist/page/database/ReadingListPageDao.java index d62de97..537595d 100644 --- a/app/src/main/java/org/wikipedia/readinglist/page/database/ReadingListPageDao.java +++ b/app/src/main/java/org/wikipedia/readinglist/page/database/ReadingListPageDao.java @@ -3,7 +3,6 @@ import android.database.Cursor; import android.net.Uri; import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import org.wikipedia.WikipediaApp; import org.wikipedia.concurrency.CallbackTask; @@ -70,19 +69,6 @@ return title; } }, callback); - } - - @Nullable public ReadingListPage findPage(@NonNull String key) { - Cursor cursor = ReadingListPageDao.instance().page(key); - try { - if (cursor.getCount() > 0) { - cursor.moveToFirst(); - return ReadingListPage.fromCursor(cursor); - } - } finally { - cursor.close(); - } - return null; } public void deletePageFromLists(@NonNull ReadingListPage page, -- To view, visit https://gerrit.wikimedia.org/r/362279 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iad051dc8b2bfd8c38e65d5569c5c003ae77916a0 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Dbrant <dbr...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits