Source:
<code>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 -> { try { forms.load(source.getFormList()); view.refresh(); updateActionButtons(); } catch (Exception e) { <START> System.err.println(e.toString()); <END> } }); view.onSource(source -> { this.source = Optional.of(source); Source.clearAllPreferences(tabPreferences); source.storePreferences(tabPreferences, getStorePasswordsConsentProperty()); forms.load(source.getFormList()); view.refresh(); updateActionButtons(); }); 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))); }); view.onCancel(() -> terminationFuture.markAsCancelled(new PullEvent.Abort("Cancelled by the user"))); }</code><technical_language>this code is executed in UI mode, log this error instead of System.err. Also, side effects of this callback for view.onReset() in line 87 (we want forget server conf reset UI). extract a method reuse in places</technical_language>

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); source.ifPresent(source -> { try { forms.load(source.getFormList()); view.refresh(); updateActionButtons(); } catch (HttpException e) { log.warn("Unable to get form list from {}: {}", source.getDescription(), e.toString()); } }); view.onSource(source -> { this.source = Optional.of(source); Source.clearAllPreferences(tabPreferences); source.storePreferences(tabPreferences, getStorePasswordsConsentProperty()); forms.load(source.getFormList()); view.refresh(); updateActionButtons(); }); 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))); }); view.onCancel(() -> terminationFuture.markAsCancelled(new PullEvent.Abort("Cancelled by the user"))); }