aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wfar...@apache.org
Subject [3/3] git commit: Use java.util.Objects replacements for guava helpers.
Date Tue, 01 Jul 2014 20:36:46 GMT
Use java.util.Objects replacements for guava helpers.

Reviewed at https://reviews.apache.org/r/22982/


Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/5bd68359
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/5bd68359
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/5bd68359

Branch: refs/heads/master
Commit: 5bd68359402a2588ac89d023971f78c7198be0c2
Parents: d7b8f76
Author: Bill Farner <wfarner@apache.org>
Authored: Tue Jul 1 13:34:02 2014 -0700
Committer: Bill Farner <wfarner@apache.org>
Committed: Tue Jul 1 13:34:02 2014 -0700

----------------------------------------------------------------------
 .../apache/aurora/codec/ThriftBinaryCodec.java  | 10 +--
 .../org/apache/aurora/scheduler/Driver.java     |  5 +-
 .../apache/aurora/scheduler/DriverFactory.java  |  3 +-
 .../aurora/scheduler/MesosSchedulerImpl.java    | 12 ++--
 .../aurora/scheduler/MesosTaskFactory.java      |  5 +-
 .../aurora/scheduler/SchedulerLifecycle.java    | 27 ++++----
 .../aurora/scheduler/TaskIdGenerator.java       |  4 +-
 .../org/apache/aurora/scheduler/TaskVars.java   |  6 +-
 .../aurora/scheduler/UserTaskLauncher.java      |  8 +--
 .../apache/aurora/scheduler/app/AppModule.java  |  5 +-
 .../aurora/scheduler/app/Log4jConfigurator.java |  5 +-
 .../scheduler/async/GcExecutorLauncher.java     | 18 +++---
 .../aurora/scheduler/async/HistoryPruner.java   | 12 ++--
 .../aurora/scheduler/async/OfferQueue.java      |  9 ++-
 .../aurora/scheduler/async/Preemptor.java       | 15 +++--
 .../scheduler/async/RescheduleCalculator.java   | 12 ++--
 .../aurora/scheduler/async/TaskGroups.java      | 23 ++++---
 .../aurora/scheduler/async/TaskScheduler.java   | 17 +++--
 .../aurora/scheduler/async/TaskThrottler.java   | 10 +--
 .../aurora/scheduler/async/TaskTimeout.java     |  6 +-
 .../apache/aurora/scheduler/base/AsyncUtil.java |  4 +-
 .../org/apache/aurora/scheduler/base/Query.java | 34 +++++-----
 .../configuration/ConfigurationManager.java     | 12 ++--
 .../scheduler/configuration/Resources.java      | 29 ++++-----
 .../aurora/scheduler/cron/CrontabEntry.java     | 27 ++++----
 .../aurora/scheduler/cron/SanitizedCronJob.java |  4 +-
 .../scheduler/cron/quartz/AuroraCronJob.java    | 16 ++---
 .../cron/quartz/AuroraCronJobFactory.java       |  5 +-
 .../cron/quartz/CronJobManagerImpl.java         | 18 +++---
 .../scheduler/cron/quartz/CronLifecycle.java    |  8 +--
 .../cron/quartz/CronPredictorImpl.java          |  6 +-
 .../cron/quartz/CronSchedulerImpl.java          |  6 +-
 .../aurora/scheduler/cron/quartz/Quartz.java    |  6 +-
 .../events/NotifyingSchedulingFilter.java       |  7 +--
 .../aurora/scheduler/events/PubsubEvent.java    | 40 ++++++------
 .../scheduler/events/PubsubEventModule.java     |  6 +-
 .../scheduler/filter/AttributeAggregate.java    |  8 +--
 .../scheduler/filter/ConstraintFilter.java      |  6 +-
 .../scheduler/filter/SchedulingFilter.java      | 12 ++--
 .../scheduler/filter/SchedulingFilterImpl.java  |  6 +-
 .../aurora/scheduler/http/LeaderRedirect.java   |  6 +-
 .../scheduler/http/LeaderRedirectFilter.java    |  4 +-
 .../org/apache/aurora/scheduler/http/Locks.java |  5 +-
 .../aurora/scheduler/http/Maintenance.java      |  4 +-
 .../org/apache/aurora/scheduler/http/Mname.java |  6 +-
 .../apache/aurora/scheduler/http/Offers.java    |  4 +-
 .../aurora/scheduler/http/PendingTasks.java     |  6 +-
 .../apache/aurora/scheduler/http/Quotas.java    |  4 +-
 .../aurora/scheduler/http/ServletModule.java    |  4 +-
 .../apache/aurora/scheduler/http/Slaves.java    |  5 +-
 .../aurora/scheduler/http/StructDump.java       |  6 +-
 .../aurora/scheduler/http/Utilization.java      |  3 +-
 .../scheduler/local/FakeDriverFactory.java      |  6 +-
 .../aurora/scheduler/log/mesos/MesosLog.java    | 21 +++----
 .../log/mesos/MesosLogStreamModule.java         |  4 +-
 .../aurora/scheduler/log/testing/FileLog.java   |  4 +-
 .../log/testing/FileLogStreamModule.java        |  4 +-
 .../aurora/scheduler/metadata/NearestFit.java   |  4 +-
 .../scheduler/quota/QuotaCheckResult.java       |  6 +-
 .../aurora/scheduler/quota/QuotaInfo.java       |  8 +--
 .../aurora/scheduler/quota/QuotaManager.java    |  4 +-
 .../aurora/scheduler/sla/MetricCalculator.java  | 11 ++--
 .../aurora/scheduler/sla/SlaAlgorithm.java      | 11 ++--
 .../apache/aurora/scheduler/sla/SlaModule.java  | 10 ++-
 .../aurora/scheduler/state/LockManagerImpl.java |  9 ++-
 .../scheduler/state/MaintenanceController.java  |  8 +--
 .../scheduler/state/SchedulerCoreImpl.java      | 16 ++---
 .../aurora/scheduler/state/SideEffect.java      |  9 +--
 .../scheduler/state/StateManagerImpl.java       | 23 +++----
 .../aurora/scheduler/state/TaskAssigner.java    |  8 +--
 .../scheduler/state/TaskStateMachine.java       |  6 +-
 .../scheduler/state/TransitionResult.java       | 14 ++---
 .../scheduler/stats/AsyncStatsModule.java       | 11 ++--
 .../aurora/scheduler/stats/ResourceCounter.java |  3 +-
 .../aurora/scheduler/stats/SlotSizeCounter.java | 10 +--
 .../scheduler/stats/TaskStatCalculator.java     |  6 +-
 .../storage/CallOrderEnforcingStorage.java      |  6 +-
 .../scheduler/storage/ForwardingStore.java      | 14 ++---
 .../scheduler/storage/ReadWriteLockManager.java |  6 +-
 .../scheduler/storage/backup/BackupModule.java  |  8 +--
 .../scheduler/storage/backup/Recovery.java      | 12 ++--
 .../scheduler/storage/backup/StorageBackup.java | 13 ++--
 .../scheduler/storage/db/DbLockStore.java       |  6 +-
 .../aurora/scheduler/storage/db/DbModule.java   |  5 +-
 .../scheduler/storage/db/DbQuotaStore.java      |  4 +-
 .../aurora/scheduler/storage/db/DbStorage.java  |  4 +-
 .../scheduler/storage/db/LockKeyMapper.java     |  6 +-
 .../scheduler/storage/db/MigrationModule.java   |  6 +-
 .../scheduler/storage/log/LogManager.java       | 10 +--
 .../scheduler/storage/log/LogStorage.java       | 28 ++++-----
 .../storage/log/SnapshotStoreImpl.java          |  8 +--
 .../storage/log/WriteAheadStorage.java          | 52 ++++++++--------
 .../storage/log/testing/LogOpMatcher.java       |  5 +-
 .../scheduler/storage/mem/MemJobStore.java      | 14 ++---
 .../scheduler/storage/mem/MemStorage.java       |  4 +-
 .../scheduler/storage/mem/MemStorageModule.java |  4 +-
 .../scheduler/storage/mem/MemTaskStore.java     | 14 ++---
 .../thrift/SchedulerThriftInterface.java        | 65 ++++++++++----------
 .../thrift/aop/UserCapabilityInterceptor.java   |  4 +-
 .../scheduler/thrift/auth/ThriftAuthModule.java |  3 +-
 .../aurora/tools/java/thrift_wrapper_codegen.py |  4 +-
 .../aurora/scheduler/cron/quartz/CronIT.java    |  1 -
 .../cron/quartz/CronPredictorImplTest.java      |  1 -
 .../apache/aurora/scheduler/http/LocksTest.java |  1 -
 .../aurora/scheduler/sla/SlaAlgorithmTest.java  |  1 -
 .../aurora/scheduler/sla/SlaModuleTest.java     |  1 -
 .../scheduler/state/LockManagerImplTest.java    |  1 -
 .../scheduler/state/TaskStateMachineTest.java   |  6 +-
 .../scheduler/thrift/aop/ForwardingThrift.java  |  4 +-
 109 files changed, 530 insertions(+), 536 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/codec/ThriftBinaryCodec.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/codec/ThriftBinaryCodec.java b/src/main/java/org/apache/aurora/codec/ThriftBinaryCodec.java
index 2c827fe..da4f0e5 100644
--- a/src/main/java/org/apache/aurora/codec/ThriftBinaryCodec.java
+++ b/src/main/java/org/apache/aurora/codec/ThriftBinaryCodec.java
@@ -13,9 +13,9 @@
  */
 package org.apache.aurora.codec;
 
-import javax.annotation.Nullable;
+import java.util.Objects;
 
-import com.google.common.base.Preconditions;
+import javax.annotation.Nullable;
 
 import org.apache.thrift.TBase;
 import org.apache.thrift.TDeserializer;
@@ -69,8 +69,8 @@ public final class ThriftBinaryCodec {
   public static <T extends TBase<T, ?>> T decodeNonNull(Class<T> clazz, byte[] buffer)
       throws CodingException {
 
-    Preconditions.checkNotNull(clazz);
-    Preconditions.checkNotNull(buffer);
+    Objects.requireNonNull(clazz);
+    Objects.requireNonNull(buffer);
 
     try {
       T t = clazz.newInstance();
@@ -108,7 +108,7 @@ public final class ThriftBinaryCodec {
    * @throws CodingException If the object could not be encoded.
    */
   public static byte[] encodeNonNull(TBase<?, ?> tBase) throws CodingException {
-    Preconditions.checkNotNull(tBase);
+    Objects.requireNonNull(tBase);
 
     try {
       return new TSerializer(PROTOCOL_FACTORY).serialize(tBase);

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/Driver.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/Driver.java b/src/main/java/org/apache/aurora/scheduler/Driver.java
index ffedfc3..b07378f 100644
--- a/src/main/java/org/apache/aurora/scheduler/Driver.java
+++ b/src/main/java/org/apache/aurora/scheduler/Driver.java
@@ -13,6 +13,7 @@
  */
 package org.apache.aurora.scheduler;
 
+import java.util.Objects;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.logging.Logger;
@@ -111,7 +112,7 @@ public interface Driver {
     private synchronized SchedulerDriver get(State expected) {
       // TODO(William Farner): Formalize the failure case here by throwing a checked exception.
       stateMachine.checkState(expected);
-      return Preconditions.checkNotNull(driverRef.get());
+      return Objects.requireNonNull(driverRef.get());
     }
 
     @Override
@@ -126,7 +127,7 @@ public interface Driver {
 
     @Override
     public void initialize(SchedulerDriver driver) {
-      Preconditions.checkNotNull(driver);
+      Objects.requireNonNull(driver);
       stateMachine.checkState(State.INIT);
       Preconditions.checkState(driverRef.compareAndSet(null, driver));
       stateMachine.transition(State.RUNNING);

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/DriverFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/DriverFactory.java b/src/main/java/org/apache/aurora/scheduler/DriverFactory.java
index 0f40112..a65e1bb 100644
--- a/src/main/java/org/apache/aurora/scheduler/DriverFactory.java
+++ b/src/main/java/org/apache/aurora/scheduler/DriverFactory.java
@@ -18,6 +18,7 @@ import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.Objects;
 import java.util.Properties;
 import java.util.logging.Logger;
 
@@ -107,7 +108,7 @@ public interface DriverFactory extends Function<String, SchedulerDriver> {
 
     @Inject
     DriverFactoryImpl(Provider<Scheduler> scheduler) {
-      this.scheduler = Preconditions.checkNotNull(scheduler);
+      this.scheduler = Objects.requireNonNull(scheduler);
     }
 
     @VisibleForTesting

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/MesosSchedulerImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/MesosSchedulerImpl.java b/src/main/java/org/apache/aurora/scheduler/MesosSchedulerImpl.java
index 0dce5c4..e4439f6 100644
--- a/src/main/java/org/apache/aurora/scheduler/MesosSchedulerImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/MesosSchedulerImpl.java
@@ -50,7 +50,7 @@ import org.apache.mesos.Protos.TaskStatus;
 import org.apache.mesos.Scheduler;
 import org.apache.mesos.SchedulerDriver;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 /**
  * Location for communication with mesos.
@@ -93,11 +93,11 @@ class MesosSchedulerImpl implements Scheduler {
       List<TaskLauncher> taskLaunchers,
       EventSink eventSink) {
 
-    this.storage = checkNotNull(storage);
-    this.stateManager = checkNotNull(stateManager);
-    this.lifecycle = checkNotNull(lifecycle);
-    this.taskLaunchers = checkNotNull(taskLaunchers);
-    this.eventSink = checkNotNull(eventSink);
+    this.storage = requireNonNull(storage);
+    this.stateManager = requireNonNull(stateManager);
+    this.lifecycle = requireNonNull(lifecycle);
+    this.taskLaunchers = requireNonNull(taskLaunchers);
+    this.eventSink = requireNonNull(eventSink);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/MesosTaskFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/MesosTaskFactory.java b/src/main/java/org/apache/aurora/scheduler/MesosTaskFactory.java
index 979b4bb..83d0406 100644
--- a/src/main/java/org/apache/aurora/scheduler/MesosTaskFactory.java
+++ b/src/main/java/org/apache/aurora/scheduler/MesosTaskFactory.java
@@ -42,7 +42,8 @@ import org.apache.mesos.Protos.SlaveID;
 import org.apache.mesos.Protos.TaskID;
 import org.apache.mesos.Protos.TaskInfo;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
+
 import static com.twitter.common.base.MorePreconditions.checkNotBlank;
 
 /**
@@ -108,7 +109,7 @@ public interface MesosTaskFactory {
 
     @Override
     public TaskInfo createFrom(IAssignedTask task, SlaveID slaveId) throws SchedulerException {
-      checkNotNull(task);
+      requireNonNull(task);
       byte[] taskInBytes;
       try {
         taskInBytes = ThriftBinaryCodec.encode(task.newBuilder());

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/SchedulerLifecycle.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/SchedulerLifecycle.java b/src/main/java/org/apache/aurora/scheduler/SchedulerLifecycle.java
index 48b4404..b4139eb 100644
--- a/src/main/java/org/apache/aurora/scheduler/SchedulerLifecycle.java
+++ b/src/main/java/org/apache/aurora/scheduler/SchedulerLifecycle.java
@@ -59,7 +59,8 @@ import org.apache.aurora.scheduler.storage.StorageBackfill;
 import org.apache.mesos.Protos;
 import org.apache.mesos.SchedulerDriver;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
+
 import static com.twitter.common.zookeeper.SingletonService.LeadershipListener;
 
 /**
@@ -148,8 +149,8 @@ public class SchedulerLifecycle implements EventSubscriber {
     private final ScheduledExecutorService executorService;
 
     DefaultDelayedActions(LeadingOptions leadingOptions, ScheduledExecutorService executorService) {
-      this.leadingOptions = checkNotNull(leadingOptions);
-      this.executorService = checkNotNull(executorService);
+      this.leadingOptions = requireNonNull(leadingOptions);
+      this.executorService = requireNonNull(executorService);
     }
 
     @Override
@@ -200,14 +201,14 @@ public class SchedulerLifecycle implements EventSubscriber {
       final EventSink eventSink,
       final ShutdownRegistry shutdownRegistry) {
 
-    checkNotNull(driverFactory);
-    checkNotNull(storage);
-    checkNotNull(lifecycle);
-    checkNotNull(driver);
-    checkNotNull(delayedActions);
-    checkNotNull(clock);
-    checkNotNull(eventSink);
-    checkNotNull(shutdownRegistry);
+    requireNonNull(driverFactory);
+    requireNonNull(storage);
+    requireNonNull(lifecycle);
+    requireNonNull(driver);
+    requireNonNull(delayedActions);
+    requireNonNull(clock);
+    requireNonNull(eventSink);
+    requireNonNull(shutdownRegistry);
 
     Stats.export(new StatImpl<Integer>("framework_registered") {
       @Override
@@ -490,8 +491,8 @@ public class SchedulerLifecycle implements EventSubscriber {
           leadingTimeLimit.getValue() >= 0,
           "Leading time limit must be positive.");
 
-      this.registrationDelayLimit = checkNotNull(registrationDelayLimit);
-      this.leadingTimeLimit = checkNotNull(leadingTimeLimit);
+      this.registrationDelayLimit = requireNonNull(registrationDelayLimit);
+      this.leadingTimeLimit = requireNonNull(leadingTimeLimit);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/TaskIdGenerator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/TaskIdGenerator.java b/src/main/java/org/apache/aurora/scheduler/TaskIdGenerator.java
index d96e34a..5c75cc8 100644
--- a/src/main/java/org/apache/aurora/scheduler/TaskIdGenerator.java
+++ b/src/main/java/org/apache/aurora/scheduler/TaskIdGenerator.java
@@ -13,11 +13,11 @@
  */
 package org.apache.aurora.scheduler;
 
+import java.util.Objects;
 import java.util.UUID;
 
 import javax.inject.Inject;
 
-import com.google.common.base.Preconditions;
 import com.twitter.common.util.Clock;
 
 import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
@@ -42,7 +42,7 @@ public interface TaskIdGenerator {
 
     @Inject
     TaskIdGeneratorImpl(Clock clock) {
-      this.clock = Preconditions.checkNotNull(clock);
+      this.clock = Objects.requireNonNull(clock);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/TaskVars.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/TaskVars.java b/src/main/java/org/apache/aurora/scheduler/TaskVars.java
index a58696b..ed63d5a 100644
--- a/src/main/java/org/apache/aurora/scheduler/TaskVars.java
+++ b/src/main/java/org/apache/aurora/scheduler/TaskVars.java
@@ -44,7 +44,7 @@ import org.apache.aurora.scheduler.storage.Storage.Work;
 import org.apache.aurora.scheduler.storage.entities.IAttribute;
 import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 /**
  * A container that tracks and exports stat counters for tasks.
@@ -58,8 +58,8 @@ class TaskVars implements EventSubscriber {
 
   @Inject
   TaskVars(Storage storage, final StatsProvider statProvider) {
-    this.storage = checkNotNull(storage);
-    checkNotNull(statProvider);
+    this.storage = requireNonNull(storage);
+    requireNonNull(statProvider);
     counters = CacheBuilder.newBuilder().build(new CacheLoader<String, Counter>() {
       @Override
       public Counter load(String statName) {

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/UserTaskLauncher.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/UserTaskLauncher.java b/src/main/java/org/apache/aurora/scheduler/UserTaskLauncher.java
index f79b0fa..250c2df 100644
--- a/src/main/java/org/apache/aurora/scheduler/UserTaskLauncher.java
+++ b/src/main/java/org/apache/aurora/scheduler/UserTaskLauncher.java
@@ -31,7 +31,7 @@ import org.apache.mesos.Protos.Offer;
 import org.apache.mesos.Protos.OfferID;
 import org.apache.mesos.Protos.TaskStatus;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 /**
  * A task launcher that matches resource offers against user tasks.
@@ -51,13 +51,13 @@ class UserTaskLauncher implements TaskLauncher {
 
   @Inject
   UserTaskLauncher(OfferQueue offerQueue, StateManager stateManager) {
-    this.offerQueue = checkNotNull(offerQueue);
-    this.stateManager = checkNotNull(stateManager);
+    this.offerQueue = requireNonNull(offerQueue);
+    this.stateManager = requireNonNull(stateManager);
   }
 
   @Override
   public boolean willUse(Offer offer) {
-    checkNotNull(offer);
+    requireNonNull(offer);
 
     offerQueue.addOffer(offer);
     return true;

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/app/AppModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/app/AppModule.java b/src/main/java/org/apache/aurora/scheduler/app/AppModule.java
index a0b3744..30b1ba6 100644
--- a/src/main/java/org/apache/aurora/scheduler/app/AppModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/app/AppModule.java
@@ -58,7 +58,8 @@ import org.apache.aurora.scheduler.storage.entities.IServerInfo;
 import org.apache.mesos.Scheduler;
 import org.apache.zookeeper.data.ACL;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
+
 import static com.twitter.common.base.MorePreconditions.checkNotBlank;
 
 import static org.apache.aurora.gen.apiConstants.THRIFT_API_VERSION;
@@ -83,7 +84,7 @@ class AppModule extends AbstractModule {
     this.clusterName = checkNotBlank(clusterName);
     this.serverSetPath = checkNotBlank(serverSetPath);
     this.statsUrlPrefix = statsUrlPrefix;
-    this.zkClientConfig = checkNotNull(zkClientConfig);
+    this.zkClientConfig = requireNonNull(zkClientConfig);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/app/Log4jConfigurator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/app/Log4jConfigurator.java b/src/main/java/org/apache/aurora/scheduler/app/Log4jConfigurator.java
index dc99ddc..6df497e 100644
--- a/src/main/java/org/apache/aurora/scheduler/app/Log4jConfigurator.java
+++ b/src/main/java/org/apache/aurora/scheduler/app/Log4jConfigurator.java
@@ -13,7 +13,8 @@
  */
 package org.apache.aurora.scheduler.app;
 
-import com.google.common.base.Preconditions;
+import java.util.Objects;
+
 import com.twitter.common.logging.RootLogConfig;
 import com.twitter.common.logging.RootLogConfig.Configuration;
 import com.twitter.common.logging.log4j.GlogLayout;
@@ -36,7 +37,7 @@ final class Log4jConfigurator {
    * @param glogConfig The glog configuration in effect.
    */
   static void configureConsole(Configuration glogConfig) {
-    Preconditions.checkNotNull(glogConfig);
+    Objects.requireNonNull(glogConfig);
 
     BasicConfigurator.configure(
         new ConsoleAppender(new GlogLayout(), ConsoleAppender.SYSTEM_ERR));

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/async/GcExecutorLauncher.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/async/GcExecutorLauncher.java b/src/main/java/org/apache/aurora/scheduler/async/GcExecutorLauncher.java
index a70f817..e1f6977 100644
--- a/src/main/java/org/apache/aurora/scheduler/async/GcExecutorLauncher.java
+++ b/src/main/java/org/apache/aurora/scheduler/async/GcExecutorLauncher.java
@@ -61,7 +61,7 @@ import org.apache.mesos.Protos.TaskID;
 import org.apache.mesos.Protos.TaskInfo;
 import org.apache.mesos.Protos.TaskStatus;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 /**
  * A task launcher that periodically initiates garbage collection on a host, re-using a single
@@ -128,12 +128,12 @@ public class GcExecutorLauncher implements TaskLauncher {
       Driver driver,
       Supplier<String> uuidGenerator) {
 
-    this.settings = checkNotNull(settings);
-    this.storage = checkNotNull(storage);
-    this.clock = checkNotNull(clock);
-    this.executor = checkNotNull(executor);
-    this.driver = checkNotNull(driver);
-    this.uuidGenerator = checkNotNull(uuidGenerator);
+    this.settings = requireNonNull(settings);
+    this.storage = requireNonNull(storage);
+    this.clock = requireNonNull(clock);
+    this.executor = requireNonNull(executor);
+    this.driver = requireNonNull(driver);
+    this.uuidGenerator = requireNonNull(uuidGenerator);
     this.pulses = CacheBuilder.newBuilder()
         .expireAfterWrite(settings.getMaxGcInterval(), TimeUnit.MILLISECONDS)
         .build();
@@ -234,8 +234,8 @@ public class GcExecutorLauncher implements TaskLauncher {
 
     @VisibleForTesting
     GcExecutorSettings(Amount<Long, Time> gcInterval, Optional<String> gcExecutorPath) {
-      this.gcInterval = checkNotNull(gcInterval);
-      this.gcExecutorPath = checkNotNull(gcExecutorPath);
+      this.gcInterval = requireNonNull(gcInterval);
+      this.gcExecutorPath = requireNonNull(gcExecutorPath);
     }
 
     @VisibleForTesting

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/async/HistoryPruner.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/async/HistoryPruner.java b/src/main/java/org/apache/aurora/scheduler/async/HistoryPruner.java
index 1fff2b3..ebae58a 100644
--- a/src/main/java/org/apache/aurora/scheduler/async/HistoryPruner.java
+++ b/src/main/java/org/apache/aurora/scheduler/async/HistoryPruner.java
@@ -39,7 +39,7 @@ import org.apache.aurora.scheduler.storage.Storage;
 import org.apache.aurora.scheduler.storage.entities.IJobKey;
 import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 import static org.apache.aurora.scheduler.events.PubsubEvent.EventSubscriber;
 import static org.apache.aurora.scheduler.events.PubsubEvent.TaskStateChange;
@@ -89,11 +89,11 @@ public class HistoryPruner implements EventSubscriber {
       final HistoryPrunnerSettings settings,
       final Storage storage) {
 
-    this.executor = checkNotNull(executor);
-    this.stateManager = checkNotNull(stateManager);
-    this.clock = checkNotNull(clock);
-    this.settings = checkNotNull(settings);
-    this.storage = checkNotNull(storage);
+    this.executor = requireNonNull(executor);
+    this.stateManager = requireNonNull(stateManager);
+    this.clock = requireNonNull(clock);
+    this.settings = requireNonNull(settings);
+    this.storage = requireNonNull(storage);
   }
 
   @VisibleForTesting

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/async/OfferQueue.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/async/OfferQueue.java b/src/main/java/org/apache/aurora/scheduler/async/OfferQueue.java
index cf22e9c..92c8438 100644
--- a/src/main/java/org/apache/aurora/scheduler/async/OfferQueue.java
+++ b/src/main/java/org/apache/aurora/scheduler/async/OfferQueue.java
@@ -15,6 +15,7 @@ package org.apache.aurora.scheduler.async;
 
 import java.util.Comparator;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 import java.util.concurrent.ConcurrentSkipListSet;
 import java.util.concurrent.ScheduledExecutorService;
@@ -25,9 +26,7 @@ import java.util.logging.Logger;
 import javax.inject.Inject;
 
 import com.google.common.base.Function;
-import com.google.common.base.Objects;
 import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
 import com.google.common.base.Supplier;
 import com.google.common.collect.FluentIterable;
 import com.google.common.collect.Iterables;
@@ -188,7 +187,7 @@ public interface OfferQueue extends EventSubscriber {
     }
 
     private boolean removeFromHostOffers(final OfferID offerId) {
-      Preconditions.checkNotNull(offerId);
+      Objects.requireNonNull(offerId);
 
       // The small risk of inconsistency is acceptable here - if we have an accept/remove race
       // on an offer, the master will mark the task as LOST and it will be retried.
@@ -248,12 +247,12 @@ public interface OfferQueue extends EventSubscriber {
           return false;
         }
         HostOffer other = (HostOffer) o;
-        return Objects.equal(offer, other.offer) && mode == other.mode;
+        return Objects.equals(offer, other.offer) && mode == other.mode;
       }
 
       @Override
       public int hashCode() {
-        return Objects.hashCode(offer, mode);
+        return Objects.hash(offer, mode);
       }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/async/Preemptor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/async/Preemptor.java b/src/main/java/org/apache/aurora/scheduler/async/Preemptor.java
index f29ad7f..4088559 100644
--- a/src/main/java/org/apache/aurora/scheduler/async/Preemptor.java
+++ b/src/main/java/org/apache/aurora/scheduler/async/Preemptor.java
@@ -58,8 +58,7 @@ import static java.lang.annotation.ElementType.FIELD;
 import static java.lang.annotation.ElementType.METHOD;
 import static java.lang.annotation.ElementType.PARAMETER;
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 import static org.apache.aurora.gen.ScheduleStatus.PENDING;
 import static org.apache.aurora.gen.ScheduleStatus.PREEMPTING;
@@ -150,12 +149,12 @@ public interface Preemptor {
         @PreemptionDelay Amount<Long, Time> preemptionCandidacyDelay,
         Clock clock) {
 
-      this.storage = checkNotNull(storage);
-      this.stateManager = checkNotNull(stateManager);
-      this.offerQueue = checkNotNull(offerQueue);
-      this.schedulingFilter = checkNotNull(schedulingFilter);
-      this.preemptionCandidacyDelay = checkNotNull(preemptionCandidacyDelay);
-      this.clock = checkNotNull(clock);
+      this.storage = requireNonNull(storage);
+      this.stateManager = requireNonNull(stateManager);
+      this.offerQueue = requireNonNull(offerQueue);
+      this.schedulingFilter = requireNonNull(schedulingFilter);
+      this.preemptionCandidacyDelay = requireNonNull(preemptionCandidacyDelay);
+      this.clock = requireNonNull(clock);
     }
 
     private List<IAssignedTask> fetch(Query.Builder query, Predicate<IScheduledTask> filter) {

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/async/RescheduleCalculator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/async/RescheduleCalculator.java b/src/main/java/org/apache/aurora/scheduler/async/RescheduleCalculator.java
index 6ad733c..aaa3513 100644
--- a/src/main/java/org/apache/aurora/scheduler/async/RescheduleCalculator.java
+++ b/src/main/java/org/apache/aurora/scheduler/async/RescheduleCalculator.java
@@ -39,7 +39,7 @@ import org.apache.aurora.scheduler.storage.Storage;
 import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
 import org.apache.aurora.scheduler.storage.entities.ITaskEvent;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 import static org.apache.aurora.gen.ScheduleStatus.DRAINING;
 import static org.apache.aurora.gen.ScheduleStatus.KILLING;
@@ -122,16 +122,16 @@ public interface RescheduleCalculator {
           Amount<Long, Time> flappingTaskThreashold,
           Amount<Integer, Time> maxStartupRescheduleDelay) {
 
-        this.flappingTaskBackoff = checkNotNull(flappingTaskBackoff);
-        this.flappingTaskThreashold = checkNotNull(flappingTaskThreashold);
-        this.maxStartupRescheduleDelay = checkNotNull(maxStartupRescheduleDelay);
+        this.flappingTaskBackoff = requireNonNull(flappingTaskBackoff);
+        this.flappingTaskThreashold = requireNonNull(flappingTaskThreashold);
+        this.maxStartupRescheduleDelay = requireNonNull(maxStartupRescheduleDelay);
       }
     }
 
     @Inject
     RescheduleCalculatorImpl(Storage storage, RescheduleCalculatorSettings settings) {
-      this.storage = checkNotNull(storage);
-      this.settings = checkNotNull(settings);
+      this.storage = requireNonNull(storage);
+      this.settings = requireNonNull(settings);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/async/TaskGroups.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/async/TaskGroups.java b/src/main/java/org/apache/aurora/scheduler/async/TaskGroups.java
index 8a8e6e2..0656b9b 100644
--- a/src/main/java/org/apache/aurora/scheduler/async/TaskGroups.java
+++ b/src/main/java/org/apache/aurora/scheduler/async/TaskGroups.java
@@ -13,6 +13,7 @@
  */
 package org.apache.aurora.scheduler.async;
 
+import java.util.Objects;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.ScheduledThreadPoolExecutor;
@@ -21,7 +22,6 @@ import java.util.logging.Logger;
 import javax.inject.Inject;
 
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Objects;
 import com.google.common.base.Optional;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Iterables;
@@ -46,10 +46,9 @@ import org.apache.aurora.scheduler.storage.entities.IAssignedTask;
 import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
 import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
 
+import static java.util.Objects.requireNonNull;
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
 
-import static com.google.common.base.Preconditions.checkNotNull;
-
 import static org.apache.aurora.gen.ScheduleStatus.PENDING;
 
 /**
@@ -76,8 +75,8 @@ public class TaskGroups implements EventSubscriber {
     private final RateLimiter rateLimiter;
 
     TaskGroupsSettings(BackoffStrategy taskGroupBackoff, RateLimiter rateLimiter) {
-      this.taskGroupBackoff = checkNotNull(taskGroupBackoff);
-      this.rateLimiter = checkNotNull(rateLimiter);
+      this.taskGroupBackoff = requireNonNull(taskGroupBackoff);
+      this.rateLimiter = requireNonNull(rateLimiter);
     }
   }
 
@@ -104,11 +103,11 @@ public class TaskGroups implements EventSubscriber {
       final TaskScheduler taskScheduler,
       final RescheduleCalculator rescheduleCalculator) {
 
-    this.executor = checkNotNull(executor);
-    checkNotNull(rateLimiter);
-    checkNotNull(taskScheduler);
-    this.backoff = checkNotNull(backoff);
-    this.rescheduleCalculator = checkNotNull(rescheduleCalculator);
+    this.executor = requireNonNull(executor);
+    requireNonNull(rateLimiter);
+    requireNonNull(taskScheduler);
+    this.backoff = requireNonNull(backoff);
+    this.rescheduleCalculator = requireNonNull(rescheduleCalculator);
 
     this.taskScheduler = new TaskScheduler() {
       @Override
@@ -226,7 +225,7 @@ public class TaskGroups implements EventSubscriber {
 
     @Override
     public int hashCode() {
-      return Objects.hashCode(canonicalTask);
+      return Objects.hash(canonicalTask);
     }
 
     @Override
@@ -235,7 +234,7 @@ public class TaskGroups implements EventSubscriber {
         return false;
       }
       GroupKey other = (GroupKey) o;
-      return Objects.equal(canonicalTask, other.canonicalTask);
+      return Objects.equals(canonicalTask, other.canonicalTask);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/async/TaskScheduler.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/async/TaskScheduler.java b/src/main/java/org/apache/aurora/scheduler/async/TaskScheduler.java
index 57ed758..a37232a 100644
--- a/src/main/java/org/apache/aurora/scheduler/async/TaskScheduler.java
+++ b/src/main/java/org/apache/aurora/scheduler/async/TaskScheduler.java
@@ -62,8 +62,7 @@ import static java.lang.annotation.ElementType.FIELD;
 import static java.lang.annotation.ElementType.METHOD;
 import static java.lang.annotation.ElementType.PARAMETER;
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 import static org.apache.aurora.gen.ScheduleStatus.LOST;
 import static org.apache.aurora.gen.ScheduleStatus.PENDING;
@@ -118,11 +117,11 @@ interface TaskScheduler extends EventSubscriber {
         @ReservationDuration Amount<Long, Time> reservationDuration,
         final Clock clock) {
 
-      this.storage = checkNotNull(storage);
-      this.stateManager = checkNotNull(stateManager);
-      this.assigner = checkNotNull(assigner);
-      this.offerQueue = checkNotNull(offerQueue);
-      this.preemptor = checkNotNull(preemptor);
+      this.storage = requireNonNull(storage);
+      this.stateManager = requireNonNull(stateManager);
+      this.assigner = requireNonNull(assigner);
+      this.offerQueue = requireNonNull(offerQueue);
+      this.preemptor = requireNonNull(preemptor);
       this.reservations = new Reservations(reservationDuration, clock);
     }
 
@@ -243,8 +242,8 @@ interface TaskScheduler extends EventSubscriber {
       private final Cache<SlaveID, String> reservations;
 
       Reservations(final Amount<Long, Time> duration, final Clock clock) {
-        checkNotNull(duration);
-        checkNotNull(clock);
+        requireNonNull(duration);
+        requireNonNull(clock);
         this.reservations = CacheBuilder.newBuilder()
             .expireAfterWrite(duration.as(Time.MINUTES), TimeUnit.MINUTES)
             .ticker(new Ticker() {

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/async/TaskThrottler.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/async/TaskThrottler.java b/src/main/java/org/apache/aurora/scheduler/async/TaskThrottler.java
index d21856f..ca6129c 100644
--- a/src/main/java/org/apache/aurora/scheduler/async/TaskThrottler.java
+++ b/src/main/java/org/apache/aurora/scheduler/async/TaskThrottler.java
@@ -28,7 +28,7 @@ import org.apache.aurora.scheduler.events.PubsubEvent.EventSubscriber;
 import org.apache.aurora.scheduler.events.PubsubEvent.TaskStateChange;
 import org.apache.aurora.scheduler.state.StateManager;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 import static org.apache.aurora.gen.ScheduleStatus.PENDING;
 import static org.apache.aurora.gen.ScheduleStatus.THROTTLED;
@@ -55,10 +55,10 @@ class TaskThrottler implements EventSubscriber {
       ScheduledExecutorService executor,
       StateManager stateManager) {
 
-    this.rescheduleCalculator = checkNotNull(rescheduleCalculator);
-    this.clock = checkNotNull(clock);
-    this.executor = checkNotNull(executor);
-    this.stateManager = checkNotNull(stateManager);
+    this.rescheduleCalculator = requireNonNull(rescheduleCalculator);
+    this.clock = requireNonNull(clock);
+    this.executor = requireNonNull(executor);
+    this.stateManager = requireNonNull(stateManager);
   }
 
   @Subscribe

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/async/TaskTimeout.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/async/TaskTimeout.java b/src/main/java/org/apache/aurora/scheduler/async/TaskTimeout.java
index 0b63721..8914022 100644
--- a/src/main/java/org/apache/aurora/scheduler/async/TaskTimeout.java
+++ b/src/main/java/org/apache/aurora/scheduler/async/TaskTimeout.java
@@ -34,7 +34,7 @@ import org.apache.aurora.scheduler.events.PubsubEvent.EventSubscriber;
 import org.apache.aurora.scheduler.events.PubsubEvent.TaskStateChange;
 import org.apache.aurora.scheduler.state.StateManager;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 /**
  * Observes task transitions and identifies tasks that are 'stuck' in a transient state.  Stuck
@@ -69,8 +69,8 @@ class TaskTimeout implements EventSubscriber {
       Amount<Long, Time> timeout,
       StatsProvider statsProvider) {
 
-    this.executor = checkNotNull(executor);
-    this.stateManager = checkNotNull(stateManager);
+    this.executor = requireNonNull(executor);
+    this.stateManager = requireNonNull(stateManager);
     this.timeoutMillis = timeout.as(Time.MILLISECONDS);
     this.timedOutTasks = statsProvider.makeCounter(TIMED_OUT_TASKS_COUNTER);
   }

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/base/AsyncUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/base/AsyncUtil.java b/src/main/java/org/apache/aurora/scheduler/base/AsyncUtil.java
index 48b36c2..212ba12 100644
--- a/src/main/java/org/apache/aurora/scheduler/base/AsyncUtil.java
+++ b/src/main/java/org/apache/aurora/scheduler/base/AsyncUtil.java
@@ -23,7 +23,7 @@ import javax.annotation.Nullable;
 
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 /**
  * Utility class for facilitating async scheduling.
@@ -47,7 +47,7 @@ public final class AsyncUtil {
       String nameFormat,
       final Logger logger) {
 
-    checkNotNull(nameFormat);
+    requireNonNull(nameFormat);
 
     return new ScheduledThreadPoolExecutor(
         poolSize,

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/base/Query.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/base/Query.java b/src/main/java/org/apache/aurora/scheduler/base/Query.java
index cfb1d16..d8572bb 100644
--- a/src/main/java/org/apache/aurora/scheduler/base/Query.java
+++ b/src/main/java/org/apache/aurora/scheduler/base/Query.java
@@ -14,9 +14,9 @@
 package org.apache.aurora.scheduler.base;
 
 import java.util.EnumSet;
+import java.util.Objects;
 import java.util.Set;
 
-import com.google.common.base.Objects;
 import com.google.common.base.Optional;
 import com.google.common.base.Supplier;
 import com.google.common.collect.ImmutableSet;
@@ -29,7 +29,7 @@ import org.apache.aurora.gen.ScheduleStatus;
 import org.apache.aurora.gen.TaskQuery;
 import org.apache.aurora.scheduler.storage.entities.IJobKey;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 /**
  * A utility class to construct storage queries.
@@ -153,7 +153,7 @@ public final class Query {
     }
 
     Builder(final TaskQuery query) {
-      this.query = checkNotNull(query); // It is expected that the caller calls deepCopy.
+      this.query = requireNonNull(query); // It is expected that the caller calls deepCopy.
     }
 
     /**
@@ -172,17 +172,17 @@ public final class Query {
     public boolean equals(Object that) {
       return that != null
           && that instanceof Builder
-          && Objects.equal(query, ((Builder) that).query);
+          && Objects.equals(query, ((Builder) that).query);
     }
 
     @Override
     public int hashCode() {
-      return Objects.hashCode(query);
+      return Objects.hash(query);
     }
 
     @Override
     public String toString() {
-      return Objects.toStringHelper(this)
+      return com.google.common.base.Objects.toStringHelper(this)
           .add("query", query)
           .toString();
     }
@@ -195,7 +195,7 @@ public final class Query {
      * @return A new Builder scoped to the given tasks.
      */
     public Builder byId(String taskId, String... taskIds) {
-      checkNotNull(taskId);
+      requireNonNull(taskId);
 
       return new Builder(
           query.deepCopy()
@@ -211,7 +211,7 @@ public final class Query {
      * @return A new Builder scoped to the given tasks.
      */
     public Builder byId(Iterable<String> taskIds) {
-      checkNotNull(taskIds);
+      requireNonNull(taskIds);
 
       return new Builder(
           query.deepCopy().setTaskIds(ImmutableSet.copyOf(taskIds)));
@@ -224,7 +224,7 @@ public final class Query {
      * @return A new Builder scoped to the given role.
      */
     public Builder byRole(String role) {
-      checkNotNull(role);
+      requireNonNull(role);
 
       return new Builder(
           query.deepCopy().setOwner(new Identity().setRole(role)));
@@ -239,8 +239,8 @@ public final class Query {
      * @return A new Builder scoped to the given environment.
      */
     public Builder byEnv(String role, String environment) {
-      checkNotNull(role);
-      checkNotNull(environment);
+      requireNonNull(role);
+      requireNonNull(environment);
 
       return new Builder(
           query.deepCopy()
@@ -274,7 +274,7 @@ public final class Query {
      * @return A new Builder scoped to the given slaves.
      */
     public Builder bySlave(String slaveHost, String... slaveHosts) {
-      checkNotNull(slaveHost);
+      requireNonNull(slaveHost);
 
       return bySlave(ImmutableSet.<String>builder().add(slaveHost).add(slaveHosts).build());
     }
@@ -288,7 +288,7 @@ public final class Query {
      * @return A new Builder scoped to the slaveHosts.
      */
     public Builder bySlave(Iterable<String> slaveHosts) {
-      checkNotNull(slaveHosts);
+      requireNonNull(slaveHosts);
 
       return new Builder(query.deepCopy().setSlaveHosts(ImmutableSet.copyOf(slaveHosts)));
     }
@@ -302,7 +302,7 @@ public final class Query {
      * @return A new Builder scoped to the given statuses.
      */
     public Builder byStatus(ScheduleStatus status, ScheduleStatus... statuses) {
-      checkNotNull(status);
+      requireNonNull(status);
 
       return new Builder(
           query.deepCopy().setStatuses(EnumSet.of(status, statuses)));
@@ -317,7 +317,7 @@ public final class Query {
      * @return A new Builder scoped to the given statuses.
      */
     public Builder byStatus(Iterable<ScheduleStatus> statuses) {
-      checkNotNull(statuses);
+      requireNonNull(statuses);
 
       return new Builder(
           query.deepCopy().setStatuses(EnumSet.copyOf(ImmutableSet.copyOf(statuses))));
@@ -357,7 +357,7 @@ public final class Query {
      */
     public Builder byInstances(IJobKey jobKey, Iterable<Integer> instanceIds) {
       JobKeys.assertValid(jobKey);
-      checkNotNull(instanceIds);
+      requireNonNull(instanceIds);
 
       return new Builder(
           query.deepCopy()
@@ -375,7 +375,7 @@ public final class Query {
      * @return A new Builder scoped to the job keys.
      */
     public Builder byJobKeys(Iterable<IJobKey> jobKeys) {
-      checkNotNull(jobKeys);
+      requireNonNull(jobKeys);
 
       return new Builder(query.deepCopy().setJobKeys(IJobKey.toBuildersSet(jobKeys)));
     }

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/configuration/ConfigurationManager.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/configuration/ConfigurationManager.java b/src/main/java/org/apache/aurora/scheduler/configuration/ConfigurationManager.java
index 47cb70b..3661f84 100644
--- a/src/main/java/org/apache/aurora/scheduler/configuration/ConfigurationManager.java
+++ b/src/main/java/org/apache/aurora/scheduler/configuration/ConfigurationManager.java
@@ -13,12 +13,12 @@
  */
 package org.apache.aurora.scheduler.configuration;
 
+import java.util.Objects;
 import java.util.regex.Pattern;
 
 import javax.annotation.Nullable;
 
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
 import com.google.common.base.Predicate;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
@@ -174,16 +174,16 @@ public final class ConfigurationManager {
         && identifier.length() <= MAX_IDENTIFIER_LENGTH;
   }
 
-  private static void checkNotNull(Object value, String error) throws TaskDescriptionException {
+  private static void requireNonNull(Object value, String error) throws TaskDescriptionException {
     if (value == null) {
       throw new TaskDescriptionException(error);
     }
   }
 
   private static void assertOwnerValidity(IIdentity jobOwner) throws TaskDescriptionException {
-    checkNotNull(jobOwner, "No job owner specified!");
-    checkNotNull(jobOwner.getRole(), "No job role specified!");
-    checkNotNull(jobOwner.getUser(), "No job user specified!");
+    requireNonNull(jobOwner, "No job owner specified!");
+    requireNonNull(jobOwner.getRole(), "No job role specified!");
+    requireNonNull(jobOwner.getUser(), "No job user specified!");
 
     if (!isGoodIdentifier(jobOwner.getRole())) {
       throw new TaskDescriptionException(
@@ -225,7 +225,7 @@ public final class ConfigurationManager {
   public static IJobConfiguration validateAndPopulate(IJobConfiguration job)
       throws TaskDescriptionException {
 
-    Preconditions.checkNotNull(job);
+    Objects.requireNonNull(job);
 
     if (!job.isSetTaskConfig()) {
       throw new TaskDescriptionException("Job configuration must have taskConfig set.");

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/configuration/Resources.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/configuration/Resources.java b/src/main/java/org/apache/aurora/scheduler/configuration/Resources.java
index 1d557c7..65c4b52 100644
--- a/src/main/java/org/apache/aurora/scheduler/configuration/Resources.java
+++ b/src/main/java/org/apache/aurora/scheduler/configuration/Resources.java
@@ -15,11 +15,11 @@ package org.apache.aurora.scheduler.configuration;
 
 import java.util.Collections;
 import java.util.List;
+import java.util.Objects;
 import java.util.Set;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Function;
-import com.google.common.base.Objects;
 import com.google.common.base.Predicate;
 import com.google.common.base.Predicates;
 import com.google.common.collect.ContiguousSet;
@@ -36,7 +36,6 @@ import com.twitter.common.quantity.Data;
 
 import org.apache.aurora.scheduler.base.Numbers;
 import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
-import org.apache.commons.lang.builder.EqualsBuilder;
 import org.apache.mesos.Protos.Offer;
 import org.apache.mesos.Protos.Resource;
 import org.apache.mesos.Protos.Value.Range;
@@ -44,7 +43,7 @@ import org.apache.mesos.Protos.Value.Ranges;
 import org.apache.mesos.Protos.Value.Scalar;
 import org.apache.mesos.Protos.Value.Type;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 /**
  * A container for multiple resource vectors.
@@ -82,8 +81,8 @@ public class Resources {
    */
   public Resources(double numCpus, Amount<Long, Data> ram, Amount<Long, Data> disk, int numPorts) {
     this.numCpus = numCpus;
-    this.ram = checkNotNull(ram);
-    this.disk = checkNotNull(disk);
+    this.ram = requireNonNull(ram);
+    this.disk = requireNonNull(disk);
     this.numPorts = numPorts;
   }
 
@@ -137,17 +136,15 @@ public class Resources {
     }
 
     Resources other = (Resources) o;
-    return new EqualsBuilder()
-        .append(numCpus, other.numCpus)
-        .append(ram, other.ram)
-        .append(disk, other.disk)
-        .append(numPorts, other.numPorts)
-        .isEquals();
+    return Objects.equals(numCpus, other.numCpus)
+        && Objects.equals(ram, other.ram)
+        && Objects.equals(disk, other.disk)
+        && Objects.equals(numPorts, other.numPorts);
   }
 
   @Override
   public int hashCode() {
-    return Objects.hashCode(numCpus, ram, disk, numPorts);
+    return Objects.hash(numCpus, ram, disk, numPorts);
   }
 
   /**
@@ -157,7 +154,7 @@ public class Resources {
    * @return The resources required by the task.
    */
   public static Resources from(ITaskConfig task) {
-    checkNotNull(task);
+    requireNonNull(task);
     return new Resources(
         task.getNumCpus(),
         Amount.of(task.getRamMb(), Data.MB),
@@ -172,7 +169,7 @@ public class Resources {
    * @return The canonical resources.
    */
   public static Resources from(List<Resource> resources) {
-    checkNotNull(resources);
+    requireNonNull(resources);
     return new Resources(
         getScalarValue(resources, CPUS),
         Amount.of((long) getScalarValue(resources, RAM_MB), Data.MB),
@@ -188,7 +185,7 @@ public class Resources {
    * @return The resources available in the offer.
    */
   public static Resources from(Offer offer) {
-    checkNotNull(offer);
+    requireNonNull(offer);
     return new Resources(
         getScalarValue(offer, CPUS),
         Amount.of((long) getScalarValue(offer, RAM_MB), Data.MB),
@@ -379,7 +376,7 @@ public class Resources {
   public static Set<Integer> getPorts(Offer offer, int numPorts)
       throws InsufficientResourcesException {
 
-    checkNotNull(offer);
+    requireNonNull(offer);
 
     if (numPorts == 0) {
       return ImmutableSet.of();

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/cron/CrontabEntry.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/cron/CrontabEntry.java b/src/main/java/org/apache/aurora/scheduler/cron/CrontabEntry.java
index 6f01a69..904dd72 100644
--- a/src/main/java/org/apache/aurora/scheduler/cron/CrontabEntry.java
+++ b/src/main/java/org/apache/aurora/scheduler/cron/CrontabEntry.java
@@ -16,12 +16,12 @@ package org.apache.aurora.scheduler.cron;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.Objects;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Joiner;
-import com.google.common.base.Objects;
 import com.google.common.base.Optional;
 import com.google.common.base.Splitter;
 import com.google.common.collect.BiMap;
@@ -34,8 +34,9 @@ import com.google.common.collect.Range;
 import com.google.common.collect.RangeSet;
 import com.google.common.collect.TreeRangeSet;
 
+import static java.util.Objects.requireNonNull;
+
 import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
 
 /**
  * A pattern that describes one or more cron 5-tuples (minute, hour, dayOfMonth, month, dayOfWeek).
@@ -278,16 +279,16 @@ public final class CrontabEntry {
       return false;
     }
     CrontabEntry that = (CrontabEntry) o;
-    return Objects.equal(getMinute(), that.getMinute())
-        && Objects.equal(getHour(), that.getHour())
-        && Objects.equal(getDayOfMonth(), that.getDayOfMonth())
-        && Objects.equal(getMonth(), that.getMonth())
-        && Objects.equal(getDayOfWeek(), that.getDayOfWeek());
+    return Objects.equals(getMinute(), that.getMinute())
+        && Objects.equals(getHour(), that.getHour())
+        && Objects.equals(getDayOfMonth(), that.getDayOfMonth())
+        && Objects.equals(getMonth(), that.getMonth())
+        && Objects.equals(getDayOfWeek(), that.getDayOfWeek());
   }
 
   @Override
   public int hashCode() {
-    return Objects.hashCode(getMinute(), getHour(), getDayOfWeek(), getMonth(), getDayOfMonth());
+    return Objects.hash(getMinute(), getHour(), getDayOfWeek(), getMonth(), getDayOfMonth());
   }
 
   private static class Parser {
@@ -349,11 +350,11 @@ public final class CrontabEntry {
       Matcher matcher = CRONTAB_ENTRY.matcher(schedule);
       checkArgument(matcher.matches(), "Invalid cron schedule " + schedule);
 
-      rawMinute = checkNotNull(matcher.group("minute"));
-      rawHour = checkNotNull(matcher.group("hour"));
-      rawDayOfMonth = checkNotNull(matcher.group("dayOfMonth"));
-      rawMonth = checkNotNull(matcher.group("month"));
-      rawDayOfWeek = checkNotNull(matcher.group("dayOfWeek"));
+      rawMinute = requireNonNull(matcher.group("minute"));
+      rawHour = requireNonNull(matcher.group("hour"));
+      rawDayOfMonth = requireNonNull(matcher.group("dayOfMonth"));
+      rawMonth = requireNonNull(matcher.group("month"));
+      rawDayOfWeek = requireNonNull(matcher.group("dayOfWeek"));
     }
 
     CrontabEntry get() throws IllegalArgumentException {

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/cron/SanitizedCronJob.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/cron/SanitizedCronJob.java b/src/main/java/org/apache/aurora/scheduler/cron/SanitizedCronJob.java
index 17ac286..48b403e 100644
--- a/src/main/java/org/apache/aurora/scheduler/cron/SanitizedCronJob.java
+++ b/src/main/java/org/apache/aurora/scheduler/cron/SanitizedCronJob.java
@@ -24,7 +24,7 @@ import org.apache.aurora.scheduler.configuration.SanitizedConfiguration;
 import org.apache.aurora.scheduler.storage.entities.IJobConfiguration;
 import org.apache.commons.lang.StringUtils;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 /**
  * Used by functions that expect field validation before being called.
@@ -105,7 +105,7 @@ public final class SanitizedCronJob {
   }
 
   private static boolean hasCronSchedule(IJobConfiguration job) {
-    checkNotNull(job);
+    requireNonNull(job);
     return !StringUtils.isEmpty(job.getCronSchedule());
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJob.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJob.java b/src/main/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJob.java
index 57d874b..6220281 100644
--- a/src/main/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJob.java
+++ b/src/main/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJob.java
@@ -19,12 +19,12 @@ import java.util.Set;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.logging.Level;
 import java.util.logging.Logger;
+
 import javax.inject.Inject;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Optional;
 import com.google.common.collect.ImmutableMap;
-
 import com.twitter.common.base.Supplier;
 import com.twitter.common.stats.Stats;
 import com.twitter.common.util.BackoffHelper;
@@ -43,13 +43,13 @@ import org.apache.aurora.scheduler.storage.Storage;
 import org.apache.aurora.scheduler.storage.entities.IJobConfiguration;
 import org.apache.aurora.scheduler.storage.entities.IJobKey;
 import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
-
 import org.quartz.DisallowConcurrentExecution;
 import org.quartz.Job;
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
+
 import static com.google.common.base.Preconditions.checkState;
 
 import static org.apache.aurora.gen.ScheduleStatus.KILLING;
@@ -87,10 +87,10 @@ class AuroraCronJob implements Job {
       StateManager stateManager,
       CronJobManager cronJobManager) {
 
-    this.storage = checkNotNull(storage);
-    this.stateManager = checkNotNull(stateManager);
-    this.cronJobManager = checkNotNull(cronJobManager);
-    this.delayedStartBackoff = checkNotNull(config.getDelayedStartBackoff());
+    this.storage = requireNonNull(storage);
+    this.stateManager = requireNonNull(stateManager);
+    this.cronJobManager = requireNonNull(cronJobManager);
+    this.delayedStartBackoff = requireNonNull(config.getDelayedStartBackoff());
   }
 
   private static final class DeferredLaunch {
@@ -219,7 +219,7 @@ class AuroraCronJob implements Job {
     private final BackoffHelper delayedStartBackoff;
 
     Config(BackoffHelper delayedStartBackoff) {
-      this.delayedStartBackoff = checkNotNull(delayedStartBackoff);
+      this.delayedStartBackoff = requireNonNull(delayedStartBackoff);
     }
 
     public BackoffHelper getDelayedStartBackoff() {

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJobFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJobFactory.java b/src/main/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJobFactory.java
index 311bcb3..bb3bbbd 100644
--- a/src/main/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJobFactory.java
+++ b/src/main/java/org/apache/aurora/scheduler/cron/quartz/AuroraCronJobFactory.java
@@ -22,7 +22,8 @@ import org.quartz.SchedulerException;
 import org.quartz.spi.JobFactory;
 import org.quartz.spi.TriggerFiredBundle;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
+
 import static com.google.common.base.Preconditions.checkState;
 
 /**
@@ -33,7 +34,7 @@ class AuroraCronJobFactory implements JobFactory {
 
   @Inject
   AuroraCronJobFactory(Provider<AuroraCronJob> auroraCronJobProvider) {
-    this.auroraCronJobProvider = checkNotNull(auroraCronJobProvider);
+    this.auroraCronJobProvider = requireNonNull(auroraCronJobProvider);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronJobManagerImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronJobManagerImpl.java b/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronJobManagerImpl.java
index 9eda3b7..8e2d3d9 100644
--- a/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronJobManagerImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronJobManagerImpl.java
@@ -43,7 +43,7 @@ import org.quartz.Scheduler;
 import org.quartz.SchedulerException;
 import org.quartz.impl.matchers.GroupMatcher;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 /**
  * NOTE: The source of truth for whether a cron job exists or not is always the JobStore. If state
@@ -60,9 +60,9 @@ class CronJobManagerImpl implements CronJobManager {
 
   @Inject
   CronJobManagerImpl(Storage storage, Scheduler scheduler, TimeZone timeZone) {
-    this.storage = checkNotNull(storage);
-    this.scheduler = checkNotNull(scheduler);
-    this.timeZone = checkNotNull(timeZone);
+    this.storage = requireNonNull(storage);
+    this.scheduler = requireNonNull(scheduler);
+    this.timeZone = requireNonNull(timeZone);
   }
 
   @Override
@@ -72,7 +72,7 @@ class CronJobManagerImpl implements CronJobManager {
 
   @Override
   public void startJobNow(final IJobKey jobKey) throws CronException {
-    checkNotNull(jobKey);
+    requireNonNull(jobKey);
 
     storage.weaklyConsistentRead(new Work<Void, CronException>() {
       @Override
@@ -104,7 +104,7 @@ class CronJobManagerImpl implements CronJobManager {
 
   @Override
   public void updateJob(final SanitizedCronJob config) throws CronException {
-    checkNotNull(config);
+    requireNonNull(config);
     checkNoRunOverlap(config);
 
     final IJobKey jobKey = config.getSanitizedConfig().getJobConfig().getKey();
@@ -123,7 +123,7 @@ class CronJobManagerImpl implements CronJobManager {
 
   @Override
   public void createJob(final SanitizedCronJob cronJob) throws CronException {
-    checkNotNull(cronJob);
+    requireNonNull(cronJob);
     checkNoRunOverlap(cronJob);
 
     final IJobKey jobKey = cronJob.getSanitizedConfig().getJobConfig().getKey();
@@ -192,7 +192,7 @@ class CronJobManagerImpl implements CronJobManager {
 
   @Override
   public boolean hasJob(final IJobKey jobKey) {
-    checkNotNull(jobKey);
+    requireNonNull(jobKey);
 
     return storage.consistentRead(new Work.Quiet<Boolean>() {
       @Override
@@ -204,7 +204,7 @@ class CronJobManagerImpl implements CronJobManager {
 
   @Override
   public boolean deleteJob(final IJobKey jobKey) {
-    checkNotNull(jobKey);
+    requireNonNull(jobKey);
 
     return storage.write(new MutateWork.Quiet<Boolean>() {
       @Override

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronLifecycle.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronLifecycle.java b/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronLifecycle.java
index 02ba94a..1d39783 100644
--- a/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronLifecycle.java
+++ b/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronLifecycle.java
@@ -34,7 +34,7 @@ import org.apache.aurora.scheduler.storage.entities.IJobConfiguration;
 import org.quartz.Scheduler;
 import org.quartz.SchedulerException;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 /**
  * Manager for startup and teardown of Quartz scheduler.
@@ -56,9 +56,9 @@ class CronLifecycle extends AbstractIdleService implements PubsubEvent.EventSubs
       ShutdownRegistry shutdownRegistry,
       CronJobManagerImpl cronJobManager) {
 
-    this.scheduler = checkNotNull(scheduler);
-    this.shutdownRegistry = checkNotNull(shutdownRegistry);
-    this.cronJobManager = checkNotNull(cronJobManager);
+    this.scheduler = requireNonNull(scheduler);
+    this.shutdownRegistry = requireNonNull(shutdownRegistry);
+    this.cronJobManager = requireNonNull(cronJobManager);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronPredictorImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronPredictorImpl.java b/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronPredictorImpl.java
index a2f099a..d362a1e 100644
--- a/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronPredictorImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronPredictorImpl.java
@@ -24,7 +24,7 @@ import org.apache.aurora.scheduler.cron.CronPredictor;
 import org.apache.aurora.scheduler.cron.CrontabEntry;
 import org.quartz.CronExpression;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 class CronPredictorImpl implements CronPredictor {
   private final Clock clock;
@@ -32,8 +32,8 @@ class CronPredictorImpl implements CronPredictor {
 
   @Inject
   CronPredictorImpl(Clock clock, TimeZone timeZone) {
-    this.clock = checkNotNull(clock);
-    this.timeZone = checkNotNull(timeZone);
+    this.clock = requireNonNull(clock);
+    this.timeZone = requireNonNull(timeZone);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronSchedulerImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronSchedulerImpl.java b/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronSchedulerImpl.java
index 5b24b31..1ec8ddf 100644
--- a/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronSchedulerImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/cron/quartz/CronSchedulerImpl.java
@@ -31,7 +31,7 @@ import org.quartz.CronTrigger;
 import org.quartz.Scheduler;
 import org.quartz.SchedulerException;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 import static org.apache.aurora.scheduler.cron.quartz.Quartz.jobKey;
 
@@ -42,12 +42,12 @@ class CronSchedulerImpl implements CronScheduler {
 
   @Inject
   CronSchedulerImpl(Scheduler scheduler) {
-    this.scheduler = checkNotNull(scheduler);
+    this.scheduler = requireNonNull(scheduler);
   }
 
   @Override
   public Optional<CrontabEntry> getSchedule(IJobKey jobKey) throws IllegalStateException {
-    checkNotNull(jobKey);
+    requireNonNull(jobKey);
 
     try {
       return Optional.of(Iterables.getOnlyElement(

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/cron/quartz/Quartz.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/cron/quartz/Quartz.java b/src/main/java/org/apache/aurora/scheduler/cron/quartz/Quartz.java
index 25c81b9..45e062d 100644
--- a/src/main/java/org/apache/aurora/scheduler/cron/quartz/Quartz.java
+++ b/src/main/java/org/apache/aurora/scheduler/cron/quartz/Quartz.java
@@ -36,7 +36,7 @@ import org.quartz.JobDetail;
 import org.quartz.JobKey;
 import org.quartz.TriggerBuilder;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 /**
  * Utilities for converting Aurora datatypes to Quartz datatypes.
@@ -108,8 +108,8 @@ final class Quartz {
   }
 
   static JobDetail jobDetail(IJobKey jobKey, Class<? extends Job> jobClass) {
-    checkNotNull(jobKey);
-    checkNotNull(jobClass);
+    requireNonNull(jobKey);
+    requireNonNull(jobClass);
 
     return JobBuilder.newJob(jobClass)
         .withIdentity(jobKey(jobKey))

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/events/NotifyingSchedulingFilter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/events/NotifyingSchedulingFilter.java b/src/main/java/org/apache/aurora/scheduler/events/NotifyingSchedulingFilter.java
index 29fe32b..5cb0b2d 100644
--- a/src/main/java/org/apache/aurora/scheduler/events/NotifyingSchedulingFilter.java
+++ b/src/main/java/org/apache/aurora/scheduler/events/NotifyingSchedulingFilter.java
@@ -31,8 +31,7 @@ import static java.lang.annotation.ElementType.FIELD;
 import static java.lang.annotation.ElementType.METHOD;
 import static java.lang.annotation.ElementType.PARAMETER;
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 /**
  * A decorating scheduling filter that sends an event when a scheduling assignment is vetoed.
@@ -54,8 +53,8 @@ class NotifyingSchedulingFilter implements SchedulingFilter {
       @NotifyDelegate SchedulingFilter delegate,
       EventSink eventSink) {
 
-    this.delegate = checkNotNull(delegate);
-    this.eventSink = checkNotNull(eventSink);
+    this.delegate = requireNonNull(delegate);
+    this.eventSink = requireNonNull(eventSink);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/events/PubsubEvent.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/events/PubsubEvent.java b/src/main/java/org/apache/aurora/scheduler/events/PubsubEvent.java
index 2afbef8..e7fafec 100644
--- a/src/main/java/org/apache/aurora/scheduler/events/PubsubEvent.java
+++ b/src/main/java/org/apache/aurora/scheduler/events/PubsubEvent.java
@@ -13,9 +13,9 @@
  */
 package org.apache.aurora.scheduler.events;
 
+import java.util.Objects;
 import java.util.Set;
 
-import com.google.common.base.Objects;
 import com.google.common.base.Optional;
 
 import org.apache.aurora.gen.HostStatus;
@@ -24,7 +24,7 @@ import org.apache.aurora.scheduler.base.Tasks;
 import org.apache.aurora.scheduler.filter.SchedulingFilter.Veto;
 import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 /**
  * Event notifications related to tasks.
@@ -44,7 +44,7 @@ public interface PubsubEvent {
     private final Set<IScheduledTask> tasks;
 
     public TasksDeleted(Set<IScheduledTask> tasks) {
-      this.tasks = checkNotNull(tasks);
+      this.tasks = requireNonNull(tasks);
     }
 
     public Set<IScheduledTask> getTasks() {
@@ -58,17 +58,17 @@ public interface PubsubEvent {
       }
 
       TasksDeleted other = (TasksDeleted) o;
-      return Objects.equal(tasks, other.tasks);
+      return Objects.equals(tasks, other.tasks);
     }
 
     @Override
     public int hashCode() {
-      return Objects.hashCode(tasks);
+      return Objects.hash(tasks);
     }
 
     @Override
     public String toString() {
-      return Objects.toStringHelper(this)
+      return com.google.common.base.Objects.toStringHelper(this)
           .add("tasks", Tasks.ids(tasks))
           .toString();
     }
@@ -84,8 +84,8 @@ public interface PubsubEvent {
     private final Optional<ScheduleStatus> oldState;
 
     private TaskStateChange(IScheduledTask task, Optional<ScheduleStatus> oldState) {
-      this.task = checkNotNull(task);
-      this.oldState = checkNotNull(oldState);
+      this.task = requireNonNull(task);
+      this.oldState = requireNonNull(oldState);
     }
 
     /**
@@ -136,18 +136,18 @@ public interface PubsubEvent {
       }
 
       TaskStateChange other = (TaskStateChange) o;
-      return Objects.equal(task, other.task)
-          && Objects.equal(oldState, other.oldState);
+      return Objects.equals(task, other.task)
+          && Objects.equals(oldState, other.oldState);
     }
 
     @Override
     public int hashCode() {
-      return Objects.hashCode(task, oldState);
+      return Objects.hash(task, oldState);
     }
 
     @Override
     public String toString() {
-      return Objects.toStringHelper(this)
+      return com.google.common.base.Objects.toStringHelper(this)
           .add("task", Tasks.id(task))
           .add("oldState", getOldState())
           .add("newState", getNewState())
@@ -162,7 +162,7 @@ public interface PubsubEvent {
     private final HostStatus status;
 
     public HostMaintenanceStateChange(HostStatus status) {
-      this.status = checkNotNull(status);
+      this.status = requireNonNull(status);
     }
 
     public HostStatus getStatus() {
@@ -176,12 +176,12 @@ public interface PubsubEvent {
       }
 
       HostMaintenanceStateChange other = (HostMaintenanceStateChange) o;
-      return Objects.equal(status, other.status);
+      return Objects.equals(status, other.status);
     }
 
     @Override
     public int hashCode() {
-      return Objects.hashCode(status);
+      return Objects.hash(status);
     }
   }
 
@@ -193,8 +193,8 @@ public interface PubsubEvent {
     private final Set<Veto> vetoes;
 
     public Vetoed(String taskId, Set<Veto> vetoes) {
-      this.taskId = checkNotNull(taskId);
-      this.vetoes = checkNotNull(vetoes);
+      this.taskId = requireNonNull(taskId);
+      this.vetoes = requireNonNull(vetoes);
     }
 
     public String getTaskId() {
@@ -212,13 +212,13 @@ public interface PubsubEvent {
       }
 
       Vetoed other = (Vetoed) o;
-      return Objects.equal(taskId, other.taskId)
-          && Objects.equal(vetoes, other.vetoes);
+      return Objects.equals(taskId, other.taskId)
+          && Objects.equals(vetoes, other.vetoes);
     }
 
     @Override
     public int hashCode() {
-      return Objects.hashCode(taskId, vetoes);
+      return Objects.hash(taskId, vetoes);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/events/PubsubEventModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/events/PubsubEventModule.java b/src/main/java/org/apache/aurora/scheduler/events/PubsubEventModule.java
index d29fbd4..cd5aa17 100644
--- a/src/main/java/org/apache/aurora/scheduler/events/PubsubEventModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/events/PubsubEventModule.java
@@ -33,7 +33,7 @@ import org.apache.aurora.scheduler.events.NotifyingSchedulingFilter.NotifyDelega
 import org.apache.aurora.scheduler.events.PubsubEvent.EventSubscriber;
 import org.apache.aurora.scheduler.filter.SchedulingFilter;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 /**
  * Binding module for plumbing event notifications.
@@ -81,8 +81,8 @@ public final class PubsubEventModule extends AbstractModule {
 
     @Inject
     RegisterSubscribers(EventBus eventBus, Set<EventSubscriber> subscribers) {
-      this.eventBus = checkNotNull(eventBus);
-      this.subscribers = checkNotNull(subscribers);
+      this.eventBus = requireNonNull(eventBus);
+      this.subscribers = requireNonNull(subscribers);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/filter/AttributeAggregate.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/filter/AttributeAggregate.java b/src/main/java/org/apache/aurora/scheduler/filter/AttributeAggregate.java
index 71620d7..da7b662 100644
--- a/src/main/java/org/apache/aurora/scheduler/filter/AttributeAggregate.java
+++ b/src/main/java/org/apache/aurora/scheduler/filter/AttributeAggregate.java
@@ -30,7 +30,7 @@ import org.apache.aurora.scheduler.storage.AttributeStore;
 import org.apache.aurora.scheduler.storage.entities.IAttribute;
 import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 /**
  * A temporary view of a job's state. Once constructed, instances of this class should be discarded
@@ -60,8 +60,8 @@ public class AttributeAggregate {
       final Supplier<ImmutableSet<IScheduledTask>> activeTaskSupplier,
       final AttributeStore attributeStore) {
 
-    checkNotNull(activeTaskSupplier);
-    checkNotNull(attributeStore);
+    requireNonNull(activeTaskSupplier);
+    requireNonNull(attributeStore);
 
     final Function<IScheduledTask, Iterable<IAttribute>> getHostAttributes =
         new Function<IScheduledTask, Iterable<IAttribute>>() {
@@ -69,7 +69,7 @@ public class AttributeAggregate {
           public Iterable<IAttribute> apply(IScheduledTask task) {
             // Note: this assumes we have access to attributes for hosts where all active tasks
             // reside.
-            String host = checkNotNull(task.getAssignedTask().getSlaveHost());
+            String host = requireNonNull(task.getAssignedTask().getSlaveHost());
             return attributeStore.getHostAttributes(host).get().getAttributes();
           }
         };

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/filter/ConstraintFilter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/filter/ConstraintFilter.java b/src/main/java/org/apache/aurora/scheduler/filter/ConstraintFilter.java
index 860a240..3839083 100644
--- a/src/main/java/org/apache/aurora/scheduler/filter/ConstraintFilter.java
+++ b/src/main/java/org/apache/aurora/scheduler/filter/ConstraintFilter.java
@@ -29,7 +29,7 @@ import org.apache.aurora.scheduler.storage.entities.IAttribute;
 import org.apache.aurora.scheduler.storage.entities.IConstraint;
 import org.apache.aurora.scheduler.storage.entities.ITaskConstraint;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 /**
  * Filter that determines whether a task's constraints are satisfied.
@@ -45,8 +45,8 @@ class ConstraintFilter {
    * @param hostAttributes The attributes of the host to test against.
    */
   ConstraintFilter(AttributeAggregate cachedjobState, Iterable<IAttribute> hostAttributes) {
-    this.cachedjobState = checkNotNull(cachedjobState);
-    this.hostAttributes = checkNotNull(hostAttributes);
+    this.cachedjobState = requireNonNull(cachedjobState);
+    this.hostAttributes = requireNonNull(hostAttributes);
   }
 
   @VisibleForTesting

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilter.java b/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilter.java
index b206830..1e3018e 100644
--- a/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilter.java
+++ b/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilter.java
@@ -13,10 +13,10 @@
  */
 package org.apache.aurora.scheduler.filter;
 
+import java.util.Objects;
 import java.util.Set;
 
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Objects;
 
 import org.apache.aurora.scheduler.ResourceSlot;
 import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
@@ -80,19 +80,19 @@ public interface SchedulingFilter {
       }
 
       Veto other = (Veto) o;
-      return Objects.equal(reason, other.reason)
-          && score == other.score
-          && valueMismatch == other.valueMismatch;
+      return Objects.equals(reason, other.reason)
+          && Objects.equals(score, other.score)
+          && Objects.equals(valueMismatch, other.valueMismatch);
     }
 
     @Override
     public int hashCode() {
-      return Objects.hashCode(reason, score, valueMismatch);
+      return Objects.hash(reason, score, valueMismatch);
     }
 
     @Override
     public String toString() {
-      return Objects.toStringHelper(this)
+      return com.google.common.base.Objects.toStringHelper(this)
           .add("reason", reason)
           .add("score", score)
           .add("valueMismatch", valueMismatch)

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilterImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilterImpl.java b/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilterImpl.java
index a336b47..da29428 100644
--- a/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilterImpl.java
+++ b/src/main/java/org/apache/aurora/scheduler/filter/SchedulingFilterImpl.java
@@ -42,7 +42,7 @@ import org.apache.aurora.scheduler.storage.entities.IAttribute;
 import org.apache.aurora.scheduler.storage.entities.IConstraint;
 import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 import static org.apache.aurora.gen.MaintenanceMode.DRAINED;
 import static org.apache.aurora.gen.MaintenanceMode.DRAINING;
@@ -77,8 +77,8 @@ public class SchedulingFilterImpl implements SchedulingFilter {
    */
   @Inject
   public SchedulingFilterImpl(Storage storage, MaintenanceController maintenance) {
-    this.storage = checkNotNull(storage);
-    this.maintenance = checkNotNull(maintenance);
+    this.storage = requireNonNull(storage);
+    this.maintenance = requireNonNull(maintenance);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/http/LeaderRedirect.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/http/LeaderRedirect.java b/src/main/java/org/apache/aurora/scheduler/http/LeaderRedirect.java
index 070c7da..e50de1e 100644
--- a/src/main/java/org/apache/aurora/scheduler/http/LeaderRedirect.java
+++ b/src/main/java/org/apache/aurora/scheduler/http/LeaderRedirect.java
@@ -14,6 +14,7 @@
 package org.apache.aurora.scheduler.http;
 
 import java.net.InetSocketAddress;
+import java.util.Objects;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.logging.Logger;
 
@@ -22,7 +23,6 @@ import javax.servlet.http.HttpServletRequest;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Iterables;
 import com.google.common.net.HostAndPort;
@@ -54,8 +54,8 @@ public class LeaderRedirect {
 
   @Inject
   LeaderRedirect(LocalServiceRegistry serviceRegistry, DynamicHostSet<ServiceInstance> schedulers) {
-    this.serviceRegistry = Preconditions.checkNotNull(serviceRegistry);
-    this.schedulers = Preconditions.checkNotNull(schedulers);
+    this.serviceRegistry = Objects.requireNonNull(serviceRegistry);
+    this.schedulers = Objects.requireNonNull(schedulers);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/http/LeaderRedirectFilter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/http/LeaderRedirectFilter.java b/src/main/java/org/apache/aurora/scheduler/http/LeaderRedirectFilter.java
index 051166c..86939aa 100644
--- a/src/main/java/org/apache/aurora/scheduler/http/LeaderRedirectFilter.java
+++ b/src/main/java/org/apache/aurora/scheduler/http/LeaderRedirectFilter.java
@@ -14,6 +14,7 @@
 package org.apache.aurora.scheduler.http;
 
 import java.io.IOException;
+import java.util.Objects;
 
 import javax.inject.Inject;
 import javax.servlet.FilterChain;
@@ -22,7 +23,6 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
 import com.twitter.common.net.http.filters.AbstractHttpFilter;
 
 /**
@@ -34,7 +34,7 @@ public class LeaderRedirectFilter extends AbstractHttpFilter {
 
   @Inject
   LeaderRedirectFilter(LeaderRedirect redirector) {
-    this.redirector = Preconditions.checkNotNull(redirector);
+    this.redirector = Objects.requireNonNull(redirector);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/5bd68359/src/main/java/org/apache/aurora/scheduler/http/Locks.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/http/Locks.java b/src/main/java/org/apache/aurora/scheduler/http/Locks.java
index dce1891..e275dd7 100644
--- a/src/main/java/org/apache/aurora/scheduler/http/Locks.java
+++ b/src/main/java/org/apache/aurora/scheduler/http/Locks.java
@@ -13,6 +13,8 @@
  */
 package org.apache.aurora.scheduler.http;
 
+import java.util.Objects;
+
 import javax.inject.Inject;
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
@@ -21,7 +23,6 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
 import com.google.common.base.Function;
-import com.google.common.base.Preconditions;
 import com.google.common.collect.Maps;
 
 import org.apache.aurora.gen.LockKey;
@@ -40,7 +41,7 @@ public class Locks {
 
   @Inject
   Locks(LockManager lockManager) {
-    this.lockManager = Preconditions.checkNotNull(lockManager);
+    this.lockManager = Objects.requireNonNull(lockManager);
   }
 
   /**


Mime
View raw message