Source:
public PullPanel(TransferPanelForm view, TransferForms forms, BriefcasePreferences tabPreferences, BriefcasePreferences appPreferences, TerminationFuture terminationFuture, Analytics analytics) { AnnotationProcessor.process(this); this.view = view; this.forms = forms; this.tabPreferences = tabPreferences; this.appPreferences = appPreferences; this.terminationFuture = terminationFuture; this.analytics = analytics; getContainer().addComponentListener(analytics.buildComponentListener("Pull")); source = RemoteServer.readPreferences(tabPreferences).flatMap(view::preloadSource); source.ifPresent(source -> { source.getFormList().thenAccept(formList -> { forms.load(formList); view.refresh(); updateActionButtons(); }).onError(cause -> { log.warn("Unable to load form list from {}", source.getDescription(), cause); errorMessage("Error Loading Forms", "We haven't been able to load forms using the saved source. Try reloading it or reset it, please."); }); }); view.onSource(source -> { this.source = Optional.of(source); Source.clearAllPreferences(tabPreferences); source.storePreferences(tabPreferences, getStorePasswordsConsentProperty()); source.getFormList().thenAccept(formList -> { forms.load(formList); view.refresh(); updateActionButtons(); }).onError(cause -> { log.warn("Unable to load form list from {}", source.getDescription(), cause); errorMessage("Error Loading Forms", "We haven't been able to load forms using the saved source. Try reloading it or reset it, please."); }); }); view.onReset(() -> { forms.clear(); view.refresh(); source = Optional.empty(); Source.clearAllPreferences(tabPreferences); updateActionButtons(); }); view.onChange(this::updateActionButtons); view.onAction(() -> { view.setWorking(); forms.forEach(FormStatus::clearStatusHistory); source.ifPresent(s -> s.pull(forms.getSelectedForms(), terminationFuture, appPreferences.getBriefcaseDir().orElseThrow(BriefcaseException::new), appPreferences.getPullInParallel().orElse(false), false)); }); view.onCancel(() -> terminationFuture.markAsCancelled(new PullEvent.Abort("Cancelled by the user"))); }

Target:
public PullPanel(TransferPanelForm view, TransferForms forms, BriefcasePreferences tabPreferences, BriefcasePreferences appPreferences, TerminationFuture terminationFuture, Analytics analytics) { AnnotationProcessor.process(this); this.view = view; this.forms = forms; this.tabPreferences = tabPreferences; this.appPreferences = appPreferences; this.terminationFuture = terminationFuture; this.analytics = analytics; getContainer().addComponentListener(analytics.buildComponentListener("Pull")); source = RemoteServer.readPreferences(tabPreferences).flatMap(view::preloadSource); view.onReady(() -> source.ifPresent(source -> onSource(view, forms, source))); view.onSource(source -> { this.source = Optional.of(source); Source.clearAllPreferences(tabPreferences); source.storePreferences(tabPreferences, getStorePasswordsConsentProperty()); onSource(view, forms, source); }); view.onReset(() -> { forms.clear(); view.refresh(); source = Optional.empty(); Source.clearAllPreferences(tabPreferences); updateActionButtons(); }); view.onChange(this::updateActionButtons); view.onAction(() -> { view.setWorking(); forms.forEach(FormStatus::clearStatusHistory); source.ifPresent(s -> s.pull(forms.getSelectedForms(), terminationFuture, appPreferences.getBriefcaseDir().orElseThrow(BriefcaseException::new), appPreferences.getPullInParallel().orElse(false), false)); }); view.onCancel(() -> terminationFuture.markAsCancelled(new PullEvent.Abort("Cancelled by the user"))); }