diff --git a/src/main/java/org/dspace/ctask/replicate/BagItReplicateConsumer.java b/src/main/java/org/dspace/ctask/replicate/BagItReplicateConsumer.java index 3acaa06..0447adf 100644 --- a/src/main/java/org/dspace/ctask/replicate/BagItReplicateConsumer.java +++ b/src/main/java/org/dspace/ctask/replicate/BagItReplicateConsumer.java @@ -217,7 +217,7 @@ public void end(Context ctx) throws Exception long stamp = System.currentTimeMillis(); // first the queueables Set entrySet = new HashSet(); - if (taskQMap.size() > 0) + if (!taskQMap.isEmpty()) { List taskList = new ArrayList(); for (String task : taskQMap.keySet()) @@ -232,7 +232,7 @@ public void end(Context ctx) throws Exception taskQMap.clear(); } // now the performables - if (taskPMap.size() > 0) + if (!taskPMap.isEmpty()) { Curator curator = new Curator(); for (String task : taskPMap.keySet()) @@ -256,7 +256,7 @@ public void end(Context ctx) throws Exception } processDelete(ctx); } - if (entrySet.size() > 0) + if (!entrySet.isEmpty()) { taskQueue.enqueue(queueName, entrySet); } @@ -467,7 +467,7 @@ private void mapId(Map> map, List tasks, String id) private void parseTasks(String propName) { String taskStr = configurationService.getProperty("replicate.consumer.tasks." + propName); - if (taskStr == null || taskStr.length() == 0) + if (taskStr == null || taskStr.isEmpty()) { return; }