summaryrefslogtreecommitdiffstats
path: root/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/AccountDashboardScreen.java
diff options
context:
space:
mode:
Diffstat (limited to 'gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/AccountDashboardScreen.java')
-rw-r--r--gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/AccountDashboardScreen.java24
1 files changed, 8 insertions, 16 deletions
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/AccountDashboardScreen.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/AccountDashboardScreen.java
index 0465902d8b..7ec1102115 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/AccountDashboardScreen.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/AccountDashboardScreen.java
@@ -14,6 +14,8 @@
package com.google.gerrit.client.changes;
+import static java.util.Comparator.comparing;
+
import com.google.gerrit.client.Gerrit;
import com.google.gerrit.client.NotFoundScreen;
import com.google.gerrit.client.info.ChangeInfo;
@@ -23,7 +25,6 @@ import com.google.gerrit.client.ui.InlineHyperlink;
import com.google.gerrit.client.ui.Screen;
import com.google.gerrit.common.PageLinks;
import com.google.gerrit.extensions.client.ListChangesOption;
-import com.google.gerrit.reviewdb.client.Account;
import com.google.gwt.core.client.JsArray;
import com.google.gwt.event.dom.client.KeyPressEvent;
import com.google.gwtexpui.globalkey.client.KeyCommand;
@@ -43,7 +44,7 @@ public class AccountDashboardScreen extends Screen implements ChangeListScreen {
MY_DASHBOARD_OPTIONS = Collections.unmodifiableSet(options);
}
- private final Account.Id ownerId;
+ private final Integer ownerId;
private final boolean mine;
private ChangeTable table;
private ChangeTable.Section workInProgress;
@@ -51,9 +52,9 @@ public class AccountDashboardScreen extends Screen implements ChangeListScreen {
private ChangeTable.Section incoming;
private ChangeTable.Section closed;
- public AccountDashboardScreen(Account.Id id) {
- ownerId = id;
- mine = Gerrit.isSignedIn() && ownerId.equals(Gerrit.getUserAccount().getId());
+ public AccountDashboardScreen(Integer accountId) {
+ ownerId = accountId;
+ mine = Gerrit.isSignedIn() && ownerId == Gerrit.getUserAccount()._accountId();
}
@Override
@@ -177,7 +178,7 @@ public class AccountDashboardScreen extends Screen implements ChangeListScreen {
}
}
- Collections.sort(Natives.asList(out), outComparator());
+ Natives.asList(out).sort(outComparator());
table.updateColumnsForLabels(wip, out, in, done);
workInProgress.display(wip);
@@ -188,16 +189,7 @@ public class AccountDashboardScreen extends Screen implements ChangeListScreen {
}
private Comparator<ChangeInfo> outComparator() {
- return new Comparator<ChangeInfo>() {
- @Override
- public int compare(ChangeInfo a, ChangeInfo b) {
- int cmp = a.created().compareTo(b.created());
- if (cmp != 0) {
- return cmp;
- }
- return a._number() - b._number();
- }
- };
+ return comparing(ChangeInfo::created).thenComparing(ChangeInfo::_number);
}
private boolean hasChanges(JsArray<ChangeList> result) {