From b8f523c95f4fd5fc705f2c6c2a2d98217b9da450 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 21 Apr 2015 20:10:37 +0000
Subject: [PATCH] Converted use of Collection.size() to Collection.isEmpty().

---
 opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewIndexPanel.java |   29 ++++++-----------------------
 1 files changed, 6 insertions(+), 23 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewIndexPanel.java b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewIndexPanel.java
index a1c120f..0ddc06b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewIndexPanel.java
+++ b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewIndexPanel.java
@@ -188,7 +188,7 @@
           }
         }
       }
-      if (customAttrNames.size() > 0)
+      if (!customAttrNames.isEmpty())
       {
         newElements.add(new CategorizedComboBoxElement(
             CUSTOM_ATTRIBUTES,
@@ -200,7 +200,7 @@
               CategorizedComboBoxElement.Type.REGULAR));
         }
       }
-      if (standardAttrNames.size() > 0)
+      if (!standardAttrNames.isEmpty())
       {
         newElements.add(new CategorizedComboBoxElement(
             STANDARD_ATTRIBUTES,
@@ -212,21 +212,6 @@
               CategorizedComboBoxElement.Type.REGULAR));
         }
       }
-      // Ignore configuration attr names
-      /*
-        if (configurationAttrNames.size() > 0)
-        {
-          newElements.add(new CategorizedComboBoxDescriptor(
-              "Configuration Attributes",
-              CategorizedComboBoxDescriptor.Type.CATEGORY));
-          for (String attrName : configurationAttrNames)
-          {
-            newElements.add(new CategorizedComboBoxDescriptor(
-                attrName,
-                CategorizedComboBoxDescriptor.Type.REGULAR));
-          }
-        }
-       */
       DefaultComboBoxModel model =
         (DefaultComboBoxModel)attributes.getModel();
       updateComboBoxModel(newElements, model);
@@ -323,7 +308,7 @@
     {
       task.canLaunch(newTask, errors);
     }
-    if (errors.size() == 0)
+    if (errors.isEmpty())
     {
       launchOperation(newTask,
           INFO_CTRL_PANEL_CREATING_NEW_INDEX_SUMMARY.get(attrName),
@@ -429,13 +414,11 @@
         // All the operations are incompatible if they apply to this
         // backend for safety.  This is a short operation so the limitation
         // has not a lot of impact.
-        Set<String> backends =
-          new TreeSet<String>(taskToBeLaunched.getBackends());
+        Set<String> backends = new TreeSet<>(taskToBeLaunched.getBackends());
         backends.retainAll(getBackends());
-        if (backends.size() > 0)
+        if (!backends.isEmpty())
         {
-          incompatibilityReasons.add(getIncompatibilityMessage(this,
-              taskToBeLaunched));
+          incompatibilityReasons.add(getIncompatibilityMessage(this, taskToBeLaunched));
           canLaunch = false;
         }
       }

--
Gitblit v1.10.0