accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [11/16] accumulo git commit: ACCUMULO-4046 Modernize 1.7 branch
Date Wed, 03 Feb 2016 17:54:04 GMT
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReport.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReport.java b/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReport.java
index 2f2d0c4..4dc1eed 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReport.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReport.java
@@ -16,7 +16,7 @@
  */
 package org.apache.accumulo.server.problems;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -52,9 +52,9 @@ public class ProblemReport {
   private long creationTime;
 
   public ProblemReport(String table, ProblemType problemType, String resource, String server, Throwable e, long creationTime) {
-    checkNotNull(table, "table is null");
-    checkNotNull(problemType, "problemType is null");
-    checkNotNull(resource, "resource is null");
+    requireNonNull(table, "table is null");
+    requireNonNull(problemType, "problemType is null");
+    requireNonNull(resource, "resource is null");
     this.tableName = table;
 
     this.problemType = problemType;
@@ -85,9 +85,9 @@ public class ProblemReport {
   }
 
   private ProblemReport(String table, ProblemType problemType, String resource, byte enc[]) throws IOException {
-    checkNotNull(table, "table is null");
-    checkNotNull(problemType, "problemType is null");
-    checkNotNull(resource, "resource is null");
+    requireNonNull(table, "table is null");
+    requireNonNull(problemType, "problemType is null");
+    requireNonNull(resource, "resource is null");
     this.tableName = table;
     this.problemType = problemType;
     this.resource = resource;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/base/src/main/java/org/apache/accumulo/server/replication/DistributedWorkQueueWorkAssignerHelper.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/replication/DistributedWorkQueueWorkAssignerHelper.java b/server/base/src/main/java/org/apache/accumulo/server/replication/DistributedWorkQueueWorkAssignerHelper.java
index 2494ee2..339a03e 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/replication/DistributedWorkQueueWorkAssignerHelper.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/replication/DistributedWorkQueueWorkAssignerHelper.java
@@ -16,12 +16,13 @@
  */
 package org.apache.accumulo.server.replication;
 
+import static java.util.Objects.requireNonNull;
+
 import java.util.Map.Entry;
 
 import org.apache.accumulo.core.replication.ReplicationTarget;
 import org.apache.accumulo.server.zookeeper.DistributedWorkQueue;
 
-import com.google.common.base.Preconditions;
 import com.google.common.collect.Maps;
 
 /**
@@ -51,7 +52,7 @@ public class DistributedWorkQueueWorkAssignerHelper {
    * @return Components which created the queue key
    */
   public static Entry<String,ReplicationTarget> fromQueueKey(String queueKey) {
-    Preconditions.checkNotNull(queueKey);
+    requireNonNull(queueKey);
 
     int index = queueKey.indexOf(KEY_SEPARATOR);
     if (-1 == index) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicaSystemFactory.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicaSystemFactory.java b/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicaSystemFactory.java
index 4764609..6b48da3 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicaSystemFactory.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicaSystemFactory.java
@@ -16,12 +16,13 @@
  */
 package org.apache.accumulo.server.replication;
 
+import static java.util.Objects.requireNonNull;
+
 import java.util.Map.Entry;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Preconditions;
 import com.google.common.collect.Maps;
 
 /**
@@ -63,7 +64,7 @@ public class ReplicaSystemFactory {
    * @return An entry where the set is the replica system name and the value is the configuration string.
    */
   public Entry<String,String> parseReplicaSystemConfiguration(String value) {
-    Preconditions.checkNotNull(value);
+    requireNonNull(value);
 
     int index = value.indexOf(',');
     if (-1 == index) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicaSystemHelper.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicaSystemHelper.java b/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicaSystemHelper.java
index 50acc65..5643117 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicaSystemHelper.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicaSystemHelper.java
@@ -16,6 +16,8 @@
  */
 package org.apache.accumulo.server.replication;
 
+import static java.util.Objects.requireNonNull;
+
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.BatchWriter;
@@ -32,8 +34,6 @@ import org.apache.hadoop.fs.Path;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Preconditions;
-
 /**
  *
  */
@@ -43,7 +43,7 @@ public class ReplicaSystemHelper {
   private ClientContext context;
 
   public ReplicaSystemHelper(ClientContext context) {
-    Preconditions.checkNotNull(context);
+    requireNonNull(context);
     this.context = context;
   }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicationUtil.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicationUtil.java b/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicationUtil.java
index a8e7b64..a793b6a 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicationUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicationUtil.java
@@ -54,7 +54,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.Iterables;
-import com.google.common.collect.Maps;
 import com.google.protobuf.InvalidProtocolBufferException;
 
 public class ReplicationUtil {
@@ -267,7 +266,7 @@ public class ReplicationUtil {
   }
 
   public Map<String,String> invert(Map<String,String> map) {
-    Map<String,String> newMap = Maps.newHashMapWithExpectedSize(map.size());
+    Map<String,String> newMap = new HashMap<>(map.size());
     for (Entry<String,String> entry : map.entrySet()) {
       newMap.put(entry.getValue(), entry.getKey());
     }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/base/src/main/java/org/apache/accumulo/server/replication/StatusCombiner.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/replication/StatusCombiner.java b/server/base/src/main/java/org/apache/accumulo/server/replication/StatusCombiner.java
index 401b14c..aacf64d 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/replication/StatusCombiner.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/replication/StatusCombiner.java
@@ -16,6 +16,8 @@
  */
 package org.apache.accumulo.server.replication;
 
+import static java.util.Objects.requireNonNull;
+
 import java.io.IOException;
 import java.util.Iterator;
 import java.util.Map;
@@ -33,7 +35,6 @@ import org.apache.accumulo.server.replication.proto.Replication.Status.Builder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Preconditions;
 import com.google.protobuf.InvalidProtocolBufferException;
 
 /**
@@ -55,7 +56,7 @@ public class StatusCombiner extends TypedValueCombiner<Status> {
     @Override
     public Status decode(byte[] b) {
       // Override super because it calls decodeUnchecked, which is not as performant
-      Preconditions.checkNotNull(b, "cannot decode null byte array");
+      requireNonNull(b, "cannot decode null byte array");
       try {
         return Status.parseFrom(b);
       } catch (InvalidProtocolBufferException e) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java b/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java
index aaccc34..77d6412 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java
@@ -16,6 +16,8 @@
  */
 package org.apache.accumulo.server.rpc;
 
+import static com.google.common.base.Preconditions.checkArgument;
+
 import java.io.IOException;
 import java.lang.reflect.Field;
 import java.net.BindException;
@@ -60,7 +62,6 @@ import org.apache.thrift.transport.TTransportFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Preconditions;
 import com.google.common.net.HostAndPort;
 
 /**
@@ -484,7 +485,7 @@ public class TServerUtils {
 
     // This is presently not supported. It's hypothetically possible, I believe, to work, but it would require changes in how the transports
     // work at the Thrift layer to ensure that both the SSL and SASL handshakes function. SASL's quality of protection addresses privacy issues.
-    Preconditions.checkArgument(!(sslParams != null && saslParams != null), "Cannot start a Thrift server using both SSL and SASL");
+    checkArgument(!(sslParams != null && saslParams != null), "Cannot start a Thrift server using both SSL and SASL");
 
     ServerAddress serverAddress;
     switch (serverType) {
@@ -564,7 +565,7 @@ public class TServerUtils {
    * @return A {@link UGIAssumingProcessor} which wraps the provided processor
    */
   private static TProcessor updateSaslProcessor(ThriftServerType serverType, TProcessor processor) {
-    Preconditions.checkArgument(ThriftServerType.SASL == serverType);
+    checkArgument(ThriftServerType.SASL == serverType);
 
     // Wrap the provided processor in our special processor which proxies the provided UGI on the logged-in UGI
     // Important that we have Timed -> UGIAssuming -> [provided] to make sure that the metrics are still reported

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/base/src/main/java/org/apache/accumulo/server/security/delegation/AuthenticationKey.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/delegation/AuthenticationKey.java b/server/base/src/main/java/org/apache/accumulo/server/security/delegation/AuthenticationKey.java
index 2907099..0ae6257 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/security/delegation/AuthenticationKey.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/security/delegation/AuthenticationKey.java
@@ -18,7 +18,7 @@
 
 package org.apache.accumulo.server.security.delegation;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 import java.io.DataInput;
 import java.io.DataOutput;
@@ -47,7 +47,7 @@ public class AuthenticationKey implements Writable {
   }
 
   public AuthenticationKey(int keyId, long creationDate, long expirationDate, SecretKey key) {
-    checkNotNull(key);
+    requireNonNull(key);
     authKey = new TAuthenticationKey(ByteBuffer.wrap(key.getEncoded()));
     authKey.setCreationDate(creationDate);
     authKey.setKeyId(keyId);
@@ -56,27 +56,27 @@ public class AuthenticationKey implements Writable {
   }
 
   public int getKeyId() {
-    checkNotNull(authKey);
+    requireNonNull(authKey);
     return authKey.getKeyId();
   }
 
   public long getCreationDate() {
-    checkNotNull(authKey);
+    requireNonNull(authKey);
     return authKey.getCreationDate();
   }
 
   public void setCreationDate(long creationDate) {
-    checkNotNull(authKey);
+    requireNonNull(authKey);
     authKey.setCreationDate(creationDate);
   }
 
   public long getExpirationDate() {
-    checkNotNull(authKey);
+    requireNonNull(authKey);
     return authKey.getExpirationDate();
   }
 
   public void setExpirationDate(long expirationDate) {
-    checkNotNull(authKey);
+    requireNonNull(authKey);
     authKey.setExpirationDate(expirationDate);
   }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/base/src/main/java/org/apache/accumulo/server/security/delegation/AuthenticationTokenSecretManager.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/delegation/AuthenticationTokenSecretManager.java b/server/base/src/main/java/org/apache/accumulo/server/security/delegation/AuthenticationTokenSecretManager.java
index 66f9cdc..99a088a 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/security/delegation/AuthenticationTokenSecretManager.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/security/delegation/AuthenticationTokenSecretManager.java
@@ -19,7 +19,7 @@
 package org.apache.accumulo.server.security.delegation;
 
 import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 import java.util.Iterator;
 import java.util.Map;
@@ -70,7 +70,7 @@ public class AuthenticationTokenSecretManager extends SecretManager<Authenticati
    *          Maximum age (in milliseconds) before a token expires and is no longer valid
    */
   public AuthenticationTokenSecretManager(Instance instance, long tokenMaxLifetime) {
-    checkNotNull(instance);
+    requireNonNull(instance);
     checkArgument(tokenMaxLifetime > 0, "Max lifetime must be positive");
     this.instance = instance;
     this.tokenMaxLifetime = tokenMaxLifetime;
@@ -150,8 +150,8 @@ public class AuthenticationTokenSecretManager extends SecretManager<Authenticati
    */
   public Entry<Token<AuthenticationTokenIdentifier>,AuthenticationTokenIdentifier> generateToken(String username, DelegationTokenConfig cfg)
       throws AccumuloException {
-    checkNotNull(username);
-    checkNotNull(cfg);
+    requireNonNull(username);
+    requireNonNull(cfg);
 
     final AuthenticationTokenIdentifier id = new AuthenticationTokenIdentifier(username, cfg);
 
@@ -179,7 +179,7 @@ public class AuthenticationTokenSecretManager extends SecretManager<Authenticati
    *          The key to add.
    */
   public synchronized void addKey(AuthenticationKey key) {
-    checkNotNull(key);
+    requireNonNull(key);
 
     log.debug("Adding AuthenticationKey with keyId {}", key.getKeyId());
 
@@ -197,7 +197,7 @@ public class AuthenticationTokenSecretManager extends SecretManager<Authenticati
    * @return True if the key was removed, otherwise false.
    */
   synchronized boolean removeKey(Integer keyId) {
-    checkNotNull(keyId);
+    requireNonNull(keyId);
 
     log.debug("Removing AuthenticatioKey with keyId {}", keyId);
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/base/src/main/java/org/apache/accumulo/server/security/delegation/ZooAuthenticationKeyDistributor.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/delegation/ZooAuthenticationKeyDistributor.java b/server/base/src/main/java/org/apache/accumulo/server/security/delegation/ZooAuthenticationKeyDistributor.java
index 0542596..7685559 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/security/delegation/ZooAuthenticationKeyDistributor.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/security/delegation/ZooAuthenticationKeyDistributor.java
@@ -16,8 +16,8 @@
  */
 package org.apache.accumulo.server.security.delegation;
 
-import static com.google.common.base.Preconditions.checkNotNull;
 import static com.google.common.base.Preconditions.checkState;
+import static java.util.Objects.requireNonNull;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -50,8 +50,8 @@ public class ZooAuthenticationKeyDistributor {
   private AtomicBoolean initialized = new AtomicBoolean(false);
 
   public ZooAuthenticationKeyDistributor(ZooReaderWriter zk, String baseNode) {
-    checkNotNull(zk);
-    checkNotNull(baseNode);
+    requireNonNull(zk);
+    requireNonNull(baseNode);
     this.zk = zk;
     this.baseNode = baseNode;
   }
@@ -129,7 +129,7 @@ public class ZooAuthenticationKeyDistributor {
    */
   public synchronized void advertise(AuthenticationKey newKey) throws KeeperException, InterruptedException {
     checkState(initialized.get(), "Not initialized");
-    checkNotNull(newKey);
+    requireNonNull(newKey);
 
     // Make sure the node doesn't already exist
     String path = qualifyPath(newKey);
@@ -163,7 +163,7 @@ public class ZooAuthenticationKeyDistributor {
    */
   public synchronized void remove(AuthenticationKey key) throws KeeperException, InterruptedException {
     checkState(initialized.get(), "Not initialized");
-    checkNotNull(key);
+    requireNonNull(key);
 
     String path = qualifyPath(key);
     if (!zk.exists(path)) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java b/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java
index 3c4a05a..9a8f6ed 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java
@@ -16,6 +16,8 @@
  */
 package org.apache.accumulo.server.util;
 
+import static java.util.Objects.requireNonNull;
+
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.FileWriter;
@@ -73,7 +75,6 @@ import com.beust.jcommander.JCommander;
 import com.beust.jcommander.Parameter;
 import com.beust.jcommander.Parameters;
 import com.google.auto.service.AutoService;
-import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
 import com.google.common.net.HostAndPort;
 
@@ -393,7 +394,7 @@ public class Admin implements KeywordExecutable {
    * @return The tservers znode for the instance
    */
   static String getTServersZkPath(Instance instance) {
-    Preconditions.checkNotNull(instance);
+    requireNonNull(instance);
     final String instanceRoot = ZooUtil.getRoot(instance);
     return instanceRoot + Constants.ZTSERVERS;
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/base/src/main/java/org/apache/accumulo/server/watcher/Log4jConfiguration.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/watcher/Log4jConfiguration.java b/server/base/src/main/java/org/apache/accumulo/server/watcher/Log4jConfiguration.java
index b9e6805..bea7175 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/watcher/Log4jConfiguration.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/watcher/Log4jConfiguration.java
@@ -16,14 +16,14 @@
  */
 package org.apache.accumulo.server.watcher;
 
+import static java.util.Objects.requireNonNull;
+
 import java.io.File;
 
 import org.apache.log4j.LogManager;
 import org.apache.log4j.PropertyConfigurator;
 import org.apache.log4j.xml.DOMConfigurator;
 
-import com.google.common.base.Preconditions;
-
 /**
  * Encapsulate calls to PropertyConfigurator or DOMConfigurator to set up logging
  */
@@ -35,7 +35,7 @@ public class Log4jConfiguration {
   private final String auditConfig;
 
   public Log4jConfiguration(String filename) {
-    Preconditions.checkNotNull(filename, "log4j configuration filename must not be null");
+    requireNonNull(filename, "log4j configuration filename must not be null");
     usingProperties = filename.endsWith(".properties");
     this.filename = filename;
     log4jFile = new File(filename);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/master/src/main/java/org/apache/accumulo/master/metrics/MasterMetricsFactory.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/metrics/MasterMetricsFactory.java b/server/master/src/main/java/org/apache/accumulo/master/metrics/MasterMetricsFactory.java
index 649a6cd..bbf61a0 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/metrics/MasterMetricsFactory.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/metrics/MasterMetricsFactory.java
@@ -16,6 +16,8 @@
  */
 package org.apache.accumulo.master.metrics;
 
+import static java.util.Objects.requireNonNull;
+
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.master.Master;
@@ -23,8 +25,6 @@ import org.apache.accumulo.server.metrics.Metrics;
 import org.apache.accumulo.server.metrics.MetricsSystemHelper;
 import org.apache.hadoop.metrics2.MetricsSystem;
 
-import com.google.common.base.Preconditions;
-
 /**
  *
  */
@@ -35,7 +35,7 @@ public class MasterMetricsFactory {
   private final Master master;
 
   public MasterMetricsFactory(AccumuloConfiguration conf, Master master) {
-    Preconditions.checkNotNull(conf);
+    requireNonNull(conf);
     useOldMetrics = conf.getBoolean(Property.GENERAL_LEGACY_METRICS);
     this.master = master;
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/master/src/main/java/org/apache/accumulo/master/replication/MasterReplicationCoordinator.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/replication/MasterReplicationCoordinator.java b/server/master/src/main/java/org/apache/accumulo/master/replication/MasterReplicationCoordinator.java
index be8a264..db711b8 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/replication/MasterReplicationCoordinator.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/replication/MasterReplicationCoordinator.java
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.master.replication;
 
+import static com.google.common.base.Preconditions.checkArgument;
 import static java.nio.charset.StandardCharsets.UTF_8;
 
 import java.util.Iterator;
@@ -39,8 +40,6 @@ import org.apache.zookeeper.KeeperException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Preconditions;
-
 /**
  * Choose a tserver to service a replication task
  */
@@ -93,7 +92,7 @@ public class MasterReplicationCoordinator implements ReplicationCoordinator.Ifac
   }
 
   protected TServerInstance getRandomTServer(Set<TServerInstance> tservers, int offset) {
-    Preconditions.checkArgument(tservers.size() > offset, "Must provide an offset less than the size of the set");
+    checkArgument(tservers.size() > offset, "Must provide an offset less than the size of the set");
     Iterator<TServerInstance> iter = tservers.iterator();
     while (offset > 0) {
       iter.next();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/master/src/main/java/org/apache/accumulo/master/tableOps/CompactRange.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/tableOps/CompactRange.java b/server/master/src/main/java/org/apache/accumulo/master/tableOps/CompactRange.java
index 2a508c5..7a9c5d6 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/CompactRange.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/CompactRange.java
@@ -17,6 +17,7 @@
 package org.apache.accumulo.master.tableOps;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
+import static java.util.Objects.requireNonNull;
 
 import java.util.List;
 
@@ -41,8 +42,6 @@ import org.apache.zookeeper.KeeperException.NoNodeException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Preconditions;
-
 public class CompactRange extends MasterRepo {
   private static final Logger log = LoggerFactory.getLogger(CompactRange.class);
 
@@ -55,9 +54,9 @@ public class CompactRange extends MasterRepo {
   public CompactRange(String tableId, byte[] startRow, byte[] endRow, List<IteratorSetting> iterators, CompactionStrategyConfig compactionStrategy)
       throws ThriftTableOperationException {
 
-    Preconditions.checkNotNull(tableId, "Invalid argument: null tableId");
-    Preconditions.checkNotNull(iterators, "Invalid argument: null iterator list");
-    Preconditions.checkNotNull(compactionStrategy, "Invalid argument: null compactionStrategy");
+    requireNonNull(tableId, "Invalid argument: null tableId");
+    requireNonNull(iterators, "Invalid argument: null iterator list");
+    requireNonNull(compactionStrategy, "Invalid argument: null compactionStrategy");
 
     this.tableId = tableId;
     this.startRow = startRow.length == 0 ? null : startRow;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/master/src/main/java/org/apache/accumulo/master/tableOps/LoadFiles.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/tableOps/LoadFiles.java b/server/master/src/main/java/org/apache/accumulo/master/tableOps/LoadFiles.java
index d67ae0b..14fb18f 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/LoadFiles.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/LoadFiles.java
@@ -191,7 +191,7 @@ class LoadFiles extends MasterRepo {
   }
 
   static String sampleList(Collection<?> potentiallyLongList, int max) {
-    StringBuffer result = new StringBuffer();
+    StringBuilder result = new StringBuilder();
     result.append("[");
     int i = 0;
     for (Object obj : potentiallyLongList) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/tserver/src/main/java/org/apache/accumulo/tserver/ActiveAssignmentRunnable.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/ActiveAssignmentRunnable.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/ActiveAssignmentRunnable.java
index a25d22f..10ef28a 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/ActiveAssignmentRunnable.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/ActiveAssignmentRunnable.java
@@ -16,14 +16,14 @@
  */
 package org.apache.accumulo.tserver;
 
+import static java.util.Objects.requireNonNull;
+
 import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.accumulo.core.data.impl.KeyExtent;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Preconditions;
-
 /**
  *
  */
@@ -38,9 +38,9 @@ public class ActiveAssignmentRunnable implements Runnable {
   private volatile Thread executingThread;
 
   public ActiveAssignmentRunnable(ConcurrentHashMap<KeyExtent,RunnableStartedAt> activeAssignments, KeyExtent extent, Runnable delegate) {
-    Preconditions.checkNotNull(activeAssignments);
-    Preconditions.checkNotNull(extent);
-    Preconditions.checkNotNull(delegate);
+    requireNonNull(activeAssignments);
+    requireNonNull(extent);
+    requireNonNull(delegate);
     this.activeAssignments = activeAssignments;
     this.extent = extent;
     this.delegate = delegate;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/tserver/src/main/java/org/apache/accumulo/tserver/ConditionCheckerContext.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/ConditionCheckerContext.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/ConditionCheckerContext.java
index 39aa684..b95a82f 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/ConditionCheckerContext.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/ConditionCheckerContext.java
@@ -17,6 +17,8 @@
 
 package org.apache.accumulo.tserver;
 
+import static com.google.common.base.Preconditions.checkArgument;
+
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -44,8 +46,6 @@ import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
 import org.apache.accumulo.tserver.data.ServerConditionalMutation;
 import org.apache.hadoop.io.Text;
 
-import com.google.common.base.Preconditions;
-
 public class ConditionCheckerContext {
   private CompressedIterators compressedIters;
 
@@ -145,7 +145,7 @@ public class ConditionCheckerContext {
     }
 
     public void check(SortedKeyValueIterator<Key,Value> systemIter) throws IOException {
-      Preconditions.checkArgument(!checked, "check() method should only be called once");
+      checkArgument(!checked, "check() method should only be called once");
       checked = true;
 
       for (ServerConditionalMutation scm : conditionsToCheck) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
index 94f16ee..d2790da 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
@@ -16,7 +16,7 @@
  */
 package org.apache.accumulo.tserver;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -548,8 +548,8 @@ public class TabletServerResourceManager {
     private final AccumuloConfiguration tableConf;
 
     TabletResourceManager(KeyExtent extent, AccumuloConfiguration tableConf) {
-      checkNotNull(extent, "extent is null");
-      checkNotNull(tableConf, "tableConf is null");
+      requireNonNull(extent, "extent is null");
+      requireNonNull(tableConf, "tableConf is null");
       this.extent = extent;
       this.tableConf = tableConf;
     }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/WriteParameters.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/WriteParameters.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/WriteParameters.java
index edb862e..770759a 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/WriteParameters.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/WriteParameters.java
@@ -16,7 +16,7 @@
  */
 package org.apache.accumulo.tserver.compaction;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
 
 public class WriteParameters {
   private String compressType = null;
@@ -38,7 +38,7 @@ public class WriteParameters {
   }
 
   public void setHdfsBlockSize(long hdfsBlockSize) {
-    Preconditions.checkArgument(hdfsBlockSize >= 0);
+    checkArgument(hdfsBlockSize >= 0);
     this.hdfsBlockSize = hdfsBlockSize;
   }
 
@@ -47,7 +47,7 @@ public class WriteParameters {
   }
 
   public void setBlockSize(long blockSize) {
-    Preconditions.checkArgument(blockSize >= 0);
+    checkArgument(blockSize >= 0);
     this.blockSize = blockSize;
   }
 
@@ -56,7 +56,7 @@ public class WriteParameters {
   }
 
   public void setIndexBlockSize(long indexBlockSize) {
-    Preconditions.checkArgument(indexBlockSize >= 0);
+    checkArgument(indexBlockSize >= 0);
     this.indexBlockSize = indexBlockSize;
   }
 
@@ -65,7 +65,7 @@ public class WriteParameters {
   }
 
   public void setReplication(int replication) {
-    Preconditions.checkArgument(replication >= 0);
+    checkArgument(replication >= 0);
     this.replication = replication;
   }
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMetricsFactory.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMetricsFactory.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMetricsFactory.java
index 56b1c42..36fc3ab 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMetricsFactory.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMetricsFactory.java
@@ -16,6 +16,8 @@
  */
 package org.apache.accumulo.tserver.metrics;
 
+import static java.util.Objects.requireNonNull;
+
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.server.metrics.Metrics;
@@ -23,8 +25,6 @@ import org.apache.accumulo.server.metrics.MetricsSystemHelper;
 import org.apache.accumulo.tserver.TabletServer;
 import org.apache.hadoop.metrics2.MetricsSystem;
 
-import com.google.common.base.Preconditions;
-
 /**
  * Factory to create Metrics instances for various TabletServer functions.
  *
@@ -36,7 +36,7 @@ public class TabletServerMetricsFactory {
   private final MetricsSystem metricsSystem;
 
   public TabletServerMetricsFactory(AccumuloConfiguration conf) {
-    Preconditions.checkNotNull(conf);
+    requireNonNull(conf);
     useOldMetrics = conf.getBoolean(Property.GENERAL_LEGACY_METRICS);
 
     if (useOldMetrics) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
index e8e9627..3624e74 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
@@ -16,6 +16,8 @@
  */
 package org.apache.accumulo.tserver.replication;
 
+import static java.util.Objects.requireNonNull;
+
 import java.io.ByteArrayOutputStream;
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
@@ -79,7 +81,6 @@ import org.apache.thrift.transport.TTransportException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Preconditions;
 import com.google.common.net.HostAndPort;
 
 public class AccumuloReplicaSystem implements ReplicaSystem {
@@ -131,7 +132,7 @@ public class AccumuloReplicaSystem implements ReplicaSystem {
 
   @Override
   public void configure(String configuration) {
-    Preconditions.checkNotNull(configuration);
+    requireNonNull(configuration);
 
     // instance_name,zookeepers
     int index = configuration.indexOf(',');
@@ -597,8 +598,8 @@ public class AccumuloReplicaSystem implements ReplicaSystem {
   }
 
   protected String getPassword(AccumuloConfiguration localConf, ReplicationTarget target) {
-    Preconditions.checkNotNull(localConf);
-    Preconditions.checkNotNull(target);
+    requireNonNull(localConf);
+    requireNonNull(target);
 
     Map<String,String> peerPasswords = localConf.getAllPropertiesWithPrefix(Property.REPLICATION_PEER_PASSWORD);
     String password = peerPasswords.get(Property.REPLICATION_PEER_PASSWORD.getKey() + target.getPeerName());
@@ -609,8 +610,8 @@ public class AccumuloReplicaSystem implements ReplicaSystem {
   }
 
   protected String getKeytab(AccumuloConfiguration localConf, ReplicationTarget target) {
-    Preconditions.checkNotNull(localConf);
-    Preconditions.checkNotNull(target);
+    requireNonNull(localConf);
+    requireNonNull(target);
 
     Map<String,String> peerKeytabs = localConf.getAllPropertiesWithPrefix(Property.REPLICATION_PEER_KEYTAB);
     String keytab = peerKeytabs.get(Property.REPLICATION_PEER_KEYTAB.getKey() + target.getPeerName());
@@ -621,8 +622,8 @@ public class AccumuloReplicaSystem implements ReplicaSystem {
   }
 
   protected String getPrincipal(AccumuloConfiguration localConf, ReplicationTarget target) {
-    Preconditions.checkNotNull(localConf);
-    Preconditions.checkNotNull(target);
+    requireNonNull(localConf);
+    requireNonNull(target);
 
     String peerName = target.getPeerName();
     String userKey = Property.REPLICATION_PEER_USER.getKey() + peerName;
@@ -636,10 +637,10 @@ public class AccumuloReplicaSystem implements ReplicaSystem {
   }
 
   protected ClientContext getContextForPeer(AccumuloConfiguration localConf, ReplicationTarget target, String principal, AuthenticationToken token) {
-    Preconditions.checkNotNull(localConf);
-    Preconditions.checkNotNull(target);
-    Preconditions.checkNotNull(principal);
-    Preconditions.checkNotNull(token);
+    requireNonNull(localConf);
+    requireNonNull(target);
+    requireNonNull(principal);
+    requireNonNull(token);
 
     return new ClientContext(getPeerInstance(target), new Credentials(principal, token), localConf);
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java
index 1cd7fa6..97018df 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java
@@ -54,7 +54,7 @@ public class SessionManager {
   private final long maxIdle;
   private final long maxUpdateIdle;
   private final List<Session> idleSessions = new ArrayList<Session>();
-  private final Long expiredSessionMarker = new Long(-1);
+  private final Long expiredSessionMarker = Long.valueOf(-1);
   private final AccumuloConfiguration aconf;
 
   public SessionManager(AccumuloConfiguration conf) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
index 923b4a1..3231ce9 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
@@ -17,6 +17,7 @@
 package org.apache.accumulo.tserver.tablet;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
+import static java.util.Objects.requireNonNull;
 
 import java.io.ByteArrayInputStream;
 import java.io.DataInputStream;
@@ -148,7 +149,6 @@ import org.apache.zookeeper.KeeperException.NoNodeException;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
 
 /**
  *
@@ -464,7 +464,7 @@ public class Tablet implements TabletCommitter {
     if (null == tblConf) {
       Tables.clearCache(tabletServer.getInstance());
       tblConf = tabletServer.getTableConfiguration(extent);
-      Preconditions.checkNotNull(tblConf, "Could not get table configuration for " + extent.getTableId().toString());
+      requireNonNull(tblConf, "Could not get table configuration for " + extent.getTableId().toString());
     }
 
     this.tableConfiguration = tblConf;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/server/tserver/src/test/java/org/apache/accumulo/tserver/constraints/ConstraintCheckerTest.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/constraints/ConstraintCheckerTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/constraints/ConstraintCheckerTest.java
index ec30da4..c590242 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/constraints/ConstraintCheckerTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/constraints/ConstraintCheckerTest.java
@@ -25,6 +25,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
@@ -40,7 +41,6 @@ import org.junit.Test;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Iterables;
-import com.google.common.collect.Sets;
 
 public class ConstraintCheckerTest {
 
@@ -118,7 +118,7 @@ public class ConstraintCheckerTest {
     constraints.add(makeFailureConstraint());
     List<ConstraintViolationSummary> cvsList = cc.check(env, m).asList();
     assertEquals(2, cvsList.size());
-    Set<String> violationDescs = Sets.newHashSet();
+    Set<String> violationDescs = new HashSet<>();
     for (ConstraintViolationSummary cvs : cvsList) {
       violationDescs.add(cvs.getViolationDescription());
     }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/shell/src/main/java/org/apache/accumulo/shell/ShellUtil.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/accumulo/shell/ShellUtil.java b/shell/src/main/java/org/apache/accumulo/shell/ShellUtil.java
index 8505756..aa74556 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/ShellUtil.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/ShellUtil.java
@@ -20,14 +20,13 @@ import static java.nio.charset.StandardCharsets.UTF_8;
 
 import java.io.File;
 import java.io.FileNotFoundException;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Scanner;
 
 import org.apache.accumulo.core.util.Base64;
 import org.apache.hadoop.io.Text;
 
-import com.google.common.collect.Lists;
-
 public class ShellUtil {
 
   /**
@@ -45,7 +44,7 @@ public class ShellUtil {
   public static List<Text> scanFile(String filename, boolean decode) throws FileNotFoundException {
     String line;
     Scanner file = new Scanner(new File(filename), UTF_8.name());
-    List<Text> result = Lists.newArrayList();
+    List<Text> result = new ArrayList<>();
     try {
       while (file.hasNextLine()) {
         line = file.nextLine();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/test/src/main/java/org/apache/accumulo/test/randomwalk/Environment.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/Environment.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/Environment.java
index 0c53b35..c162a38 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/Environment.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/Environment.java
@@ -16,7 +16,7 @@
  */
 package org.apache.accumulo.test.randomwalk;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 import java.io.File;
 import java.io.IOException;
@@ -92,7 +92,7 @@ public class Environment {
    *           if p is null
    */
   public Environment(Properties p) {
-    checkNotNull(p);
+    requireNonNull(p);
     this.p = p;
   }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/test/src/main/java/org/apache/accumulo/test/stress/random/IntArgValidator.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/stress/random/IntArgValidator.java b/test/src/main/java/org/apache/accumulo/test/stress/random/IntArgValidator.java
index 1582f0d..5a5ad3e 100644
--- a/test/src/main/java/org/apache/accumulo/test/stress/random/IntArgValidator.java
+++ b/test/src/main/java/org/apache/accumulo/test/stress/random/IntArgValidator.java
@@ -17,16 +17,18 @@
 
 package org.apache.accumulo.test.stress.random;
 
+import static com.google.common.base.Preconditions.checkArgument;
+import static java.util.Objects.requireNonNull;
+
 import com.beust.jcommander.IValueValidator;
 import com.beust.jcommander.ParameterException;
-import com.google.common.base.Preconditions;
 
 public class IntArgValidator implements IValueValidator<Integer> {
 
   @Override
   public void validate(String name, Integer value) throws ParameterException {
-    Preconditions.checkNotNull(value);
-    Preconditions.checkArgument(value > 0);
+    requireNonNull(value);
+    checkArgument(value > 0);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/test/src/main/java/org/apache/accumulo/test/stress/random/RandomWithinRange.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/stress/random/RandomWithinRange.java b/test/src/main/java/org/apache/accumulo/test/stress/random/RandomWithinRange.java
index 8da9a37..06cea28 100644
--- a/test/src/main/java/org/apache/accumulo/test/stress/random/RandomWithinRange.java
+++ b/test/src/main/java/org/apache/accumulo/test/stress/random/RandomWithinRange.java
@@ -16,9 +16,9 @@
  */
 package org.apache.accumulo.test.stress.random;
 
-import java.util.Random;
+import static com.google.common.base.Preconditions.checkArgument;
 
-import com.google.common.base.Preconditions;
+import java.util.Random;
 
 /**
  * Class that returns positive integers between some minimum and maximum.
@@ -33,8 +33,8 @@ public class RandomWithinRange {
   }
 
   public RandomWithinRange(Random random, int min, int max) {
-    Preconditions.checkArgument(min > 0, "Min must be positive.");
-    Preconditions.checkArgument(max >= min, "Max must be greater than or equal to min.");
+    checkArgument(min > 0, "Min must be positive.");
+    checkArgument(max >= min, "Max must be greater than or equal to min.");
     this.random = random;
     this.min = min;
     this.max = max;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java b/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java
index 16460ed..e2b35f4 100644
--- a/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java
+++ b/test/src/test/java/org/apache/accumulo/harness/AccumuloClusterIT.java
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.harness;
 
+import static com.google.common.base.Preconditions.checkState;
 import static java.nio.charset.StandardCharsets.UTF_8;
 import static org.junit.Assert.fail;
 
@@ -54,8 +55,6 @@ import org.junit.BeforeClass;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Preconditions;
-
 /**
  * General Integration-Test base class that provides access to an Accumulo instance for testing. This instance could be MAC or a standalone instance.
  */
@@ -229,27 +228,27 @@ public abstract class AccumuloClusterIT extends AccumuloIT implements MiniCluste
   }
 
   public static AccumuloCluster getCluster() {
-    Preconditions.checkState(initialized);
+    checkState(initialized);
     return cluster;
   }
 
   public static ClusterControl getClusterControl() {
-    Preconditions.checkState(initialized);
+    checkState(initialized);
     return cluster.getClusterControl();
   }
 
   public static ClusterType getClusterType() {
-    Preconditions.checkState(initialized);
+    checkState(initialized);
     return type;
   }
 
   public static String getAdminPrincipal() {
-    Preconditions.checkState(initialized);
+    checkState(initialized);
     return clusterConf.getAdminPrincipal();
   }
 
   public static AuthenticationToken getAdminToken() {
-    Preconditions.checkState(initialized);
+    checkState(initialized);
     return clusterConf.getAdminToken();
   }
 
@@ -290,12 +289,12 @@ public abstract class AccumuloClusterIT extends AccumuloIT implements MiniCluste
   }
 
   public static FileSystem getFileSystem() throws IOException {
-    Preconditions.checkState(initialized);
+    checkState(initialized);
     return cluster.getFileSystem();
   }
 
   public static AccumuloClusterConfiguration getClusterConfiguration() {
-    Preconditions.checkState(initialized);
+    checkState(initialized);
     return clusterConf;
   }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/test/src/test/java/org/apache/accumulo/harness/MiniClusterHarness.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/harness/MiniClusterHarness.java b/test/src/test/java/org/apache/accumulo/harness/MiniClusterHarness.java
index 8fa4760..57da534 100644
--- a/test/src/test/java/org/apache/accumulo/harness/MiniClusterHarness.java
+++ b/test/src/test/java/org/apache/accumulo/harness/MiniClusterHarness.java
@@ -16,7 +16,9 @@
  */
 package org.apache.accumulo.harness;
 
+import static com.google.common.base.Preconditions.checkArgument;
 import static java.nio.charset.StandardCharsets.UTF_8;
+import static java.util.Objects.requireNonNull;
 import static org.junit.Assert.assertTrue;
 
 import java.io.BufferedOutputStream;
@@ -44,8 +46,6 @@ import org.apache.hadoop.fs.CommonConfigurationKeysPublic;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Preconditions;
-
 /**
  * Harness that sets up a MiniAccumuloCluster in a manner expected for Accumulo integration tests.
  */
@@ -108,8 +108,8 @@ public class MiniClusterHarness {
 
   public MiniAccumuloClusterImpl create(String testClassName, String testMethodName, AuthenticationToken token,
       MiniClusterConfigurationCallback configCallback, TestingKdc kdc) throws Exception {
-    Preconditions.checkNotNull(token);
-    Preconditions.checkArgument(token instanceof PasswordToken || token instanceof KerberosToken, "A PasswordToken or KerberosToken is required");
+    requireNonNull(token);
+    checkArgument(token instanceof PasswordToken || token instanceof KerberosToken, "A PasswordToken or KerberosToken is required");
 
     String rootPasswd;
     if (token instanceof PasswordToken) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/test/src/test/java/org/apache/accumulo/harness/TestingKdc.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/harness/TestingKdc.java b/test/src/test/java/org/apache/accumulo/harness/TestingKdc.java
index 06cd082..0b3e395 100644
--- a/test/src/test/java/org/apache/accumulo/harness/TestingKdc.java
+++ b/test/src/test/java/org/apache/accumulo/harness/TestingKdc.java
@@ -17,7 +17,7 @@
 package org.apache.accumulo.harness;
 
 import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 import static org.junit.Assert.assertTrue;
 
 import java.io.File;
@@ -84,8 +84,8 @@ public class TestingKdc {
   }
 
   public TestingKdc(File kdcDir, File keytabDir, long maxTicketLifetime) throws Exception {
-    checkNotNull(kdcDir, "KDC directory was null");
-    checkNotNull(keytabDir, "Keytab directory was null");
+    requireNonNull(kdcDir, "KDC directory was null");
+    requireNonNull(keytabDir, "Keytab directory was null");
     checkArgument(maxTicketLifetime > 0, "Ticket lifetime must be positive");
 
     this.keytabDir = keytabDir;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/test/src/test/java/org/apache/accumulo/harness/conf/AccumuloClusterPropertyConfiguration.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/harness/conf/AccumuloClusterPropertyConfiguration.java b/test/src/test/java/org/apache/accumulo/harness/conf/AccumuloClusterPropertyConfiguration.java
index 8661d39..4e04db9 100644
--- a/test/src/test/java/org/apache/accumulo/harness/conf/AccumuloClusterPropertyConfiguration.java
+++ b/test/src/test/java/org/apache/accumulo/harness/conf/AccumuloClusterPropertyConfiguration.java
@@ -16,6 +16,8 @@
  */
 package org.apache.accumulo.harness.conf;
 
+import static java.util.Objects.requireNonNull;
+
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileReader;
@@ -29,8 +31,6 @@ import org.apache.accumulo.harness.AccumuloClusterIT.ClusterType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Preconditions;
-
 /**
  * Base class for extracting configuration values from Java Properties
  */
@@ -125,7 +125,7 @@ public abstract class AccumuloClusterPropertyConfiguration implements AccumuloCl
   }
 
   public Map<String,String> getConfiguration(ClusterType type) {
-    Preconditions.checkNotNull(type);
+    requireNonNull(type);
 
     String prefix;
     switch (type) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/test/src/test/java/org/apache/accumulo/harness/conf/AccumuloMiniClusterConfiguration.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/harness/conf/AccumuloMiniClusterConfiguration.java b/test/src/test/java/org/apache/accumulo/harness/conf/AccumuloMiniClusterConfiguration.java
index cb43556..4579182 100644
--- a/test/src/test/java/org/apache/accumulo/harness/conf/AccumuloMiniClusterConfiguration.java
+++ b/test/src/test/java/org/apache/accumulo/harness/conf/AccumuloMiniClusterConfiguration.java
@@ -16,6 +16,8 @@
  */
 package org.apache.accumulo.harness.conf;
 
+import static java.util.Objects.requireNonNull;
+
 import java.io.IOException;
 import java.util.Map;
 
@@ -33,8 +35,6 @@ import org.apache.hadoop.security.UserGroupInformation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Preconditions;
-
 /**
  * Extract configuration properties for a MiniAccumuloCluster from Java properties
  */
@@ -111,7 +111,7 @@ public class AccumuloMiniClusterConfiguration extends AccumuloClusterPropertyCon
   }
 
   public void setClientConf(ClientConfiguration conf) {
-    Preconditions.checkNotNull(conf, "Client configuration was null");
+    requireNonNull(conf, "Client configuration was null");
     this.clientConf = conf;
   }
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/test/src/test/java/org/apache/accumulo/test/AccumuloOutputFormatIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/AccumuloOutputFormatIT.java b/test/src/test/java/org/apache/accumulo/test/AccumuloOutputFormatIT.java
index 7d67230..20556ab 100644
--- a/test/src/test/java/org/apache/accumulo/test/AccumuloOutputFormatIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/AccumuloOutputFormatIT.java
@@ -20,6 +20,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
 
 import java.io.File;
 import java.io.IOException;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
@@ -45,8 +46,6 @@ import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.junit.rules.TemporaryFolder;
 
-import com.google.common.collect.Maps;
-
 /**
  * Prevent regression of ACCUMULO-3709. Exists as a mini test because mock instance doesn't produce this error when dynamically changing the table permissions.
  */
@@ -66,7 +65,7 @@ public class AccumuloOutputFormatIT {
   public void setUp() throws Exception {
     folder.create();
     MiniAccumuloConfig config = new MiniAccumuloConfig(folder.getRoot(), secret);
-    Map<String,String> configMap = Maps.newHashMap();
+    Map<String,String> configMap = new HashMap<>();
     configMap.put(Property.TSERV_SESSION_MAXIDLE.toString(), "1");
     config.setSiteConfig(configMap);
     config.setNumTservers(1);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java b/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java
index dc8f9dd..852fd60 100644
--- a/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java
@@ -64,7 +64,6 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
 
 public class TableOperationsIT extends AccumuloClusterIT {
@@ -203,7 +202,7 @@ public class TableOperationsIT extends AccumuloClusterIT {
     tops.clone(originalTable, clonedTable, true, null, null);
     tops.merge(clonedTable, null, new Text("b"));
 
-    Map<String,Integer> rowCounts = Maps.newHashMap();
+    Map<String,Integer> rowCounts = new HashMap<>();
     Scanner s = connector.createScanner(clonedTable, new Authorizations());
     for (Entry<Key,Value> entry : s) {
       final Key key = entry.getKey();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/test/src/test/java/org/apache/accumulo/test/WaitForBalanceIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/WaitForBalanceIT.java b/test/src/test/java/org/apache/accumulo/test/WaitForBalanceIT.java
index 93854f5..0df236a 100644
--- a/test/src/test/java/org/apache/accumulo/test/WaitForBalanceIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/WaitForBalanceIT.java
@@ -86,8 +86,8 @@ public class WaitForBalanceIT extends ConfigurableMacIT {
           } else {
             Integer count = counts.get(location);
             if (count == null)
-              count = new Integer(0);
-            count = new Integer(count.intValue() + 1);
+              count = Integer.valueOf(0);
+            count = Integer.valueOf(count.intValue() + 1);
             counts.put(location, count);
           }
           location = null;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b639709e/test/src/test/java/org/apache/accumulo/test/replication/ReplicationIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/replication/ReplicationIT.java b/test/src/test/java/org/apache/accumulo/test/replication/ReplicationIT.java
index e2ee215..61e0191 100644
--- a/test/src/test/java/org/apache/accumulo/test/replication/ReplicationIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/replication/ReplicationIT.java
@@ -299,7 +299,7 @@ public class ReplicationIT extends ConfigurableMacIT {
     Assert.assertTrue("'root' user could not read the replication table",
         conn.securityOperations().hasTablePermission("root", ReplicationTable.NAME, TablePermission.READ));
 
-    Set<String> replRows = Sets.newHashSet();
+    Set<String> replRows = new HashSet<>();
     Scanner scanner;
     attempts = 5;
     while (replRows.isEmpty() && attempts > 0) {
@@ -319,7 +319,7 @@ public class ReplicationIT extends ConfigurableMacIT {
       }
     }
 
-    Set<String> wals = Sets.newHashSet();
+    Set<String> wals = new HashSet<>();
     Scanner s;
     attempts = 5;
     while (wals.isEmpty() && attempts > 0) {


Mime
View raw message