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:
Edwin Kempin
2014-11-17 14:26:41 +01:00
committed by David Pursehouse
parent b3a96b5ac5
commit 3efed75534
14 changed files with 42 additions and 41 deletions

View File

@@ -14,9 +14,10 @@
package com.google.gerrit.server.auth;
import com.google.common.base.Objects;
import com.google.gerrit.common.Nullable;
import java.util.Objects;
/**
* Defines an abstract request for user authentication to Gerrit.
*/
@@ -50,7 +51,7 @@ public abstract class AuthRequest {
}
public void checkPassword(String pwd) throws AuthException {
if (!Objects.equal(getPassword(), pwd)) {
if (!Objects.equals(getPassword(), pwd)) {
throw new InvalidCredentialsException();
}
}