Source:
private void pageLoadFromNetwork(final ErrorCallback errorCallback) { if (model.getTitle() == null) { return; } fragment.updateBookmarkAndMenuOptions(); networkErrorCallback = errorCallback; if (!fragment.isAdded()) { return; } fragment.requireActivity().invalidateOptionsMenu(); if (fragment.callback() != null) { fragment.callback().onPageUpdateProgressBar(true); } app.getSessionFunnel().leadSectionFetchStart(); disposables.add(Observable.zip(ServiceFactory.getRest(model.getTitle().getWikiSite()) .getSummaryResponse(model.getTitle().getPrefixedText(), null, model.getCacheControl().toString(), model.shouldSaveOffline() ? OfflineCacheInterceptor.SAVE_HEADER_SAVE : null, model.getTitle().getWikiSite().languageCode(), UriUtil.encodeURL(model.getTitle().getPrefixedText())), ServiceFactory.get(model.getTitle().getWikiSite()) .getWatchedInfo(model.getTitle().getPrefixedText()), Pair::new) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(pair -> { Response<PageSummary> pageSummaryResponse = pair.first; MwQueryResponse watchedResponse = pair.second; boolean isWatched = false; if (watchedResponse != null && watchedResponse.query() != null && watchedResponse.query().firstPage() != null) { isWatched = watchedResponse.query().firstPage().isWatched(); } if (pageSummaryResponse.body() != null) { createPageModel(pageSummaryResponse.body(), isWatched); } else { throw new RuntimeException("Summary response was invalid."); } if (OfflineCacheInterceptor.SAVE_HEADER_SAVE.equals(pageSummaryResponse.headers().get(OfflineCacheInterceptor.SAVE_HEADER))) { showPageOfflineMessage(pageSummaryResponse.raw().header("date", "")); } fragment.onPageMetadataLoaded(); }, throwable -> { L.e("Page details network response error: ", throwable); commonSectionFetchOnCatch(throwable); }) ); bridge.resetHtml(model.getTitle()); }

Target:
private void pageLoadFromNetwork(final ErrorCallback errorCallback) { if (model.getTitle() == null) { return; } fragment.updateBookmarkAndMenuOptions(); networkErrorCallback = errorCallback; if (!fragment.isAdded()) { return; } fragment.requireActivity().invalidateOptionsMenu(); if (fragment.callback() != null) { fragment.callback().onPageUpdateProgressBar(true); } app.getSessionFunnel().leadSectionFetchStart(); disposables.add(Observable.zip(ServiceFactory.getRest(model.getTitle().getWikiSite()) .getSummaryResponse(model.getTitle().getPrefixedText(), null, model.getCacheControl().toString(), model.shouldSaveOffline() ? OfflineCacheInterceptor.SAVE_HEADER_SAVE : null, model.getTitle().getWikiSite().languageCode(), UriUtil.encodeURL(model.getTitle().getPrefixedText())), AccountUtil.isLoggedIn() ? ServiceFactory.get(model.getTitle().getWikiSite()).getWatchedInfo(model.getTitle().getPrefixedText()) : Observable.just(new MwQueryResponse()), Pair::new) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(pair -> { Response<PageSummary> pageSummaryResponse = pair.first; MwQueryResponse watchedResponse = pair.second; boolean isWatched = false; if (watchedResponse != null && watchedResponse.query() != null && watchedResponse.query().firstPage() != null) { isWatched = watchedResponse.query().firstPage().isWatched(); } if (pageSummaryResponse.body() != null) { createPageModel(pageSummaryResponse.body(), isWatched); } else { throw new RuntimeException("Summary response was invalid."); } if (OfflineCacheInterceptor.SAVE_HEADER_SAVE.equals(pageSummaryResponse.headers().get(OfflineCacheInterceptor.SAVE_HEADER))) { showPageOfflineMessage(pageSummaryResponse.raw().header("date", "")); } fragment.onPageMetadataLoaded(); }, throwable -> { L.e("Page details network response error: ", throwable); commonSectionFetchOnCatch(throwable); }) ); bridge.resetHtml(model.getTitle()); }