commit a83ef89d3d24add737cd1ae28ea7910f186f0dda Author: Patrick Hiesel Date: Mon Oct 5 14:31:38 2020 +0200 Remove unused CurrentUser#cacheKey method Change-Id: If7ccfd9a418a379c677a7150fd14a7fc2d497cd5 diff --git a/java/com/google/gerrit/server/AnonymousUser.java b/java/com/google/gerrit/server/AnonymousUser.java index 91d2d05..c96d61a 100644 --- a/java/com/google/gerrit/server/AnonymousUser.java +++ b/java/com/google/gerrit/server/AnonymousUser.java @@ -27,12 +27,6 @@ public class AnonymousUser extends CurrentUser { } @Override - public Object getCacheKey() { - // Treat all anonymous users as a single user - return "anonymous"; - } - - @Override public String toString() { return "ANONYMOUS"; } diff --git a/java/com/google/gerrit/server/CurrentUser.java b/java/com/google/gerrit/server/CurrentUser.java index 75afc04..1955340 100644 --- a/java/com/google/gerrit/server/CurrentUser.java +++ b/java/com/google/gerrit/server/CurrentUser.java @@ -90,12 +90,6 @@ public abstract class CurrentUser { */ public abstract GroupMembership getEffectiveGroups(); - /** - * Returns a unique identifier for this user that is intended to be used as a cache key. Returned - * object should to implement {@code equals()} and {@code hashCode()} for effective caching. - */ - public abstract Object getCacheKey(); - /** Unique name of the user on this server, if one has been assigned. */ public Optional getUserName() { return Optional.empty(); diff --git a/java/com/google/gerrit/server/IdentifiedUser.java b/java/com/google/gerrit/server/IdentifiedUser.java index 7cafdc0..14d74d0 100644 --- a/java/com/google/gerrit/server/IdentifiedUser.java +++ b/java/com/google/gerrit/server/IdentifiedUser.java @@ -390,11 +390,6 @@ public class IdentifiedUser extends CurrentUser { return effectiveGroups; } - @Override - public Object getCacheKey() { - return getAccountId(); - } - public PersonIdent newRefLogIdent() { return newRefLogIdent(new Date(), TimeZone.getDefault()); } diff --git a/java/com/google/gerrit/server/InternalUser.java b/java/com/google/gerrit/server/InternalUser.java index 381819d..821a0c6 100644 --- a/java/com/google/gerrit/server/InternalUser.java +++ b/java/com/google/gerrit/server/InternalUser.java @@ -36,11 +36,6 @@ public class InternalUser extends CurrentUser { } @Override - public String getCacheKey() { - return "internal"; - } - - @Override public boolean isInternalUser() { return true; } diff --git a/java/com/google/gerrit/server/PeerDaemonUser.java b/java/com/google/gerrit/server/PeerDaemonUser.java index b27e05c..8a8b67a 100644 --- a/java/com/google/gerrit/server/PeerDaemonUser.java +++ b/java/com/google/gerrit/server/PeerDaemonUser.java @@ -40,11 +40,6 @@ public class PeerDaemonUser extends CurrentUser { return GroupMembership.EMPTY; } - @Override - public Object getCacheKey() { - return getRemoteAddress(); - } - public SocketAddress getRemoteAddress() { return peer; } diff --git a/java/com/google/gerrit/server/query/change/SingleGroupUser.java b/java/com/google/gerrit/server/query/change/SingleGroupUser.java index c451d46..7947b6b 100644 --- a/java/com/google/gerrit/server/query/change/SingleGroupUser.java +++ b/java/com/google/gerrit/server/query/change/SingleGroupUser.java @@ -36,9 +36,4 @@ public final class SingleGroupUser extends CurrentUser { public GroupMembership getEffectiveGroups() { return groups; } - - @Override - public Object getCacheKey() { - return groups.getKnownGroups(); - } } diff --git a/javatests/com/google/gerrit/server/extensions/webui/UiActionsTest.java b/javatests/com/google/gerrit/server/extensions/webui/UiActionsTest.java index de23ef4..1cdca1b 100644 --- a/javatests/com/google/gerrit/server/extensions/webui/UiActionsTest.java +++ b/javatests/com/google/gerrit/server/extensions/webui/UiActionsTest.java @@ -101,11 +101,6 @@ public class UiActionsTest { } @Override - public Object getCacheKey() { - return new Object(); - } - - @Override public boolean isIdentifiedUser() { return true; } diff --git a/javatests/com/google/gerrit/server/permissions/RefControlTest.java b/javatests/com/google/gerrit/server/permissions/RefControlTest.java index 81cb732..64f9392 100644 --- a/javatests/com/google/gerrit/server/permissions/RefControlTest.java +++ b/javatests/com/google/gerrit/server/permissions/RefControlTest.java @@ -1198,11 +1198,6 @@ public class RefControlTest { } @Override - public Object getCacheKey() { - return new Object(); - } - - @Override public Optional getUserName() { return Optional.ofNullable(username); } diff --git a/plugins/replication b/plugins/replication index 293ee35..bc47d23 160000 --- a/plugins/replication +++ b/plugins/replication @@ -1 +1 @@ -Subproject commit 293ee3590d9fb57f6882e11126d8c97532cce968 +Subproject commit bc47d238733981d957a820f4c66f7128fca80663