bookkeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhai...@apache.org
Subject [bookkeeper] branch master updated: Issue 223: Code cleanups
Date Tue, 04 Jul 2017 04:14:58 GMT
This is an automated email from the ASF dual-hosted git repository.

zhaijia pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new 21366fe  Issue 223: Code cleanups
21366fe is described below

commit 21366fee0e43e69591a03d7b517cf66dff2861d9
Author: sigee <sigee15@gmail.com>
AuthorDate: Tue Jul 4 12:14:11 2017 +0800

    Issue 223: Code cleanups
    
    Descriptions of the changes in this PR:
    
    There are some different kind of cleanups by commits. To make the code more readeable and improve code quality and improve performance in some cases.
    E.g.:
     - Remove unnecessary semicolons
     - Remove unused/unneeded/duplicated imports
    - Replace l to L in long literals
    - Remove boxing on an already boxed value
    - Replace iterations to bulk operations
    
    Author: sigee <sigee15@gmail.com>
    
    Reviewers: Enrico Olivelli <None>, Jia Zhai <None>, Sijie Guo <None>
    
    This closes #217 from sigee/cleanups
---
 .../benchmark/BenchThroughputLatency.java          |  2 --
 .../org/apache/bookkeeper/bookie/BookieShell.java  | 10 ---------
 .../java/org/apache/bookkeeper/bookie/Cookie.java  |  2 +-
 .../org/apache/bookkeeper/bookie/FileInfo.java     |  2 +-
 .../bookkeeper/bookie/FileSystemUpgrade.java       | 11 ++-------
 .../apache/bookkeeper/bookie/ReadOnlyFileInfo.java |  7 ------
 .../apache/bookkeeper/client/BookKeeperAdmin.java  |  3 +--
 .../apache/bookkeeper/client/BookieInfoReader.java |  6 ++---
 .../org/apache/bookkeeper/client/LedgerHandle.java |  2 +-
 .../bookkeeper/client/TryReadLastConfirmedOp.java  |  2 --
 .../bookkeeper/client/WeightedRandomSelection.java |  1 -
 .../bookkeeper/conf/ServerConfiguration.java       |  2 +-
 .../bookkeeper/meta/FlatLedgerManagerFactory.java  |  2 +-
 .../org/apache/bookkeeper/meta/LedgerLayout.java   |  1 -
 .../meta/LegacyHierarchicalLedgerManager.java      |  4 ----
 .../meta/LongHierarchicalLedgerManager.java        |  1 -
 .../bookkeeper/meta/LongZkLedgerIdGenerator.java   |  8 +++----
 .../bookkeeper/meta/ZkLedgerIdGenerator.java       |  1 -
 .../meta/ZkLedgerUnderreplicationManager.java      |  3 +--
 .../bookkeeper/metastore/MSWatchedEvent.java       |  2 +-
 .../org/apache/bookkeeper/proto/BookieClient.java  |  2 +-
 .../apache/bookkeeper/proto/BookieNettyServer.java |  2 +-
 .../bookkeeper/proto/PerChannelBookieClient.java   |  1 -
 .../org/apache/bookkeeper/replication/Auditor.java |  1 -
 .../bookkeeper/replication/AuditorElector.java     |  1 -
 .../bookkeeper/replication/AutoRecoveryMain.java   |  2 --
 .../org/apache/bookkeeper/util/EntryFormatter.java |  2 --
 .../bookkeeper/util/HexDumpEntryFormatter.java     |  2 +-
 .../java/org/apache/bookkeeper/util/IOUtils.java   |  1 -
 .../bookkeeper/util/StringEntryFormatter.java      |  4 +---
 .../java/org/apache/bookkeeper/util/ZkUtils.java   |  3 +--
 .../util/collections/ConcurrentLongHashMap.java    |  2 +-
 .../util/collections/ConcurrentLongHashSet.java    |  2 +-
 .../collections/ConcurrentLongLongHashMap.java     |  2 +-
 .../collections/ConcurrentLongLongPairHashMap.java |  2 +-
 .../util/collections/ConcurrentOpenHashMap.java    |  2 +-
 .../util/collections/ConcurrentOpenHashSet.java    |  2 +-
 .../java/org/apache/bookkeeper/auth/TestAuth.java  |  1 -
 .../apache/bookkeeper/bookie/BookieAccessor.java   |  1 -
 .../bookie/BookieInitializationTest.java           |  2 +-
 .../bookkeeper/bookie/BookieJournalTest.java       |  3 ---
 .../apache/bookkeeper/bookie/CompactionTest.java   | 12 +++++-----
 .../bookie/EnableZkSecurityBasicTest.java          |  5 ++---
 .../bookkeeper/bookie/IndexCorruptionTest.java     |  4 ++--
 .../bookie/TestGcOverreplicatedLedger.java         |  4 +---
 .../bookkeeper/client/BookKeeperCloseTest.java     |  4 +---
 .../apache/bookkeeper/client/BookKeeperTest.java   | 16 ++++++-------
 .../bookkeeper/client/BookieRecoveryTest.java      |  8 +++----
 .../client/GenericEnsemblePlacementPolicyTest.java |  8 +++----
 .../apache/bookkeeper/client/LedgerCloseTest.java  |  1 -
 .../apache/bookkeeper/client/ListLedgersTest.java  |  2 --
 .../client/ParallelLedgerRecoveryTest.java         |  1 -
 .../client/TestAddEntryQuorumTimeout.java          |  1 -
 .../bookkeeper/client/TestBookieWatcher.java       |  1 -
 .../client/TestGetBookieInfoTimeout.java           |  2 +-
 .../apache/bookkeeper/client/TestReadTimeout.java  |  8 ++-----
 .../TestRegionAwareEnsemblePlacementPolicy.java    |  2 --
 .../bookkeeper/client/UpdateLedgerOpTest.java      |  2 +-
 .../bookkeeper/proto/NetworkLessBookieTest.java    |  4 ++--
 .../proto/TestPerChannelBookieClient.java          |  1 -
 .../replication/AuditorLedgerCheckerTest.java      |  2 +-
 .../replication/AuthAutoRecoveryTest.java          |  1 -
 .../bookkeeper/sasl/GSSAPIBookKeeperTest.java      |  2 +-
 .../bookkeeper/sasl/MD5DigestBookKeeperTest.java   |  2 +-
 .../apache/bookkeeper/test/AsyncLedgerOpsTest.java |  2 +-
 .../bookkeeper/test/BookKeeperClusterTestCase.java |  4 ++--
 .../apache/bookkeeper/test/BookieClientTest.java   |  2 +-
 .../bookkeeper/test/BookieJournalRollingTest.java  |  2 +-
 .../bookkeeper/test/BookieReadWriteTest.java       | 10 ++++-----
 .../apache/bookkeeper/test/BookieZKExpireTest.java |  5 -----
 .../apache/bookkeeper/test/ConditionalSetTest.java | 10 ---------
 .../apache/bookkeeper/test/TestBackwardCompat.java |  2 +-
 .../org/apache/bookkeeper/test/ZooKeeperUtil.java  |  1 -
 .../org/apache/bookkeeper/util/TestZkUtils.java    |  6 ++---
 .../collections/ConcurrentLongHashMapTest.java     |  6 ++---
 .../collections/ConcurrentLongHashSetTest.java     | 14 ++++++------
 .../collections/ConcurrentLongLongHashMapTest.java | 18 +++++++--------
 .../collections/ConcurrentOpenHashMapTest.java     | 26 +++++++++++-----------
 .../collections/ConcurrentOpenHashSetTest.java     | 14 ++++++------
 .../bookkeeper/stats/CodahaleMetricsProvider.java  |  3 ---
 80 files changed, 117 insertions(+), 213 deletions(-)

diff --git a/bookkeeper-benchmark/src/main/java/org/apache/bookkeeper/benchmark/BenchThroughputLatency.java b/bookkeeper-benchmark/src/main/java/org/apache/bookkeeper/benchmark/BenchThroughputLatency.java
index b121944..71e76b6 100644
--- a/bookkeeper-benchmark/src/main/java/org/apache/bookkeeper/benchmark/BenchThroughputLatency.java
+++ b/bookkeeper-benchmark/src/main/java/org/apache/bookkeeper/benchmark/BenchThroughputLatency.java
@@ -23,9 +23,7 @@ import java.io.BufferedOutputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
-import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.Random;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.Semaphore;
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java
index 750aeaa..3fc9d25 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java
@@ -43,15 +43,12 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.bookkeeper.bookie.BookieException.InvalidCookieException;
 import org.apache.bookkeeper.bookie.EntryLogger.EntryLogScanner;
 import org.apache.bookkeeper.bookie.Journal.JournalScanner;
-import org.apache.bookkeeper.bookie.Journal;
 import org.apache.bookkeeper.client.BKException;
-import org.apache.bookkeeper.client.BookieInfoReader;
 import org.apache.bookkeeper.client.BookieInfoReader.BookieInfo;
 import org.apache.bookkeeper.client.BookKeeper;
 import org.apache.bookkeeper.client.BookKeeper.DigestType;
@@ -68,10 +65,7 @@ import org.apache.bookkeeper.meta.LedgerManager.LedgerRangeIterator;
 import org.apache.bookkeeper.meta.LedgerManagerFactory;
 import org.apache.bookkeeper.meta.LedgerUnderreplicationManager;
 import org.apache.bookkeeper.net.BookieSocketAddress;
-import org.apache.bookkeeper.proto.BookieClient;
-import org.apache.bookkeeper.proto.BookkeeperProtocol;
 import org.apache.bookkeeper.proto.BookkeeperInternalCallbacks.GenericCallback;
-import org.apache.bookkeeper.proto.BookkeeperInternalCallbacks.GetBookieInfoCallback;
 import org.apache.bookkeeper.replication.AuditorElector;
 import org.apache.bookkeeper.util.EntryFormatter;
 import org.apache.bookkeeper.util.IOUtils;
@@ -86,13 +80,10 @@ import org.apache.commons.cli.HelpFormatter;
 import org.apache.commons.cli.MissingArgumentException;
 import org.apache.commons.cli.Options;
 import org.apache.commons.cli.ParseException;
-import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.configuration.CompositeConfiguration;
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.HexDump;
-import org.apache.commons.io.output.ByteArrayOutputStream;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.mutable.MutableBoolean;
 import org.apache.zookeeper.KeeperException;
@@ -103,7 +94,6 @@ import org.slf4j.LoggerFactory;
 import com.google.common.collect.Lists;
 import com.google.common.util.concurrent.AbstractFuture;
 
-import javax.sql.rowset.serial.SerialRef;
 
 /**
  * Bookie Shell is to provide utilities for users to administer a bookkeeper cluster.
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Cookie.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Cookie.java
index b1aa2dc..c758195 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Cookie.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Cookie.java
@@ -125,7 +125,7 @@ class Cookie {
     }
 
     private boolean verifyLedgerDirs(Cookie c, boolean checkIfSuperSet) {
-        if (checkIfSuperSet == false) {
+        if (!checkIfSuperSet) {
             return ledgerDirs.equals(c.ledgerDirs);
         } else {
             return isSuperSet(decodeDirPathFromCookie(ledgerDirs), decodeDirPathFromCookie(c.ledgerDirs));
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileInfo.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileInfo.java
index 2f4282e..5aeb385 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileInfo.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileInfo.java
@@ -438,7 +438,7 @@ class FileInfo {
         if (parent.exists()) {
             return;
         }
-        if (parent.mkdirs() == false) {
+        if (!parent.mkdirs()) {
             throw new IOException("Counldn't mkdirs for " + parent);
         }
     }
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileSystemUpgrade.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileSystemUpgrade.java
index 2b8d325..bd8837c 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileSystemUpgrade.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileSystemUpgrade.java
@@ -44,12 +44,7 @@ import java.net.MalformedURLException;
 import java.io.File;
 import java.io.FilenameFilter;
 import java.io.IOException;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Scanner;
-import java.util.NoSuchElementException;
+import java.util.*;
 
 import static com.google.common.base.Charsets.UTF_8;
 
@@ -100,9 +95,7 @@ public class FileSystemUpgrade {
     private static List<File> getAllDirectories(ServerConfiguration conf) {
         List<File> dirs = new ArrayList<File>();
         dirs.addAll(Lists.newArrayList(conf.getJournalDirs()));
-        for (File d: conf.getLedgerDirs()) {
-            dirs.add(d);
-        }
+        Collections.addAll(dirs, conf.getLedgerDirs());
         return dirs;
     }
 
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ReadOnlyFileInfo.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ReadOnlyFileInfo.java
index 0040fa6..7e9885c 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ReadOnlyFileInfo.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ReadOnlyFileInfo.java
@@ -23,13 +23,6 @@ package org.apache.bookkeeper.bookie;
 
 import java.io.File;
 import java.io.IOException;
-import java.io.RandomAccessFile;
-import java.nio.ByteBuffer;
-import java.nio.BufferUnderflowException;
-import java.nio.channels.FileChannel;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * Provide a readonly file info.
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeperAdmin.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeperAdmin.java
index 634d553..16d39ce 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeperAdmin.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeperAdmin.java
@@ -474,7 +474,7 @@ public class BookKeeperAdmin implements AutoCloseable {
 
         // Wait for the async method to complete.
         synchronized (sync) {
-            while (sync.value == false) {
+            while (!sync.value) {
                 sync.wait();
             }
         }
@@ -520,7 +520,6 @@ public class BookKeeperAdmin implements AutoCloseable {
                 getAvailableBookies(bookieSrc, bookieDest, cb, context);
             }
 
-            ;
         }, null);
     }
 
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookieInfoReader.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookieInfoReader.java
index 823e649..da66848 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookieInfoReader.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookieInfoReader.java
@@ -123,7 +123,7 @@ public class BookieInfoReader {
      */
     @SuppressWarnings("unchecked")
     void getReadWriteBookieInfo(Collection<BookieSocketAddress> newBookiesList) {
-        if (instanceRunning.get() == false) {
+        if (!instanceRunning.get()) {
             instanceRunning.compareAndSet(false, true);
         } else {
             isQueued.set(true);
@@ -164,9 +164,7 @@ public class BookieInfoReader {
                     bookieInfoMap.remove(b);
                     this.bookies.remove(b);
                 }
-                for (BookieSocketAddress b : joinedBookies) {
-                    this.bookies.add(b);
-                }
+                this.bookies.addAll(joinedBookies);
             } else {
                 joinedBookies = this.bookies = newBookiesList;
             }
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java
index 9a96078..bd6c7d6 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java
@@ -475,7 +475,7 @@ public class LedgerHandle implements AutoCloseable {
                     public String toString() {
                         return String.format("WriteLedgerConfigForClose(%d)", ledgerId);
                     }
-                };
+                }
 
                 writeLedgerConfig(new CloseCb());
 
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/TryReadLastConfirmedOp.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/TryReadLastConfirmedOp.java
index c896e93..ff07575 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/TryReadLastConfirmedOp.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/TryReadLastConfirmedOp.java
@@ -26,8 +26,6 @@ import org.slf4j.LoggerFactory;
 
 import io.netty.buffer.ByteBuf;
 
-import java.util.List;
-
 /**
  * This op is try to read last confirmed without involving quorum coverage checking.
  * Use {@link ReadLastConfirmedOp} if you need quorum coverage checking.
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/WeightedRandomSelection.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/WeightedRandomSelection.java
index 980bcd7..f185e11 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/WeightedRandomSelection.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/WeightedRandomSelection.java
@@ -28,7 +28,6 @@ import java.util.TreeMap;
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
-import org.apache.bookkeeper.client.BookieInfoReader.BookieInfo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ServerConfiguration.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ServerConfiguration.java
index 28952f2..b4dd066 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ServerConfiguration.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ServerConfiguration.java
@@ -1713,7 +1713,7 @@ public class ServerConfiguration extends AbstractConfiguration {
     public String getLedgerStorageClass() {
         String ledgerStorageClass = getString(LEDGER_STORAGE_CLASS, SortedLedgerStorage.class.getName());
         if (ledgerStorageClass.equals(SortedLedgerStorage.class.getName())
-                && getSortedLedgerStorageEnabled() == false) {
+                && !getSortedLedgerStorageEnabled()) {
             // This is to retain compatibility with BK-4.3 configuration
             // In BK-4.3, the ledger storage is configured through the "sortedLedgerStorageEnabled" flag :
             // sortedLedgerStorageEnabled == true (default) ---> use SortedLedgerStorage
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/FlatLedgerManagerFactory.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/FlatLedgerManagerFactory.java
index 7c64fec..33a46c6 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/FlatLedgerManagerFactory.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/FlatLedgerManagerFactory.java
@@ -90,7 +90,7 @@ public class FlatLedgerManagerFactory extends LedgerManagerFactory {
             String ledgersRootPath = conf.getZkLedgersRootPath();
             List<String> children = zk.getChildren(ledgersRootPath, false);
             for (String child : children) {
-                if (ledgerManager.isSpecialZnode(child)) {
+                if (FlatLedgerManager.isSpecialZnode(child)) {
                     continue;
                 }
                 ZKUtil.deleteRecursive(zk, ledgersRootPath + "/" + child);
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LedgerLayout.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LedgerLayout.java
index 5bca733..730e288 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LedgerLayout.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LedgerLayout.java
@@ -24,7 +24,6 @@ import java.util.List;
 import org.apache.bookkeeper.util.BookKeeperConstants;
 import org.apache.zookeeper.CreateMode;
 import org.apache.zookeeper.KeeperException;
-import org.apache.zookeeper.ZooDefs.Ids;
 import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.data.ACL;
 
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LegacyHierarchicalLedgerManager.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LegacyHierarchicalLedgerManager.java
index 8be23b2..60c44f7 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LegacyHierarchicalLedgerManager.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LegacyHierarchicalLedgerManager.java
@@ -23,9 +23,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.NavigableSet;
 import java.util.NoSuchElementException;
-import java.util.TreeSet;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.bookkeeper.conf.AbstractConfiguration;
 import org.apache.bookkeeper.proto.BookkeeperInternalCallbacks.Processor;
@@ -33,7 +30,6 @@ import org.apache.bookkeeper.util.StringUtils;
 import org.apache.bookkeeper.util.ZkUtils;
 import org.apache.zookeeper.AsyncCallback;
 import org.apache.zookeeper.KeeperException;
-import org.apache.zookeeper.KeeperException.Code;
 import org.apache.zookeeper.ZooKeeper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LongHierarchicalLedgerManager.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LongHierarchicalLedgerManager.java
index f8f7546..b01886e 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LongHierarchicalLedgerManager.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LongHierarchicalLedgerManager.java
@@ -24,7 +24,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.NavigableSet;
 import java.util.NoSuchElementException;
-import java.util.TreeSet;
 
 import org.apache.bookkeeper.conf.AbstractConfiguration;
 import org.apache.bookkeeper.proto.BookkeeperInternalCallbacks.Processor;
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LongZkLedgerIdGenerator.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LongZkLedgerIdGenerator.java
index c3a62cf..f410744 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LongZkLedgerIdGenerator.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/LongZkLedgerIdGenerator.java
@@ -19,9 +19,7 @@ package org.apache.bookkeeper.meta;
 
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Formatter;
 import java.util.List;
-import java.util.Locale;
 import java.util.Optional;
 
 import org.apache.bookkeeper.client.BKException;
@@ -70,7 +68,7 @@ public class LongZkLedgerIdGenerator implements LedgerIdGenerator {
         UNKNOWN,
         PRESENT,
         NOT_PRESENT
-    };
+    }
 
     public LongZkLedgerIdGenerator(ZooKeeper zk, String ledgersPath, String idGenZnodeName, ZkLedgerIdGenerator shortIdGen, List<ACL> zkAcls) {
         this.zk = zk;
@@ -91,8 +89,8 @@ public class LongZkLedgerIdGenerator implements LedgerIdGenerator {
             @Override
             public void operationComplete(int rc, Long result) {
                 if(rc == BKException.Code.OK) {
-                    assert((highBits & 0xFFFFFFFF00000000l) == 0);
-                    assert((result & 0xFFFFFFFF00000000l) == 0);
+                    assert((highBits & 0xFFFFFFFF00000000L) == 0);
+                    assert((result & 0xFFFFFFFF00000000L) == 0);
                     cb.operationComplete(rc, (highBits << 32) | result);
                 }
                 else if(rc == BKException.Code.LedgerIdOverflowException) {
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/ZkLedgerIdGenerator.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/ZkLedgerIdGenerator.java
index ba2bce1..03e471c 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/ZkLedgerIdGenerator.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/ZkLedgerIdGenerator.java
@@ -28,7 +28,6 @@ import org.apache.zookeeper.AsyncCallback;
 import org.apache.zookeeper.AsyncCallback.StringCallback;
 import org.apache.zookeeper.CreateMode;
 import org.apache.zookeeper.KeeperException;
-import org.apache.zookeeper.ZooDefs.Ids;
 import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.data.ACL;
 import org.slf4j.Logger;
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/ZkLedgerUnderreplicationManager.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/ZkLedgerUnderreplicationManager.java
index e986317..e9d48f3 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/ZkLedgerUnderreplicationManager.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/ZkLedgerUnderreplicationManager.java
@@ -49,7 +49,6 @@ import org.apache.zookeeper.CreateMode;
 import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.WatchedEvent;
 import org.apache.zookeeper.Watcher;
-import org.apache.zookeeper.ZooDefs.Ids;
 import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.data.Stat;
 import org.slf4j.Logger;
@@ -93,7 +92,7 @@ public class ZkLedgerUnderreplicationManager implements LedgerUnderreplicationMa
 
         String getLockZNode() { return lockZNode; }
         int getLedgerZNodeVersion() { return ledgerZNodeVersion; }
-    };
+    }
     private final Map<Long, Lock> heldLocks = new ConcurrentHashMap<Long, Lock>();
     private final Pattern idExtractionPattern;
 
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/metastore/MSWatchedEvent.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/metastore/MSWatchedEvent.java
index 1823878..d97112c 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/metastore/MSWatchedEvent.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/metastore/MSWatchedEvent.java
@@ -18,7 +18,7 @@
 package org.apache.bookkeeper.metastore;
 
 public class MSWatchedEvent {
-    public enum EventType {CHANGED, REMOVED};
+    public enum EventType {CHANGED, REMOVED}
     
     String key;
     EventType type;
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieClient.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieClient.java
index b25a3b8..1376048 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieClient.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieClient.java
@@ -32,7 +32,6 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import org.apache.bookkeeper.auth.AuthProviderFactoryFactory;
 import org.apache.bookkeeper.auth.ClientAuthProvider;
-import com.google.common.util.concurrent.ThreadFactoryBuilder;
 import org.apache.bookkeeper.client.BKException;
 import org.apache.bookkeeper.client.BookieInfoReader.BookieInfo;
 import org.apache.bookkeeper.conf.ClientConfiguration;
@@ -51,6 +50,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.Lists;
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
 import com.google.protobuf.ExtensionRegistry;
 
 import io.netty.buffer.ByteBuf;
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieNettyServer.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieNettyServer.java
index 22c3cff..c1114bb 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieNettyServer.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieNettyServer.java
@@ -257,7 +257,7 @@ class BookieNettyServer {
                     pipeline.addLast("lengthprepender", new LengthFieldPrepender(4));
 
                     pipeline.addLast("bookieProtoDecoder", new BookieProtoEncoding.RequestDecoder(registry));
-                    pipeline.addLast("bookieProtoEncoder", new BookieProtoEncoding.ResponseEncoder(registry));;
+                    pipeline.addLast("bookieProtoEncoder", new BookieProtoEncoding.ResponseEncoder(registry));
                     pipeline.addLast("bookieAuthHandler", new AuthHandler.ServerSideHandler(contextHandler.getConnectionPeer(), authProviderFactory));
 
                     ChannelInboundHandler requestHandler = isRunning.get()
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java
index 3905083..2ec567b 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java
@@ -97,7 +97,6 @@ import org.apache.bookkeeper.stats.StatsLogger;
 import org.apache.bookkeeper.util.MathUtils;
 import org.apache.bookkeeper.util.OrderedSafeExecutor;
 import org.apache.bookkeeper.util.SafeRunnable;
-import org.apache.commons.lang.SystemUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java
index 9e7d034..3df941f 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java
@@ -43,7 +43,6 @@ import org.apache.bookkeeper.replication.ReplicationException.CompatibilityExcep
 import org.apache.bookkeeper.replication.ReplicationException.UnavailableException;
 import org.apache.bookkeeper.replication.ReplicationStats;
 import org.apache.bookkeeper.stats.Counter;
-import org.apache.bookkeeper.stats.NullStatsLogger;
 import org.apache.bookkeeper.stats.OpStatsLogger;
 import org.apache.bookkeeper.stats.StatsLogger;
 import org.apache.bookkeeper.zookeeper.ZooKeeperClient;
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/AuditorElector.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/AuditorElector.java
index b396e89..4dde544 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/AuditorElector.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/AuditorElector.java
@@ -48,7 +48,6 @@ import org.apache.zookeeper.Watcher;
 import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.Watcher.Event.EventType;
 import org.apache.zookeeper.Watcher.Event.KeeperState;
-import org.apache.zookeeper.ZooDefs.Ids;
 import com.google.protobuf.TextFormat;
 import static com.google.common.base.Charsets.UTF_8;
 
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/AutoRecoveryMain.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/AutoRecoveryMain.java
index 3039470..19ccd85 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/AutoRecoveryMain.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/AutoRecoveryMain.java
@@ -36,9 +36,7 @@ import org.apache.bookkeeper.replication.ReplicationException.CompatibilityExcep
 import org.apache.bookkeeper.replication.ReplicationException.UnavailableException;
 import org.apache.bookkeeper.stats.NullStatsLogger;
 import org.apache.bookkeeper.stats.StatsLogger;
-import org.apache.bookkeeper.util.ZkUtils;
 import org.apache.bookkeeper.zookeeper.ZooKeeperClient;
-import org.apache.bookkeeper.zookeeper.ZooKeeperWatcherBase;
 import org.apache.commons.cli.BasicParser;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.HelpFormatter;
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/EntryFormatter.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/EntryFormatter.java
index 1549a9f..8ad0e12 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/EntryFormatter.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/EntryFormatter.java
@@ -21,8 +21,6 @@
 
 package org.apache.bookkeeper.util;
 
-import java.io.IOException;
-
 import org.apache.commons.configuration.Configuration;
 
 import org.slf4j.Logger;
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/HexDumpEntryFormatter.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/HexDumpEntryFormatter.java
index e51e2a8..d900e60 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/HexDumpEntryFormatter.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/HexDumpEntryFormatter.java
@@ -50,4 +50,4 @@ public class HexDumpEntryFormatter extends EntryFormatter {
         }
     }
 
-};
+}
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/IOUtils.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/IOUtils.java
index 0ecbf57..de99181 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/IOUtils.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/IOUtils.java
@@ -25,7 +25,6 @@ import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.nio.channels.WritableByteChannel;
 
-import org.apache.commons.io.FileUtils;
 import org.slf4j.Logger;
 
 /**
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/StringEntryFormatter.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/StringEntryFormatter.java
index 43a5fc9..d76bc20 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/StringEntryFormatter.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/StringEntryFormatter.java
@@ -23,8 +23,6 @@ package org.apache.bookkeeper.util;
 
 import java.io.IOException;
 
-import org.apache.commons.configuration.Configuration;
-
 import com.google.protobuf.ByteString;
 
 public class StringEntryFormatter extends EntryFormatter {
@@ -44,4 +42,4 @@ public class StringEntryFormatter extends EntryFormatter {
         }
     }
 
-};
+}
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/ZkUtils.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/ZkUtils.java
index a12ba40..440a69a 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/ZkUtils.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/ZkUtils.java
@@ -38,7 +38,6 @@ import org.apache.zookeeper.KeeperException.Code;
 import org.apache.zookeeper.ZooDefs;
 import org.apache.zookeeper.data.ACL;
 import org.apache.zookeeper.ZooKeeper;
-import org.apache.zookeeper.data.ACL;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -241,7 +240,7 @@ public class ZkUtils {
         });
 
         synchronized (ctx) {
-            while (ctx.done == false) {
+            while (!ctx.done) {
                 ctx.wait();
             }
         }
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentLongHashMap.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentLongHashMap.java
index 63603cb..b78eb5f 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentLongHashMap.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentLongHashMap.java
@@ -474,7 +474,7 @@ public class ConcurrentLongHashMap<V> {
         }
     }
 
-    private static final long HashMixer = 0xc6a4a7935bd1e995l;
+    private static final long HashMixer = 0xc6a4a7935bd1e995L;
     private static final int R = 47;
 
     static final long hash(long key) {
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentLongHashSet.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentLongHashSet.java
index d02b0bc..d9c67f3 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentLongHashSet.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentLongHashSet.java
@@ -395,7 +395,7 @@ public class ConcurrentLongHashSet {
         }
     }
 
-    private static final long HashMixer = 0xc6a4a7935bd1e995l;
+    private static final long HashMixer = 0xc6a4a7935bd1e995L;
     private static final int R = 47;
 
     final static long hash(long key) {
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongHashMap.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongHashMap.java
index 7b5b5c2..12a3d76 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongHashMap.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongHashMap.java
@@ -697,7 +697,7 @@ public class ConcurrentLongLongHashMap {
         }
     }
 
-    private static final long HashMixer = 0xc6a4a7935bd1e995l;
+    private static final long HashMixer = 0xc6a4a7935bd1e995L;
     private static final int R = 47;
 
     final static long hash(long key) {
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongPairHashMap.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongPairHashMap.java
index 7677735..13a7529 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongPairHashMap.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongPairHashMap.java
@@ -488,7 +488,7 @@ public class ConcurrentLongLongPairHashMap {
         }
     }
 
-    private static final long HashMixer = 0xc6a4a7935bd1e995l;
+    private static final long HashMixer = 0xc6a4a7935bd1e995L;
     private static final int R = 47;
 
     final static long hash(long key1, long key2) {
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentOpenHashMap.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentOpenHashMap.java
index 90fc548..fe9612c 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentOpenHashMap.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentOpenHashMap.java
@@ -473,7 +473,7 @@ public class ConcurrentOpenHashMap<K, V> {
         }
     }
 
-    private static final long HashMixer = 0xc6a4a7935bd1e995l;
+    private static final long HashMixer = 0xc6a4a7935bd1e995L;
     private static final int R = 47;
 
     final static <K> long hash(K key) {
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentOpenHashSet.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentOpenHashSet.java
index 99a552d..a056a17 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentOpenHashSet.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentOpenHashSet.java
@@ -396,7 +396,7 @@ public class ConcurrentOpenHashSet<V> {
         }
     }
 
-    private static final long HashMixer = 0xc6a4a7935bd1e995l;
+    private static final long HashMixer = 0xc6a4a7935bd1e995L;
     private static final int R = 47;
 
     final static <K> long hash(K key) {
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/auth/TestAuth.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/auth/TestAuth.java
index f499ad3..878422c 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/auth/TestAuth.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/auth/TestAuth.java
@@ -34,7 +34,6 @@ import org.apache.bookkeeper.client.LedgerHandle;
 import org.apache.bookkeeper.conf.ClientConfiguration;
 import org.apache.bookkeeper.conf.ServerConfiguration;
 import org.apache.bookkeeper.proto.BookieServer;
-import org.apache.bookkeeper.proto.BookkeeperInternalCallbacks.GenericCallback;
 import org.apache.bookkeeper.test.BookKeeperClusterTestCase;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/BookieAccessor.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/BookieAccessor.java
index 07d810e..f49f8ae 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/BookieAccessor.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/BookieAccessor.java
@@ -21,7 +21,6 @@
 package org.apache.bookkeeper.bookie;
 
 import java.io.IOException;
-import java.util.concurrent.Future;
 
 import org.apache.bookkeeper.bookie.CheckpointSource.Checkpoint;
 
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/BookieInitializationTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/BookieInitializationTest.java
index b3e6ca9..278f08a 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/BookieInitializationTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/BookieInitializationTest.java
@@ -105,7 +105,7 @@ public class BookieInitializationTest extends BookKeeperClusterTestCase {
                 bookie.zk = zkc;
                 zkc.close();
                 return bookie;
-            };
+            }
         };
 
         bkServer.start();
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/BookieJournalTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/BookieJournalTest.java
index 711d38b..30062e9 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/BookieJournalTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/BookieJournalTest.java
@@ -20,9 +20,6 @@
  */
 package org.apache.bookkeeper.bookie;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.fail;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CompactionTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CompactionTest.java
index 3570775..0f22415 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CompactionTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/CompactionTest.java
@@ -534,9 +534,9 @@ public abstract class CompactionTest extends BookKeeperClusterTestCase {
         assertFalse("Log shouldnt exist", log0.exists());
         InterleavedLedgerStorage storage = new InterleavedLedgerStorage();
         storage.initialize(conf, manager, dirs, dirs, checkpointSource, NullStatsLogger.INSTANCE);
-        ledgers.add(1l);
-        ledgers.add(2l);
-        ledgers.add(3l);
+        ledgers.add(1L);
+        ledgers.add(2L);
+        ledgers.add(3L);
         storage.setMasterKey(1, KEY);
         storage.setMasterKey(2, KEY);
         storage.setMasterKey(3, KEY);
@@ -548,8 +548,8 @@ public abstract class CompactionTest extends BookKeeperClusterTestCase {
         storage.shutdown();
 
         assertTrue("Log should exist", log0.exists());
-        ledgers.remove(2l);
-        ledgers.remove(3l);
+        ledgers.remove(2L);
+        ledgers.remove(3L);
 
         storage = new InterleavedLedgerStorage();
         storage.initialize(conf, manager, dirs, dirs, checkpointSource, NullStatsLogger.INSTANCE);
@@ -563,7 +563,7 @@ public abstract class CompactionTest extends BookKeeperClusterTestCase {
         }
         assertFalse("Log shouldnt exist", log0.exists());
 
-        ledgers.add(4l);
+        ledgers.add(4L);
         storage.setMasterKey(4, KEY);
         storage.addEntry(genEntry(4, 1, ENTRY_SIZE)); // force ledger 1 page to flush
 
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/EnableZkSecurityBasicTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/EnableZkSecurityBasicTest.java
index 277801f..7d20395 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/EnableZkSecurityBasicTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/EnableZkSecurityBasicTest.java
@@ -33,7 +33,6 @@ import org.apache.zookeeper.data.ACL;
 import org.apache.zookeeper.data.Stat;
 import org.junit.AfterClass;
 import static org.junit.Assert.assertEquals;
-import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -86,8 +85,8 @@ public class EnableZkSecurityBasicTest extends BookKeeperClusterTestCase {
 
         conf.setZkEnableSecurity(true);
 
-        try (BookKeeper bkc = new BookKeeper(conf);) {
-            try (LedgerHandle lh = bkc.createLedger(1, 1, 1, BookKeeper.DigestType.CRC32, "testPasswd".getBytes());) {
+        try (BookKeeper bkc = new BookKeeper(conf)) {
+            try (LedgerHandle lh = bkc.createLedger(1, 1, 1, BookKeeper.DigestType.CRC32, "testPasswd".getBytes())) {
                 lh.addEntry("foo".getBytes(StandardCharsets.UTF_8));
             }
         }
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/IndexCorruptionTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/IndexCorruptionTest.java
index 151feae..4f2d58f 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/IndexCorruptionTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/IndexCorruptionTest.java
@@ -81,7 +81,7 @@ public class IndexCorruptionTest extends BookKeeperClusterTestCase {
         restartBookies();
 
         Enumeration<LedgerEntry> seq = wlh.readEntries(0, numMsgs - 1);
-        assertTrue("Enumeration of ledger entries has no element", seq.hasMoreElements() == true);
+        assertTrue("Enumeration of ledger entries has no element", seq.hasMoreElements());
         int entryId = 0;
         while (seq.hasMoreElements()) {
             LedgerEntry e = seq.nextElement();
@@ -139,7 +139,7 @@ public class IndexCorruptionTest extends BookKeeperClusterTestCase {
 
         numMsgs += 3;
         Enumeration<LedgerEntry> seq = lh2.readEntries(0, numMsgs - 1);
-        assertTrue("Enumeration of ledger entries has no element", seq.hasMoreElements() == true);
+        assertTrue("Enumeration of ledger entries has no element", seq.hasMoreElements());
         int entryId = 0;
         while (seq.hasMoreElements()) {
             LedgerEntry e = seq.nextElement();
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/TestGcOverreplicatedLedger.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/TestGcOverreplicatedLedger.java
index 2dae0b0..1b58c2b 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/TestGcOverreplicatedLedger.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/TestGcOverreplicatedLedger.java
@@ -231,9 +231,7 @@ public class TestGcOverreplicatedLedger extends LedgerManagerTestCase {
         }
         SortedMap<Long, ArrayList<BookieSocketAddress>> ensembles = ledgerMetadata.getEnsembles();
         for (ArrayList<BookieSocketAddress> fragmentEnsembles : ensembles.values()) {
-            for (BookieSocketAddress ensemble : fragmentEnsembles) {
-                allAddresses.remove(ensemble);
-            }
+            allAddresses.removeAll(fragmentEnsembles);
         }
         Assert.assertEquals(allAddresses.size(), 1);
         return allAddresses.get(0);
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperCloseTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperCloseTest.java
index 41a8ecd..5d5cc16 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperCloseTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperCloseTest.java
@@ -40,10 +40,8 @@ import org.slf4j.LoggerFactory;
 import com.google.common.util.concurrent.SettableFuture;
 
 import io.netty.buffer.ByteBuf;
-import io.netty.buffer.Unpooled;
 
 import java.io.IOException;
-import java.nio.ByteBuffer;
 import java.util.Enumeration;
 import java.util.Set;
 import java.util.concurrent.CountDownLatch;
@@ -470,7 +468,7 @@ public class BookKeeperCloseTest extends BookKeeperClusterTestCase {
     @Test(timeout = 60000)
     public void testBookKeeperAdmin() throws Exception {
         BookKeeper bk = new BookKeeper(baseClientConf, zkc);
-        try (BookKeeperAdmin bkadmin = new BookKeeperAdmin(bk);) {
+        try (BookKeeperAdmin bkadmin = new BookKeeperAdmin(bk)) {
 
             LOG.info("Create ledger and add entries to it");
             LedgerHandle lh1 = createLedgerWithEntries(bk, 100);
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperTest.java
index 9ec835d..ab22ef7 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookKeeperTest.java
@@ -297,10 +297,10 @@ public class BookKeeperTest extends BaseTestCase {
         ClientConfiguration conf = new ClientConfiguration()
                 .setZkServers(zkUtil.getZooKeeperConnectString());
         BookKeeper _bkc;
-        try (BookKeeper bkc = new BookKeeper(conf);) {
+        try (BookKeeper bkc = new BookKeeper(conf)) {
             _bkc = bkc;
             long ledgerId;
-            try (LedgerHandle lh = bkc.createLedger(digestType, "testPasswd".getBytes());) {
+            try (LedgerHandle lh = bkc.createLedger(digestType, "testPasswd".getBytes())) {
                 ledgerId = lh.getId();
                 for (int i = 0; i < 100; i++) {
                     lh.addEntry("foobar".getBytes());
@@ -441,7 +441,7 @@ public class BookKeeperTest extends BaseTestCase {
         ClientConfiguration clientConfiguration = new ClientConfiguration()
             .setZkServers(zkUtil.getZooKeeperConnectString());
 
-        try (BookKeeper bkWriter = new BookKeeper(clientConfiguration);) {
+        try (BookKeeper bkWriter = new BookKeeper(clientConfiguration)) {
             LedgerHandle writeLh = bkWriter.createLedger(digestType, "testPasswd".getBytes());
             long ledgerId = writeLh.getId();
             int numOfEntries = 5;
@@ -450,7 +450,7 @@ public class BookKeeperTest extends BaseTestCase {
             }
 
             try (BookKeeper bkReader = new BookKeeper(clientConfiguration);
-                LedgerHandle rlh = bkReader.openLedgerNoRecovery(ledgerId, digestType, "testPasswd".getBytes());) {
+                LedgerHandle rlh = bkReader.openLedgerNoRecovery(ledgerId, digestType, "testPasswd".getBytes())) {
                 Assert.assertTrue(
                     "Expected LAC of rlh: " + (numOfEntries - 2) + " actual LAC of rlh: " + rlh.getLastAddConfirmed(),
                     (rlh.getLastAddConfirmed() == (numOfEntries - 2)));
@@ -471,7 +471,7 @@ public class BookKeeperTest extends BaseTestCase {
             }
 
             try (BookKeeper bkReader = new BookKeeper(clientConfiguration);
-                LedgerHandle rlh = bkReader.openLedgerNoRecovery(ledgerId, digestType, "testPasswd".getBytes());) {
+                LedgerHandle rlh = bkReader.openLedgerNoRecovery(ledgerId, digestType, "testPasswd".getBytes())) {
                 Assert.assertTrue(
                     "Expected LAC of rlh: " + (numOfEntries - 2) + " actual LAC of rlh: " + rlh.getLastAddConfirmed(),
                     (rlh.getLastAddConfirmed() == (numOfEntries - 2)));
@@ -538,7 +538,7 @@ public class BookKeeperTest extends BaseTestCase {
             restartBookies();
 
             try (BookKeeper bkReader = new BookKeeper(clientConfiguration);
-                LedgerHandle rlh = bkReader.openLedgerNoRecovery(ledgerId, digestType, "testPasswd".getBytes());) {
+                LedgerHandle rlh = bkReader.openLedgerNoRecovery(ledgerId, digestType, "testPasswd".getBytes())) {
                 Assert.assertTrue(
                     "Expected LAC of rlh: " + (numOfEntries - 2) + " actual LAC of rlh: " + rlh.getLastAddConfirmed(),
                     (rlh.getLastAddConfirmed() == (numOfEntries - 2)));
@@ -559,7 +559,7 @@ public class BookKeeperTest extends BaseTestCase {
             }
 
             try (BookKeeper bkReader = new BookKeeper(clientConfiguration);
-                LedgerHandle rlh = bkReader.openLedgerNoRecovery(ledgerId, digestType, "testPasswd".getBytes());) {
+                LedgerHandle rlh = bkReader.openLedgerNoRecovery(ledgerId, digestType, "testPasswd".getBytes())) {
                 Assert.assertTrue(
                     "Expected LAC of rlh: " + (numOfEntries - 2) + " actual LAC of rlh: " + rlh.getLastAddConfirmed(),
                     (rlh.getLastAddConfirmed() == (numOfEntries - 2)));
@@ -623,7 +623,7 @@ public class BookKeeperTest extends BaseTestCase {
 
             // open ledger with fencing, this will repair the ledger and make the last entry readable
             try (BookKeeper bkReader = new BookKeeper(clientConfiguration);
-                LedgerHandle rlh = bkReader.openLedger(ledgerId, digestType, "testPasswd".getBytes());) {
+                LedgerHandle rlh = bkReader.openLedger(ledgerId, digestType, "testPasswd".getBytes())) {
                 Assert.assertTrue(
                     "Expected LAC of rlh: " + (numOfEntries - 1) + " actual LAC of rlh: " + rlh.getLastAddConfirmed(),
                     (rlh.getLastAddConfirmed() == (numOfEntries - 1)));
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookieRecoveryTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookieRecoveryTest.java
index 3b307e1..b33cbfd 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookieRecoveryTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookieRecoveryTest.java
@@ -334,7 +334,7 @@ public class BookieRecoveryTest extends BookKeeperClusterTestCase {
 
         // Wait for the async method to complete.
         synchronized (sync) {
-            while (sync.value == false) {
+            while (!sync.value) {
                 sync.wait();
             }
             assertTrue(bookieRecoverCb.success);
@@ -391,7 +391,7 @@ public class BookieRecoveryTest extends BookKeeperClusterTestCase {
 
         // Wait for the async method to complete.
         synchronized (sync) {
-            while (sync.value == false) {
+            while (!sync.value) {
                 sync.wait();
             }
             assertTrue(bookieRecoverCb.success);
@@ -514,7 +514,7 @@ public class BookieRecoveryTest extends BookKeeperClusterTestCase {
         }
 
         long await() throws InterruptedException {
-            if (latch.await(60, TimeUnit.SECONDS) == false) {
+            if (!latch.await(60, TimeUnit.SECONDS)) {
                 LOG.warn("Didn't get all responses in verification");
                 return 0;
             } else {
@@ -593,7 +593,7 @@ public class BookieRecoveryTest extends BookKeeperClusterTestCase {
         });
 
         synchronized (syncObj) {
-            while (syncObj.value == false) {
+            while (!syncObj.value) {
                 syncObj.wait();
             }
         }
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/GenericEnsemblePlacementPolicyTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/GenericEnsemblePlacementPolicyTest.java
index e28a691..cc591aa 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/GenericEnsemblePlacementPolicyTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/GenericEnsemblePlacementPolicyTest.java
@@ -85,7 +85,7 @@ public class GenericEnsemblePlacementPolicyTest extends BookKeeperClusterTestCas
         try {
             Map<String, byte[]> customMetadata = new HashMap<>();
             customMetadata.put(property, value);
-            try (BookKeeper bk = new BookKeeper(baseClientConf, zkc);) {
+            try (BookKeeper bk = new BookKeeper(baseClientConf, zkc)) {
                 bk.createLedger(1, 1, 1, digestType, PASSWORD.getBytes(), customMetadata);
             }
             assertEquals(1, customMetadataOnNewEnsembleStack.size());
@@ -102,7 +102,7 @@ public class GenericEnsemblePlacementPolicyTest extends BookKeeperClusterTestCas
             startBKCluster();
             Map<String, byte[]> customMetadata = new HashMap<>();
             customMetadata.put(property, value);
-            try (BookKeeper bk = new BookKeeper(baseClientConf, zkc);) {
+            try (BookKeeper bk = new BookKeeper(baseClientConf, zkc)) {
                 bk.createLedger(1, 1, 1, digestType, PASSWORD.getBytes(), customMetadata);
                 fail("creation should fail");
             } catch (BKException.BKNotEnoughBookiesException bneb) {
@@ -122,8 +122,8 @@ public class GenericEnsemblePlacementPolicyTest extends BookKeeperClusterTestCas
         try {
             Map<String, byte[]> customMetadata = new HashMap<>();
             customMetadata.put(property, value);
-            try (BookKeeper bk = new BookKeeper(baseClientConf, zkc);) {
-                try (LedgerHandle lh = bk.createLedger(2, 2, 2, digestType, PASSWORD.getBytes(), customMetadata);) {
+            try (BookKeeper bk = new BookKeeper(baseClientConf, zkc)) {
+                try (LedgerHandle lh = bk.createLedger(2, 2, 2, digestType, PASSWORD.getBytes(), customMetadata)) {
                     lh.addEntry(value);
                     long lId = lh.getId();
                     ArrayList<BookieSocketAddress> ensembleAtFirstEntry = lh.getLedgerMetadata().getEnsemble(lId);
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/LedgerCloseTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/LedgerCloseTest.java
index 0c470a2..161826d 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/LedgerCloseTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/LedgerCloseTest.java
@@ -20,7 +20,6 @@ package org.apache.bookkeeper.client;
 import io.netty.buffer.ByteBuf;
 
 import java.io.IOException;
-import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/ListLedgersTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/ListLedgersTest.java
index 70ff6e0..8231ed8 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/ListLedgersTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/ListLedgersTest.java
@@ -23,8 +23,6 @@ import org.apache.bookkeeper.client.BookKeeper.DigestType;
 import org.apache.bookkeeper.conf.ClientConfiguration;
 import org.apache.bookkeeper.test.BaseTestCase;
 
-import org.apache.zookeeper.KeeperException;
-
 import org.junit.Assert;
 import org.junit.Test;
 import org.slf4j.Logger;
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/ParallelLedgerRecoveryTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/ParallelLedgerRecoveryTest.java
index 850a790..ba7e34f 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/ParallelLedgerRecoveryTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/ParallelLedgerRecoveryTest.java
@@ -22,7 +22,6 @@ package org.apache.bookkeeper.client;
 
 import static com.google.common.base.Charsets.UTF_8;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 import io.netty.buffer.ByteBuf;
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestAddEntryQuorumTimeout.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestAddEntryQuorumTimeout.java
index da62fe0..bfe7ce3 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestAddEntryQuorumTimeout.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestAddEntryQuorumTimeout.java
@@ -22,7 +22,6 @@ package org.apache.bookkeeper.client;
 
 import org.apache.bookkeeper.client.AsyncCallback.AddCallback;
 import org.apache.bookkeeper.client.BookKeeper.DigestType;
-import org.apache.bookkeeper.conf.ClientConfiguration;
 import org.apache.bookkeeper.net.BookieSocketAddress;
 import org.apache.bookkeeper.test.BookKeeperClusterTestCase;
 import org.junit.Assert;
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestBookieWatcher.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestBookieWatcher.java
index 9558ddc..f460a31 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestBookieWatcher.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestBookieWatcher.java
@@ -26,7 +26,6 @@ import java.util.concurrent.TimeUnit;
 
 import org.apache.bookkeeper.conf.ClientConfiguration;
 import org.apache.bookkeeper.test.BookKeeperClusterTestCase;
-import org.apache.bookkeeper.zookeeper.BoundExponentialBackoffRetryPolicy;
 import org.apache.bookkeeper.zookeeper.ZooKeeperClient;
 import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.WatchedEvent;
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestGetBookieInfoTimeout.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestGetBookieInfoTimeout.java
index 6ff1535..fbe50a1 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestGetBookieInfoTimeout.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestGetBookieInfoTimeout.java
@@ -115,7 +115,7 @@ public class TestGetBookieInfoTimeout extends BookKeeperClusterTestCase {
                 this.freeDiskSpace = 0L;
                 this.totalDiskCapacity = 0L;
             }
-        };
+        }
         CallbackObj obj = new CallbackObj(flags);
         bc.getBookieInfo(addr, flags, new GetBookieInfoCallback() {
             @Override
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestReadTimeout.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestReadTimeout.java
index 96c5fa8..4ee892c 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestReadTimeout.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestReadTimeout.java
@@ -63,9 +63,7 @@ public class TestReadTimeout extends BookKeeperClusterTestCase {
         }
         
         Set<BookieSocketAddress> beforeSet = new HashSet<BookieSocketAddress>();
-        for (BookieSocketAddress addr : writelh.getLedgerMetadata().getEnsemble(numEntries)) {
-            beforeSet.add(addr);
-        }
+        beforeSet.addAll(writelh.getLedgerMetadata().getEnsemble(numEntries));
 
         final BookieSocketAddress bookieToSleep
             = writelh.getLedgerMetadata().getEnsemble(numEntries).get(0);
@@ -84,9 +82,7 @@ public class TestReadTimeout extends BookKeeperClusterTestCase {
         Assert.assertTrue("Write request did not finish", completed.get());
 
         Set<BookieSocketAddress> afterSet = new HashSet<BookieSocketAddress>();
-        for (BookieSocketAddress addr : writelh.getLedgerMetadata().getEnsemble(numEntries + 1)) {
-            afterSet.add(addr);
-        }
+        afterSet.addAll(writelh.getLedgerMetadata().getEnsemble(numEntries + 1));
         beforeSet.removeAll(afterSet);
         Assert.assertTrue("Bookie set should not match", beforeSet.size() != 0);
     }
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRegionAwareEnsemblePlacementPolicy.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRegionAwareEnsemblePlacementPolicy.java
index 09c6262..26d7e6b 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRegionAwareEnsemblePlacementPolicy.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/TestRegionAwareEnsemblePlacementPolicy.java
@@ -32,7 +32,6 @@ import io.netty.util.HashedWheelTimer;
 
 import org.apache.bookkeeper.client.BKException.BKNotEnoughBookiesException;
 import org.apache.bookkeeper.conf.ClientConfiguration;
-import org.apache.bookkeeper.feature.Feature;
 import org.apache.bookkeeper.feature.FeatureProvider;
 import org.apache.bookkeeper.feature.SettableFeature;
 import org.apache.bookkeeper.feature.SettableFeatureProvider;
@@ -47,7 +46,6 @@ import org.slf4j.LoggerFactory;
 
 import junit.framework.TestCase;
 
-import static org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicy.REPP_DNS_RESOLVER_CLASS;
 import static org.apache.bookkeeper.client.RegionAwareEnsemblePlacementPolicy.*;
 import static org.apache.bookkeeper.feature.SettableFeatureProvider.DISABLE_ALL;
 
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/UpdateLedgerOpTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/UpdateLedgerOpTest.java
index ebcf8fa..48d9984 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/UpdateLedgerOpTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/UpdateLedgerOpTest.java
@@ -240,7 +240,7 @@ public class UpdateLedgerOpTest extends BookKeeperClusterTestCase {
                     lh.asyncAddEntry(("foobar" + i).getBytes(), cb, null);
                 }
 
-            };
+            }
         };
         th.start();
         ArrayList<BookieSocketAddress> ensemble = lh.getLedgerMetadata().getEnsemble(0);
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/NetworkLessBookieTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/NetworkLessBookieTest.java
index 41f35a7..4921af9 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/NetworkLessBookieTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/NetworkLessBookieTest.java
@@ -64,8 +64,8 @@ public class NetworkLessBookieTest extends BaseTestCase {
         zkUtil.sleepServer(5, l);
         l.await();
                 
-        try (BookKeeper bkc = new BookKeeper(conf);) {
-            try (LedgerHandle h = bkc.createLedger(1,1,digestType, "testPasswd".getBytes());) {
+        try (BookKeeper bkc = new BookKeeper(conf)) {
+            try (LedgerHandle h = bkc.createLedger(1,1,digestType, "testPasswd".getBytes())) {
                 h.addEntry("test".getBytes());
             }
         }
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/TestPerChannelBookieClient.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/TestPerChannelBookieClient.java
index e2a4f32..d08d006 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/TestPerChannelBookieClient.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/TestPerChannelBookieClient.java
@@ -45,7 +45,6 @@ import io.netty.channel.EventLoopGroup;
 import io.netty.channel.nio.NioEventLoopGroup;
 
 import java.io.IOException;
-import java.nio.ByteBuffer;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/AuditorLedgerCheckerTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/AuditorLedgerCheckerTest.java
index 8402c04..103f1ce 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/AuditorLedgerCheckerTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/AuditorLedgerCheckerTest.java
@@ -624,7 +624,7 @@ public class AuditorLedgerCheckerTest extends MultiLedgerManagerTestCase {
                     + event.getPath());
             for (Long ledgerId : ledgerList) {
                 if (event.getPath().contains(ledgerId + "")) {
-                    urLedgerList.add(Long.valueOf(ledgerId));
+                    urLedgerList.add(ledgerId);
                 }
             }
             LOG.debug("Count down and waiting for next notification");
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/AuthAutoRecoveryTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/AuthAutoRecoveryTest.java
index 470aefe..49b1800 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/AuthAutoRecoveryTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/AuthAutoRecoveryTest.java
@@ -28,7 +28,6 @@ import org.apache.bookkeeper.conf.ClientConfiguration;
 
 
 import org.apache.bookkeeper.conf.ServerConfiguration;
-import org.apache.bookkeeper.proto.BookkeeperInternalCallbacks;
 import org.apache.bookkeeper.test.BookKeeperClusterTestCase;
 import org.junit.Test;
 import org.slf4j.Logger;
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/sasl/GSSAPIBookKeeperTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/sasl/GSSAPIBookKeeperTest.java
index 07d31a8..0ff8f0a 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/sasl/GSSAPIBookKeeperTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/sasl/GSSAPIBookKeeperTest.java
@@ -180,7 +180,7 @@ public class GSSAPIBookKeeperTest extends BookKeeperClusterTestCase {
 
         try (BookKeeper bkc = new BookKeeper(clientConf, zkc);
             LedgerHandle lh = bkc.openLedger(ledgerId, DigestType.CRC32,
-                PASSWD);) {
+                PASSWD)) {
             if (lh.getLastAddConfirmed() < 0) {
                 return 0;
             }
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/sasl/MD5DigestBookKeeperTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/sasl/MD5DigestBookKeeperTest.java
index 185c5cf..572e315 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/sasl/MD5DigestBookKeeperTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/sasl/MD5DigestBookKeeperTest.java
@@ -88,7 +88,7 @@ public class MD5DigestBookKeeperTest extends BookKeeperClusterTestCase {
 
         try (BookKeeper bkc = new BookKeeper(clientConf, zkc);
             LedgerHandle lh = bkc.openLedger(ledgerId, DigestType.CRC32,
-                PASSWD);) {
+                PASSWD)) {
 
             if (lh.getLastAddConfirmed() < 0) {
                 return 0;
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/AsyncLedgerOpsTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/AsyncLedgerOpsTest.java
index 28eff34..a54436e 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/AsyncLedgerOpsTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/AsyncLedgerOpsTest.java
@@ -161,7 +161,7 @@ public class AsyncLedgerOpsTest extends MultiLedgerManagerMultiDigestTestCase
             lh.asyncReadEntries(0, numEntriesToWrite - 1, this, sync);
 
             synchronized (sync) {
-                while (sync.value == false) {
+                while (!sync.value) {
                     sync.wait();
                 }
             }
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookKeeperClusterTestCase.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookKeeperClusterTestCase.java
index 437c794..9106841 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookKeeperClusterTestCase.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookKeeperClusterTestCase.java
@@ -167,7 +167,7 @@ public abstract class BookKeeperClusterTestCase {
      */
     protected void stopBKCluster() throws Exception {
         if (bkc != null) {
-            bkc.close();;
+            bkc.close();
         }
 
         for (BookieServer server : bs) {
@@ -629,7 +629,7 @@ public abstract class BookKeeperClusterTestCase {
      * isAutoRecoveryEnabled is true.
      */
     public void stopReplicationService() throws Exception{
-        if(false == isAutoRecoveryEnabled()){
+        if(!isAutoRecoveryEnabled()){
             return;
         }
         for (Entry<BookieServer, AutoRecoveryMain> autoRecoveryProcess : autoRecoveryProcesses
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieClientTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieClientTest.java
index fe371e5..7de5cbd 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieClientTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieClientTest.java
@@ -269,7 +269,7 @@ public class BookieClientTest {
                 this.freeDiskSpace = 0L;
                 this.totalDiskCapacity = 0L;
             }
-        };
+        }
         CallbackObj obj = new CallbackObj(flags);
         bc.getBookieInfo(addr, flags, new GetBookieInfoCallback() {
             @Override
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieJournalRollingTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieJournalRollingTest.java
index a72bf57..e6aa423 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieJournalRollingTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieJournalRollingTest.java
@@ -141,7 +141,7 @@ public class BookieJournalRollingTest extends BookKeeperClusterTestCase {
             }
             while (start < numMsgs) {
                 Enumeration<LedgerEntry> seq = lhs[j].readEntries(start, end);
-                assertTrue("Enumeration of ledger entries has no element", seq.hasMoreElements() == true);
+                assertTrue("Enumeration of ledger entries has no element", seq.hasMoreElements());
                 while (seq.hasMoreElements()) {
                     LedgerEntry e = seq.nextElement();
                     assertEquals(entryId, e.getEntryId());
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieReadWriteTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieReadWriteTest.java
index 5f1f839..85d657c 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieReadWriteTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieReadWriteTest.java
@@ -222,7 +222,7 @@ public class BookieReadWriteTest extends MultiLedgerManagerMultiDigestTestCase
             lh.asyncReadEntries(0, numEntriesToWrite - 1, this, sync);
 
             synchronized (sync) {
-                while (sync.value == false) {
+                while (!sync.value) {
                     sync.wait();
                 }
                 assertEquals("Error reading", BKException.Code.OK, sync.getReturnCode());
@@ -345,7 +345,7 @@ public class BookieReadWriteTest extends MultiLedgerManagerMultiDigestTestCase
             lh.asyncReadEntries(0, numEntries - 1, this, sync);
 
             synchronized (sync) {
-                while (sync.value == false) {
+                while (!sync.value) {
                     sync.wait();
                 }
                 assertEquals("Error reading", BKException.Code.OK, sync.getReturnCode());
@@ -430,7 +430,7 @@ public class BookieReadWriteTest extends MultiLedgerManagerMultiDigestTestCase
             LOG.info("Ledger ID: " + lh.getId());
             for (int i = 0; i < numEntriesToWrite; i++) {
                 int randomInt = rng.nextInt(maxInt);
-                byte[] entry = new String(Integer.toString(randomInt)).getBytes(charset);
+                byte[] entry = Integer.toString(randomInt).getBytes(charset);
                 entries.add(entry);
                 lh.asyncAddEntry(entry, this, sync);
             }
@@ -765,7 +765,7 @@ public class BookieReadWriteTest extends MultiLedgerManagerMultiDigestTestCase
             long toRead = lac - 1;
 
             Enumeration<LedgerEntry> readEntry = lhOpen.readEntries(toRead, toRead);
-            assertTrue("Enumeration of ledger entries has no element", readEntry.hasMoreElements() == true);
+            assertTrue("Enumeration of ledger entries has no element", readEntry.hasMoreElements());
             LedgerEntry e = readEntry.nextElement();
             assertEquals(toRead, e.getEntryId());
             Assert.assertArrayEquals(entries.get((int)toRead), e.getEntry());
@@ -851,7 +851,7 @@ public class BookieReadWriteTest extends MultiLedgerManagerMultiDigestTestCase
             long readLastConfirmed = lhOpen.readLastConfirmed();
             assertTrue(readLastConfirmed != 0);
             Enumeration<LedgerEntry> readEntry = lhOpen.readEntries(toRead, toRead);
-            assertTrue("Enumeration of ledger entries has no element", readEntry.hasMoreElements() == true);
+            assertTrue("Enumeration of ledger entries has no element", readEntry.hasMoreElements());
             LedgerEntry e = readEntry.nextElement();
             assertEquals(toRead, e.getEntryId());
             Assert.assertArrayEquals(entries.get(toRead), e.getEntry());
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieZKExpireTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieZKExpireTest.java
index 573bc15..2402309 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieZKExpireTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieZKExpireTest.java
@@ -23,17 +23,12 @@ package org.apache.bookkeeper.test;
 
 import java.io.File;
 import org.junit.Test;
-import org.junit.Before;
-import org.junit.After;
 import static org.junit.Assert.*;
 
 import org.apache.bookkeeper.conf.ServerConfiguration;
 
-import java.net.InetAddress;
 import java.util.HashSet;
 import org.apache.bookkeeper.proto.BookieServer;
-import org.apache.bookkeeper.bookie.Bookie;
-import org.apache.bookkeeper.util.IOUtils;
 
 public class BookieZKExpireTest extends BookKeeperClusterTestCase {
 
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ConditionalSetTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ConditionalSetTest.java
index a06accd..6655eab 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ConditionalSetTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ConditionalSetTest.java
@@ -20,24 +20,14 @@
  */
 package org.apache.bookkeeper.test;
 
-import java.io.File;
 import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.Random;
-import java.util.concurrent.Semaphore;
-import java.util.concurrent.atomic.AtomicInteger;
 
-import org.apache.bookkeeper.conf.ClientConfiguration;
-import org.apache.bookkeeper.bookie.Bookie;
 import org.apache.bookkeeper.client.BookKeeperTestClient;
 import org.apache.bookkeeper.client.BKException;
 import org.apache.bookkeeper.client.BookKeeper;
 import org.apache.bookkeeper.client.LedgerHandle;
 import org.apache.bookkeeper.client.BookKeeper.DigestType;
-import org.apache.bookkeeper.proto.BookkeeperInternalCallbacks.WriteCallback;
 import org.apache.zookeeper.KeeperException;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/TestBackwardCompat.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/TestBackwardCompat.java
index 18504e3..b5d01b3 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/TestBackwardCompat.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/TestBackwardCompat.java
@@ -50,7 +50,7 @@ import org.slf4j.LoggerFactory;
 public class TestBackwardCompat {
     private final static Logger LOG = LoggerFactory.getLogger(TestBackwardCompat.class);
 
-    private static ZooKeeperUtil zkUtil = new ZooKeeperUtil();;
+    private static ZooKeeperUtil zkUtil = new ZooKeeperUtil();
     private static byte[] ENTRY_DATA = "ThisIsAnEntry".getBytes();
 
     static void waitUp(int port) throws Exception {
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ZooKeeperUtil.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ZooKeeperUtil.java
index 481b647..a327479 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ZooKeeperUtil.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ZooKeeperUtil.java
@@ -27,7 +27,6 @@ import java.net.InetAddress;
 import java.net.InetSocketAddress;
 
 import org.apache.bookkeeper.util.IOUtils;
-import org.apache.bookkeeper.util.ZkUtils;
 import org.apache.bookkeeper.zookeeper.ZooKeeperClient;
 import org.apache.bookkeeper.zookeeper.ZooKeeperWatcherBase;
 import org.apache.commons.io.FileUtils;
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/TestZkUtils.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/TestZkUtils.java
index 4faf09d..ebacb3b 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/TestZkUtils.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/TestZkUtils.java
@@ -62,12 +62,12 @@ public class TestZkUtils extends TestCase {
         /*
          * "/ledgers/available" is already created in ZooKeeperUtil.startServer
          */
-        String ledgerZnodePath = new String("/ledgers/000/000/000/001");
+        String ledgerZnodePath = "/ledgers/000/000/000/001";
         ZkUtils.createFullPathOptimistic(zkc, ledgerZnodePath, "data".getBytes(), Ids.OPEN_ACL_UNSAFE,
                 CreateMode.PERSISTENT);
         assertTrue(ledgerZnodePath + " zNode should exist", null != zkc.exists(ledgerZnodePath, false));
 
-        ledgerZnodePath = new String("/ledgers/000/000/000/002");
+        ledgerZnodePath = "/ledgers/000/000/000/002";
         ZkUtils.createFullPathOptimistic(zkc, ledgerZnodePath, "data".getBytes(), Ids.OPEN_ACL_UNSAFE,
                 CreateMode.PERSISTENT);
         assertTrue(ledgerZnodePath + " zNode should exist", null != zkc.exists(ledgerZnodePath, false));
@@ -76,7 +76,7 @@ public class TestZkUtils extends TestCase {
         assertTrue(ledgerZnodePath + " zNode should not exist, since it is deleted",
                 null == zkc.exists(ledgerZnodePath, false));
 
-        ledgerZnodePath = new String("/ledgers/000/000/000/001");
+        ledgerZnodePath = "/ledgers/000/000/000/001";
         assertTrue(ledgerZnodePath + " zNode should exist", null != zkc.exists(ledgerZnodePath, false));
         ZkUtils.deleteFullPathOptimistic(zkc, ledgerZnodePath, -1);
         assertTrue(ledgerZnodePath + " zNode should not exist, since it is deleted",
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongHashMapTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongHashMapTest.java
index 44f42b8..ed5bb2d 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongHashMapTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongHashMapTest.java
@@ -244,7 +244,7 @@ public class ConcurrentLongHashMapTest {
 
         map.put(0, "zero");
 
-        assertEquals(map.keys(), Lists.newArrayList(0l));
+        assertEquals(map.keys(), Lists.newArrayList(0L));
         assertEquals(map.values(), Lists.newArrayList("zero"));
 
         map.remove(0);
@@ -258,7 +258,7 @@ public class ConcurrentLongHashMapTest {
 
         List<Long> keys = map.keys();
         Collections.sort(keys);
-        assertEquals(keys, Lists.newArrayList(0l, 1l, 2l));
+        assertEquals(keys, Lists.newArrayList(0L, 1L, 2L));
 
         List<String> values = map.values();
         Collections.sort(values);
@@ -268,7 +268,7 @@ public class ConcurrentLongHashMapTest {
 
         keys = map.keys();
         Collections.sort(keys);
-        assertEquals(keys, Lists.newArrayList(0l, 1l, 2l));
+        assertEquals(keys, Lists.newArrayList(0L, 1L, 2L));
 
         values = map.values();
         Collections.sort(values);
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongHashSetTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongHashSetTest.java
index 5a8d904..4eed735 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongHashSetTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongHashSetTest.java
@@ -218,21 +218,21 @@ public class ConcurrentLongHashSetTest {
 
         assertEquals(set.items(), Collections.emptySet());
 
-        set.add(0l);
+        set.add(0L);
 
-        assertEquals(set.items(), Sets.newHashSet(0l));
+        assertEquals(set.items(), Sets.newHashSet(0L));
 
-        set.remove(0l);
+        set.remove(0L);
 
         assertEquals(set.items(), Collections.emptySet());
 
-        set.add(0l);
-        set.add(1l);
-        set.add(2l);
+        set.add(0L);
+        set.add(1L);
+        set.add(2L);
 
         List<Long> values = Lists.newArrayList(set.items());
         Collections.sort(values);
-        assertEquals(values, Lists.newArrayList(0l, 1l, 2l));
+        assertEquals(values, Lists.newArrayList(0L, 1L, 2L));
 
         set.clear();
         assertTrue(set.isEmpty());
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongHashMapTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongHashMapTest.java
index a7492a1..fb26393 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongHashMapTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentLongLongHashMapTest.java
@@ -242,8 +242,8 @@ public class ConcurrentLongLongHashMapTest {
 
         map.put(0, 0);
 
-        assertEquals(map.keys(), Lists.newArrayList(0l));
-        assertEquals(map.values(), Lists.newArrayList(0l));
+        assertEquals(map.keys(), Lists.newArrayList(0L));
+        assertEquals(map.values(), Lists.newArrayList(0L));
 
         map.remove(0);
 
@@ -256,21 +256,21 @@ public class ConcurrentLongLongHashMapTest {
 
         List<Long> keys = map.keys();
         Collections.sort(keys);
-        assertEquals(keys, Lists.newArrayList(0l, 1l, 2l));
+        assertEquals(keys, Lists.newArrayList(0L, 1L, 2L));
 
         List<Long> values = map.values();
         Collections.sort(values);
-        assertEquals(values, Lists.newArrayList(0l, 11l, 22l));
+        assertEquals(values, Lists.newArrayList(0L, 11L, 22L));
 
         map.put(1, 111);
 
         keys = map.keys();
         Collections.sort(keys);
-        assertEquals(keys, Lists.newArrayList(0l, 1l, 2l));
+        assertEquals(keys, Lists.newArrayList(0L, 1L, 2L));
 
         values = map.values();
         Collections.sort(values);
-        assertEquals(values, Lists.newArrayList(0l, 22l, 111l));
+        assertEquals(values, Lists.newArrayList(0L, 22L, 111L));
 
         map.clear();
         assertTrue(map.isEmpty());
@@ -464,9 +464,9 @@ public class ConcurrentLongLongHashMapTest {
         lmap.put(3, 33);
 
         Map<Long, Long> map = Maps.newTreeMap();
-        map.put(1l, 11l);
-        map.put(2l, 22l);
-        map.put(3l, 33l);
+        map.put(1L, 11L);
+        map.put(2L, 22L);
+        map.put(3L, 33L);
 
         assertEquals(map, lmap.asMap());
     }
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentOpenHashMapTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentOpenHashMapTest.java
index d1dd0be..be6fcc6 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentOpenHashMapTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentOpenHashMapTest.java
@@ -229,33 +229,33 @@ public class ConcurrentOpenHashMapTest {
         assertEquals(map.keys(), Collections.emptyList());
         assertEquals(map.values(), Collections.emptyList());
 
-        map.put(0l, "zero");
+        map.put(0L, "zero");
 
-        assertEquals(map.keys(), Lists.newArrayList(0l));
+        assertEquals(map.keys(), Lists.newArrayList(0L));
         assertEquals(map.values(), Lists.newArrayList("zero"));
 
-        map.remove(0l);
+        map.remove(0L);
 
         assertEquals(map.keys(), Collections.emptyList());
         assertEquals(map.values(), Collections.emptyList());
 
-        map.put(0l, "zero");
-        map.put(1l, "one");
-        map.put(2l, "two");
+        map.put(0L, "zero");
+        map.put(1L, "one");
+        map.put(2L, "two");
 
         List<Long> keys = map.keys();
         Collections.sort(keys);
-        assertEquals(keys, Lists.newArrayList(0l, 1l, 2l));
+        assertEquals(keys, Lists.newArrayList(0L, 1L, 2L));
 
         List<String> values = map.values();
         Collections.sort(values);
         assertEquals(values, Lists.newArrayList("one", "two", "zero"));
 
-        map.put(1l, "uno");
+        map.put(1L, "uno");
 
         keys = map.keys();
         Collections.sort(keys);
-        assertEquals(keys, Lists.newArrayList(0l, 1l, 2l));
+        assertEquals(keys, Lists.newArrayList(0L, 1L, 2L));
 
         values = map.values();
         Collections.sort(values);
@@ -302,11 +302,11 @@ public class ConcurrentOpenHashMapTest {
     @Test
     public void testPutIfAbsent() {
         ConcurrentOpenHashMap<Long, String> map = new ConcurrentOpenHashMap<>();
-        assertEquals(map.putIfAbsent(1l, "one"), null);
-        assertEquals(map.get(1l), "one");
+        assertEquals(map.putIfAbsent(1L, "one"), null);
+        assertEquals(map.get(1L), "one");
 
-        assertEquals(map.putIfAbsent(1l, "uno"), "one");
-        assertEquals(map.get(1l), "one");
+        assertEquals(map.putIfAbsent(1L, "uno"), "one");
+        assertEquals(map.get(1L), "one");
     }
 
     @Test
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentOpenHashSetTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentOpenHashSetTest.java
index ec20718..89f59b8 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentOpenHashSetTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/util/collections/ConcurrentOpenHashSetTest.java
@@ -217,21 +217,21 @@ public class ConcurrentOpenHashSetTest {
 
         assertEquals(set.values(), Collections.emptyList());
 
-        set.add(0l);
+        set.add(0L);
 
-        assertEquals(set.values(), Lists.newArrayList(0l));
+        assertEquals(set.values(), Lists.newArrayList(0L));
 
-        set.remove(0l);
+        set.remove(0L);
 
         assertEquals(set.values(), Collections.emptyList());
 
-        set.add(0l);
-        set.add(1l);
-        set.add(2l);
+        set.add(0L);
+        set.add(1L);
+        set.add(2L);
 
         List<Long> values = set.values();
         Collections.sort(values);
-        assertEquals(values, Lists.newArrayList(0l, 1l, 2l));
+        assertEquals(values, Lists.newArrayList(0L, 1L, 2L));
 
         set.clear();
         assertTrue(set.isEmpty());
diff --git a/bookkeeper-stats-providers/codahale-metrics-provider/src/main/java/org/apache/bookkeeper/stats/CodahaleMetricsProvider.java b/bookkeeper-stats-providers/codahale-metrics-provider/src/main/java/org/apache/bookkeeper/stats/CodahaleMetricsProvider.java
index 57890e9..37c1461 100644
--- a/bookkeeper-stats-providers/codahale-metrics-provider/src/main/java/org/apache/bookkeeper/stats/CodahaleMetricsProvider.java
+++ b/bookkeeper-stats-providers/codahale-metrics-provider/src/main/java/org/apache/bookkeeper/stats/CodahaleMetricsProvider.java
@@ -26,15 +26,12 @@ import com.codahale.metrics.Slf4jReporter;
 import com.codahale.metrics.JmxReporter;
 import com.google.common.base.Strings;
 import com.google.common.net.HostAndPort;
-import static com.codahale.metrics.MetricRegistry.name;
 import com.codahale.metrics.graphite.Graphite;
 import com.codahale.metrics.graphite.GraphiteReporter;
 
 import com.codahale.metrics.jvm.GarbageCollectorMetricSet;
 import com.codahale.metrics.jvm.MemoryUsageGaugeSet;
 
-import org.apache.bookkeeper.stats.StatsLogger;
-import org.apache.bookkeeper.stats.StatsProvider;
 import org.apache.commons.configuration.Configuration;
 
 import java.util.List;

-- 
To stop receiving notification emails like this one, please contact
['"commits@bookkeeper.apache.org" <commits@bookkeeper.apache.org>'].

Mime
View raw message