diff --git a/accumulo/src/main/java/com/yahoo/ycsb/db/AccumuloClient.java b/accumulo/src/main/java/com/yahoo/ycsb/db/AccumuloClient.java index 79be7d9154a23b3e285599886cd9867410a6f0b9..db78e8793d531b28843a64989dd14f252f5bb107 100644 --- a/accumulo/src/main/java/com/yahoo/ycsb/db/AccumuloClient.java +++ b/accumulo/src/main/java/com/yahoo/ycsb/db/AccumuloClient.java @@ -416,7 +416,7 @@ public class AccumuloClient extends DB { // If the results are empty, the key is enqueued in // Zookeeper // and tried again, until the results are found. - if (result.size() == 0) { + if (result.isEmpty()) { q.produce(strKey); int count = ((Integer) hmKeyNumReads.get(strKey)).intValue(); hmKeyNumReads.put(strKey, new Integer(count + 1)); diff --git a/accumulo/src/main/java/com/yahoo/ycsb/db/ZKProducerConsumer.java b/accumulo/src/main/java/com/yahoo/ycsb/db/ZKProducerConsumer.java index 2d42c79a5b9f090307b9b674f80a147419958d07..1b478f72b738e45440def94939146babb7984775 100644 --- a/accumulo/src/main/java/com/yahoo/ycsb/db/ZKProducerConsumer.java +++ b/accumulo/src/main/java/com/yahoo/ycsb/db/ZKProducerConsumer.java @@ -174,7 +174,7 @@ public class ZKProducerConsumer implements Watcher { while (true) { synchronized (mutex) { List<String> list = zk.getChildren(getRoot(), true); - if (list.size() == 0) { + if (list.isEmpty()) { System.out.println("Going to wait"); mutex.wait(); } else { diff --git a/core/src/main/java/com/yahoo/ycsb/CommandLine.java b/core/src/main/java/com/yahoo/ycsb/CommandLine.java index 02885730ec76ce1d4ceab0aa50b3247543bd1c19..80c1fc18b1df7b00807ee300fdbf4d4a3177a5ce 100644 --- a/core/src/main/java/com/yahoo/ycsb/CommandLine.java +++ b/core/src/main/java/com/yahoo/ycsb/CommandLine.java @@ -327,7 +327,7 @@ public class CommandLine Status ret=db.scan(table,tokens[1],Integer.parseInt(tokens[2]),fields,results); System.out.println("Result: "+ret.getName()); int record=0; - if (results.size()==0) + if (results.isEmpty()) { System.out.println("0 records"); } diff --git a/couchbase/src/main/java/com/yahoo/ycsb/db/CouchbaseClient.java b/couchbase/src/main/java/com/yahoo/ycsb/db/CouchbaseClient.java index fb29c456006770257dcc66c4f0667d0bd3234c8e..d5179b34915ae86f4e18c52a91fce97172938a27 100644 --- a/couchbase/src/main/java/com/yahoo/ycsb/db/CouchbaseClient.java +++ b/couchbase/src/main/java/com/yahoo/ycsb/db/CouchbaseClient.java @@ -291,7 +291,7 @@ public class CouchbaseClient extends DB { if (useJson) { try { JsonNode json = JSON_MAPPER.readTree((String) source); - boolean checkFields = fields != null && fields.size() > 0; + boolean checkFields = fields != null && !fields.isEmpty(); for (Iterator<Map.Entry<String, JsonNode>> jsonFields = json.fields(); jsonFields.hasNext();) { Map.Entry<String, JsonNode> jsonField = jsonFields.next(); String name = jsonField.getKey(); diff --git a/memcached/src/main/java/com/yahoo/ycsb/db/MemcachedClient.java b/memcached/src/main/java/com/yahoo/ycsb/db/MemcachedClient.java index 8a95d8fbbbf6d19c329a81f1d1885a3acb653272..9ce0b93c9293d9dbb7daa99df531c0cc3a4b190f 100644 --- a/memcached/src/main/java/com/yahoo/ycsb/db/MemcachedClient.java +++ b/memcached/src/main/java/com/yahoo/ycsb/db/MemcachedClient.java @@ -262,7 +262,7 @@ public class MemcachedClient extends DB { String value, Set<String> fields, Map<String, ByteIterator> result) throws IOException { JsonNode json = MAPPER.readTree(value); - boolean checkFields = fields != null && fields.size() > 0; + boolean checkFields = fields != null && !fields.isEmpty(); for (Iterator<Map.Entry<String, JsonNode>> jsonFields = json.getFields(); jsonFields.hasNext(); /* increment in loop body */) {