Prefer requireNonNull from Java API over Guava's checkNotNull
Most replacements are a trivial one-to-one replacement of the call to checkNotNull with requireNonNull, however there are some calls that make use of checkNotNull's variable argument list and formatting parameters. Replace these with String.format wrapped in a supplier. Using the Java API rather than Guava means we can get rid of the custom implementation, and Edwin's TODO, in AccessSection. Change-Id: I1d4a6b342e3544abdbba4f05ac4308d223b6768b
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
|
||||
package com.google.gerrit.server.util;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static java.util.Objects.requireNonNull;
|
||||
|
||||
import com.google.common.base.Throwables;
|
||||
import com.google.gerrit.reviewdb.client.Project;
|
||||
@@ -83,7 +83,7 @@ public abstract class RequestScopePropagator {
|
||||
*/
|
||||
@SuppressWarnings("javadoc") // See GuiceRequestScopePropagator#wrapImpl
|
||||
public final <T> Callable<T> wrap(Callable<T> callable) {
|
||||
final RequestContext callerContext = checkNotNull(local.getContext());
|
||||
final RequestContext callerContext = requireNonNull(local.getContext());
|
||||
final Callable<T> wrapped = wrapImpl(context(callerContext, cleanup(callable)));
|
||||
return new Callable<T>() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user