hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [31/50] [abbrv] hbase git commit: HBASE-10699 Set capacity on ArrayList where possible and use isEmpty instead of size() == 0
Date Mon, 23 Jan 2017 23:02:04 GMT
http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/HFileArchiver.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/HFileArchiver.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/HFileArchiver.java
index e2016ef..ee32887 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/HFileArchiver.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/HFileArchiver.java
@@ -229,7 +229,7 @@ public class HFileArchiver {
     }
 
     // short circuit if we don't have any files to delete
-    if (compactedFiles.size() == 0) {
+    if (compactedFiles.isEmpty()) {
       LOG.debug("No store files to dispose, done!");
       return;
     }
@@ -311,7 +311,7 @@ public class HFileArchiver {
   private static List<File> resolveAndArchive(FileSystem fs, Path baseArchiveDir,
       Collection<File> toArchive, long start) throws IOException {
     // short circuit if no files to move
-    if (toArchive.size() == 0) return Collections.emptyList();
+    if (toArchive.isEmpty()) return Collections.emptyList();
 
     if (LOG.isTraceEnabled()) LOG.trace("moving files to the archive directory: " + baseArchiveDir);
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/errorhandling/ForeignException.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/errorhandling/ForeignException.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/errorhandling/ForeignException.java
index 3af01ac..bfcf486 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/errorhandling/ForeignException.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/errorhandling/ForeignException.java
@@ -181,7 +181,7 @@ public class ForeignException extends IOException {
    *         the sender).
    */
   private static StackTraceElement[] toStackTrace(List<StackTraceElementMessage> traceList) {
-    if (traceList == null || traceList.size() == 0) {
+    if (traceList == null || traceList.isEmpty()) {
       return new StackTraceElement[0]; // empty array
     }
     StackTraceElement[] trace = new StackTraceElement[traceList.size()];

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodeAssignmentHelper.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodeAssignmentHelper.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodeAssignmentHelper.java
index 98e058d..625d01f 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodeAssignmentHelper.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodeAssignmentHelper.java
@@ -562,7 +562,7 @@ public class FavoredNodeAssignmentHelper {
 
     // Is the rack valid? Do we recognize it?
     if (rack == null || getServersFromRack(rack) == null ||
-        getServersFromRack(rack).size() == 0) {
+        getServersFromRack(rack).isEmpty()) {
       return null;
     }
 
@@ -577,7 +577,7 @@ public class FavoredNodeAssignmentHelper {
         serversToChooseFrom.remove(StartcodeAgnosticServerName.valueOf(sn));
       }
       // Do we have any servers left to choose from?
-      if (serversToChooseFrom.size() == 0) {
+      if (serversToChooseFrom.isEmpty()) {
         return null;
       }
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodesPlan.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodesPlan.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodesPlan.java
index 5629f35..f24d9fc 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodesPlan.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodesPlan.java
@@ -55,7 +55,7 @@ public class FavoredNodesPlan {
    * @param servers
    */
   public void updateFavoredNodesMap(HRegionInfo region, List<ServerName> servers) {
-    if (region == null || servers == null || servers.size() == 0) {
+    if (region == null || servers == null || servers.isEmpty()) {
       return;
     }
     this.favoredNodesMap.put(region.getRegionNameAsString(), servers);

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java
index 98c29e7..84c1fea 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java
@@ -360,12 +360,12 @@ public class HttpServer implements FilterContainer {
         }
       }
 
-      if (endpoints.size() == 0 && connector == null) {
+      if (endpoints.isEmpty() && connector == null) {
         throw new HadoopIllegalArgumentException("No endpoints specified");
       }
 
       if (hostName == null) {
-        hostName = endpoints.size() == 0 ? connector.getHost() : endpoints.get(
+        hostName = endpoints.isEmpty() ? connector.getHost() : endpoints.get(
             0).getHost();
       }
 
@@ -1179,7 +1179,7 @@ public class HttpServer implements FilterContainer {
    */
   @Override
   public String toString() {
-    if (listeners.size() == 0) {
+    if (listeners.isEmpty()) {
       return "Inactive HttpServer";
     } else {
       StringBuilder sb = new StringBuilder("HttpServer (")

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java
index 770f202..7de91e9 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java
@@ -807,7 +807,7 @@ public class TableMapReduceUtil {
       throw new IllegalArgumentException("Must provide a configuration object.");
     }
     Set<String> paths = new HashSet<String>(conf.getStringCollection("tmpjars"));
-    if (paths.size() == 0) {
+    if (paths.isEmpty()) {
       throw new IllegalArgumentException("Configuration contains no tmpjars.");
     }
     StringBuilder sb = new StringBuilder();

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java
index d2863e3..ef042af 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java
@@ -112,7 +112,7 @@ public class CatalogJanitor extends ScheduledChore {
           && !this.services.isInMaintenanceMode()
           && am != null
           && am.isFailoverCleanupDone()
-          && am.getRegionStates().getRegionsInTransition().size() == 0) {
+          && am.getRegionStates().getRegionsInTransition().isEmpty()) {
         scan();
       } else {
         LOG.warn("CatalogJanitor disabled! Not running scan.");

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
index 154958b..fbe8ec6 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
@@ -2902,7 +2902,7 @@ public class HMaster extends HRegionServer implements MasterServices {
       final String namespace, final String regex, final List<TableName> tableNameList,
       final boolean includeSysTables)
   throws IOException {
-    if (tableNameList == null || tableNameList.size() == 0) {
+    if (tableNameList == null || tableNameList.isEmpty()) {
       // request for all TableDescriptors
       Collection<HTableDescriptor> allHtds;
       if (namespace != null && namespace.length() > 0) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java
index 7c2df61..09d5190 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java
@@ -808,7 +808,7 @@ public class RegionStates {
     TableName table = hri.getTable();
     Map<String, RegionState> indexMap = regionStatesTableIndex.get(table);
     indexMap.remove(encodedName);
-    if (indexMap.size() == 0)
+    if (indexMap.isEmpty())
       regionStatesTableIndex.remove(table);
     lastAssignments.remove(encodedName);
     ServerName sn = regionAssignments.remove(hri);

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
index 38493cd..37830f7 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
@@ -554,7 +554,7 @@ public class ServerManager {
 
       try {
         List<String> servers = ZKUtil.listChildrenNoWatch(zkw, zkw.znodePaths.rsZNode);
-        if (servers == null || servers.size() == 0 || (servers.size() == 1
+        if (servers == null || servers.isEmpty() || (servers.size() == 1
             && servers.contains(sn.toString()))) {
           LOG.info("ZK shows there is only the master self online, exiting now");
           // Master could have lost some ZK events, no need to wait more.

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
index 589da14..1c0c12f 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
@@ -762,7 +762,7 @@ public class SplitLogManager {
           EnvironmentEdgeManager.currentTime()
               - getSplitLogManagerCoordination().getLastRecoveryTime();
       if (!failedRecoveringRegionDeletions.isEmpty()
-          || (tot == 0 && tasks.size() == 0 && (timeInterval > checkRecoveringTimeThreshold))) {
+          || (tot == 0 && tasks.isEmpty() && (timeInterval > checkRecoveringTimeThreshold))) {
         // inside the function there have more checks before GC anything
         if (!failedRecoveringRegionDeletions.isEmpty()) {
           List<Pair<Set<ServerName>, Boolean>> previouslyFailedDeletions =

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/SimpleLoadBalancer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/SimpleLoadBalancer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/SimpleLoadBalancer.java
index 673db95..a6a0774 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/SimpleLoadBalancer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/SimpleLoadBalancer.java
@@ -484,7 +484,7 @@ public class SimpleLoadBalancer extends BaseLoadBalancer {
       setLoad(serverLoadList, i, balanceInfo.getNumRegionsAdded());
       if (balanceInfo.getHriList().size() + balanceInfo.getNumRegionsAdded() == max) {
         HRegionInfo hriToPlan;
-        if (balanceInfo.getHriList().size() == 0) {
+        if (balanceInfo.getHriList().isEmpty()) {
           LOG.debug("During balanceOverall, we found " + serverload.getServerName()
                   + " has no HRegionInfo, no operation needed");
           continue;

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactionTool.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactionTool.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactionTool.java
index a47228b..b037c89 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactionTool.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactionTool.java
@@ -423,7 +423,7 @@ public class CompactionTool extends Configured implements Tool {
       return 1;
     }
 
-    if (toCompactDirs.size() == 0) {
+    if (toCompactDirs.isEmpty()) {
       printUsage("No directories to compact specified.");
       return 1;
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
index 5fc53d8..f35d788 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
@@ -3698,7 +3698,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
         boolean valueIsNull = comparator.getValue() == null || comparator.getValue().length == 0;
         boolean matches = false;
         long cellTs = 0;
-        if (result.size() == 0 && valueIsNull) {
+        if (result.isEmpty() && valueIsNull) {
           matches = true;
         } else if (result.size() > 0 && result.get(0).getValueLength() == 0 && valueIsNull) {
           matches = true;

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
index 808cd20..425667a 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
@@ -522,7 +522,7 @@ public class HStore implements Store {
   }
 
   private List<StoreFile> openStoreFiles(Collection<StoreFileInfo> files) throws IOException {
-    if (files == null || files.size() == 0) {
+    if (files == null || files.isEmpty()) {
       return new ArrayList<StoreFile>();
     }
     // initialize the thread pool for opening store files in parallel..

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/ExploringCompactionPolicy.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/ExploringCompactionPolicy.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/ExploringCompactionPolicy.java
index f0cb5d2..8b5aa31 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/ExploringCompactionPolicy.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/ExploringCompactionPolicy.java
@@ -114,7 +114,7 @@ public class ExploringCompactionPolicy extends RatioBasedCompactionPolicy {
         }
       }
     }
-    if (bestSelection.size() == 0 && mightBeStuck) {
+    if (bestSelection.isEmpty() && mightBeStuck) {
       LOG.debug("Exploring compaction algorithm has selected " + smallest.size()
           + " files of size "+ smallestSize + " because the store might be stuck");
       return new ArrayList<StoreFile>(smallest);

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/StripeCompactionPolicy.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/StripeCompactionPolicy.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/StripeCompactionPolicy.java
index ff1dd8e..a553cf6 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/StripeCompactionPolicy.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/StripeCompactionPolicy.java
@@ -136,7 +136,7 @@ public class StripeCompactionPolicy extends CompactionPolicy {
       return selectNewStripesCompaction(si);
     }
 
-    boolean canDropDeletesNoL0 = l0Files.size() == 0;
+    boolean canDropDeletesNoL0 = l0Files.isEmpty();
     if (shouldCompactL0) {
       if (!canDropDeletesNoL0) {
         // If we need to compact L0, see if we can add something to it, and drop deletes.

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/querymatcher/LegacyScanQueryMatcher.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/querymatcher/LegacyScanQueryMatcher.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/querymatcher/LegacyScanQueryMatcher.java
index 0ec3444..4ba685f 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/querymatcher/LegacyScanQueryMatcher.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/querymatcher/LegacyScanQueryMatcher.java
@@ -371,7 +371,7 @@ public class LegacyScanQueryMatcher extends ScanQueryMatcher {
     int maxVersions = Math.min(scan.getMaxVersions(), scanInfo.getMaxVersions());
     boolean hasNullColumn;
     ColumnTracker columnTracker;
-    if (columns == null || columns.size() == 0) {
+    if (columns == null || columns.isEmpty()) {
       // there is always a null column in the wildcard column query.
       hasNullColumn = true;
       // use a specialized scan for wildcard column tracker.

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/querymatcher/UserScanQueryMatcher.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/querymatcher/UserScanQueryMatcher.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/querymatcher/UserScanQueryMatcher.java
index fcda4a6..407f3fc 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/querymatcher/UserScanQueryMatcher.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/querymatcher/UserScanQueryMatcher.java
@@ -198,7 +198,7 @@ public abstract class UserScanQueryMatcher extends ScanQueryMatcher {
         : Math.min(scan.getMaxVersions(), scanInfo.getMaxVersions());
     boolean hasNullColumn;
     ColumnTracker columnTracker;
-    if (columns == null || columns.size() == 0) {
+    if (columns == null || columns.isEmpty()) {
       // there is always a null column in the wildcard column query.
       hasNullColumn = true;
       // use a specialized scan for wildcard column tracker.

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/WALEditsReplaySink.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/WALEditsReplaySink.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/WALEditsReplaySink.java
index 6cfd631..4dee9f1 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/WALEditsReplaySink.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/WALEditsReplaySink.java
@@ -94,7 +94,7 @@ public class WALEditsReplaySink {
    * @throws IOException on IO failure
    */
   public void replayEntries(List<Pair<HRegionLocation, Entry>> entries) throws IOException {
-    if (entries.size() == 0) {
+    if (entries.isEmpty()) {
       return;
     }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/master/TableCFsUpdater.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/master/TableCFsUpdater.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/master/TableCFsUpdater.java
index 08888f8..bb8cbe85 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/master/TableCFsUpdater.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/master/TableCFsUpdater.java
@@ -75,7 +75,7 @@ public class TableCFsUpdater extends ReplicationStateZKBase {
         String peerNode = getPeerNode(peerId);
         ReplicationPeerConfig rpc = getReplicationPeerConig(peerNode);
         // We only need to copy data from tableCFs node to rpc Node the first time hmaster start.
-        if (rpc.getTableCFsMap() == null || rpc.getTableCFsMap().size() == 0) {
+        if (rpc.getTableCFsMap() == null || rpc.getTableCFsMap().isEmpty()) {
           // we copy TableCFs node into PeerNode
           LOG.info("copy tableCFs into peerNode:" + peerId);
           ReplicationProtos.TableCF[] tableCFs =

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java
index 4e4cf37..71f9f3d 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java
@@ -184,7 +184,7 @@ public class ReplicationSink {
                   CellUtil.isDelete(cell) ? new Delete(cell.getRowArray(), cell.getRowOffset(),
                       cell.getRowLength()) : new Put(cell.getRowArray(), cell.getRowOffset(),
                       cell.getRowLength());
-              List<UUID> clusterIds = new ArrayList<UUID>();
+              List<UUID> clusterIds = new ArrayList<UUID>(entry.getKey().getClusterIdsList().size());
               for (HBaseProtos.UUID clusterId : entry.getKey().getClusterIdsList()) {
                 clusterIds.add(toUUID(clusterId));
               }
@@ -275,7 +275,7 @@ public class ReplicationSink {
 
   private void addFamilyAndItsHFilePathToTableInMap(byte[] family, String pathToHfileFromNS,
       List<Pair<byte[], List<String>>> familyHFilePathsList) {
-    List<String> hfilePaths = new ArrayList<String>();
+    List<String> hfilePaths = new ArrayList<String>(1);
     hfilePaths.add(pathToHfileFromNS);
     familyHFilePathsList.add(new Pair<byte[], List<String>>(family, hfilePaths));
   }
@@ -283,7 +283,7 @@ public class ReplicationSink {
   private void addNewTableEntryInMap(
       final Map<String, List<Pair<byte[], List<String>>>> bulkLoadHFileMap, byte[] family,
       String pathToHfileFromNS, String tableName) {
-    List<String> hfilePaths = new ArrayList<String>();
+    List<String> hfilePaths = new ArrayList<String>(1);
     hfilePaths.add(pathToHfileFromNS);
     Pair<byte[], List<String>> newFamilyHFilePathsPair =
         new Pair<byte[], List<String>>(family, hfilePaths);

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
index 7a229eb..1eaa84c 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
@@ -614,7 +614,7 @@ public class ReplicationSource extends Thread
         //We take the snapshot now so that we are protected against races
         //where a new file gets enqueued while the current file is being processed
         //(and where we just finished reading the current file).
-        if (!this.replicationQueueInfo.isQueueRecovered() && queue.size() == 0) {
+        if (!this.replicationQueueInfo.isQueueRecovered() && queue.isEmpty()) {
           currentWALisBeingWrittenTo = true;
         }
         // Open a reader on it
@@ -1075,7 +1075,7 @@ public class ReplicationSource extends Thread
      */
     private boolean isCurrentLogEmpty() {
       return (this.repLogReader.getPosition() == 0 &&
-          !this.replicationQueueInfo.isQueueRecovered() && queue.size() == 0);
+          !this.replicationQueueInfo.isQueueRecovered() && queue.isEmpty());
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
index 5b574da..5cb7d75 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
@@ -780,7 +780,7 @@ public class ReplicationSourceManager implements ReplicationListener {
     @Override
     public void run() {
       List<String> currentReplicators = replicationQueues.getListOfReplicators();
-      if (currentReplicators == null || currentReplicators.size() == 0) {
+      if (currentReplicators == null || currentReplicators.isEmpty()) {
         return;
       }
       List<String> otherRegionServers = replicationTracker.getListOfRegionServers();

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/DefaultVisibilityLabelServiceImpl.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/DefaultVisibilityLabelServiceImpl.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/DefaultVisibilityLabelServiceImpl.java
index f1aec09..9abb3a2 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/DefaultVisibilityLabelServiceImpl.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/DefaultVisibilityLabelServiceImpl.java
@@ -553,7 +553,7 @@ public class DefaultVisibilityLabelServiceImpl implements VisibilityLabelService
       Byte deleteTagsFormat) throws IOException {
     if ((deleteTagsFormat != null && deleteTagsFormat == SORTED_ORDINAL_SERIALIZATION_FORMAT)
         && (putTagsFormat == null || putTagsFormat == SORTED_ORDINAL_SERIALIZATION_FORMAT)) {
-      if (putVisTags.size() == 0) {
+      if (putVisTags.isEmpty()) {
         // Early out if there are no tags in the cell
         return false;
       }

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java
index d1f5372..98afe8b 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java
@@ -399,7 +399,7 @@ public class RestoreSnapshotHelper {
    */
   private void removeHdfsRegions(final ThreadPoolExecutor exec, final List<HRegionInfo> regions)
       throws IOException {
-    if (regions == null || regions.size() == 0) return;
+    if (regions == null || regions.isEmpty()) return;
     ModifyRegionUtils.editRegions(exec, regions, new ModifyRegionUtils.RegionEditTask() {
       @Override
       public void editRegion(final HRegionInfo hri) throws IOException {
@@ -414,7 +414,7 @@ public class RestoreSnapshotHelper {
   private void restoreHdfsRegions(final ThreadPoolExecutor exec,
       final Map<String, SnapshotRegionManifest> regionManifests,
       final List<HRegionInfo> regions) throws IOException {
-    if (regions == null || regions.size() == 0) return;
+    if (regions == null || regions.isEmpty()) return;
     ModifyRegionUtils.editRegions(exec, regions, new ModifyRegionUtils.RegionEditTask() {
       @Override
       public void editRegion(final HRegionInfo hri) throws IOException {
@@ -429,7 +429,7 @@ public class RestoreSnapshotHelper {
   private void restoreHdfsMobRegions(final ThreadPoolExecutor exec,
       final Map<String, SnapshotRegionManifest> regionManifests,
       final List<HRegionInfo> regions) throws IOException {
-    if (regions == null || regions.size() == 0) return;
+    if (regions == null || regions.isEmpty()) return;
     ModifyRegionUtils.editRegions(exec, regions, new ModifyRegionUtils.RegionEditTask() {
       @Override
       public void editRegion(final HRegionInfo hri) throws IOException {
@@ -562,7 +562,7 @@ public class RestoreSnapshotHelper {
   private HRegionInfo[] cloneHdfsRegions(final ThreadPoolExecutor exec,
       final Map<String, SnapshotRegionManifest> regionManifests,
       final List<HRegionInfo> regions) throws IOException {
-    if (regions == null || regions.size() == 0) return null;
+    if (regions == null || regions.isEmpty()) return null;
 
     final Map<String, HRegionInfo> snapshotRegions =
       new HashMap<String, HRegionInfo>(regions.size());

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotInfo.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotInfo.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotInfo.java
index 3fb445c..85d3af3 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotInfo.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotInfo.java
@@ -686,7 +686,7 @@ public final class SnapshotInfo extends AbstractHBaseTool {
     List<SnapshotDescription> snapshotList = getSnapshotList(conf);
 
 
-    if (snapshotList.size() == 0) {
+    if (snapshotList.isEmpty()) {
       return Collections.emptyMap();
     }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotManifest.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotManifest.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotManifest.java
index e74982d..47e3073 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotManifest.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotManifest.java
@@ -425,7 +425,7 @@ public final class SnapshotManifest {
    * This is an helper to get a map with the region encoded name
    */
   public Map<String, SnapshotRegionManifest> getRegionManifestsMap() {
-    if (regionManifests == null || regionManifests.size() == 0) return null;
+    if (regionManifests == null || regionManifests.isEmpty()) return null;
 
     HashMap<String, SnapshotRegionManifest> regionsMap =
         new HashMap<String, SnapshotRegionManifest>(regionManifests.size());

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotReferenceUtil.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotReferenceUtil.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotReferenceUtil.java
index b250229..8cd438e 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotReferenceUtil.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotReferenceUtil.java
@@ -112,7 +112,7 @@ public final class SnapshotReferenceUtil {
       throws IOException {
     SnapshotManifest manifest = SnapshotManifest.open(conf, fs, snapshotDir, desc);
     List<SnapshotRegionManifest> regionManifests = manifest.getRegionManifests();
-    if (regionManifests == null || regionManifests.size() == 0) {
+    if (regionManifests == null || regionManifests.isEmpty()) {
       LOG.debug("No manifest files present: " + snapshotDir);
       return;
     }
@@ -184,7 +184,7 @@ public final class SnapshotReferenceUtil {
 
     final Path snapshotDir = manifest.getSnapshotDir();
     List<SnapshotRegionManifest> regionManifests = manifest.getRegionManifests();
-    if (regionManifests == null || regionManifests.size() == 0) {
+    if (regionManifests == null || regionManifests.isEmpty()) {
       LOG.debug("No manifest files present: " + snapshotDir);
       return;
     }
@@ -205,7 +205,7 @@ public final class SnapshotReferenceUtil {
     final Path snapshotDir = manifest.getSnapshotDir();
 
     List<SnapshotRegionManifest> regionManifests = manifest.getRegionManifests();
-    if (regionManifests == null || regionManifests.size() == 0) {
+    if (regionManifests == null || regionManifests.isEmpty()) {
       LOG.debug("No manifest files present: " + snapshotDir);
       return;
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java
index 3d77ca1..c6d3e80 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java
@@ -1318,7 +1318,7 @@ public final class Canary implements Tool {
             "option, tablenames:" + foundTableNames.toString());
         this.errorCode = USAGE_EXIT_CODE;
       }
-      return foundTableNames.size() == 0;
+      return foundTableNames.isEmpty();
     }
 
     private void monitorRegionServers(Map<String, List<HRegionInfo>> rsAndRMap) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
index 553f756..f989d09 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
@@ -1331,7 +1331,7 @@ public class HBaseFsck extends Configured implements Closeable {
   public void fixOrphanTables() throws IOException {
     if (shouldFixTableOrphans() && !orphanTableDirs.isEmpty()) {
 
-      List<TableName> tmpList = new ArrayList<TableName>();
+      List<TableName> tmpList = new ArrayList<TableName>(orphanTableDirs.keySet().size());
       tmpList.addAll(orphanTableDirs.keySet());
       HTableDescriptor[] htds = getHTableDescriptors(tmpList);
       Iterator<Entry<TableName, Set<String>>> iter =
@@ -2531,7 +2531,7 @@ public class HBaseFsck extends Configured implements Closeable {
       // the region chain in META
       //if (hbi.foundRegionDir == null) continue;
       //if (hbi.deployedOn.size() != 1) continue;
-      if (hbi.deployedOn.size() == 0) continue;
+      if (hbi.deployedOn.isEmpty()) continue;
 
       // We should be safe here
       TableName tableName = hbi.metaEntry.getTable();
@@ -3089,7 +3089,7 @@ public class HBaseFsck extends Configured implements Closeable {
       byte[] prevKey = null;
       byte[] problemKey = null;
 
-      if (splits.size() == 0) {
+      if (splits.isEmpty()) {
         // no region for this table
         handler.handleHoleInRegionChain(HConstants.EMPTY_START_ROW, HConstants.EMPTY_END_ROW);
       }
@@ -3145,7 +3145,7 @@ public class HBaseFsck extends Configured implements Closeable {
             }
           }
 
-        } else if (ranges.size() == 0) {
+        } else if (ranges.isEmpty()) {
           if (problemKey != null) {
             LOG.warn("reached end of problem group: " + Bytes.toStringBinary(key));
           }
@@ -3377,7 +3377,7 @@ public class HBaseFsck extends Configured implements Closeable {
       }
       if (servers.size() != 1) {
         noProblem = false;
-        if (servers.size() == 0) {
+        if (servers.isEmpty()) {
           assignMetaReplica(i);
         } else if (servers.size() > 1) {
           errors
@@ -4466,7 +4466,7 @@ public class HBaseFsck extends Configured implements Closeable {
    * Empty list means all tables are included.
    */
   boolean isTableIncluded(TableName table) {
-    return (tablesIncluded.size() == 0) || tablesIncluded.contains(table);
+    return (tablesIncluded.isEmpty()) || tablesIncluded.contains(table);
   }
 
   public void includeTable(TableName table) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/util/IdLock.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/IdLock.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/IdLock.java
index cc84093..7f283e6 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/IdLock.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/IdLock.java
@@ -118,7 +118,7 @@ public class IdLock {
 
   /** For testing */
   void assertMapEmpty() {
-    assert map.size() == 0;
+    assert map.isEmpty();
   }
 
   @VisibleForTesting

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/util/RegionMover.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/RegionMover.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/RegionMover.java
index 08fe076..01ee201 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/RegionMover.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/RegionMover.java
@@ -463,17 +463,17 @@ public class RegionMover extends AbstractHBaseTool {
       boolean ack, List<HRegionInfo> movedRegions) throws Exception {
     List<HRegionInfo> regionsToMove = new ArrayList<HRegionInfo>();// FindBugs: DLS_DEAD_LOCAL_STORE
     regionsToMove = getRegions(this.conf, server);
-    if (regionsToMove.size() == 0) {
+    if (regionsToMove.isEmpty()) {
       LOG.info("No Regions to move....Quitting now");
       return;
-    } else if (regionServers.size() == 0) {
+    } else if (regionServers.isEmpty()) {
       LOG.warn("No Regions were moved - no servers available");
       throw new Exception("No online region servers");
     }
     while (true) {
       regionsToMove = getRegions(this.conf, server);
       regionsToMove.removeAll(movedRegions);
-      if (regionsToMove.size() == 0) {
+      if (regionsToMove.isEmpty()) {
         break;
       }
       int counter = 0;
@@ -823,7 +823,7 @@ public class RegionMover extends AbstractHBaseTool {
   private ArrayList<String> getServers(Admin admin) throws IOException {
     ArrayList<ServerName> serverInfo =
         new ArrayList<ServerName>(admin.getClusterStatus().getServers());
-    ArrayList<String> regionServers = new ArrayList<String>();
+    ArrayList<String> regionServers = new ArrayList<String>(serverInfo.size());
     for (ServerName server : serverInfo) {
       regionServers.add(server.getServerName());
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/util/hbck/HFileCorruptionChecker.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/hbck/HFileCorruptionChecker.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/hbck/HFileCorruptionChecker.java
index c0ce639..820da7a 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/hbck/HFileCorruptionChecker.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/hbck/HFileCorruptionChecker.java
@@ -174,7 +174,7 @@ public class HFileCorruptionChecker {
 
     List<FileStatus> hfs = FSUtils.filterFileStatuses(statuses, new HFileFilter(fs));
     // Hadoop 1.0 listStatus does not throw an exception if the path does not exist.
-    if (hfs.size() == 0 && !fs.exists(cfDir)) {
+    if (hfs.isEmpty() && !fs.exists(cfDir)) {
       LOG.warn("Colfam Directory " + cfDir +
           " does not exist.  Likely due to concurrent split/compaction. Skipping.");
       missing.add(cfDir);
@@ -207,7 +207,7 @@ public class HFileCorruptionChecker {
 
     List<FileStatus> hfs = FSUtils.filterFileStatuses(statuses, new HFileFilter(fs));
     // Hadoop 1.0 listStatus does not throw an exception if the path does not exist.
-    if (hfs.size() == 0 && !fs.exists(cfDir)) {
+    if (hfs.isEmpty() && !fs.exists(cfDir)) {
       LOG.warn("Mob colfam Directory " + cfDir +
           " does not exist.  Likely the table is deleted. Skipping.");
       missedMobFiles.add(cfDir);
@@ -311,7 +311,7 @@ public class HFileCorruptionChecker {
 
     List<FileStatus> cfs = FSUtils.filterFileStatuses(statuses, new FamilyDirFilter(fs));
     // Hadoop 1.0 listStatus does not throw an exception if the path does not exist.
-    if (cfs.size() == 0 && !fs.exists(regionDir)) {
+    if (cfs.isEmpty() && !fs.exists(regionDir)) {
       LOG.warn("Region Directory " + regionDir +
           " does not exist.  Likely due to concurrent split/compaction. Skipping.");
       missing.add(regionDir);
@@ -343,7 +343,7 @@ public class HFileCorruptionChecker {
     }
 
     // Parallelize check at the region dir level
-    List<RegionDirChecker> rdcs = new ArrayList<RegionDirChecker>();
+    List<RegionDirChecker> rdcs = new ArrayList<RegionDirChecker>(rds.size() + 1);
     List<Future<Void>> rdFutures;
 
     for (FileStatus rdFs : rds) {
@@ -541,7 +541,7 @@ public class HFileCorruptionChecker {
       out.print("      " + mq);
     }
 
-    String initialState = (corrupted.size() == 0) ? "OK" : "CORRUPTED";
+    String initialState = (corrupted.isEmpty()) ? "OK" : "CORRUPTED";
     String fixedState = (corrupted.size() == quarantined.size()) ? "OK"
         : "CORRUPTED";
 
@@ -560,7 +560,7 @@ public class HFileCorruptionChecker {
     for (Path mq : missedMobFiles) {
       out.print("      " + mq);
     }
-    String initialMobState = (corruptedMobFiles.size() == 0) ? "OK" : "CORRUPTED";
+    String initialMobState = (corruptedMobFiles.isEmpty()) ? "OK" : "CORRUPTED";
     String fixedMobState = (corruptedMobFiles.size() == quarantinedMobFiles.size()) ? "OK"
         : "CORRUPTED";
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/AbstractFSWALProvider.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/AbstractFSWALProvider.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/AbstractFSWALProvider.java
index 76a6415..5a801c2 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/AbstractFSWALProvider.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/AbstractFSWALProvider.java
@@ -115,7 +115,7 @@ public abstract class AbstractFSWALProvider<T extends AbstractFSWAL<?>> implemen
     if (wal == null) {
       return Collections.emptyList();
     }
-    List<WAL> wals = new ArrayList<WAL>();
+    List<WAL> wals = new ArrayList<WAL>(1);
     wals.add(wal);
     return wals;
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/DisabledWALProvider.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/DisabledWALProvider.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/DisabledWALProvider.java
index 7f10d7d..337f2b4 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/DisabledWALProvider.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/DisabledWALProvider.java
@@ -67,7 +67,7 @@ class DisabledWALProvider implements WALProvider {
 
   @Override
   public List<WAL> getWALs() throws IOException {
-    List<WAL> wals = new ArrayList<WAL>();
+    List<WAL> wals = new ArrayList<WAL>(1);
     wals.add(disabled);
     return wals;
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALKey.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALKey.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALKey.java
index 3bf01bc..63e6649 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALKey.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALKey.java
@@ -229,7 +229,7 @@ public class WALKey implements SequenceId, Comparable<WALKey> {
   public WALKey(final byte[] encodedRegionName, final TableName tablename,
                 long logSeqNum,
       final long now, UUID clusterId) {
-    List<UUID> clusterIds = new ArrayList<UUID>();
+    List<UUID> clusterIds = new ArrayList<UUID>(1);
     clusterIds.add(clusterId);
     init(encodedRegionName, tablename, logSeqNum, now, clusterIds,
         HConstants.NO_NONCE, HConstants.NO_NONCE, null, null);

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALPrettyPrinter.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALPrettyPrinter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALPrettyPrinter.java
index b212fe6..a6fd85f 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALPrettyPrinter.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALPrettyPrinter.java
@@ -293,7 +293,7 @@ public class WALPrettyPrinter {
             actions.add(op);
           }
         }
-        if (actions.size() == 0)
+        if (actions.isEmpty())
           continue;
         txn.put("actions", actions);
         if (outputJSON) {
@@ -381,7 +381,7 @@ public class WALPrettyPrinter {
     try {
       CommandLine cmd = parser.parse(options, args);
       files = cmd.getArgList();
-      if (files.size() == 0 || cmd.hasOption("h")) {
+      if (files.isEmpty() || cmd.hasOption("h")) {
         HelpFormatter formatter = new HelpFormatter();
         formatter.printHelp("WAL <filename...>", options, true);
         System.exit(-1);

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java
index ab74318..ff73073 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java
@@ -350,7 +350,7 @@ public class MiniZooKeeperCluster {
     LOG.info("Kill the current active ZK servers in the cluster " +
         "on client port: " + clientPort);
 
-    if (standaloneServerFactoryList.size() == 0) {
+    if (standaloneServerFactoryList.isEmpty()) {
       // there is no backup servers;
       return -1;
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/test/java/org/apache/hadoop/hbase/TestPartialResultsFromClientSide.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestPartialResultsFromClientSide.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestPartialResultsFromClientSide.java
index b0a6137..18a4d86 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestPartialResultsFromClientSide.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestPartialResultsFromClientSide.java
@@ -681,7 +681,7 @@ public class TestPartialResultsFromClientSide {
       LOG.info("Actual count: " + result.size());
     }
 
-    if (expKvList.size() == 0) return;
+    if (expKvList.isEmpty()) return;
 
     int i = 0;
     for (Cell kv : result.rawCells()) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java
index ae93e67..ff7d211 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java
@@ -2233,7 +2233,7 @@ public class TestFromClientSide {
       get = new Get(bytes);
       get.addFamily(FAMILIES[0]);
       result = ht.get(get);
-      assertTrue(result.size() == 0);
+      assertTrue(result.isEmpty());
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java
index 8862109..c48ec31 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestScannersFromClientSide.java
@@ -744,7 +744,7 @@ public class TestScannersFromClientSide {
     LOG.info(msg);
     LOG.info("Expected count: " + expKvList.size());
     LOG.info("Actual count: " + result.size());
-    if (expKvList.size() == 0)
+    if (expKvList.isEmpty())
       return;
 
     int i = 0;

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java
index 5078038..59ccbcf 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java
@@ -466,7 +466,7 @@ public class TestDistributedLogSplitting {
       public boolean evaluate() throws Exception {
         List<String> recoveringRegions = zkw.getRecoverableZooKeeper().getChildren(
             zkw.znodePaths.recoveringRegionsZNode, false);
-        return (recoveringRegions != null && recoveringRegions.size() == 0);
+        return (recoveringRegions != null && recoveringRegions.isEmpty());
       }
     });
   }
@@ -573,7 +573,7 @@ public class TestDistributedLogSplitting {
         public boolean evaluate() throws Exception {
           List<String> recoveringRegions = zkw.getRecoverableZooKeeper().getChildren(
               zkw.znodePaths.recoveringRegionsZNode, false);
-          boolean done = recoveringRegions != null && recoveringRegions.size() == 0;
+          boolean done = recoveringRegions != null && recoveringRegions.isEmpty();
           if (!done) {
             LOG.info("Recovering regions: " + recoveringRegions);
           }
@@ -665,7 +665,7 @@ public class TestDistributedLogSplitting {
         public boolean evaluate() throws Exception {
           List<String> recoveringRegions = zkw.getRecoverableZooKeeper().getChildren(
               zkw.znodePaths.recoveringRegionsZNode, false);
-          return (recoveringRegions != null && recoveringRegions.size() == 0);
+          return (recoveringRegions != null && recoveringRegions.isEmpty());
         }
       });
 
@@ -717,7 +717,7 @@ public class TestDistributedLogSplitting {
       TEST_UTIL.waitFor(60000, 1000, new Waiter.Predicate<Exception>() {
         @Override
         public boolean evaluate() throws Exception {
-          return (tmphrs.getRecoveringRegions().size() == 0);
+          return (tmphrs.getRecoveringRegions().isEmpty());
         }
       });
     } finally {
@@ -868,7 +868,7 @@ public class TestDistributedLogSplitting {
               zkw.znodePaths.recoveringRegionsZNode, false);
           ServerManager serverManager = master.getServerManager();
           return (!serverManager.areDeadServersInProgress() &&
-              recoveringRegions != null && recoveringRegions.size() == 0);
+              recoveringRegions != null && recoveringRegions.isEmpty());
         }
       });
 
@@ -1111,7 +1111,7 @@ public class TestDistributedLogSplitting {
         public boolean evaluate() throws Exception {
           List<String> recoveringRegions = zkw.getRecoverableZooKeeper().getChildren(
               zkw.znodePaths.recoveringRegionsZNode, false);
-          return (recoveringRegions != null && recoveringRegions.size() == 0);
+          return (recoveringRegions != null && recoveringRegions.isEmpty());
         }
       });
 
@@ -1286,7 +1286,7 @@ public class TestDistributedLogSplitting {
           it.remove();
         }
       }
-      if (regions.size() == 0) return;
+      if (regions.isEmpty()) return;
       HRegionInfo curRegionInfo = regions.get(0);
       byte[] startRow = curRegionInfo.getStartKey();
       if (startRow == null || startRow.length == 0) {
@@ -1381,7 +1381,7 @@ public class TestDistributedLogSplitting {
           it.remove();
         }
       }
-      if (regions.size() == 0) return;
+      if (regions.isEmpty()) return;
       HRegionInfo curRegionInfo = regions.get(0);
       byte[] startRow = curRegionInfo.getStartKey();
       if (startRow == null || startRow.length == 0) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement.java
index 78572fd..b2be237 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement.java
@@ -150,13 +150,13 @@ public class TestRegionPlacement {
     rp.setTargetTableName(new String[]{tableStr});
     List<AssignmentVerificationReport> reports = rp.verifyRegionPlacement(false);
     AssignmentVerificationReport report = reports.get(0);
-    assertTrue(report.getRegionsWithoutValidFavoredNodes().size() == 0);
-    assertTrue(report.getNonFavoredAssignedRegions().size() == 0);
+    assertTrue(report.getRegionsWithoutValidFavoredNodes().isEmpty());
+    assertTrue(report.getNonFavoredAssignedRegions().isEmpty());
     assertTrue(report.getTotalFavoredAssignments() >= REGION_NUM);
     assertTrue(report.getNumRegionsOnFavoredNodeByPosition(FavoredNodesPlan.Position.PRIMARY) != 0);
     assertTrue(report.getNumRegionsOnFavoredNodeByPosition(FavoredNodesPlan.Position.SECONDARY) == 0);
     assertTrue(report.getNumRegionsOnFavoredNodeByPosition(FavoredNodesPlan.Position.TERTIARY) == 0);
-    assertTrue(report.getUnassignedRegions().size() == 0);
+    assertTrue(report.getUnassignedRegions().isEmpty());
 
     // Check when a RS stops, the regions get assigned to their secondary/tertiary
     killRandomServerAndVerifyAssignment();
@@ -164,8 +164,8 @@ public class TestRegionPlacement {
     // also verify that the AssignmentVerificationReport has the correct information
     reports = rp.verifyRegionPlacement(false);
     report = reports.get(0);
-    assertTrue(report.getRegionsWithoutValidFavoredNodes().size() == 0);
-    assertTrue(report.getNonFavoredAssignedRegions().size() == 0);
+    assertTrue(report.getRegionsWithoutValidFavoredNodes().isEmpty());
+    assertTrue(report.getNonFavoredAssignedRegions().isEmpty());
     assertTrue(report.getTotalFavoredAssignments() >= REGION_NUM);
     assertTrue(report.getNumRegionsOnFavoredNodeByPosition(FavoredNodesPlan.Position.PRIMARY) > 0);
     assertTrue("secondary " +

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java
index eca7703..c59f64b 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestColumnSeeking.java
@@ -147,7 +147,7 @@ public class TestColumnSeeking {
         Scan scan = new Scan();
         scan.setMaxVersions();
         if (i < numberOfTests) {
-          if (columnLists[i].size() == 0) continue; // HBASE-7700
+          if (columnLists[i].isEmpty()) continue; // HBASE-7700
           kvSet = kvMaps[i].values();
           for (String column : columnLists[i]) {
             scan.addColumn(familyBytes, Bytes.toBytes(column));
@@ -259,7 +259,7 @@ public class TestColumnSeeking {
       Scan scan = new Scan();
       scan.setMaxVersions();
       if (i < numberOfTests) {
-        if (columnLists[i].size() == 0) continue; // HBASE-7700
+        if (columnLists[i].isEmpty()) continue; // HBASE-7700
         kvSet = kvMaps[i].values();
         for (String column : columnLists[i]) {
           scan.addColumn(familyBytes, Bytes.toBytes(column));

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultCompactSelection.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultCompactSelection.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultCompactSelection.java
index 1513cd0..4fa18b8 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultCompactSelection.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultCompactSelection.java
@@ -176,7 +176,7 @@ public class TestDefaultCompactSelection extends TestCompactionPolicy {
     CompactionRequest result = ((RatioBasedCompactionPolicy) store.storeEngine
         .getCompactionPolicy()).selectCompaction(candidates,
         new ArrayList<StoreFile>(), false, false, false);
-    Assert.assertTrue(result.getFiles().size() == 0);
+    Assert.assertTrue(result.getFiles().isEmpty());
     store.setScanInfo(oldScanInfo);
   }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java
index e2a57eb..c722621 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java
@@ -152,7 +152,7 @@ public class TestEndToEndSplitTransaction {
         for (int i= 0; i< 5; i++) {
           List<HRegionInfo> regions =
               MetaTableAccessor.getTableRegions(connection, tableName, true);
-          if (regions.size() == 0) {
+          if (regions.isEmpty()) {
             continue;
           }
           int regionIndex = random.nextInt(regions.size());

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
index d40a684..ba27622 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
@@ -4756,7 +4756,7 @@ public class TestHRegion {
       primaryRegion.getRegionFileSystem().removeStoreFiles(Bytes.toString(families[0]), storeFiles);
       Collection<StoreFileInfo> storeFileInfos = primaryRegion.getRegionFileSystem()
           .getStoreFiles(families[0]);
-      Assert.assertTrue(storeFileInfos == null || storeFileInfos.size() == 0);
+      Assert.assertTrue(storeFileInfos == null || storeFileInfos.isEmpty());
 
       verifyData(secondaryRegion, 0, 1000, cq, families);
     } finally {

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
index 364f355..043473a 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
@@ -229,7 +229,7 @@ public class TestSplitTransactionOnCluster {
     htd.addFamily(new HColumnDescriptor(cf));
     admin.createTable(htd);
 
-    for (int i = 0; cluster.getRegions(tableName).size() == 0 && i < 100; i++) {
+    for (int i = 0; cluster.getRegions(tableName).isEmpty() && i < 100; i++) {
       Thread.sleep(100);
     }
     assertEquals(1, cluster.getRegions(tableName).size());

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestCompactedHFilesDischarger.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestCompactedHFilesDischarger.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestCompactedHFilesDischarger.java
index c23e794..aa5a20e 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestCompactedHFilesDischarger.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestCompactedHFilesDischarger.java
@@ -77,7 +77,7 @@ public class TestCompactedHFilesDischarger {
     Path path = testUtil.getDataTestDir(getClass().getSimpleName());
     region = HBaseTestingUtility.createRegionAndWAL(info, path, testUtil.getConfiguration(), htd);
     rss = mock(RegionServerServices.class);
-    List<Region> regions = new ArrayList<Region>();
+    List<Region> regions = new ArrayList<Region>(1);
     regions.add(region);
     when(rss.getOnlineRegions()).thenReturn(regions);
   }
@@ -153,7 +153,7 @@ public class TestCompactedHFilesDischarger {
       assertFalse(file.isCompactedAway());
     }
     compactedfiles = ((HStore) store).getStoreEngine().getStoreFileManager().getCompactedfiles();
-    assertTrue(compactedfiles.size() == 0);
+    assertTrue(compactedfiles.isEmpty());
     
   }
 
@@ -225,7 +225,7 @@ public class TestCompactedHFilesDischarger {
       assertFalse(file.isCompactedAway());
     }
     compactedfiles = ((HStore) store).getStoreEngine().getStoreFileManager().getCompactedfiles();
-    assertTrue(compactedfiles.size() == 0);
+    assertTrue(compactedfiles.isEmpty());
   }
 
   @Test
@@ -333,7 +333,7 @@ public class TestCompactedHFilesDischarger {
       assertFalse(file.isCompactedAway());
     }
     compactedfiles = ((HStore) store).getStoreEngine().getStoreFileManager().getCompactedfiles();
-    assertTrue(compactedfiles.size() == 0);
+    assertTrue(compactedfiles.isEmpty());
   }
 
   protected void countDown() {

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestStripeCompactionPolicy.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestStripeCompactionPolicy.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestStripeCompactionPolicy.java
index fa6e62a..5fadee8 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestStripeCompactionPolicy.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestStripeCompactionPolicy.java
@@ -666,7 +666,7 @@ public class TestStripeCompactionPolicy {
    */
   private static StripeInformationProvider createStripesWithSizes(
       int l0Count, long l0Size, Long[]... sizes) throws Exception {
-    ArrayList<List<Long>> sizeList = new ArrayList<List<Long>>();
+    ArrayList<List<Long>> sizeList = new ArrayList<List<Long>>(sizes.length);
     for (Long[] size : sizes) {
       sizeList.add(Arrays.asList(size));
     }
@@ -695,7 +695,7 @@ public class TestStripeCompactionPolicy {
       List<List<Long>> stripeSizes, List<Long> l0Sizes) throws Exception {
     List<List<StoreFile>> stripeFiles = new ArrayList<List<StoreFile>>(stripeSizes.size());
     for (List<Long> sizes : stripeSizes) {
-      List<StoreFile> sfs = new ArrayList<StoreFile>();
+      List<StoreFile> sfs = new ArrayList<StoreFile>(sizes.size());
       for (Long size : sizes) {
         sfs.add(createFile(size));
       }

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestStripeCompactor.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestStripeCompactor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestStripeCompactor.java
index 97331e8..4b82940 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestStripeCompactor.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/compactions/TestStripeCompactor.java
@@ -177,7 +177,7 @@ public class TestStripeCompactor {
       null, NoLimitThroughputController.INSTANCE, null);
     assertEquals(output.length, paths.size());
     writers.verifyKvs(output, true, true);
-    List<byte[]> boundaries = new ArrayList<byte[]>();
+    List<byte[]> boundaries = new ArrayList<byte[]>(output.length + 2);
     boundaries.add(left);
     for (int i = 1; i < output.length; ++i) {
       boundaries.add(CellUtil.cloneRow(output[i][0]));

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/querymatcher/TestExplicitColumnTracker.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/querymatcher/TestExplicitColumnTracker.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/querymatcher/TestExplicitColumnTracker.java
index a7e0667..3480597 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/querymatcher/TestExplicitColumnTracker.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/querymatcher/TestExplicitColumnTracker.java
@@ -49,7 +49,7 @@ public class TestExplicitColumnTracker {
     ColumnTracker exp = new ExplicitColumnTracker(trackColumns, 0, maxVersions, Long.MIN_VALUE);
 
     // Initialize result
-    List<ScanQueryMatcher.MatchCode> result = new ArrayList<ScanQueryMatcher.MatchCode>();
+    List<ScanQueryMatcher.MatchCode> result = new ArrayList<ScanQueryMatcher.MatchCode>(scannerColumns.size());
 
     long timestamp = 0;
     // "Match"
@@ -71,7 +71,7 @@ public class TestExplicitColumnTracker {
     // Looking for every other
     columns.add(col2);
     columns.add(col4);
-    List<MatchCode> expected = new ArrayList<ScanQueryMatcher.MatchCode>();
+    List<MatchCode> expected = new ArrayList<ScanQueryMatcher.MatchCode>(5);
     expected.add(ScanQueryMatcher.MatchCode.SEEK_NEXT_COL); // col1
     expected.add(ScanQueryMatcher.MatchCode.INCLUDE_AND_SEEK_NEXT_COL); // col2
     expected.add(ScanQueryMatcher.MatchCode.SEEK_NEXT_COL); // col3
@@ -80,7 +80,7 @@ public class TestExplicitColumnTracker {
     int maxVersions = 1;
 
     // Create "Scanner"
-    List<byte[]> scanner = new ArrayList<byte[]>();
+    List<byte[]> scanner = new ArrayList<byte[]>(5);
     scanner.add(col1);
     scanner.add(col2);
     scanner.add(col3);
@@ -98,7 +98,7 @@ public class TestExplicitColumnTracker {
     columns.add(col2);
     columns.add(col4);
 
-    List<ScanQueryMatcher.MatchCode> expected = new ArrayList<ScanQueryMatcher.MatchCode>();
+    List<ScanQueryMatcher.MatchCode> expected = new ArrayList<ScanQueryMatcher.MatchCode>(15);
     expected.add(ScanQueryMatcher.MatchCode.SEEK_NEXT_COL);
     expected.add(ScanQueryMatcher.MatchCode.SEEK_NEXT_COL);
     expected.add(ScanQueryMatcher.MatchCode.SEEK_NEXT_COL);
@@ -121,7 +121,7 @@ public class TestExplicitColumnTracker {
     int maxVersions = 2;
 
     // Create "Scanner"
-    List<byte[]> scanner = new ArrayList<byte[]>();
+    List<byte[]> scanner = new ArrayList<byte[]>(15);
     scanner.add(col1);
     scanner.add(col1);
     scanner.add(col1);

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/querymatcher/TestScanWildcardColumnTracker.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/querymatcher/TestScanWildcardColumnTracker.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/querymatcher/TestScanWildcardColumnTracker.java
index 044988b..2852947 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/querymatcher/TestScanWildcardColumnTracker.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/querymatcher/TestScanWildcardColumnTracker.java
@@ -44,20 +44,20 @@ public class TestScanWildcardColumnTracker {
     ScanWildcardColumnTracker tracker = new ScanWildcardColumnTracker(0, VERSIONS, Long.MIN_VALUE);
 
     // Create list of qualifiers
-    List<byte[]> qualifiers = new ArrayList<byte[]>();
+    List<byte[]> qualifiers = new ArrayList<byte[]>(4);
     qualifiers.add(Bytes.toBytes("qualifier1"));
     qualifiers.add(Bytes.toBytes("qualifier2"));
     qualifiers.add(Bytes.toBytes("qualifier3"));
     qualifiers.add(Bytes.toBytes("qualifier4"));
 
     // Setting up expected result
-    List<MatchCode> expected = new ArrayList<MatchCode>();
+    List<MatchCode> expected = new ArrayList<MatchCode>(4);
     expected.add(ScanQueryMatcher.MatchCode.INCLUDE);
     expected.add(ScanQueryMatcher.MatchCode.INCLUDE);
     expected.add(ScanQueryMatcher.MatchCode.INCLUDE);
     expected.add(ScanQueryMatcher.MatchCode.INCLUDE);
 
-    List<ScanQueryMatcher.MatchCode> actual = new ArrayList<MatchCode>();
+    List<ScanQueryMatcher.MatchCode> actual = new ArrayList<MatchCode>(qualifiers.size());
 
     for (byte[] qualifier : qualifiers) {
       ScanQueryMatcher.MatchCode mc = ScanQueryMatcher.checkColumn(tracker, qualifier, 0,
@@ -76,20 +76,20 @@ public class TestScanWildcardColumnTracker {
     ScanWildcardColumnTracker tracker = new ScanWildcardColumnTracker(0, VERSIONS, Long.MIN_VALUE);
 
     // Create list of qualifiers
-    List<byte[]> qualifiers = new ArrayList<byte[]>();
+    List<byte[]> qualifiers = new ArrayList<byte[]>(4);
     qualifiers.add(Bytes.toBytes("qualifier1"));
     qualifiers.add(Bytes.toBytes("qualifier1"));
     qualifiers.add(Bytes.toBytes("qualifier1"));
     qualifiers.add(Bytes.toBytes("qualifier2"));
 
     // Setting up expected result
-    List<ScanQueryMatcher.MatchCode> expected = new ArrayList<MatchCode>();
+    List<ScanQueryMatcher.MatchCode> expected = new ArrayList<MatchCode>(4);
     expected.add(ScanQueryMatcher.MatchCode.INCLUDE);
     expected.add(ScanQueryMatcher.MatchCode.INCLUDE);
     expected.add(ScanQueryMatcher.MatchCode.SEEK_NEXT_COL);
     expected.add(ScanQueryMatcher.MatchCode.INCLUDE);
 
-    List<MatchCode> actual = new ArrayList<ScanQueryMatcher.MatchCode>();
+    List<MatchCode> actual = new ArrayList<ScanQueryMatcher.MatchCode>(qualifiers.size());
 
     long timestamp = 0;
     for (byte[] qualifier : qualifiers) {
@@ -109,7 +109,7 @@ public class TestScanWildcardColumnTracker {
     ScanWildcardColumnTracker tracker = new ScanWildcardColumnTracker(0, VERSIONS, Long.MIN_VALUE);
 
     // Create list of qualifiers
-    List<byte[]> qualifiers = new ArrayList<byte[]>();
+    List<byte[]> qualifiers = new ArrayList<byte[]>(2);
     qualifiers.add(Bytes.toBytes("qualifier2"));
     qualifiers.add(Bytes.toBytes("qualifier1"));
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/querymatcher/TestUserScanQueryMatcher.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/querymatcher/TestUserScanQueryMatcher.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/querymatcher/TestUserScanQueryMatcher.java
index 04c3611..0831404 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/querymatcher/TestUserScanQueryMatcher.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/querymatcher/TestUserScanQueryMatcher.java
@@ -69,7 +69,7 @@ public class TestUserScanQueryMatcher extends AbstractTestScanQueryMatcher {
     // of just byte []
 
     // Expected result
-    List<MatchCode> expected = new ArrayList<ScanQueryMatcher.MatchCode>();
+    List<MatchCode> expected = new ArrayList<ScanQueryMatcher.MatchCode>(6);
     expected.add(ScanQueryMatcher.MatchCode.SEEK_NEXT_COL);
     expected.add(ScanQueryMatcher.MatchCode.INCLUDE_AND_SEEK_NEXT_COL);
     expected.add(ScanQueryMatcher.MatchCode.SEEK_NEXT_COL);
@@ -83,7 +83,7 @@ public class TestUserScanQueryMatcher extends AbstractTestScanQueryMatcher {
       new ScanInfo(this.conf, fam2, 0, 1, ttl, KeepDeletedCells.FALSE, 0, rowComparator),
       get.getFamilyMap().get(fam2), now - ttl, now, null);
 
-    List<KeyValue> memstore = new ArrayList<KeyValue>();
+    List<KeyValue> memstore = new ArrayList<KeyValue>(6);
     memstore.add(new KeyValue(row1, fam2, col1, 1, data));
     memstore.add(new KeyValue(row1, fam2, col2, 1, data));
     memstore.add(new KeyValue(row1, fam2, col3, 1, data));
@@ -92,7 +92,7 @@ public class TestUserScanQueryMatcher extends AbstractTestScanQueryMatcher {
 
     memstore.add(new KeyValue(row2, fam1, col1, data));
 
-    List<ScanQueryMatcher.MatchCode> actual = new ArrayList<ScanQueryMatcher.MatchCode>();
+    List<ScanQueryMatcher.MatchCode> actual = new ArrayList<ScanQueryMatcher.MatchCode>(memstore.size());
     KeyValue k = memstore.get(0);
     qm.setToNewRow(k);
 
@@ -113,7 +113,7 @@ public class TestUserScanQueryMatcher extends AbstractTestScanQueryMatcher {
     // of just byte []
 
     // Expected result
-    List<MatchCode> expected = new ArrayList<ScanQueryMatcher.MatchCode>();
+    List<MatchCode> expected = new ArrayList<ScanQueryMatcher.MatchCode>(6);
     expected.add(ScanQueryMatcher.MatchCode.INCLUDE);
     expected.add(ScanQueryMatcher.MatchCode.INCLUDE);
     expected.add(ScanQueryMatcher.MatchCode.INCLUDE);
@@ -126,7 +126,7 @@ public class TestUserScanQueryMatcher extends AbstractTestScanQueryMatcher {
       new ScanInfo(this.conf, fam2, 0, 1, ttl, KeepDeletedCells.FALSE, 0, rowComparator), null,
       now - ttl, now, null);
 
-    List<KeyValue> memstore = new ArrayList<KeyValue>();
+    List<KeyValue> memstore = new ArrayList<KeyValue>(6);
     memstore.add(new KeyValue(row1, fam2, col1, 1, data));
     memstore.add(new KeyValue(row1, fam2, col2, 1, data));
     memstore.add(new KeyValue(row1, fam2, col3, 1, data));
@@ -134,7 +134,7 @@ public class TestUserScanQueryMatcher extends AbstractTestScanQueryMatcher {
     memstore.add(new KeyValue(row1, fam2, col5, 1, data));
     memstore.add(new KeyValue(row2, fam1, col1, 1, data));
 
-    List<ScanQueryMatcher.MatchCode> actual = new ArrayList<ScanQueryMatcher.MatchCode>();
+    List<ScanQueryMatcher.MatchCode> actual = new ArrayList<ScanQueryMatcher.MatchCode>(memstore.size());
 
     KeyValue k = memstore.get(0);
     qm.setToNewRow(k);

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestFSWAL.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestFSWAL.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestFSWAL.java
index 19759d1..b5c464e 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestFSWAL.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/AbstractTestFSWAL.java
@@ -399,7 +399,7 @@ public abstract class AbstractTestFSWAL {
         }
       }
       // Add any old cluster id.
-      List<UUID> clusterIds = new ArrayList<UUID>();
+      List<UUID> clusterIds = new ArrayList<UUID>(1);
       clusterIds.add(UUID.randomUUID());
       // Now make appends run slow.
       goslow.set(true);

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
index db2c241..19c534e 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
@@ -245,7 +245,7 @@ public class TestLogRolling extends AbstractTestLogRolling {
       server = TEST_UTIL.getRSForFirstRegionInTable(desc.getTableName());
       HRegionInfo region = server.getOnlineRegions(desc.getTableName()).get(0).getRegionInfo();
       final WAL log = server.getWAL(region);
-      final List<Path> paths = new ArrayList<Path>();
+      final List<Path> paths = new ArrayList<Path>(1);
       final List<Integer> preLogRolledCalled = new ArrayList<Integer>();
 
       paths.add(AbstractFSWALProvider.getCurrentFileName(log));

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALActionsListener.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALActionsListener.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALActionsListener.java
index b6bb7a0..52f8fe7 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALActionsListener.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALActionsListener.java
@@ -85,7 +85,7 @@ public class TestWALActionsListener {
   @Test
   public void testActionListener() throws Exception {
     DummyWALActionsListener observer = new DummyWALActionsListener();
-    List<WALActionsListener> list = new ArrayList<WALActionsListener>();
+    List<WALActionsListener> list = new ArrayList<WALActionsListener>(1);
     list.add(observer);
     final WALFactory wals = new WALFactory(conf, list, "testActionListener");
     DummyWALActionsListener laterobserver = new DummyWALActionsListener();

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java
index 7ac5e94..c1a9e25 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java
@@ -195,7 +195,7 @@ public class TestMasterReplication {
         ServerLoad serverLoad = clusterStatus.getLoad(rsName);
         List<ReplicationLoadSource> replicationLoadSourceList =
             serverLoad.getReplicationLoadSourceList();
-        return replicationLoadSourceList.size() == 0;
+        return replicationLoadSourceList.isEmpty();
       }
     });
 
@@ -673,7 +673,7 @@ public class TestMasterReplication {
             + ". IsDeleteReplication:" + isDeleted);
       }
       Result res = target.get(get);
-      boolean sleep = isDeleted ? res.size() > 0 : res.size() == 0;
+      boolean sleep = isDeleted ? res.size() > 0 : res.isEmpty();
       if (sleep) {
         LOG.info("Waiting for more time for replication. Row:"
             + Bytes.toString(row) + ". IsDeleteReplication:" + isDeleted);

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMultiSlaveReplication.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMultiSlaveReplication.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMultiSlaveReplication.java
index cddc055..29e7d67 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMultiSlaveReplication.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMultiSlaveReplication.java
@@ -321,7 +321,7 @@ public class TestMultiSlaveReplication {
       boolean replicatedToAll = true;
       for (Table target : targets) {
         Result res = target.get(get);
-        if (res.size() == 0) {
+        if (res.isEmpty()) {
           LOG.info("Row not available");
           replicatedToAll = false;
           break;

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestNamespaceReplication.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestNamespaceReplication.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestNamespaceReplication.java
index ee9b0cb..3814562 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestNamespaceReplication.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestNamespaceReplication.java
@@ -214,7 +214,7 @@ public class TestNamespaceReplication extends TestReplicationBase {
           fail("Waited too much time for put replication");
         }
         Result res = target.get(get);
-        if (res.size() == 0) {
+        if (res.isEmpty()) {
           LOG.info("Row not available");
         } else {
           assertEquals(res.size(), 1);

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestPerTableCFReplication.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestPerTableCFReplication.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestPerTableCFReplication.java
index bd70be0..b73dc80 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestPerTableCFReplication.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestPerTableCFReplication.java
@@ -569,7 +569,7 @@ public class TestPerTableCFReplication {
       boolean replicatedToAll = true;
       for (Table target : targets) {
         Result res = target.get(get);
-        if (res.size() == 0) {
+        if (res.isEmpty()) {
           LOG.info("Row not available");
           replicatedToAll = false;
           break;

http://git-wip-us.apache.org/repos/asf/hbase/blob/55a1aa1e/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationChangingPeerRegionservers.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationChangingPeerRegionservers.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationChangingPeerRegionservers.java
index 53aabfe..8c218d0 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationChangingPeerRegionservers.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationChangingPeerRegionservers.java
@@ -130,7 +130,7 @@ public class TestReplicationChangingPeerRegionservers extends TestReplicationBas
         fail("Waited too much time for put replication");
       }
       Result res = htable2.get(get);
-      if (res.size() == 0) {
+      if (res.isEmpty()) {
         LOG.info("Row not available");
         Thread.sleep(SLEEP_TIME);
       } else {


Mime
View raw message