Source:
void set(final ChangeInfo info, final String revision) { if (info.status().isClosed()) { setVisible(false); return; } createTab(Resources.C.relatedChanges(), Resources.C.relatedChangesTooltip()); tabPanel.selectTab(RELATED_CHANGES); ChangeApi.revision(info.legacy_id().get(), revision).view("related") .get(new AsyncCallback<RelatedInfo>() { @Override public void onSuccess(RelatedInfo result) { RelatedChangesTab tab = tabs.get(RELATED_CHANGES); tab.setTitle(Resources.M.relatedChanges(result.changes().length())); tab.setChanges(info.project(), revision, result.changes()); } @Override public void onFailure(Throwable err) { RelatedChangesTab tab = tabs.get(RELATED_CHANGES); tab.setTitle(Resources.M.relatedChanges(Resources.C.notAvailable())); tab.setError(err.getMessage()); } }); StringBuilder conflictsQuery = new StringBuilder(); conflictsQuery.append("status:open"); conflictsQuery.append(" project:").append(info.project()); conflictsQuery.append(" branch:").append(info.branch()); conflictsQuery.append(" conflicts:").append(info.change_id()); ChangeList.query(conflictsQuery.toString(), EnumSet.of(ListChangesOption.CURRENT_REVISION, ListChangesOption.CURRENT_COMMIT), new AsyncCallback<ChangeList>() { @Override public void onSuccess(ChangeList result) { if (result.length() > 0) { getTab().setTitle(Resources.M.conflictingChanges(result.length())); getTab().setChanges(info.project(), revision, convertChangeList(result)); } } @Override public void onFailure(Throwable err) { getTab().setTitle( Resources.M.conflictingChanges(Resources.C.notAvailable())); getTab().setError(err.getMessage()); } private RelatedChangesTab getTab() { if (conflictingChangesTab == null) { conflictingChangesTab = createTab(Resources.C.conflictingChanges(), Resources.C.conflictingChangesTooltip()); conflictingChangesTab.registerKeys(); } return conflictingChangesTab; } }); }

Target:
void set(final ChangeInfo info, final String revision) { if (info.status().isClosed()) { setVisible(false); return; } createTab(Resources.C.relatedChanges(), Resources.C.relatedChangesTooltip()); selectTab(RELATED_CHANGES); ChangeApi.revision(info.legacy_id().get(), revision).view("related") .get(new AsyncCallback<RelatedInfo>() { @Override public void onSuccess(RelatedInfo result) { RelatedChangesTab tab = tabs.get(RELATED_CHANGES); tab.setTitle(Resources.M.relatedChanges(result.changes().length())); tab.setChanges(info.project(), revision, result.changes()); } @Override public void onFailure(Throwable err) { RelatedChangesTab tab = tabs.get(RELATED_CHANGES); tab.setTitle(Resources.M.relatedChanges(Resources.C.notAvailable())); tab.setError(err.getMessage()); } }); StringBuilder conflictsQuery = new StringBuilder(); conflictsQuery.append("status:open"); conflictsQuery.append(" project:").append(info.project()); conflictsQuery.append(" branch:").append(info.branch()); conflictsQuery.append(" conflicts:").append(info.change_id()); ChangeList.query(conflictsQuery.toString(), EnumSet.of(ListChangesOption.CURRENT_REVISION, ListChangesOption.CURRENT_COMMIT), new AsyncCallback<ChangeList>() { @Override public void onSuccess(ChangeList result) { if (result.length() > 0) { getTab().setTitle(Resources.M.conflictingChanges(result.length())); getTab().setChanges(info.project(), revision, convertChangeList(result)); } } @Override public void onFailure(Throwable err) { getTab().setTitle( Resources.M.conflictingChanges(Resources.C.notAvailable())); getTab().setError(err.getMessage()); } private RelatedChangesTab getTab() { if (conflictingChangesTab == null) { conflictingChangesTab = createTab(Resources.C.conflictingChanges(), Resources.C.conflictingChangesTooltip()); conflictingChangesTab.registerKeys(); } return conflictingChangesTab; } }); }