Use java.util.Objects instead of com.google.common.base.Objects
Use java.util.Objects.equals(...) instead of com.google.common.base.Objects.equal(...) and java.util.Objects.hash(...) instead of com.google.common.base.Objects.hashCode(...) . The JavaDoc of both methods in com.google.common.base.Objects says that they should be treated as deprecated and that the corresponding Java 7 methods in java.util.Objects should be used instead. Change-Id: I55d53cde42a7eecfa310e1ae4038d2ee4d111c4b Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
parent
b3a96b5ac5
commit
3efed75534
@ -14,9 +14,8 @@
|
|||||||
|
|
||||||
package com.google.gerrit.common;
|
package com.google.gerrit.common;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
public class PluginData {
|
public class PluginData {
|
||||||
public final String name;
|
public final String name;
|
||||||
@ -33,14 +32,14 @@ public class PluginData {
|
|||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (obj instanceof PluginData) {
|
if (obj instanceof PluginData) {
|
||||||
PluginData o = (PluginData) obj;
|
PluginData o = (PluginData) obj;
|
||||||
return Objects.equal(name, o.name) && Objects.equal(version, o.version)
|
return Objects.equals(name, o.name) && Objects.equals(version, o.version)
|
||||||
&& Objects.equal(pluginFile, o.pluginFile);
|
&& Objects.equals(pluginFile, o.pluginFile);
|
||||||
}
|
}
|
||||||
return super.equals(obj);
|
return super.equals(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(name, version, pluginFile);
|
return Objects.hash(name, version, pluginFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -18,7 +18,6 @@ import static com.google.common.base.Preconditions.checkArgument;
|
|||||||
import static com.google.gerrit.server.change.ChangeKind.NO_CODE_CHANGE;
|
import static com.google.gerrit.server.change.ChangeKind.NO_CODE_CHANGE;
|
||||||
import static com.google.gerrit.server.change.ChangeKind.TRIVIAL_REBASE;
|
import static com.google.gerrit.server.change.ChangeKind.TRIVIAL_REBASE;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
|
||||||
import com.google.common.collect.HashBasedTable;
|
import com.google.common.collect.HashBasedTable;
|
||||||
import com.google.common.collect.ListMultimap;
|
import com.google.common.collect.ListMultimap;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
@ -47,6 +46,7 @@ import java.io.IOException;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.NavigableSet;
|
import java.util.NavigableSet;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.SortedSet;
|
import java.util.SortedSet;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ public class ApprovalCopier {
|
|||||||
LabelType type = project.getLabelTypes().byLabel(psa.getLabelId());
|
LabelType type = project.getLabelTypes().byLabel(psa.getLabelId());
|
||||||
if (type == null) {
|
if (type == null) {
|
||||||
return false;
|
return false;
|
||||||
} else if (Objects.equal(n, previous(allPsIds, psId.get())) && (
|
} else if (Objects.equals(n, previous(allPsIds, psId.get())) && (
|
||||||
type.isCopyMinScore() && type.isMaxNegative(psa)
|
type.isCopyMinScore() && type.isMaxNegative(psa)
|
||||||
|| type.isCopyMaxScore() && type.isMaxPositive(psa))) {
|
|| type.isCopyMaxScore() && type.isMaxPositive(psa))) {
|
||||||
// Copy min/max score only from the immediately preceding patch set (which
|
// Copy min/max score only from the immediately preceding patch set (which
|
||||||
|
@ -18,7 +18,6 @@ import static com.google.common.base.Preconditions.checkArgument;
|
|||||||
|
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
import com.google.common.base.Objects;
|
|
||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableListMultimap;
|
import com.google.common.collect.ImmutableListMultimap;
|
||||||
@ -57,6 +56,7 @@ import java.util.Collection;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -91,7 +91,7 @@ public class ApprovalsUtil {
|
|||||||
return Iterables.filter(psas, new Predicate<PatchSetApproval>() {
|
return Iterables.filter(psas, new Predicate<PatchSetApproval>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(PatchSetApproval input) {
|
public boolean apply(PatchSetApproval input) {
|
||||||
return Objects.equal(input.getAccountId(), accountId);
|
return Objects.equals(input.getAccountId(), accountId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -14,9 +14,10 @@
|
|||||||
|
|
||||||
package com.google.gerrit.server.auth;
|
package com.google.gerrit.server.auth;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
|
||||||
import com.google.gerrit.common.Nullable;
|
import com.google.gerrit.common.Nullable;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines an abstract request for user authentication to Gerrit.
|
* Defines an abstract request for user authentication to Gerrit.
|
||||||
*/
|
*/
|
||||||
@ -50,7 +51,7 @@ public abstract class AuthRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void checkPassword(String pwd) throws AuthException {
|
public void checkPassword(String pwd) throws AuthException {
|
||||||
if (!Objects.equal(getPassword(), pwd)) {
|
if (!Objects.equals(getPassword(), pwd)) {
|
||||||
throw new InvalidCredentialsException();
|
throw new InvalidCredentialsException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,6 @@ import static org.eclipse.jgit.lib.ObjectIdSerialization.readNotNull;
|
|||||||
import static org.eclipse.jgit.lib.ObjectIdSerialization.writeNotNull;
|
import static org.eclipse.jgit.lib.ObjectIdSerialization.writeNotNull;
|
||||||
|
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
import com.google.common.base.Objects;
|
|
||||||
import com.google.common.cache.CacheLoader;
|
import com.google.common.cache.CacheLoader;
|
||||||
import com.google.common.cache.LoadingCache;
|
import com.google.common.cache.LoadingCache;
|
||||||
import com.google.common.cache.Weigher;
|
import com.google.common.cache.Weigher;
|
||||||
@ -53,6 +52,7 @@ import java.io.ObjectInputStream;
|
|||||||
import java.io.ObjectOutputStream;
|
import java.io.ObjectOutputStream;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
|
|
||||||
public class ChangeKindCacheImpl implements ChangeKindCache {
|
public class ChangeKindCacheImpl implements ChangeKindCache {
|
||||||
@ -156,16 +156,16 @@ public class ChangeKindCacheImpl implements ChangeKindCache {
|
|||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (o instanceof Key) {
|
if (o instanceof Key) {
|
||||||
Key k = (Key) o;
|
Key k = (Key) o;
|
||||||
return Objects.equal(prior, k.prior)
|
return Objects.equals(prior, k.prior)
|
||||||
&& Objects.equal(next, k.next)
|
&& Objects.equals(next, k.next)
|
||||||
&& Objects.equal(strategyName, k.strategyName);
|
&& Objects.equals(strategyName, k.strategyName);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(prior, next, strategyName);
|
return Objects.hash(prior, next, strategyName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeObject(ObjectOutputStream out) throws IOException {
|
private void writeObject(ObjectOutputStream out) throws IOException {
|
||||||
@ -185,7 +185,7 @@ public class ChangeKindCacheImpl implements ChangeKindCache {
|
|||||||
private static class Loader extends CacheLoader<Key, ChangeKind> {
|
private static class Loader extends CacheLoader<Key, ChangeKind> {
|
||||||
@Override
|
@Override
|
||||||
public ChangeKind load(Key key) throws IOException {
|
public ChangeKind load(Key key) throws IOException {
|
||||||
if (Objects.equal(key.prior, key.next)) {
|
if (Objects.equals(key.prior, key.next)) {
|
||||||
return ChangeKind.NO_CODE_CHANGE;
|
return ChangeKind.NO_CODE_CHANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,6 @@ import static com.google.common.base.Preconditions.checkArgument;
|
|||||||
|
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
import com.google.common.base.MoreObjects;
|
import com.google.common.base.MoreObjects;
|
||||||
import com.google.common.base.Objects;
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
@ -38,6 +37,7 @@ import com.google.inject.Singleton;
|
|||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Normalizes votes on labels according to project config and permissions.
|
* Normalizes votes on labels according to project config and permissions.
|
||||||
@ -85,16 +85,16 @@ public class LabelNormalizer {
|
|||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (o instanceof Result) {
|
if (o instanceof Result) {
|
||||||
Result r = (Result) o;
|
Result r = (Result) o;
|
||||||
return Objects.equal(unchanged, r.unchanged)
|
return Objects.equals(unchanged, r.unchanged)
|
||||||
&& Objects.equal(updated, r.updated)
|
&& Objects.equals(updated, r.updated)
|
||||||
&& Objects.equal(deleted, r.deleted);
|
&& Objects.equals(deleted, r.deleted);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(unchanged, updated, deleted);
|
return Objects.hash(unchanged, updated, deleted);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -20,7 +20,6 @@ import static java.util.concurrent.TimeUnit.MINUTES;
|
|||||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||||
import static org.eclipse.jgit.lib.RefDatabase.ALL;
|
import static org.eclipse.jgit.lib.RefDatabase.ALL;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
|
||||||
import com.google.common.collect.ArrayListMultimap;
|
import com.google.common.collect.ArrayListMultimap;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import com.google.common.collect.ListMultimap;
|
import com.google.common.collect.ListMultimap;
|
||||||
@ -97,6 +96,7 @@ import java.util.HashSet;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1058,8 +1058,8 @@ public class MergeOp {
|
|||||||
try {
|
try {
|
||||||
ChangeMessage last = Iterables.getLast(cmUtil.byChange(db, notes));
|
ChangeMessage last = Iterables.getLast(cmUtil.byChange(db, notes));
|
||||||
if (last != null) {
|
if (last != null) {
|
||||||
if (Objects.equal(last.getAuthor(), msg.getAuthor())
|
if (Objects.equals(last.getAuthor(), msg.getAuthor())
|
||||||
&& Objects.equal(last.getMessage(), msg.getMessage())) {
|
&& Objects.equals(last.getMessage(), msg.getMessage())) {
|
||||||
long lastMs = last.getWrittenOn().getTime();
|
long lastMs = last.getWrittenOn().getTime();
|
||||||
long msgMs = msg.getWrittenOn().getTime();
|
long msgMs = msg.getWrittenOn().getTime();
|
||||||
long sinceMs = msgMs - lastMs;
|
long sinceMs = msgMs - lastMs;
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
package com.google.gerrit.server.git;
|
package com.google.gerrit.server.git;
|
||||||
|
|
||||||
import com.google.common.base.MoreObjects;
|
import com.google.common.base.MoreObjects;
|
||||||
import com.google.common.base.Objects;
|
|
||||||
|
|
||||||
import org.eclipse.jgit.dircache.DirCache;
|
import org.eclipse.jgit.dircache.DirCache;
|
||||||
import org.eclipse.jgit.dircache.DirCacheBuilder;
|
import org.eclipse.jgit.dircache.DirCacheBuilder;
|
||||||
@ -47,6 +46,7 @@ import org.eclipse.jgit.treewalk.TreeWalk;
|
|||||||
import org.eclipse.jgit.util.RawParseUtils;
|
import org.eclipse.jgit.util.RawParseUtils;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Support for metadata stored within a version controlled branch.
|
* Support for metadata stored within a version controlled branch.
|
||||||
@ -275,7 +275,7 @@ public abstract class VersionedMetaData {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RevCommit createRef(String refName) throws IOException {
|
public RevCommit createRef(String refName) throws IOException {
|
||||||
if (Objects.equal(src, revision)) {
|
if (Objects.equals(src, revision)) {
|
||||||
return revision;
|
return revision;
|
||||||
}
|
}
|
||||||
return updateRef(ObjectId.zeroId(), src, refName);
|
return updateRef(ObjectId.zeroId(), src, refName);
|
||||||
@ -306,7 +306,7 @@ public abstract class VersionedMetaData {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RevCommit commitAt(ObjectId expected) throws IOException {
|
public RevCommit commitAt(ObjectId expected) throws IOException {
|
||||||
if (Objects.equal(src, expected)) {
|
if (Objects.equals(src, expected)) {
|
||||||
return revision;
|
return revision;
|
||||||
}
|
}
|
||||||
return updateRef(MoreObjects.firstNonNull(expected, ObjectId.zeroId()),
|
return updateRef(MoreObjects.firstNonNull(expected, ObjectId.zeroId()),
|
||||||
|
@ -19,7 +19,6 @@ import static com.google.gerrit.server.PatchLineCommentsUtil.setCommentRevId;
|
|||||||
import static com.google.gerrit.server.notedb.CommentsInNotesUtil.getCommentPsId;
|
import static com.google.gerrit.server.notedb.CommentsInNotesUtil.getCommentPsId;
|
||||||
|
|
||||||
import com.google.common.base.MoreObjects;
|
import com.google.common.base.MoreObjects;
|
||||||
import com.google.common.base.Objects;
|
|
||||||
import com.google.common.collect.ArrayListMultimap;
|
import com.google.common.collect.ArrayListMultimap;
|
||||||
import com.google.common.collect.ComparisonChain;
|
import com.google.common.collect.ComparisonChain;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
@ -52,6 +51,7 @@ import java.sql.Timestamp;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
@ -232,13 +232,13 @@ public class ChangeRebuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void checkUpdate(AbstractChangeUpdate update) {
|
protected void checkUpdate(AbstractChangeUpdate update) {
|
||||||
checkState(Objects.equal(update.getPatchSetId(), psId),
|
checkState(Objects.equals(update.getPatchSetId(), psId),
|
||||||
"cannot apply event for %s to update for %s",
|
"cannot apply event for %s to update for %s",
|
||||||
update.getPatchSetId(), psId);
|
update.getPatchSetId(), psId);
|
||||||
checkState(when.getTime() - update.getWhen().getTime() <= TS_WINDOW_MS,
|
checkState(when.getTime() - update.getWhen().getTime() <= TS_WINDOW_MS,
|
||||||
"event at %s outside update window starting at %s",
|
"event at %s outside update window starting at %s",
|
||||||
when, update.getWhen());
|
when, update.getWhen());
|
||||||
checkState(Objects.equal(update.getUser().getAccountId(), who),
|
checkState(Objects.equals(update.getUser().getAccountId(), who),
|
||||||
"cannot apply event by %s to update by %s",
|
"cannot apply event by %s to update by %s",
|
||||||
who, update.getUser().getAccountId());
|
who, update.getUser().getAccountId());
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,6 @@ package com.google.gerrit.server.project;
|
|||||||
|
|
||||||
import com.google.common.base.CharMatcher;
|
import com.google.common.base.CharMatcher;
|
||||||
import com.google.common.base.Joiner;
|
import com.google.common.base.Joiner;
|
||||||
import com.google.common.base.Objects;
|
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
import com.google.gerrit.common.ChangeHooks;
|
import com.google.gerrit.common.ChangeHooks;
|
||||||
import com.google.gerrit.extensions.api.projects.ProjectInput.ConfigValue;
|
import com.google.gerrit.extensions.api.projects.ProjectInput.ConfigValue;
|
||||||
@ -56,6 +55,7 @@ import java.io.IOException;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@ -178,7 +178,7 @@ public class PutConfig implements RestModifyView<ProjectResource, Input> {
|
|||||||
ObjectId baseRev = projectConfig.getRevision();
|
ObjectId baseRev = projectConfig.getRevision();
|
||||||
ObjectId commitRev = projectConfig.commit(md);
|
ObjectId commitRev = projectConfig.commit(md);
|
||||||
// Only fire hook if project was actually changed.
|
// Only fire hook if project was actually changed.
|
||||||
if (!Objects.equal(baseRev, commitRev)) {
|
if (!Objects.equals(baseRev, commitRev)) {
|
||||||
IdentifiedUser user = (IdentifiedUser) currentUser.get();
|
IdentifiedUser user = (IdentifiedUser) currentUser.get();
|
||||||
hooks.doRefUpdatedHook(
|
hooks.doRefUpdatedHook(
|
||||||
new Branch.NameKey(projectName, RefNames.REFS_CONFIG),
|
new Branch.NameKey(projectName, RefNames.REFS_CONFIG),
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
package com.google.gerrit.server.project;
|
package com.google.gerrit.server.project;
|
||||||
|
|
||||||
import com.google.common.base.MoreObjects;
|
import com.google.common.base.MoreObjects;
|
||||||
import com.google.common.base.Objects;
|
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
import com.google.gerrit.common.ChangeHooks;
|
import com.google.gerrit.common.ChangeHooks;
|
||||||
import com.google.gerrit.extensions.restapi.AuthException;
|
import com.google.gerrit.extensions.restapi.AuthException;
|
||||||
@ -40,6 +39,7 @@ import org.eclipse.jgit.errors.RepositoryNotFoundException;
|
|||||||
import org.eclipse.jgit.lib.ObjectId;
|
import org.eclipse.jgit.lib.ObjectId;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
class PutDescription implements RestModifyView<ProjectResource, Input> {
|
class PutDescription implements RestModifyView<ProjectResource, Input> {
|
||||||
@ -97,7 +97,7 @@ class PutDescription implements RestModifyView<ProjectResource, Input> {
|
|||||||
ObjectId baseRev = config.getRevision();
|
ObjectId baseRev = config.getRevision();
|
||||||
ObjectId commitRev = config.commit(md);
|
ObjectId commitRev = config.commit(md);
|
||||||
// Only fire hook if project was actually changed.
|
// Only fire hook if project was actually changed.
|
||||||
if (!Objects.equal(baseRev, commitRev)) {
|
if (!Objects.equals(baseRev, commitRev)) {
|
||||||
hooks.doRefUpdatedHook(
|
hooks.doRefUpdatedHook(
|
||||||
new Branch.NameKey(resource.getNameKey(), RefNames.REFS_CONFIG),
|
new Branch.NameKey(resource.getNameKey(), RefNames.REFS_CONFIG),
|
||||||
baseRev, commitRev, user.getAccount());
|
baseRev, commitRev, user.getAccount());
|
||||||
|
@ -14,12 +14,12 @@
|
|||||||
|
|
||||||
package com.google.gerrit.server.query.change;
|
package com.google.gerrit.server.query.change;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
|
||||||
import com.google.gerrit.extensions.common.SubmitType;
|
import com.google.gerrit.extensions.common.SubmitType;
|
||||||
|
|
||||||
import org.eclipse.jgit.lib.ObjectId;
|
import org.eclipse.jgit.lib.ObjectId;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
public class ConflictKey implements Serializable {
|
public class ConflictKey implements Serializable {
|
||||||
private static final long serialVersionUID = 2L;
|
private static final long serialVersionUID = 2L;
|
||||||
@ -73,6 +73,6 @@ public class ConflictKey implements Serializable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(commit, otherCommit, submitType, contentMerge);
|
return Objects.hash(commit, otherCommit, submitType, contentMerge);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,11 +15,11 @@
|
|||||||
package com.google.gerrit.server.securestore;
|
package com.google.gerrit.server.securestore;
|
||||||
|
|
||||||
import com.google.common.base.MoreObjects;
|
import com.google.common.base.MoreObjects;
|
||||||
import com.google.common.base.Objects;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLClassLoader;
|
import java.net.URLClassLoader;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
public class SecureStoreData {
|
public class SecureStoreData {
|
||||||
public final File pluginFile;
|
public final File pluginFile;
|
||||||
@ -73,6 +73,6 @@ public class SecureStoreData {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(storeName);
|
return Objects.hash(storeName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,11 +16,12 @@ package com.google.gerrit.server.util;
|
|||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkArgument;
|
import static com.google.common.base.Preconditions.checkArgument;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
import com.google.gerrit.common.data.LabelType;
|
import com.google.gerrit.common.data.LabelType;
|
||||||
import com.google.gerrit.reviewdb.client.PatchSetApproval;
|
import com.google.gerrit.reviewdb.client.PatchSetApproval;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/** A single vote on a label, consisting of a label name and a value. */
|
/** A single vote on a label, consisting of a label name and a value. */
|
||||||
public class LabelVote {
|
public class LabelVote {
|
||||||
public static LabelVote parse(String text) {
|
public static LabelVote parse(String text) {
|
||||||
@ -99,7 +100,7 @@ public class LabelVote {
|
|||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (o instanceof LabelVote) {
|
if (o instanceof LabelVote) {
|
||||||
LabelVote l = (LabelVote) o;
|
LabelVote l = (LabelVote) o;
|
||||||
return Objects.equal(name, l.name)
|
return Objects.equals(name, l.name)
|
||||||
&& value == l.value;
|
&& value == l.value;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user