Merge "Update commons-validator to 1.4.1" into stable-2.11
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen.java
index 5922e7a..4d7dac2 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen.java
@@ -426,7 +426,7 @@
     patchSetsText.setInnerText(Resources.M.patchSets(
         currentlyViewedPatchSet, currentPatchSet));
     patchSetsAction = new PatchSetsAction(
-        info.legacy_id(), revision,
+        info.legacy_id(), revision, edit,
         style, headerLine, patchSets);
 
     RevisionInfo revInfo = info.revision(revision);
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/PatchSetsAction.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/PatchSetsAction.java
index 49cbd04..3842ee6 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/PatchSetsAction.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/PatchSetsAction.java
@@ -14,6 +14,7 @@
 
 package com.google.gerrit.client.change;
 
+import com.google.gerrit.client.changes.ChangeInfo.EditInfo;
 import com.google.gerrit.reviewdb.client.Change;
 import com.google.gwt.user.client.ui.UIObject;
 import com.google.gwt.user.client.ui.Widget;
@@ -24,11 +25,12 @@
   PatchSetsAction(
       Change.Id changeId,
       String revision,
+      EditInfo edit,
       ChangeScreen.Style style,
       UIObject relativeTo,
       Widget downloadButton) {
     super(style, relativeTo, downloadButton);
-    this.revisionBox = new PatchSetsBox(changeId, revision);
+    this.revisionBox = new PatchSetsBox(changeId, revision, edit);
   }
 
   @Override
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/PatchSetsBox.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/PatchSetsBox.java
index 92f6956..665eff5 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/PatchSetsBox.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/PatchSetsBox.java
@@ -22,8 +22,6 @@
 import com.google.gerrit.client.changes.ChangeInfo.EditInfo;
 import com.google.gerrit.client.changes.ChangeInfo.RevisionInfo;
 import com.google.gerrit.client.changes.ChangeList;
-import com.google.gerrit.client.rpc.CallbackGroup;
-import com.google.gerrit.client.rpc.GerritCallback;
 import com.google.gerrit.client.rpc.NativeMap;
 import com.google.gerrit.client.rpc.Natives;
 import com.google.gerrit.client.rpc.RestApi;
@@ -60,7 +58,6 @@
 
   private static final String OPEN;
   private static final HyperlinkImpl link = GWT.create(HyperlinkImpl.class);
-  private EditInfo edit;
 
   static {
     OPEN = DOM.createUniqueId().replace('-', '_');
@@ -105,40 +102,29 @@
 
   private final Change.Id changeId;
   private final String revision;
+  private final EditInfo edit;
   private boolean loaded;
   private JsArray<RevisionInfo> revisions;
 
   @UiField FlexTable table;
   @UiField Style style;
 
-  PatchSetsBox(Change.Id changeId, String revision) {
+  PatchSetsBox(Change.Id changeId, String revision, EditInfo edit) {
     this.changeId = changeId;
     this.revision = revision;
+    this.edit = edit;
     initWidget(uiBinder.createAndBindUi(this));
   }
 
   @Override
   protected void onLoad() {
     if (!loaded) {
-      CallbackGroup group = new CallbackGroup();
-      if (Gerrit.isSignedIn()) {
-        // TODO(davido): It shouldn't be necessary to make this call.
-        // PatchSetsBox is constructed via PatchSetsAction which is
-        // only initialized by CS2 after loading the EditInfo in that path.
-        ChangeApi.edit(changeId.get(), group.add(
-            new GerritCallback<EditInfo>() {
-              @Override
-              public void onSuccess(EditInfo result) {
-                edit = result;
-              }
-            }));
-      }
       RestApi call = ChangeApi.detail(changeId.get());
       ChangeList.addOptions(call, EnumSet.of(
           ListChangesOption.ALL_COMMITS,
           ListChangesOption.ALL_REVISIONS,
           ListChangesOption.DRAFT_COMMENTS));
-      call.get(group.addFinal(new AsyncCallback<ChangeInfo>() {
+      call.get(new AsyncCallback<ChangeInfo>() {
         @Override
         public void onSuccess(ChangeInfo result) {
           if (edit != null) {
@@ -152,7 +138,7 @@
         @Override
         public void onFailure(Throwable caught) {
         }
-      }));
+      });
     }
   }