jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/331536 )
Change subject: Hygiene: remove unused DummyClient generic parameter ...................................................................... Hygiene: remove unused DummyClient generic parameter Change-Id: I5587b4f1436bc23c82723c17fd0240c5b0baa710 --- M app/src/main/java/org/wikipedia/edit/EditClient.java M app/src/main/java/org/wikipedia/feed/dataclient/DummyClient.java M app/src/main/java/org/wikipedia/feed/mainpage/MainPageClient.java M app/src/main/java/org/wikipedia/feed/random/RandomClient.java 4 files changed, 14 insertions(+), 26 deletions(-) Approvals: Dbrant: Looks good to me, approved jenkins-bot: Verified diff --git a/app/src/main/java/org/wikipedia/edit/EditClient.java b/app/src/main/java/org/wikipedia/edit/EditClient.java index f8ee30e..e2343eb 100644 --- a/app/src/main/java/org/wikipedia/edit/EditClient.java +++ b/app/src/main/java/org/wikipedia/edit/EditClient.java @@ -47,8 +47,7 @@ Edit.Result result = response.body().edit(); if ("Success".equals(result.status())) { try { - // TODO: remove when the server reflects the updated page content - // immediately after submitting the edit, instead of a short while after. + // TODO: get edit revision and request that revision Thread.sleep(TimeUnit.SECONDS.toMillis(2)); cb.success(call, new EditSuccessResult(result.newRevId())); } catch (InterruptedException e) { diff --git a/app/src/main/java/org/wikipedia/feed/dataclient/DummyClient.java b/app/src/main/java/org/wikipedia/feed/dataclient/DummyClient.java index 7806e93..e411680 100644 --- a/app/src/main/java/org/wikipedia/feed/dataclient/DummyClient.java +++ b/app/src/main/java/org/wikipedia/feed/dataclient/DummyClient.java @@ -9,20 +9,13 @@ import java.util.Collections; /** A dummy client for providing static cards (main page, random) on tap to the FeedCoordinator. */ -public abstract class DummyClient<T extends Card> implements FeedClient { - @Override - public void request(@NonNull Context context, @NonNull WikiSite wiki, int age, - @NonNull final FeedClient.Callback cb) { - try { - cb.success(Collections.singletonList(getNewCard(wiki))); - } catch (Throwable t) { - cb.error(t); - } +public abstract class DummyClient implements FeedClient { + @Override public void request(@NonNull Context context, @NonNull WikiSite wiki, int age, + @NonNull FeedClient.Callback cb) { + cb.success(Collections.singletonList(getNewCard(wiki))); } - @Override - public void cancel() { - } + @Override public void cancel() { } - public abstract T getNewCard(WikiSite wiki); + public abstract Card getNewCard(WikiSite wiki); } diff --git a/app/src/main/java/org/wikipedia/feed/mainpage/MainPageClient.java b/app/src/main/java/org/wikipedia/feed/mainpage/MainPageClient.java index 9147322..561a514 100644 --- a/app/src/main/java/org/wikipedia/feed/mainpage/MainPageClient.java +++ b/app/src/main/java/org/wikipedia/feed/mainpage/MainPageClient.java @@ -2,14 +2,10 @@ import org.wikipedia.dataclient.WikiSite; import org.wikipedia.feed.dataclient.DummyClient; +import org.wikipedia.feed.model.Card; -public class MainPageClient extends DummyClient<MainPageCard> { - public MainPageClient() { - super(); - } - - @Override - public MainPageCard getNewCard(WikiSite wiki) { +public class MainPageClient extends DummyClient { + @Override public Card getNewCard(WikiSite wiki) { return new MainPageCard(wiki); } -} +} \ No newline at end of file diff --git a/app/src/main/java/org/wikipedia/feed/random/RandomClient.java b/app/src/main/java/org/wikipedia/feed/random/RandomClient.java index 518dd27..d359b42 100644 --- a/app/src/main/java/org/wikipedia/feed/random/RandomClient.java +++ b/app/src/main/java/org/wikipedia/feed/random/RandomClient.java @@ -2,10 +2,10 @@ import org.wikipedia.dataclient.WikiSite; import org.wikipedia.feed.dataclient.DummyClient; +import org.wikipedia.feed.model.Card; -public class RandomClient extends DummyClient<RandomCard> { - @Override - public RandomCard getNewCard(WikiSite wiki) { +public class RandomClient extends DummyClient { + @Override public Card getNewCard(WikiSite wiki) { return new RandomCard(wiki); } } \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/331536 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5587b4f1436bc23c82723c17fd0240c5b0baa710 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Niedzielski <sniedziel...@wikimedia.org> Gerrit-Reviewer: Dbrant <dbr...@wikimedia.org> Gerrit-Reviewer: Mholloway <mhollo...@wikimedia.org> Gerrit-Reviewer: Sniedzielski <sniedziel...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits