Source:
<code>private void initRevisionsAction(ChangeInfo info, String revision, NativeMap<ActionInfo> actions) { int currentPatchSet; if (info.currentRevision() != null && info.revisions().containsKey(info.currentRevision())) { currentPatchSet = info.revision(info.currentRevision())._number(); } else { JsArray<RevisionInfo> revList = info.revisions().values(); RevisionInfo.sortRevisionInfoByNumber(revList); currentPatchSet = revList.get(revList.length() - 1)._number(); } String currentlyViewedPatchSet; boolean isPatchSetCurrent = true; String revisionId = info.revision(revision).id(); if (revisionId.equals("edit")) { currentlyViewedPatchSet = Resources.M.editPatchSet(RevisionInfo.findEditParent(info.revisions() .values())); currentPatchSet = info.revisions().values().length() - 1; } else { currentlyViewedPatchSet = revisionId; if (!currentlyViewedPatchSet.equals(Integer.toString(currentPatchSet))) { isPatchSetCurrent = false; } } patchSetsText.setInnerText(Resources.M.patchSets( currentlyViewedPatchSet, currentPatchSet)); if (isPatchSetCurrent) { patchSetsText.removeClassName(style.notCurrentPatchSet()); } else { patchSetsText.addClassName(style.notCurrentPatchSet()); <START> } <END> patchSetsAction = new PatchSetsAction( info.legacyId(), revision, edit, style, headerLine, patchSets); RevisionInfo revInfo = info.revision(revision); if (revInfo.draft()) { if (actions.containsKey("publish")) { publish.setVisible(true); publish.setTitle(actions.get("publish").title()); } if (actions.containsKey("/")) { deleteRevision.setVisible(true); deleteRevision.setTitle(actions.get("/").title()); } } }</code><technical_language>This initRevisionsAction method is cluttered time indeed. refactor new if block a private, helper-ish method</technical_language>

Target:
private void initRevisionsAction(ChangeInfo info, String revision, NativeMap<ActionInfo> actions) { int currentPatchSet; if (info.currentRevision() != null && info.revisions().containsKey(info.currentRevision())) { currentPatchSet = info.revision(info.currentRevision())._number(); } else { JsArray<RevisionInfo> revList = info.revisions().values(); RevisionInfo.sortRevisionInfoByNumber(revList); currentPatchSet = revList.get(revList.length() - 1)._number(); } String currentlyViewedPatchSet; boolean isPatchSetCurrent = true; String revisionId = info.revision(revision).id(); if (revisionId.equals("edit")) { currentlyViewedPatchSet = Resources.M.editPatchSet(RevisionInfo.findEditParent(info.revisions() .values())); currentPatchSet = info.revisions().values().length() - 1; } else { currentlyViewedPatchSet = revisionId; if (!currentlyViewedPatchSet.equals(Integer.toString(currentPatchSet))) { isPatchSetCurrent = false; } } patchSetsText.setInnerText(Resources.M.patchSets( currentlyViewedPatchSet, currentPatchSet)); updatePatchSetsTextStyle(isPatchSetCurrent); patchSetsAction = new PatchSetsAction( info.legacyId(), revision, edit, style, headerLine, patchSets); RevisionInfo revInfo = info.revision(revision); if (revInfo.draft()) { if (actions.containsKey("publish")) { publish.setVisible(true); publish.setTitle(actions.get("publish").title()); } if (actions.containsKey("/")) { deleteRevision.setVisible(true); deleteRevision.setTitle(actions.get("/").title()); } } }