You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2018/05/04 16:47:18 UTC

[GitHub] mikewalch closed pull request #462: Removed redundant local variables

mikewalch closed pull request #462: Removed redundant local variables
URL: https://github.com/apache/accumulo/pull/462
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/Credentials.java b/core/src/main/java/org/apache/accumulo/core/client/impl/Credentials.java
index 0967a91425..b0772cab30 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/Credentials.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/Credentials.java
@@ -167,9 +167,7 @@ public boolean equals(Object obj) {
         : (getPrincipal().equals(other.getPrincipal()));
     if (!pEq)
       return false;
-    boolean tEq = getToken() == null ? (other.getToken() == null)
-        : (getToken().equals(other.getToken()));
-    return tEq;
+    return getToken() == null ? (other.getToken() == null) : (getToken().equals(other.getToken()));
   }
 
   @Override
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java b/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java
index dfe29e57e0..63d721ac02 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java
@@ -67,9 +67,8 @@
 
     try {
       // Master requests can take a long time: don't ever time out
-      MasterClientService.Client client = ThriftUtil
-          .getClientNoTimeout(new MasterClientService.Client.Factory(), master, context);
-      return client;
+      return ThriftUtil.getClientNoTimeout(new MasterClientService.Client.Factory(), master,
+          context);
     } catch (TTransportException tte) {
       Throwable cause = tte.getCause();
       if (null != cause && cause instanceof UnknownHostException) {
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationClient.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationClient.java
index 6eb1fd0485..ef26037b09 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationClient.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationClient.java
@@ -109,9 +109,8 @@
 
     try {
       // Master requests can take a long time: don't ever time out
-      ReplicationCoordinator.Client client = ThriftUtil.getClientNoTimeout(
-          new ReplicationCoordinator.Client.Factory(), coordinatorAddr, context);
-      return client;
+      return ThriftUtil.getClientNoTimeout(new ReplicationCoordinator.Client.Factory(),
+          coordinatorAddr, context);
     } catch (TTransportException tte) {
       log.debug("Failed to connect to master coordinator service ({})", coordinatorAddr, tte);
       return null;
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
index 30ebcdcfb0..db453d0e4f 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
@@ -354,8 +354,7 @@ String doFateOperation(FateOperation op, List<ByteBuffer> args, Map<String,Strin
         opid = null;
         return null;
       }
-      String ret = waitForFateOperation(opid);
-      return ret;
+      return waitForFateOperation(opid);
     } catch (ThriftSecurityException e) {
       switch (e.getCode()) {
         case TABLE_DOESNT_EXIST:
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mock/MockScannerBase.java b/core/src/main/java/org/apache/accumulo/core/client/mock/MockScannerBase.java
index 8cb6064e9b..059821c69f 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mock/MockScannerBase.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mock/MockScannerBase.java
@@ -142,10 +142,8 @@ public IteratorEnvironment cloneWithSamplingEnabled() {
     SortedKeyValueIterator<Key,Value> vf = VisibilityFilter.wrap(cqf, auths, defaultLabels);
     AccumuloConfiguration conf = new MockConfiguration(table.settings);
     MockIteratorEnvironment iterEnv = new MockIteratorEnvironment(auths);
-    SortedKeyValueIterator<Key,Value> result = iterEnv
-        .getTopLevelIterator(IteratorUtil.loadIterators(IteratorScope.scan, vf, null, conf,
-            serverSideIteratorList, serverSideIteratorOptions, iterEnv, false));
-    return result;
+    return iterEnv.getTopLevelIterator(IteratorUtil.loadIterators(IteratorScope.scan, vf, null,
+        conf, serverSideIteratorList, serverSideIteratorOptions, iterEnv, false));
   }
 
   @Override
diff --git a/core/src/main/java/org/apache/accumulo/core/data/impl/KeyExtent.java b/core/src/main/java/org/apache/accumulo/core/data/impl/KeyExtent.java
index afef944289..97cd24b6b4 100644
--- a/core/src/main/java/org/apache/accumulo/core/data/impl/KeyExtent.java
+++ b/core/src/main/java/org/apache/accumulo/core/data/impl/KeyExtent.java
@@ -607,8 +607,7 @@ public Range toMetadataRange() {
       metadataPrevRow.append(getPrevEndRow().getBytes(), 0, getPrevEndRow().getLength());
     }
 
-    Range range = new Range(metadataPrevRow, getPrevEndRow() == null, getMetadataEntry(), true);
-    return range;
+    return new Range(metadataPrevRow, getPrevEndRow() == null, getMetadataEntry(), true);
   }
 
   public static SortedSet<KeyExtent> findChildren(KeyExtent ke, SortedSet<KeyExtent> tablets) {
diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/RFileOperations.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/RFileOperations.java
index 6a9e543b45..0054db2e85 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/rfile/RFileOperations.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/RFileOperations.java
@@ -132,8 +132,6 @@ protected FileSKVWriter openWriter(OpenWriterOperation options) throws IOExcepti
         new RateLimitedOutputStream(outputStream, options.getRateLimiter()), compression, conf,
         acuconf);
 
-    RFile.Writer writer = new RFile.Writer(_cbw, (int) blockSize, (int) indexBlockSize,
-        samplerConfig, sampler);
-    return writer;
+    return new RFile.Writer(_cbw, (int) blockSize, (int) indexBlockSize, samplerConfig, sampler);
   }
 }
diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java
index 25462dbd3b..c817d7bcfd 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java
@@ -233,8 +233,7 @@ long getStartPos() {
        * Current size of compressed data.
        */
       long getCompressedSize() throws IOException {
-        long ret = getCurrentPos() - posStart;
-        return ret;
+        return getCurrentPos() - posStart;
       }
 
       /**
diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Compression.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Compression.java
index b979fcd505..0e6234af9f 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Compression.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Compression.java
@@ -192,8 +192,7 @@ public InputStream createDecompressionStream(InputStream downStream,
           bis1 = downStream;
         }
         CompressionInputStream cis = codec.createInputStream(bis1, decompressor);
-        BufferedInputStream bis2 = new BufferedInputStream(cis, DATA_IBUF_SIZE);
-        return bis2;
+        return new BufferedInputStream(cis, DATA_IBUF_SIZE);
       }
 
       @Override
@@ -210,9 +209,7 @@ public OutputStream createCompressionStream(OutputStream downStream, Compressor
           bos1 = downStream;
         }
         CompressionOutputStream cos = codec.createOutputStream(bos1, compressor);
-        BufferedOutputStream bos2 = new BufferedOutputStream(
-            new FinishOnFlushCompressionStream(cos), DATA_OBUF_SIZE);
-        return bos2;
+        return new BufferedOutputStream(new FinishOnFlushCompressionStream(cos), DATA_OBUF_SIZE);
       }
 
     },
@@ -275,8 +272,7 @@ public InputStream createDecompressionStream(InputStream downStream,
           }
         }
         CompressionInputStream cis = decomCodec.createInputStream(downStream, decompressor);
-        BufferedInputStream bis2 = new BufferedInputStream(cis, DATA_IBUF_SIZE);
-        return bis2;
+        return new BufferedInputStream(cis, DATA_IBUF_SIZE);
       }
 
       @Override
@@ -290,9 +286,7 @@ public OutputStream createCompressionStream(OutputStream downStream, Compressor
         }
         // always uses the default buffer size
         CompressionOutputStream cos = codec.createOutputStream(bos1, compressor);
-        BufferedOutputStream bos2 = new BufferedOutputStream(
-            new FinishOnFlushCompressionStream(cos), DATA_OBUF_SIZE);
-        return bos2;
+        return new BufferedOutputStream(new FinishOnFlushCompressionStream(cos), DATA_OBUF_SIZE);
       }
 
       @Override
@@ -422,9 +416,7 @@ public OutputStream createCompressionStream(OutputStream downStream, Compressor
         }
         // use the default codec
         CompressionOutputStream cos = snappyCodec.createOutputStream(bos1, compressor);
-        BufferedOutputStream bos2 = new BufferedOutputStream(
-            new FinishOnFlushCompressionStream(cos), DATA_OBUF_SIZE);
-        return bos2;
+        return new BufferedOutputStream(new FinishOnFlushCompressionStream(cos), DATA_OBUF_SIZE);
       }
 
       @Override
@@ -447,8 +439,7 @@ public InputStream createDecompressionStream(InputStream downStream,
         }
 
         CompressionInputStream cis = decomCodec.createInputStream(downStream, decompressor);
-        BufferedInputStream bis2 = new BufferedInputStream(cis, DATA_IBUF_SIZE);
-        return bis2;
+        return new BufferedInputStream(cis, DATA_IBUF_SIZE);
       }
 
       @Override
diff --git a/core/src/main/java/org/apache/accumulo/core/security/crypto/CachingHDFSSecretKeyEncryptionStrategy.java b/core/src/main/java/org/apache/accumulo/core/security/crypto/CachingHDFSSecretKeyEncryptionStrategy.java
index 6bdc2e39ea..923ea0b4a5 100644
--- a/core/src/main/java/org/apache/accumulo/core/security/crypto/CachingHDFSSecretKeyEncryptionStrategy.java
+++ b/core/src/main/java/org/apache/accumulo/core/security/crypto/CachingHDFSSecretKeyEncryptionStrategy.java
@@ -219,8 +219,7 @@ private String getFullPathToKey(CryptoModuleParameters params) {
         pathToKeyName = "/" + pathToKeyName;
       }
 
-      String fullPath = instanceDirectory + pathToKeyName;
-      return fullPath;
+      return instanceDirectory + pathToKeyName;
     }
 
     public byte[] getKeyEncryptionKey() {
diff --git a/core/src/main/java/org/apache/accumulo/core/security/crypto/NonCachingSecretKeyEncryptionStrategy.java b/core/src/main/java/org/apache/accumulo/core/security/crypto/NonCachingSecretKeyEncryptionStrategy.java
index 09fc87b842..7e2cef22d2 100644
--- a/core/src/main/java/org/apache/accumulo/core/security/crypto/NonCachingSecretKeyEncryptionStrategy.java
+++ b/core/src/main/java/org/apache/accumulo/core/security/crypto/NonCachingSecretKeyEncryptionStrategy.java
@@ -150,8 +150,7 @@ private String getFullPathToKey(CryptoModuleParameters params) {
       pathToKeyName = "/" + pathToKeyName;
     }
 
-    String fullPath = instanceDirectory + pathToKeyName;
-    return fullPath;
+    return instanceDirectory + pathToKeyName;
   }
 
   @SuppressWarnings("deprecation")
diff --git a/core/src/main/java/org/apache/accumulo/core/summary/SummarizerFactory.java b/core/src/main/java/org/apache/accumulo/core/summary/SummarizerFactory.java
index cc20606ece..09cb583c16 100644
--- a/core/src/main/java/org/apache/accumulo/core/summary/SummarizerFactory.java
+++ b/core/src/main/java/org/apache/accumulo/core/summary/SummarizerFactory.java
@@ -56,8 +56,7 @@ private Summarizer newSummarizer(String classname)
 
   public Summarizer getSummarizer(SummarizerConfiguration conf) {
     try {
-      Summarizer summarizer = newSummarizer(conf.getClassName());
-      return summarizer;
+      return newSummarizer(conf.getClassName());
     } catch (ClassNotFoundException | InstantiationException | IllegalAccessException
         | IOException e) {
       throw new RuntimeException(e);
diff --git a/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java b/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java
index eb6a5e0dc7..d8ef37873d 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java
@@ -203,8 +203,7 @@ else if (c >= 32 && c <= 126 && c != ',')
         sb.append("\\x").append(String.format("%02X", c));
     }
 
-    String ecf = sb.toString();
-    return ecf;
+    return sb.toString();
   }
 
   public static class PartitionedMutation extends Mutation {
diff --git a/core/src/main/java/org/apache/accumulo/core/util/Merge.java b/core/src/main/java/org/apache/accumulo/core/util/Merge.java
index 078ba5771a..2431c8ffe8 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/Merge.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/Merge.java
@@ -230,7 +230,7 @@ protected void merge(Connector conn, String table, List<Size> sizes, int numToMe
     TabletsSection.TabletColumnFamily.PREV_ROW_COLUMN.fetch(scanner);
     final Iterator<Entry<Key,Value>> iterator = scanner.iterator();
 
-    Iterator<Size> result = new Iterator<Size>() {
+    return new Iterator<Size>() {
       Size next = fetch();
 
       @Override
@@ -255,9 +255,9 @@ private Size fetch() {
 
       @Override
       public Size next() {
-        Size result = next;
+        Size result1 = next;
         next = fetch();
-        return result;
+        return result1;
       }
 
       @Override
@@ -265,7 +265,6 @@ public void remove() {
         throw new UnsupportedOperationException();
       }
     };
-    return result;
   }
 
 }
diff --git a/core/src/main/java/org/apache/accumulo/core/util/ratelimit/SharedRateLimiterFactory.java b/core/src/main/java/org/apache/accumulo/core/util/ratelimit/SharedRateLimiterFactory.java
index 86b8b09ff8..85a93f181e 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/ratelimit/SharedRateLimiterFactory.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/ratelimit/SharedRateLimiterFactory.java
@@ -90,8 +90,7 @@ public void run() {
   public RateLimiter create(String name, RateProvider rateProvider) {
     synchronized (activeLimiters) {
       if (activeLimiters.containsKey(name)) {
-        SharedRateLimiter limiter = activeLimiters.get(name);
-        return limiter;
+        return activeLimiters.get(name);
       } else {
         long initialRate;
         initialRate = rateProvider.getDesiredRate();
diff --git a/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooUtil.java b/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooUtil.java
index d5ddb9bf3d..18c24fc4c6 100644
--- a/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooUtil.java
+++ b/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooUtil.java
@@ -72,8 +72,7 @@ public static String getInstanceIDFromHdfs(Path instanceDirectory, AccumuloConfi
         throw new RuntimeException(
             "Accumulo found multiple possible instance ids in " + instanceDirectory);
       } else {
-        String result = files[0].getPath().getName();
-        return result;
+        return files[0].getPath().getName();
       }
     } catch (IOException e) {
       log.error("Problem reading instance id out of hdfs at " + instanceDirectory, e);
diff --git a/core/src/test/java/org/apache/accumulo/core/client/rfile/RFileTest.java b/core/src/test/java/org/apache/accumulo/core/client/rfile/RFileTest.java
index 4a829191e8..f8f8289548 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/rfile/RFileTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/rfile/RFileTest.java
@@ -809,10 +809,9 @@ public void testWrongGroup() throws Exception {
   }
 
   private Reader getReader(LocalFileSystem localFs, String testFile) throws IOException {
-    Reader reader = (Reader) FileOperations.getInstance().newReaderBuilder().forFile(testFile)
+    return (Reader) FileOperations.getInstance().newReaderBuilder().forFile(testFile)
         .inFileSystem(localFs, localFs.getConf())
         .withTableConfiguration(DefaultConfiguration.getInstance()).build();
-    return reader;
   }
 
   @Test
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/system/SourceSwitchingIteratorTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/system/SourceSwitchingIteratorTest.java
index 392d69759e..ef41aac8f6 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/system/SourceSwitchingIteratorTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/system/SourceSwitchingIteratorTest.java
@@ -153,8 +153,7 @@ public void test2() throws Exception {
     put(tm2, "r2", "cf1", "cq1", 5, "v6");
 
     SortedMapIterator smi2 = new SortedMapIterator(tm2);
-    TestDataSource tds2 = new TestDataSource(smi2);
-    tds.next = tds2;
+    tds.next = new TestDataSource(smi2);
 
     testAndCallNext(ssi, "r1", "cf1", "cq3", 5, "v2", true);
     testAndCallNext(ssi, "r2", "cf1", "cq1", 5, "v6", true);
@@ -186,8 +185,7 @@ public void test3() throws Exception {
 
     // setup a new data source, but it should not switch until the current row is finished
     SortedMapIterator smi2 = new SortedMapIterator(tm2);
-    TestDataSource tds2 = new TestDataSource(smi2);
-    tds.next = tds2;
+    tds.next = new TestDataSource(smi2);
 
     testAndCallNext(ssi, "r1", "cf1", "cq2", 5, "v2", true);
     testAndCallNext(ssi, "r1", "cf1", "cq3", 5, "v3", true);
@@ -213,8 +211,7 @@ public void test4() throws Exception {
     put(tm2, "r1", "cf1", "cq2", 6, "v4");
 
     SortedMapIterator smi2 = new SortedMapIterator(tm2);
-    TestDataSource tds2 = new TestDataSource(smi2);
-    tds.next = tds2;
+    tds.next = new TestDataSource(smi2);
 
     ssi.seek(new Range(), new ArrayList<>(), false);
 
diff --git a/core/src/test/java/org/apache/accumulo/core/security/crypto/CryptoTest.java b/core/src/test/java/org/apache/accumulo/core/security/crypto/CryptoTest.java
index e49dbefc3a..465162f696 100644
--- a/core/src/test/java/org/apache/accumulo/core/security/crypto/CryptoTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/security/crypto/CryptoTest.java
@@ -619,8 +619,7 @@ public void testIVIncrements() {
     encryptedDataStream.writeUTF(MARKER_STRING);
     encryptedDataStream.writeInt(MARKER_INT);
     encryptedDataStream.close();
-    byte[] encryptedBytes = encryptedByteStream.toByteArray();
-    return (encryptedBytes);
+    return (encryptedByteStream.toByteArray());
   }
 
   /**
diff --git a/fate/src/main/java/org/apache/accumulo/fate/Fate.java b/fate/src/main/java/org/apache/accumulo/fate/Fate.java
index 4af32e5b47..5569d55d12 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/Fate.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/Fate.java
@@ -194,8 +194,7 @@ public Thread newThread(Runnable r) {
 
   // get a transaction id back to the requester before doing any work
   public long startTransaction() {
-    long dir = store.create();
-    return dir;
+    return store.create();
   }
 
   // start work in the transaction.. it is safe to call this
diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java b/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java
index 14c669c1bd..6c206c128b 100644
--- a/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java
+++ b/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java
@@ -275,11 +275,9 @@ public static ServerAddress createProxyServer(HostAndPort address,
         threadName);
 
     // Create the thrift server with our processor and properties
-    ServerAddress serverAddr = TServerUtils.startTServer(serverType, timedProcessor,
-        protocolFactory, serverName, threadName, numThreads, simpleTimerThreadpoolSize,
-        threadpoolResizeInterval, maxFrameSize, sslParams, saslParams, serverSocketTimeout,
-        address);
 
-    return serverAddr;
+    return TServerUtils.startTServer(serverType, timedProcessor, protocolFactory, serverName,
+        threadName, numThreads, simpleTimerThreadpoolSize, threadpoolResizeInterval, maxFrameSize,
+        sslParams, saslParams, serverSocketTimeout, address);
   }
 }
diff --git a/server/base/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java b/server/base/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
index d0a17add4f..b9ec2ae87d 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
@@ -156,8 +156,7 @@ private static synchronized void _getInstanceID() {
       }
       Path instanceIdPath = Accumulo.getAccumuloInstanceIdPath(fs);
       log.trace("Looking for instanceId from {}", instanceIdPath);
-      String instanceIdFromFile = ZooUtil.getInstanceIDFromHdfs(instanceIdPath, acuConf);
-      instanceId = instanceIdFromFile;
+      instanceId = ZooUtil.getInstanceIDFromHdfs(instanceIdPath, acuConf);
     }
   }
 
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 a54c002224..3524bc88a6 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
@@ -180,9 +180,8 @@ private String getZPath(Instance instance) throws IOException {
     dos.close();
     baos.close();
 
-    String zpath = ZooUtil.getRoot(instance) + Constants.ZPROBLEMS + "/"
+    return ZooUtil.getRoot(instance) + Constants.ZPROBLEMS + "/"
         + Encoding.encodeAsBase64FileName(new Text(baos.toByteArray()));
-    return zpath;
   }
 
   static ProblemReport decodeZooKeeperEntry(String node) throws Exception {
diff --git a/server/base/src/main/java/org/apache/accumulo/server/replication/proto/Replication.java b/server/base/src/main/java/org/apache/accumulo/server/replication/proto/Replication.java
index b36958dbae..534a2afdae 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/replication/proto/Replication.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/replication/proto/Replication.java
@@ -491,8 +491,7 @@ public static Builder newBuilder(org.apache.accumulo.server.replication.proto.Re
     @java.lang.Override
     protected Builder newBuilderForType(
         com.google.protobuf.GeneratedMessage.BuilderParent parent) {
-      Builder builder = new Builder(parent);
-      return builder;
+      return new Builder(parent);
     }
     /**
      * Protobuf type {@code Status}
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 959dfffc72..ff5756f139 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
@@ -162,8 +162,7 @@ public static ServerAddress startServer(AccumuloServerContext service, String ho
         HostAndPort last = addresses[addresses.length - 1];
         // Attempt to allocate a port outside of the specified port property
         // Search sequentially over the next 1000 ports
-        for (int i = last.getPort() + 1; i < last.getPort() + 1001; i++) {
-          int port = i;
+        for (int port = last.getPort() + 1; port < last.getPort() + 1001; port++) {
           if (port > 65535) {
             break;
           }
diff --git a/server/base/src/main/java/org/apache/accumulo/server/rpc/UGIAssumingProcessor.java b/server/base/src/main/java/org/apache/accumulo/server/rpc/UGIAssumingProcessor.java
index 6009279a0d..cfe6b5da4c 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/rpc/UGIAssumingProcessor.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/rpc/UGIAssumingProcessor.java
@@ -80,8 +80,7 @@ public boolean process(final TProtocol inProt, final TProtocol outProt) throws T
     }
     TSaslServerTransport saslTrans = (TSaslServerTransport) trans;
     SaslServer saslServer = saslTrans.getSaslServer();
-    String authId = saslServer.getAuthorizationID();
-    String endUser = authId;
+    String endUser = saslServer.getAuthorizationID();
 
     SaslMechanism mechanism;
     try {
diff --git a/server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java b/server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java
index 8ee7887da1..82439fd373 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java
@@ -135,9 +135,7 @@ public IllegalTableTransitionException(TableState oldState, TableState newState,
       if (StringUtils.isNotEmpty(message))
         this.message = message;
       else {
-        String defaultMessage = "Error transitioning from " + oldState + " state to " + newState
-            + " state";
-        this.message = defaultMessage;
+        this.message = "Error transitioning from " + oldState + " state to " + newState + " state";
       }
     }
 
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/SystemPropUtil.java b/server/base/src/main/java/org/apache/accumulo/server/util/SystemPropUtil.java
index b7231d89d9..252708d70a 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/SystemPropUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/SystemPropUtil.java
@@ -63,10 +63,9 @@ public static boolean setSystemProperty(String property, String value)
     // create the zk node for this property and set it's data to the specified value
     String zPath = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZCONFIG + "/"
         + property;
-    boolean result = ZooReaderWriter.getInstance().putPersistentData(zPath, value.getBytes(UTF_8),
-        NodeExistsPolicy.OVERWRITE);
 
-    return result;
+    return ZooReaderWriter.getInstance().putPersistentData(zPath, value.getBytes(UTF_8),
+        NodeExistsPolicy.OVERWRITE);
   }
 
   public static void removeSystemProperty(String property)
diff --git a/server/base/src/test/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancerTest.java b/server/base/src/test/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancerTest.java
index e6423ee8a2..7c36acdc7d 100644
--- a/server/base/src/test/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancerTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancerTest.java
@@ -131,8 +131,7 @@ public void testUnevenAssignment() {
     for (char c : "abcdefghijklmnopqrstuvwxyz".toCharArray()) {
       String cString = Character.toString(c);
       HostAndPort fakeAddress = HostAndPort.fromParts("127.0.0.1", c);
-      String fakeInstance = cString;
-      TServerInstance tsi = new TServerInstance(fakeAddress, fakeInstance);
+      TServerInstance tsi = new TServerInstance(fakeAddress, cString);
       FakeTServer fakeTServer = new FakeTServer();
       servers.put(tsi, fakeTServer);
       fakeTServer.extents.add(makeExtent(cString, null, null));
diff --git a/server/base/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java b/server/base/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java
index f6bbc67809..dfe690d911 100644
--- a/server/base/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java
@@ -176,8 +176,7 @@ public void testUnevenAssignment() {
     for (char c : "abcdefghijklmnopqrstuvwxyz".toCharArray()) {
       String cString = Character.toString(c);
       HostAndPort fakeAddress = HostAndPort.fromParts("127.0.0.1", c);
-      String fakeInstance = cString;
-      TServerInstance tsi = new TServerInstance(fakeAddress, fakeInstance);
+      TServerInstance tsi = new TServerInstance(fakeAddress, cString);
       FakeTServer fakeTServer = new FakeTServer();
       servers.put(tsi, fakeTServer);
       fakeTServer.extents.add(makeExtent(cString, null, null));
@@ -217,8 +216,7 @@ public void testUnevenAssignment2() {
     for (char c : "abcdefghijklmnopqrstuvwxyz".toCharArray()) {
       String cString = Character.toString(c);
       HostAndPort fakeAddress = HostAndPort.fromParts("127.0.0.1", c);
-      String fakeInstance = cString;
-      TServerInstance tsi = new TServerInstance(fakeAddress, fakeInstance);
+      TServerInstance tsi = new TServerInstance(fakeAddress, cString);
       FakeTServer fakeTServer = new FakeTServer();
       servers.put(tsi, fakeTServer);
     }
diff --git a/server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectionTest.java b/server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectionTest.java
index bf44e3da20..7b0f13053c 100644
--- a/server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectionTest.java
+++ b/server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectionTest.java
@@ -96,9 +96,7 @@ public Key newFileReferenceKey(String tableId, String endRow, String file) {
       String row = new KeyExtent(Table.ID.of(tableId), endRow == null ? null : new Text(endRow),
           null).getMetadataEntry().toString();
       String cf = MetadataSchema.TabletsSection.DataFileColumnFamily.NAME.toString();
-      String cq = file;
-      Key key = new Key(row, cf, cq);
-      return key;
+      return new Key(row, cf, file);
     }
 
     public Value addFileReference(String tableId, String endRow, String file) {
@@ -118,8 +116,7 @@ Key newDirReferenceKey(String tableId, String endRow) {
           .getColumnFamily().toString();
       String cq = MetadataSchema.TabletsSection.ServerColumnFamily.DIRECTORY_COLUMN
           .getColumnQualifier().toString();
-      Key key = new Key(row, cf, cq);
-      return key;
+      return new Key(row, cf, cq);
     }
 
     public Value addDirReference(String tableId, String endRow, String dir) {
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/tservers/TabletServerResource.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/tservers/TabletServerResource.java
index e4025e6ee1..d3c0987e9a 100644
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/tservers/TabletServerResource.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/tservers/TabletServerResource.java
@@ -232,10 +232,7 @@ public TabletServerSummary getTserverDetails(
     CurrentTabletResults currentRes = doCurrentTabletResults(currentMinorAvg, currentMinorStdDev,
         currentMajorAvg, currentMajorStdDev);
 
-    TabletServerSummary tserverDetails = new TabletServerSummary(details, allTime, currentRes,
-        currentOps);
-
-    return tserverDetails;
+    return new TabletServerSummary(details, allTime, currentRes, currentOps);
   }
 
   private static final int concurrentScans = Monitor.getContext().getConfiguration()
diff --git a/server/tracer/src/main/java/org/apache/accumulo/tracer/ZooTraceClient.java b/server/tracer/src/main/java/org/apache/accumulo/tracer/ZooTraceClient.java
index fb6b6dc83a..e340cfbbb0 100644
--- a/server/tracer/src/main/java/org/apache/accumulo/tracer/ZooTraceClient.java
+++ b/server/tracer/src/main/java/org/apache/accumulo/tracer/ZooTraceClient.java
@@ -77,8 +77,7 @@ protected void setRetryPause(long pause) {
   @Override
   synchronized protected String getSpanKey(Map<String,String> data) {
     if (hosts.size() > 0) {
-      String host = hosts.get(random.nextInt(hosts.size()));
-      return host;
+      return hosts.get(random.nextInt(hosts.size()));
     }
     return null;
   }
diff --git a/server/tracer/src/test/java/org/apache/accumulo/tracer/AsyncSpanReceiverTest.java b/server/tracer/src/test/java/org/apache/accumulo/tracer/AsyncSpanReceiverTest.java
index 05ab02df8e..5785c1c2d3 100644
--- a/server/tracer/src/test/java/org/apache/accumulo/tracer/AsyncSpanReceiverTest.java
+++ b/server/tracer/src/test/java/org/apache/accumulo/tracer/AsyncSpanReceiverTest.java
@@ -66,9 +66,8 @@ int getQueueSize() {
 
   Span createSpan(long length) {
     long time = System.currentTimeMillis();
-    Span span = new MilliSpan.Builder().begin(time).end(time + length).description("desc")
+    return new MilliSpan.Builder().begin(time).end(time + length).description("desc")
         .parents(Collections.emptyList()).spanId(1).traceId(2).build();
-    return span;
   }
 
   @Test
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
index e8caaf1081..2b406160c2 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
@@ -65,8 +65,7 @@ public synchronized TraceRunnable peek() {
     if (task.size() == 0)
       return null;
 
-    TraceRunnable min = Collections.min(task, comparator);
-    return min;
+    return Collections.min(task, comparator);
   }
 
   @Override
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/FileManager.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/FileManager.java
index 17384c07b4..0bbf3ee977 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/FileManager.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/FileManager.java
@@ -601,8 +601,7 @@ public synchronized void reattach(SamplerConfigurationImpl samplerConfig) throws
       }
 
       for (FileDataSource fds : dataSources) {
-        FileSKVIterator reader = map.get(fds.file).remove(0);
-        FileSKVIterator source = reader;
+        FileSKVIterator source = map.get(fds.file).remove(0);
         if (samplerConfig != null) {
           source = source.getSample(samplerConfig);
           if (source == null) {
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletIteratorEnvironment.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletIteratorEnvironment.java
index d7673a9fde..d3c13b7164 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletIteratorEnvironment.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletIteratorEnvironment.java
@@ -180,8 +180,7 @@ public IteratorEnvironment cloneWithSamplingEnabled() {
       throw new SampleNotPresentException();
     }
 
-    TabletIteratorEnvironment te = new TabletIteratorEnvironment(scope, config, trm, files,
-        authorizations, sci, topLevelIterators);
-    return te;
+    return new TabletIteratorEnvironment(scope, config, trm, files, authorizations, sci,
+        topLevelIterators);
   }
 }
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
index c4b4c3ce30..d7d3506f2d 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
@@ -847,8 +847,7 @@ public long startUpdate(TInfo tinfo, TCredentials credentials, TDurability tdura
 
       UpdateSession us = new UpdateSession(new TservConstraintEnv(security, credentials),
           credentials, durability);
-      long sid = sessionManager.createSession(us, false);
-      return sid;
+      return sessionManager.createSession(us, false);
     }
 
     private void setUpdateTablet(UpdateSession us, KeyExtent keyExtent) {
@@ -2587,10 +2586,8 @@ private HostAndPort getMasterAddress() {
       if (address == null) {
         return null;
       }
-      MasterClientService.Client client = ThriftUtil
-          .getClient(new MasterClientService.Client.Factory(), address, this);
       // log.info("Listener API to master has been opened");
-      return client;
+      return ThriftUtil.getClient(new MasterClientService.Client.Factory(), address, this);
     } catch (Exception e) {
       log.warn("Issue with masterConnection (" + address + ") " + e, e);
     }
@@ -3322,8 +3319,7 @@ private Durability getMincEventDurability(KeyExtent extent) {
     } else {
       conf = confFactory.getTableConfiguration(MetadataTable.ID);
     }
-    Durability durability = DurabilityImpl.fromString(conf.get(Property.TABLE_DURABILITY));
-    return durability;
+    return DurabilityImpl.fromString(conf.get(Property.TABLE_DURABILITY));
   }
 
   public void minorCompactionFinished(CommitSession tablet, String newDatafile, long walogSeq)
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 92e67773c4..187d8d1c3e 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
@@ -600,8 +600,7 @@ public void close() {
 
   public synchronized TabletResourceManager createTabletResourceManager(KeyExtent extent,
       AccumuloConfiguration conf) {
-    TabletResourceManager trm = new TabletResourceManager(extent, conf);
-    return trm;
+    return new TabletResourceManager(extent, conf);
   }
 
   public class TabletResourceManager {
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/MajorCompactionRequest.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/MajorCompactionRequest.java
index 6a7ffcbe0f..4390e15fb9 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/MajorCompactionRequest.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/MajorCompactionRequest.java
@@ -171,10 +171,8 @@ public FileSKVIterator openReader(FileRef ref) throws IOException {
     // @TODO ensure these files are always closed?
     FileOperations fileFactory = FileOperations.getInstance();
     FileSystem ns = volumeManager.getVolumeByPath(ref.path()).getFileSystem();
-    FileSKVIterator openReader = fileFactory.newReaderBuilder()
-        .forFile(ref.path().toString(), ns, ns.getConf()).withTableConfiguration(tableConfig)
-        .seekToBeginning().build();
-    return openReader;
+    return fileFactory.newReaderBuilder().forFile(ref.path().toString(), ns, ns.getConf())
+        .withTableConfiguration(tableConfig).seekToBeginning().build();
   }
 
   public Map<String,String> getTableProperties() {
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java
index 1e92ef2a5d..87b62fee07 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java
@@ -130,8 +130,7 @@ public void mutate(InMemoryMap imm, String row, String column, long ts, String v
 
   static Key newKey(String row, String column, long ts) {
     String[] sa = column.split(":");
-    Key k = new Key(new Text(row), new Text(sa[0]), new Text(sa[1]), ts);
-    return k;
+    return new Key(new Text(row), new Text(sa[0]), new Text(sa[1]), ts);
   }
 
   static void testAndCallNext(SortedKeyValueIterator<Key,Value> dc, String row, String column,
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/CreateUserCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/CreateUserCommand.java
index 05f57c46f4..7655c28f26 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/CreateUserCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/CreateUserCommand.java
@@ -78,8 +78,7 @@ public String description() {
 
   @Override
   public Options getOptions() {
-    final Options o = new Options();
-    return o;
+    return new Options();
   }
 
   @Override
diff --git a/shell/src/test/java/org/apache/accumulo/shell/ShellTest.java b/shell/src/test/java/org/apache/accumulo/shell/ShellTest.java
index 93cd7079a1..b0ca6045af 100644
--- a/shell/src/test/java/org/apache/accumulo/shell/ShellTest.java
+++ b/shell/src/test/java/org/apache/accumulo/shell/ShellTest.java
@@ -327,13 +327,12 @@ public void scanDateStringFormatterTest() throws IOException {
         org.apache.accumulo.core.util.format.DateStringFormatter.DATE_FORMAT);
     String expected = String.format("r f:q [] %s    v", dateFormat.format(new Date(0)));
     // historically, showing few did not pertain to ColVis or Timestamp
-    String expectedFew = expected;
     String expectedNoTimestamp = String.format("r f:q []    v");
     exec("scan -fm org.apache.accumulo.core.util.format.DateStringFormatter -st", true, expected);
     exec("scan -fm org.apache.accumulo.core.util.format.DateStringFormatter -st -f 1000", true,
         expected);
     exec("scan -fm org.apache.accumulo.core.util.format.DateStringFormatter -st -f 5", true,
-        expectedFew);
+        expected);
     exec("scan -fm org.apache.accumulo.core.util.format.DateStringFormatter", true,
         expectedNoTimestamp);
     exec("deletetable t -f", true, "Table: [t] has been deleted");
diff --git a/start/src/main/java/org/apache/accumulo/start/Main.java b/start/src/main/java/org/apache/accumulo/start/Main.java
index a30c4b4504..fa3d1dc6d2 100644
--- a/start/src/main/java/org/apache/accumulo/start/Main.java
+++ b/start/src/main/java/org/apache/accumulo/start/Main.java
@@ -101,9 +101,7 @@ public static void main(final String[] args) {
   public static synchronized ClassLoader getClassLoader() {
     if (classLoader == null) {
       try {
-        ClassLoader clTmp = (ClassLoader) getVFSClassLoader().getMethod("getClassLoader")
-            .invoke(null);
-        classLoader = clTmp;
+        classLoader = (ClassLoader) getVFSClassLoader().getMethod("getClassLoader").invoke(null);
         Thread.currentThread().setContextClassLoader(classLoader);
       } catch (ClassNotFoundException | IOException | IllegalAccessException
           | IllegalArgumentException | InvocationTargetException | NoSuchMethodException
@@ -119,9 +117,8 @@ public static synchronized ClassLoader getClassLoader() {
       throws IOException, ClassNotFoundException {
     if (vfsClassLoader == null) {
       Thread.currentThread().setContextClassLoader(AccumuloClassLoader.getClassLoader());
-      Class<?> vfsClassLoaderTmp = AccumuloClassLoader.getClassLoader()
+      vfsClassLoader = AccumuloClassLoader.getClassLoader()
           .loadClass("org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader");
-      vfsClassLoader = vfsClassLoaderTmp;
     }
     return vfsClassLoader;
   }
@@ -166,8 +163,7 @@ public static void execMainClass(final Class<?> classWithMain, final String[] ar
     final Method finalMain = main;
     Runnable r = () -> {
       try {
-        final Object thisIsJustOneArgument = args;
-        finalMain.invoke(null, thisIsJustOneArgument);
+        finalMain.invoke(null, (Object) args);
       } catch (InvocationTargetException e) {
         if (e.getCause() != null) {
           die(e.getCause());
diff --git a/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java b/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java
index c09c03f31f..7df70f024a 100644
--- a/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java
+++ b/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java
@@ -249,8 +249,7 @@ public static synchronized ClassLoader getClassLoader() throws IOException {
       ClassLoader parentClassLoader = AccumuloClassLoader.class.getClassLoader();
 
       log.debug("Create 2nd tier ClassLoader using URLs: {}", urls.toString());
-      URLClassLoader aClassLoader = new URLClassLoader(urls.toArray(new URL[urls.size()]),
-          parentClassLoader) {
+      classloader = new URLClassLoader(urls.toArray(new URL[urls.size()]), parentClassLoader) {
         @Override
         protected synchronized Class<?> loadClass(String name, boolean resolve)
             throws ClassNotFoundException {
@@ -267,7 +266,6 @@ public static synchronized ClassLoader getClassLoader() throws IOException {
           return super.loadClass(name, resolve);
         }
       };
-      classloader = aClassLoader;
     }
 
     return classloader;
diff --git a/test/src/main/java/org/apache/accumulo/harness/AccumuloClusterHarness.java b/test/src/main/java/org/apache/accumulo/harness/AccumuloClusterHarness.java
index 3939af661e..42c1d4c958 100644
--- a/test/src/main/java/org/apache/accumulo/harness/AccumuloClusterHarness.java
+++ b/test/src/main/java/org/apache/accumulo/harness/AccumuloClusterHarness.java
@@ -39,7 +39,6 @@
 import org.apache.accumulo.harness.conf.AccumuloClusterConfiguration;
 import org.apache.accumulo.harness.conf.AccumuloClusterPropertyConfiguration;
 import org.apache.accumulo.harness.conf.StandaloneAccumuloClusterConfiguration;
-import org.apache.accumulo.minicluster.impl.MiniAccumuloClusterImpl;
 import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
 import org.apache.accumulo.test.categories.StandaloneCapableClusterTests;
 import org.apache.hadoop.conf.Configuration;
@@ -120,8 +119,7 @@ public void setupCluster() throws Exception {
         MiniClusterHarness miniClusterHarness = new MiniClusterHarness();
         // Intrinsically performs the callback to let tests alter MiniAccumuloConfig and
         // core-site.xml
-        MiniAccumuloClusterImpl impl = miniClusterHarness.create(this, getAdminToken(), krb);
-        cluster = impl;
+        cluster = miniClusterHarness.create(this, getAdminToken(), krb);
         // Login as the "root" user
         if (null != krb) {
           ClusterUser rootUser = krb.getRootUser();
diff --git a/test/src/main/java/org/apache/accumulo/test/MetaGetsReadersIT.java b/test/src/main/java/org/apache/accumulo/test/MetaGetsReadersIT.java
index b0a7dbcc40..1d50513952 100644
--- a/test/src/main/java/org/apache/accumulo/test/MetaGetsReadersIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/MetaGetsReadersIT.java
@@ -56,28 +56,24 @@ public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite)
 
   private static Thread slowScan(final Connector c, final String tableName,
       final AtomicBoolean stop) {
-    Thread thread = new Thread() {
-      @Override
-      public void run() {
-        try {
-          while (!stop.get()) {
-            try (Scanner s = c.createScanner(tableName, Authorizations.EMPTY)) {
-              IteratorSetting is = new IteratorSetting(50, SlowIterator.class);
-              SlowIterator.setSleepTime(is, 10);
-              s.addScanIterator(is);
-              Iterator<Entry<Key,Value>> iterator = s.iterator();
-              while (iterator.hasNext() && !stop.get()) {
-                iterator.next();
-              }
+    return new Thread(() -> {
+      try {
+        while (!stop.get()) {
+          try (Scanner s = c.createScanner(tableName, Authorizations.EMPTY)) {
+            IteratorSetting is = new IteratorSetting(50, SlowIterator.class);
+            SlowIterator.setSleepTime(is, 10);
+            s.addScanIterator(is);
+            Iterator<Entry<Key,Value>> iterator = s.iterator();
+            while (iterator.hasNext() && !stop.get()) {
+              iterator.next();
             }
           }
-        } catch (Exception ex) {
-          log.trace("{}", ex.getMessage(), ex);
-          stop.set(true);
         }
+      } catch (Exception ex) {
+        log.trace("{}", ex.getMessage(), ex);
+        stop.set(true);
       }
-    };
-    return thread;
+    });
   }
 
   @Test(timeout = 2 * 60 * 1000)
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/BatchWriterFlushIT.java b/test/src/main/java/org/apache/accumulo/test/functional/BatchWriterFlushIT.java
index 440c146f91..bfb416f216 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/BatchWriterFlushIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/BatchWriterFlushIT.java
@@ -193,11 +193,10 @@ public void runMultiThreadedBinningTest() throws Exception {
     final List<Set<Mutation>> allMuts = new LinkedList<>();
     List<Mutation> data = new ArrayList<>();
     for (int i = 0; i < NUM_THREADS; i++) {
-      final int thread = i;
       for (int j = 0; j < NUM_TO_FLUSH; j++) {
-        int row = thread * NUM_TO_FLUSH + j;
+        int row = i * NUM_TO_FLUSH + j;
         Mutation m = new Mutation(new Text(String.format("%10d", row)));
-        m.put(new Text("cf" + thread), new Text("cq"), new Value(("" + row).getBytes()));
+        m.put(new Text("cf" + i), new Text("cq"), new Value(("" + row).getBytes()));
         data.add(m);
       }
     }
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/FunctionalTestUtils.java b/test/src/main/java/org/apache/accumulo/test/functional/FunctionalTestUtils.java
index 393c193ad0..eca5e0bd5f 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/FunctionalTestUtils.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/FunctionalTestUtils.java
@@ -220,9 +220,8 @@ private static FateStatus getFateStatus(Instance instance, AccumuloCluster clust
       IZooReaderWriter zk = new ZooReaderWriterFactory().getZooReaderWriter(
           instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut(), secret);
       ZooStore<String> zs = new ZooStore<>(ZooUtil.getRoot(instance) + Constants.ZFATE, zk);
-      FateStatus fateStatus = admin.getStatus(zs, zk,
-          ZooUtil.getRoot(instance) + Constants.ZTABLE_LOCKS, null, null);
-      return fateStatus;
+      return admin.getStatus(zs, zk, ZooUtil.getRoot(instance) + Constants.ZTABLE_LOCKS, null,
+          null);
     } catch (KeeperException | InterruptedException e) {
       throw new RuntimeException(e);
     }
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/KerberosIT.java b/test/src/main/java/org/apache/accumulo/test/functional/KerberosIT.java
index 6636f0e931..01712af00e 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/KerberosIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/KerberosIT.java
@@ -454,8 +454,7 @@ public Integer run() throws Exception {
 
         try (BatchScanner bs = conn.createBatchScanner(tableName, Authorizations.EMPTY, 2)) {
           bs.setRanges(Collections.singleton(new Range()));
-          int recordsSeen = Iterables.size(bs);
-          return recordsSeen;
+          return Iterables.size(bs);
         }
       }
     });
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/MasterAssignmentIT.java b/test/src/main/java/org/apache/accumulo/test/functional/MasterAssignmentIT.java
index 7c877b1d95..b9f757d517 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/MasterAssignmentIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/MasterAssignmentIT.java
@@ -93,8 +93,7 @@ private TabletLocationState getTabletLocationState(Connector c, String tableId)
     ClientContext context = new ClientContext(getConnectionInfo());
     try (MetaDataTableScanner s = new MetaDataTableScanner(context,
         new Range(KeyExtent.getMetadataEntry(Table.ID.of(tableId), null)))) {
-      TabletLocationState tlState = s.next();
-      return tlState;
+      return s.next();
     }
   }
 }
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/NativeMapIT.java b/test/src/main/java/org/apache/accumulo/test/functional/NativeMapIT.java
index f19e77767d..70a7a4b73c 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/NativeMapIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/NativeMapIT.java
@@ -69,9 +69,8 @@ private Value newValue(int v) {
 
   public static File nativeMapLocation() {
     File projectDir = new File(System.getProperty("user.dir")).getParentFile();
-    File nativeMapDir = new File(projectDir, "server/native/target/accumulo-native-"
-        + Constants.VERSION + "/accumulo-native-" + Constants.VERSION);
-    return nativeMapDir;
+    return new File(projectDir, "server/native/target/accumulo-native-" + Constants.VERSION
+        + "/accumulo-native-" + Constants.VERSION);
   }
 
   @BeforeClass
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ScanRangeIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ScanRangeIT.java
index e0fd12d21d..36ebdf1886 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ScanRangeIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ScanRangeIT.java
@@ -213,18 +213,15 @@ private void scanRange(Connector c, String table, IntKey ik1, boolean inclusive1
   }
 
   private static Text createCF(int cf) {
-    Text tcf = new Text(String.format("cf_%03d", cf));
-    return tcf;
+    return new Text(String.format("cf_%03d", cf));
   }
 
   private static Text createCQ(int cf) {
-    Text tcf = new Text(String.format("cq_%03d", cf));
-    return tcf;
+    return new Text(String.format("cq_%03d", cf));
   }
 
   private static Text createRow(int row) {
-    Text trow = new Text(String.format("r_%06d", row));
-    return trow;
+    return new Text(String.format("r_%06d", row));
   }
 
   private void insertData(Connector c, String table) throws Exception {
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/SummaryIT.java b/test/src/main/java/org/apache/accumulo/test/functional/SummaryIT.java
index 50ff90e848..66d3689da8 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/SummaryIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/SummaryIT.java
@@ -99,9 +99,7 @@ private LongSummaryStatistics getTimestampStats(final String table, Connector c)
       throws TableNotFoundException {
     try (Scanner scanner = c.createScanner(table, Authorizations.EMPTY)) {
       Stream<Entry<Key,Value>> stream = StreamSupport.stream(scanner.spliterator(), false);
-      LongSummaryStatistics stats = stream.mapToLong(e -> e.getKey().getTimestamp())
-          .summaryStatistics();
-      return stats;
+      return stream.mapToLong(e -> e.getKey().getTimestamp()).summaryStatistics();
     }
   }
 
@@ -110,9 +108,7 @@ private LongSummaryStatistics getTimestampStats(final String table, Connector c,
     try (Scanner scanner = c.createScanner(table, Authorizations.EMPTY)) {
       scanner.setRange(new Range(startRow, false, endRow, true));
       Stream<Entry<Key,Value>> stream = StreamSupport.stream(scanner.spliterator(), false);
-      LongSummaryStatistics stats = stream.mapToLong(e -> e.getKey().getTimestamp())
-          .summaryStatistics();
-      return stats;
+      return stream.mapToLong(e -> e.getKey().getTimestamp()).summaryStatistics();
     }
   }
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services