mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
21.10.2015 b8f523c95f4fd5fc705f2c6c2a2d98217b9da450
Converted use of Collection.size() to Collection.isEmpty().


ConnectionHandlerTableModel.java:
In getAddressPortString(), inverted if statement.

IndexTask.java, RebuildIndexTask.java, StatusPanel.java, TableViewEntryPanel.java:
Extracted methods.

ControlPanelInfo.java:
Removed duplicated logic by inverting inner and outer if statements.

BaseDNPanel.java:
In okClicked(), simplified the code.

LDAPEntryPanel.java:
In saveChanges(), In okClicked(), simplified the code.

SimplifiedViewEntryPanel.java:
In getValues(), simplified code.
62 files modified
752 ■■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/admin/ads/ADSContextHelper.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/admin/ads/ServerDescriptor.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ControlPanelArgumentParser.java 8 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/IconPool.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/ConnectionHandlerTableModel.java 23 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/ControlPanelInfo.java 75 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/AddToGroupTask.java 9 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/CancelTaskTask.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/DeleteBaseDNAndBackendTask.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/DeleteEntryTask.java 18 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/DeleteIndexTask.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/IndexTask.java 33 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/ModifyEntryTask.java 28 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/NewEntryTask.java 8 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/RebuildIndexTask.java 56 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/ResetUserPasswordTask.java 8 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AbstractBrowseEntriesPanel.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AbstractNewEntryPanel.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AbstractVLVIndexPanel.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AddToGroupPanel.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BackupListPanel.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BackupPanel.java 13 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BaseDNPanel.java 7 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BinaryAttributeEditorPanel.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseEntriesPanel.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseIndexPanel.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseSchemaPanel.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/CustomObjectClassPanel.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/DBEnvironmentMonitoringPanel.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/DeleteBackendPanel.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/DeleteBaseDNPanel.java 27 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ExportLDIFPanel.java 13 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ImportLDIFPanel.java 13 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/IndexPanel.java 11 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/JavaPropertiesPanel.java 14 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/LDAPEntryPanel.java 15 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/MainMenuBar.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ManageTasksPanel.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewAttributePanel.java 9 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewBaseDNPanel.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewEntryFromLDIFPanel.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewIndexPanel.java 29 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewObjectClassPanel.java 9 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewOrganizationalUnitPanel.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewUserPanel.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewVLVIndexPanel.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/RebuildIndexPanel.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/RefreshOptionsPanel.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ResetUserPasswordPanel.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/RestorePanel.java 13 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/SimplifiedViewEntryPanel.java 64 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/StandardObjectClassPanel.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/StatusGenericPanel.java 23 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/StatusPanel.java 75 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/TableViewEntryPanel.java 32 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/TaskToSchedulePanel.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/VLVIndexPanel.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/VerifyIndexPanel.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ViewEntryPanel.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/ObjectClassCellPanel.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/quicksetup/ConfigurationTest.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/tasks/TasksTestCase.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/admin/ads/ADSContextHelper.java
@@ -103,7 +103,7 @@
        if (suffixes != null
            && suffixes.remove(DN.valueOf(ADSContext.getAdministrationSuffixDN())))
        {
          if (suffixes.size() > 0)
          if (!suffixes.isEmpty())
          {
            backend.setBaseDN(suffixes);
            backend.commit();
opendj-server-legacy/src/main/java/org/opends/admin/ads/ServerDescriptor.java
@@ -682,7 +682,7 @@
        if (port == -1)
        {
          adsProperties.put(adsProps[i][0], "false");
          if (p.size() > 0)
          if (!p.isEmpty())
          {
            port = (Integer)p.iterator().next();
          }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ControlPanelArgumentParser.java
@@ -163,12 +163,10 @@
      errorMessages.add(message);
    }
    if (errorMessages.size() > 0)
    if (!errorMessages.isEmpty())
    {
      LocalizableMessage message = ERR_CANNOT_INITIALIZE_ARGS.get(
          Utils.getMessageFromCollection(errorMessages,
              Constants.LINE_SEPARATOR));
      throw new ArgumentException(message);
      throw new ArgumentException(ERR_CANNOT_INITIALIZE_ARGS.get(
          Utils.getMessageFromCollection(errorMessages, Constants.LINE_SEPARATOR)));
    }
  }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/IconPool.java
@@ -257,7 +257,7 @@
    ImageIcon result;
    // Find the icon associated to the object class
    if (objectClasses == null || objectClasses.size() == 0) {
    if (objectClasses == null || objectClasses.isEmpty()) {
      result = getDefaultContainerIcon();
    }
    else {
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/ConnectionHandlerTableModel.java
@@ -252,19 +252,7 @@
  private String getAddressPortString(ConnectionHandlerDescriptor desc)
  {
    Set<InetAddress> addresses = desc.getAddresses();
    String returnValue;
    if (addresses.size() == 0)
    {
      if (desc.getPort() > 0)
      {
        returnValue = String.valueOf(desc.getPort());
      }
      else
      {
        returnValue = INFO_NOT_APPLICABLE_LABEL.get().toString();
      }
    }
    else
    if (!addresses.isEmpty())
    {
      StringBuilder buf = new StringBuilder();
      buf.append("<html>");
@@ -282,9 +270,14 @@
          buf.append(":").append(desc.getPort());
        }
      }
      returnValue = buf.toString();
      return buf.toString();
    }
    return returnValue;
    if (desc.getPort() > 0)
    {
      return String.valueOf(desc.getPort());
    }
    return INFO_NOT_APPLICABLE_LABEL.get().toString();
  }
  private String getProtocolString(ConnectionHandlerDescriptor desc)
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/ControlPanelInfo.java
@@ -24,7 +24,6 @@
 *      Copyright 2008-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 */
package org.opends.guitools.controlpanel.datamodel;
import java.io.File;
@@ -969,58 +968,30 @@
  private static String getURL(ServerDescriptor server,
      ConnectionHandlerDescriptor.Protocol protocol)
  {
    String sProtocol = toString(protocol);
    String url = null;
    String sProtocol = null;
    switch (protocol)
    {
    case LDAP:
      sProtocol = "ldap";
      break;
    case LDAPS:
      sProtocol = "ldaps";
      break;
    case LDAP_STARTTLS:
      sProtocol = "ldap";
      break;
    case JMX:
      sProtocol = "jmx";
      break;
    case JMXS:
      sProtocol = "jmxs";
      break;
    }
    for (ConnectionHandlerDescriptor desc : server.getConnectionHandlers())
    {
      if ((desc.getState() == ConnectionHandlerDescriptor.State.ENABLED) &&
          (desc.getProtocol() == protocol))
      {
        int port = desc.getPort();
        SortedSet<InetAddress> addresses = desc.getAddresses();
        if (addresses.size() == 0)
        {
          if (port > 0)
          {
            if (server.isLocal())
            {
            SortedSet<InetAddress> addresses = desc.getAddresses();
            if (addresses.isEmpty())
            {
              url = sProtocol +"://localhost:"+port;
            }
            else
            {
              url = sProtocol + "://" + getHostNameForLdapUrl(server.getHostname()) + ":" + port;
            }
          }
        }
        else
        {
          if (port > 0)
          {
            if (server.isLocal())
            {
              InetAddress address = addresses.first();
              url = sProtocol + "://" + getHostNameForLdapUrl(address.getHostAddress()) + ":" + port;
            }
          }
            else
            {
              url = sProtocol + "://" + getHostNameForLdapUrl(server.getHostname()) + ":" + port;
@@ -1028,10 +999,28 @@
          }
        }
      }
    }
    return url;
  }
  private static String toString(ConnectionHandlerDescriptor.Protocol protocol)
  {
    switch (protocol)
    {
    case LDAP:
      return "ldap";
    case LDAPS:
      return "ldaps";
    case LDAP_STARTTLS:
      return "ldap";
    case JMX:
      return "jmx";
    case JMXS:
      return "jmxs";
    default:
      return null;
    }
  }
  /**
   * Returns the Administration Connector URL.
   * It returns <CODE>null</CODE> if URL for the
@@ -1045,15 +1034,15 @@
    {
      int port = desc.getPort();
      SortedSet<InetAddress> addresses = desc.getAddresses();
      if (addresses.size() == 0) {
        if (port > 0) {
          return getLDAPUrl("localhost", port, true);
        if (!addresses.isEmpty())
        {
          String hostAddr = addresses.first().getHostAddress();
          return getLDAPUrl(hostAddr, port, true);
        }
      } else {
        if (port > 0) {
          InetAddress address = addresses.first();
          String a = address.getHostAddress();
          return getLDAPUrl(a, port, true);
        else
        {
          return getLDAPUrl("localhost", port, true);
        }
      }
    }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/AddToGroupTask.java
@@ -142,7 +142,7 @@
      // has not a lot of impact.
      Set<String> backends = new TreeSet<String>(taskToBeLaunched.getBackends());
      backends.retainAll(getBackends());
      if (backends.size() > 0)
      if (!backends.isEmpty())
      {
        incompatibilityReasons.add(getIncompatibilityMessage(this, taskToBeLaunched));
        return false;
@@ -169,7 +169,7 @@
      {
        final Collection<ModificationItem> modifications =
          getModifications(groupDn, dns);
        if (modifications.size() > 0)
        if (!modifications.isEmpty())
        {
          ModificationItem[] mods =
          new ModificationItem[modifications.size()];
@@ -281,10 +281,9 @@
            dnsToAdd.add(newDn.toString());
          }
        }
        if (dnsToAdd.size() > 0)
        if (!dnsToAdd.isEmpty())
        {
          Attribute attribute =
            new BasicAttribute(memberAttr);
          Attribute attribute = new BasicAttribute(memberAttr);
          for (String dn : dnsToAdd)
          {
            attribute.add(dn);
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/CancelTaskTask.java
@@ -135,7 +135,7 @@
      // has not a lot of impact.
      Set<String> backends = new TreeSet<String>(taskToBeLaunched.getBackends());
      backends.retainAll(getBackends());
      if (backends.size() > 0)
      if (!backends.isEmpty())
      {
        incompatibilityReasons.add(getIncompatibilityMessage(this, taskToBeLaunched));
        return false;
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/DeleteBaseDNAndBackendTask.java
@@ -181,7 +181,7 @@
      }
    }
    if (backendsToDelete.size() > 0)
    if (!backendsToDelete.isEmpty())
    {
      if (sb.length() > 0)
      {
@@ -216,10 +216,9 @@
      // 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));
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/DeleteEntryTask.java
@@ -175,10 +175,9 @@
      Set<String> backends =
        new TreeSet<String>(taskToBeLaunched.getBackends());
      backends.retainAll(getBackends());
      if (backends.size() > 0)
      if (!backends.isEmpty())
      {
        incompatibilityReasons.add(getIncompatibilityMessage(this,
            taskToBeLaunched));
        incompatibilityReasons.add(getIncompatibilityMessage(this, taskToBeLaunched));
        return false;
      }
    }
@@ -238,10 +237,9 @@
              node.getDN(), de);
        }
      }
      if (toNotify.size() > 0)
      if (!toNotify.isEmpty())
      {
        final List<BrowserNodeInfo> fToNotify =
          new ArrayList<BrowserNodeInfo>(toNotify);
        final List<BrowserNodeInfo> fToNotify = new ArrayList<>(toNotify);
        toNotify.clear();
        SwingUtilities.invokeLater(new Runnable()
        {
@@ -384,9 +382,9 @@
      {
        lastProgressTime = t;
        final Collection<BrowserNodeInfo> fToNotify;
        if (toNotify.size() > 0)
        if (!toNotify.isEmpty())
        {
          fToNotify = new ArrayList<BrowserNodeInfo>(toNotify);
          fToNotify = new ArrayList<>(toNotify);
          toNotify.clear();
        }
        else
@@ -467,9 +465,9 @@
      toNotify.add(controller.getNodeInfoFromPath(path));
    }
    final Collection<BrowserNodeInfo> fToNotify;
    if (toNotify.size() > 0)
    if (!toNotify.isEmpty())
    {
      fToNotify = new ArrayList<BrowserNodeInfo>(toNotify);
      fToNotify = new ArrayList<>(toNotify);
      toNotify.clear();
    }
    else
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/DeleteIndexTask.java
@@ -122,7 +122,7 @@
      // has not a lot of impact.
      final Set<String> backends = new TreeSet<String>(taskToBeLaunched.getBackends());
      backends.retainAll(getBackends());
      if (backends.size() > 0)
      if (!backends.isEmpty())
      {
        incompatibilityReasons.add(getIncompatibilityMessage(this, taskToBeLaunched));
        canLaunch = false;
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/IndexTask.java
@@ -85,13 +85,10 @@
    initializeBackendSet();
  }
  /**
   * Initialize the list of backends that are affected by this task.
   *
   */
  /** Initialize the list of backends that are affected by this task. */
  private void initializeBackendSet()
  {
    backendSet = new TreeSet<String>();
    backendSet = new TreeSet<>();
    DN theDN = null;
    for (String baseDN : baseDNs)
    {
@@ -101,26 +98,28 @@
      }
      catch (Throwable t)
      {
        throw new IllegalArgumentException("Could not decode dn "+
            baseDN, t);
        throw new IllegalArgumentException("Could not decode dn " + baseDN, t);
      }
      for (BackendDescriptor backend :
        getInfo().getServerDescriptor().getBackends())
      BackendDescriptor backend = findBackendByID(theDN);
      if (backend != null) {
        backendSet.add(backend.getBackendID());
      }
    }
  }
  private BackendDescriptor findBackendByID(DN dn)
  {
    for (BackendDescriptor backend : getInfo().getServerDescriptor().getBackends())
      {
        for (BaseDNDescriptor b : backend.getBaseDns())
        {
          if (b.getDn().equals(theDN))
        if (b.getDn().equals(dn))
          {
            backendSet.add(backend.getBackendID());
            break;
          }
        }
        if (backendSet.size() > 0)
        {
          break;
          return backend;
        }
      }
    }
    return null;
  }
  /** {@inheritDoc} */
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/ModifyEntryTask.java
@@ -138,9 +138,9 @@
    {
      modifications.remove(passwordModification);
    }
    hasModifications = modifications.size() > 0 ||
    !oldDn.equals(newEntry.getName()) ||
    (passwordModification != null);
    hasModifications = !modifications.isEmpty()
        || !oldDn.equals(newEntry.getName())
        || passwordModification != null;
  }
  /**
@@ -195,13 +195,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));
        return false;
      }
    }
@@ -227,7 +225,7 @@
      useAdminCtx = controller.isConfigurationNode(node);
      if (!mustRename)
      {
        if (modifications.size() > 0) {
        if (!modifications.isEmpty()) {
          ModificationItem[] mods =
          new ModificationItem[modifications.size()];
          modifications.toArray(mods);
@@ -303,7 +301,7 @@
        ResetUserPasswordTask newTask = new ResetUserPasswordTask(getInfo(),
            getProgressDialog(), (BasicNode)treePath.getLastPathComponent(),
            controller, sPwd.toCharArray());
        if ((modifications.size() > 0) || mustRename)
        if (!modifications.isEmpty() || mustRename)
        {
          getProgressDialog().appendProgressHtml("<br><br>");
        }
@@ -569,7 +567,7 @@
        {
          vs.remove(rdnValue);
        }
        if (vs.size() > 0)
        if (!vs.isEmpty())
        {
          modifications.add(new ModificationItem(
              DirContext.ADD_ATTRIBUTE,
@@ -595,20 +593,20 @@
        }
        else
        {
          if (toDelete.size() > 0)
          if (!toDelete.isEmpty())
          {
            modifications.add(new ModificationItem(
                DirContext.REMOVE_ATTRIBUTE,
                createAttribute(attrName, toDelete)));
          }
          if (toAdd.size() > 0)
          if (!toAdd.isEmpty())
          {
            List<ByteString> vs = new ArrayList<ByteString>(toAdd);
            if (rdnValue != null)
            {
              vs.remove(rdnValue);
            }
            if (vs.size() > 0)
            if (!vs.isEmpty())
            {
              modifications.add(new ModificationItem(
                  DirContext.ADD_ATTRIBUTE,
@@ -644,7 +642,7 @@
          }
        }
      }
      if (!found && (oldValues.size() > 0))
      if (!found && !oldValues.isEmpty())
      {
        modifications.add(new ModificationItem(
            DirContext.REMOVE_ATTRIBUTE,
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/NewEntryTask.java
@@ -146,13 +146,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));
        return false;
      }
    }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/RebuildIndexTask.java
@@ -24,7 +24,6 @@
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2012-2015 ForgeRock AS
 */
package org.opends.guitools.controlpanel.task;
import static org.opends.messages.AdminToolMessages.*;
@@ -39,6 +38,7 @@
import javax.swing.SwingUtilities;
import org.forgerock.i18n.LocalizableMessage;
import org.opends.guitools.controlpanel.datamodel.AbstractIndexDescriptor;
import org.opends.guitools.controlpanel.datamodel.BackendDescriptor;
import org.opends.guitools.controlpanel.datamodel.ControlPanelInfo;
@@ -46,12 +46,10 @@
import org.opends.guitools.controlpanel.datamodel.VLVIndexDescriptor;
import org.opends.guitools.controlpanel.ui.ProgressDialog;
import org.opends.guitools.controlpanel.util.Utilities;
import org.forgerock.i18n.LocalizableMessage;
import org.opends.server.tools.RebuildIndex;
/**
 * The class that is used when a set of indexes must be rebuilt.
 *
 */
public class RebuildIndexTask extends IndexTask
{
@@ -110,15 +108,12 @@
    boolean canLaunch = true;
    if (state == State.RUNNING && runningOnSameServer(taskToBeLaunched))
    {
      // All the operations are incompatible if they apply to this
      // backend.
      Set<String> backends =
        new TreeSet<String>(taskToBeLaunched.getBackends());
      // All the operations are incompatible if they apply to this backend.
      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;
      }
    }
@@ -138,10 +133,7 @@
      for (final String baseDN : baseDNs)
      {
        ArrayList<String> arguments = getCommandLineArguments(baseDN);
        String[] args = new String[arguments.size()];
        arguments.toArray(args);
        String[] args = arguments.toArray(new String[arguments.size()]);
        final List<String> displayArgs = getObfuscatedCommandLineArguments(
            getCommandLineArguments(baseDN));
@@ -257,7 +249,6 @@
  private boolean rebuildAll()
  {
    boolean rebuildAll = true;
    Set<BackendDescriptor> backends = new HashSet<BackendDescriptor>();
    for (AbstractIndexDescriptor index : indexes)
    {
@@ -265,48 +256,45 @@
    }
    for (BackendDescriptor backend : backends)
    {
      Set<AbstractIndexDescriptor> allIndexes =
        new HashSet<AbstractIndexDescriptor>();
      Set<AbstractIndexDescriptor> allIndexes = new HashSet<>();
      allIndexes.addAll(backend.getIndexes());
      allIndexes.addAll(backend.getVLVIndexes());
      for (AbstractIndexDescriptor index : allIndexes)
      {
        if (!ignoreIndex(index))
        if (!ignoreIndex(index)
            && !indexExists(index))
        {
          boolean found = false;
          return false;
        }
      }
    }
    return true;
  }
  private boolean indexExists(AbstractIndexDescriptor index)
  {
          for (AbstractIndexDescriptor indexToRebuild : indexes)
          {
            if (indexToRebuild.equals(index))
            {
              found = true;
              break;
        return true;
            }
          }
          if (!found)
          {
            rebuildAll = false;
            break;
          }
        }
      }
    }
    return rebuildAll;
    return false;
  }
  private boolean ignoreIndex(AbstractIndexDescriptor index)
  {
    boolean ignoreIndex = false;
    if (index instanceof IndexDescriptor)
    {
      for (String name : INDEXES_NOT_TO_SPECIFY)
      {
        if (name.equalsIgnoreCase(index.getName()))
        {
          ignoreIndex = true;
          break;
          return true;
        }
      }
    }
    return ignoreIndex;
    return false;
  }
}
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/ResetUserPasswordTask.java
@@ -180,13 +180,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));
        return false;
      }
    }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AbstractBrowseEntriesPanel.java
@@ -1154,7 +1154,7 @@
            model.addElement(newElement);
          }
          // If there are not backends, we get no indexes to set.
          if (newElements.size() > 0)
          if (!newElements.isEmpty())
          {
            model.addElement(COMBO_SEPARATOR);
          }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AbstractNewEntryPanel.java
@@ -161,7 +161,7 @@
  private void handleErrorsAndLaunchTask(ArrayList<LocalizableMessage> errors)
  {
    Entry entry = null;
    if (errors.size() == 0)
    if (errors.isEmpty())
    {
      try
      {
@@ -180,7 +180,7 @@
        errors.add(ERR_CTRL_PANEL_ENTRY_ALREADY_EXISTS.get(dn));
      }
    }
    if (errors.size() == 0)
    if (errors.isEmpty())
    {
      final ProgressDialog dlg = new ProgressDialog(
          Utilities.createFrame(), Utilities.getParentDialog(this),
@@ -194,7 +194,7 @@
        {
          task.canLaunch(newTask, errors);
        }
        if (errors.size() == 0)
        if (errors.isEmpty())
        {
          launchOperation(newTask,
              INFO_CTRL_PANEL_CREATING_NEW_ENTRY_SUMMARY.get(),
@@ -221,7 +221,7 @@
        throw new RuntimeException("Unexpected error: "+t, t);
      }
    }
    if (errors.size() > 0)
    if (!errors.isEmpty())
    {
      displayErrorDialog(errors);
    }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AbstractVLVIndexPanel.java
@@ -366,7 +366,7 @@
          }
        }
      }
      if (customAttrNames.size() > 0)
      if (!customAttrNames.isEmpty())
      {
        newElements.add(new CategorizedComboBoxElement(CUSTOM_ATTRIBUTES, CategorizedComboBoxElement.Type.CATEGORY));
        for (String attrName : customAttrNames)
@@ -374,7 +374,7 @@
          newElements.add(new CategorizedComboBoxElement(attrName, CategorizedComboBoxElement.Type.REGULAR));
        }
      }
      if (standardAttrNames.size() > 0)
      if (!standardAttrNames.isEmpty())
      {
        newElements.add(new CategorizedComboBoxElement(STANDARD_ATTRIBUTES, CategorizedComboBoxElement.Type.CATEGORY));
        for (String attrName : standardAttrNames)
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AddToGroupPanel.java
@@ -401,7 +401,7 @@
  private void handleErrorsAndLaunchTask(ArrayList<LocalizableMessage> errors)
  {
    if (errors.size() == 0)
    if (errors.isEmpty())
    {
      ProgressDialog dlg = new ProgressDialog(
          Utilities.createFrame(),
@@ -434,7 +434,7 @@
        {
          task.canLaunch(newTask, errors);
        }
        if (errors.size() == 0)
        if (errors.isEmpty())
        {
          launchOperation(newTask,
              INFO_CTRL_PANEL_ADDING_TO_GROUP_SUMMARY.get(),
@@ -454,7 +454,7 @@
        throw new RuntimeException("Unexpected error: "+t, t);
      }
    }
    if (errors.size() > 0)
    if (!errors.isEmpty())
    {
      displayErrorDialog(errors);
    }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BackupListPanel.java
@@ -400,7 +400,7 @@
            }
          }
        }
        if ((backups.size() == 0) && (firstThrowable != null))
        if (backups.isEmpty() && firstThrowable != null)
        {
          throw firstThrowable;
        }
@@ -416,7 +416,7 @@
        renderer.setParentPath(new File(parentPath));
        if (t == null)
        {
          if (returnValue.size() > 0)
          if (!returnValue.isEmpty())
          {
            for (BackupInfo backup : returnValue)
            {
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BackupPanel.java
@@ -556,7 +556,7 @@
            Utilities.getParentDialog(BackupPanel.this).setVisible(false);
          }
        }
        if (errors.size() > 0)
        if (!errors.isEmpty())
        {
          displayErrorDialog(errors);
        }
@@ -684,15 +684,12 @@
      boolean canLaunch = true;
      if (state == State.RUNNING && runningOnSameServer(taskToBeLaunched))
      {
        // All the operations are incompatible if they apply to this
        // backend.
        Set<String> backends =
          new TreeSet<String>(taskToBeLaunched.getBackends());
        // All the operations are incompatible if they apply to this backend.
        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;
        }
      }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BaseDNPanel.java
@@ -117,7 +117,7 @@
  public void okClicked()
  {
    setPrimaryValid(dnLabel);
    LinkedHashSet<LocalizableMessage> errors = new LinkedHashSet<LocalizableMessage>();
    LinkedHashSet<LocalizableMessage> errors = new LinkedHashSet<>();
    if ("".equals(dn.getText().trim()))
    {
@@ -135,10 +135,6 @@
      }
    }
    if (errors.size() > 0)
    {
      setPrimaryInvalid(dnLabel);
    }
    if (errors.isEmpty())
    {
      baseDn = dn.getText().trim();
@@ -146,6 +142,7 @@
    }
    else
    {
      setPrimaryInvalid(dnLabel);
      displayErrorDialog(errors);
      dn.setSelectionStart(0);
      dn.setSelectionEnd(dn.getText().length());
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BinaryAttributeEditorPanel.java
@@ -317,7 +317,7 @@
        setPrimaryInvalid(useBase64);
      }
    }
    if (errors.size() == 0)
    if (errors.isEmpty())
    {
      // Read the file or encode the base 64 content.
      BackgroundTask<BinaryValue> worker = new BackgroundTask<BinaryValue>()
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseEntriesPanel.java
@@ -1025,7 +1025,7 @@
      {
        task.canLaunch(newTask, errors);
      }
      if (errors.size() == 0)
      if (errors.isEmpty())
      {
        if (displayConfirmationDialog(
            INFO_CTRL_PANEL_CONFIRMATION_REQUIRED_SUMMARY.get(),
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseIndexPanel.java
@@ -600,7 +600,7 @@
    int positionUnderRoot = 0;
    for (DefaultMutableTreeNode parent : categoryNodes)
    {
      if (nodes.get(i).size() == 0)
      if (nodes.get(i).isEmpty())
      {
        if (root.getIndex(parent) != -1)
        {
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseSchemaPanel.java
@@ -1284,7 +1284,7 @@
        }
      }
    }
    if (errors.size() > 0)
    if (!errors.isEmpty())
    {
      displayErrorDialog(errors);
    }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/CustomObjectClassPanel.java
@@ -710,7 +710,7 @@
    {
      errors.add(ERR_CTRL_PANEL_SCHEMA_NOT_FOUND_DETAILS.get());
    }
    if (errors.size() == 0)
    if (errors.isEmpty())
    {
      LocalizableMessageBuilder mb = new LocalizableMessageBuilder();
@@ -843,7 +843,7 @@
    checkCompatibleSuperiors(getObjectClassSuperiors(), getObjectClassType(),
        errors);
    if (errors.size() == 0)
    if (errors.isEmpty())
    {
      ProgressDialog dlg = new ProgressDialog(
          Utilities.createFrame(),
@@ -861,7 +861,7 @@
      {
        task.canLaunch(newTask, errors);
      }
      if (errors.size() == 0)
      if (errors.isEmpty())
      {
        launchOperation(newTask,
            INFO_CTRL_PANEL_MODIFYING_OBJECTCLASS_SUMMARY.get(ocName),
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/DBEnvironmentMonitoringPanel.java
@@ -196,7 +196,7 @@
          break;
        }
      }
      if (attributes.size() > 0)
      if (!attributes.isEmpty())
      {
        setOperationsToDisplay(attributes);
        updateTableSize();
@@ -207,7 +207,7 @@
    scroll.setVisible(backendsFound && !allAttributes.isEmpty());
    noDBsFound.setVisible(!backendsFound);
    noMonitoringFound.setVisible(backendsFound && allAttributes.isEmpty());
    showOperations.setVisible(allAttributes.size() > 0);
    showOperations.setVisible(!allAttributes.isEmpty());
  }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/DeleteBackendPanel.java
@@ -148,7 +148,7 @@
        Utilities.getParentDialog(this).setVisible(false);
      }
    }
    if (errors.size() > 0)
    if (!errors.isEmpty())
    {
      displayErrorDialog(errors);
    }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/DeleteBaseDNPanel.java
@@ -187,19 +187,24 @@
            }
            i ++;
          }
          if (selected.size() > 0)
          if (!selected.isEmpty())
          {
            int[] indArray = new int[indices.size()];
            i = 0;
            for (Integer index : indices)
            {
              indArray[i] = index;
              i++;
            }
            list.setSelectedIndices(indArray);
            list.setSelectedIndices(toIntArray(indices));
          }
          checkVisibility();
        }
        private int[] toIntArray(Set<Integer> indices)
        {
          int[] result = new int[indices.size()];
          int i = 0;
          for (Integer index : indices)
          {
            result[i] = index;
            i++;
          }
          return result;
        }
      });
    }
  }
@@ -407,7 +412,7 @@
        Utilities.getParentDialog(this).setVisible(false);
      }
    }
    if (errors.size() > 0)
    if (!errors.isEmpty())
    {
      displayErrorDialog(errors);
    }
@@ -445,7 +450,7 @@
    {
      mb.append("<br> - ").append(baseDN.getDn());
    }
    if (indirectBackendsToDelete.size() > 0)
    if (!indirectBackendsToDelete.isEmpty())
    {
      mb.append("<br><br>");
      mb.append(
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ExportLDIFPanel.java
@@ -424,7 +424,7 @@
        Utilities.getParentDialog(this).setVisible(false);
      }
    }
    if (errors.size() > 0)
    if (!errors.isEmpty())
    {
      displayErrorDialog(errors);
    }
@@ -485,15 +485,12 @@
      boolean canLaunch = true;
      if (state == State.RUNNING && runningOnSameServer(taskToBeLaunched))
      {
        // All the operations are incompatible if they apply to this
        // backend.
        Set<String> backends =
          new TreeSet<String>(taskToBeLaunched.getBackends());
        // All the operations are incompatible if they apply to this backend.
        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;
        }
      }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ImportLDIFPanel.java
@@ -719,7 +719,7 @@
        Utilities.getParentDialog(this).setVisible(false);
      }
    }
    if (errors.size() > 0)
    if (!errors.isEmpty())
    {
      displayErrorDialog(errors);
    }
@@ -818,15 +818,12 @@
      boolean canLaunch = true;
      if (state == State.RUNNING && runningOnSameServer(taskToBeLaunched))
      {
        // All the operations are incompatible if they apply to this
        // backend.
        Set<String> backends =
          new TreeSet<String>(taskToBeLaunched.getBackends());
        // All the operations are incompatible if they apply to this backend.
        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;
        }
      }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/IndexPanel.java
@@ -368,7 +368,7 @@
      {
        task.canLaunch(newModifyTask, errors);
      }
      if (errors.size() == 0)
      if (errors.isEmpty())
      {
        String attributeName = index.getName();
        String backendName = index.getBackend().getBackendID();
@@ -383,7 +383,7 @@
      }
    }
    if (errors.size() > 0)
    if (!errors.isEmpty())
    {
      displayErrorDialog(errors);
    }
@@ -548,12 +548,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;
        }
      }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/JavaPropertiesPanel.java
@@ -761,7 +761,7 @@
        }
      }
    }
    if (javaHomeErrors.size() == 0)
    if (javaHomeErrors.isEmpty())
    {
      final Set<String> providedArguments = new HashSet<String>();
      for (JavaArgumentsDescriptor cmd : getCurrentJavaArguments())
@@ -833,7 +833,7 @@
                }
              }
            }
            if (notWorkingArgs.size() > 0)
            if (!notWorkingArgs.isEmpty())
            {
              File javaFile = getJavaFile(new File(jvm));
              LocalizableMessage confirmationMessage;
@@ -974,7 +974,7 @@
    {
      task.canLaunch(newTask, errors);
    }
    if (errors.size() == 0)
    if (errors.isEmpty())
    {
      launchOperation(newTask,
          INFO_CTRL_PANEL_UPDATING_JAVA_SETTINGS_SUMMARY.get(),
@@ -1392,13 +1392,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));
          return false;
        }
      }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/LDAPEntryPanel.java
@@ -566,8 +566,10 @@
      {
        task.canLaunch(newTask, errors);
      }
      if ((errors.size() == 0) && newTask.hasModifications())
      if (errors.isEmpty())
      {
        if (newTask.hasModifications()) {
        String dn = entry.getName().toString();
        launchOperation(newTask,
            INFO_CTRL_PANEL_MODIFYING_ENTRY_SUMMARY.get(dn),
@@ -580,7 +582,7 @@
        saveChanges.setEnabled(false);
        dlg.setVisible(true);
      }
      else if (errors.size() == 0)
        else
      {
        // Mark the panel as it has no changes.  This can happen because every
        // time the user types something the saveChanges button is enabled
@@ -588,11 +590,12 @@
        saveChanges.setEnabled(false);
      }
    }
    }
    catch (OpenDsException ode)
    {
      errors.add(ERR_CTRL_PANEL_INVALID_ENTRY.get(ode.getMessageObject()));
    }
    if (errors.size() > 0)
    if (!errors.isEmpty())
    {
      displayErrorDialog(errors);
    }
@@ -600,7 +603,7 @@
  private void deleteEntry()
  {
    final ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>();
    final ArrayList<LocalizableMessage> errors = new ArrayList<>();
    // Check that the entry is correct.
    // Rely in numsubordinates and hassubordinates
    boolean isLeaf = !BrowserController.getHasSubOrdinates(searchResult);
@@ -618,7 +621,7 @@
      {
        task.canLaunch(newTask, errors);
      }
      if (errors.size() == 0)
      if (errors.isEmpty())
      {
        LocalizableMessage confirmationMessage =
          isLeaf ? INFO_CTRL_PANEL_DELETE_ENTRY_CONFIRMATION_DETAILS.get(
@@ -656,7 +659,7 @@
          }
      }
    }
    if (errors.size() > 0)
    if (!errors.isEmpty())
    {
      displayErrorDialog(errors);
    }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/MainMenuBar.java
@@ -102,7 +102,7 @@
      }
    }
    boolean confirmed = true;
    if (runningTasks.size() > 0)
    if (!runningTasks.isEmpty())
    {
      String allTasks = Utilities.getStringFromCollection(runningTasks, "<br>");
      LocalizableMessage title = INFO_CTRL_PANEL_CONFIRMATION_REQUIRED_SUMMARY.get();
@@ -259,7 +259,7 @@
      }
    }
    boolean confirmed = true;
    if (runningTasks.size() > 0)
    if (!runningTasks.isEmpty())
    {
      String allTasks = Utilities.getStringFromCollection(runningTasks, "<br>");
      LocalizableMessage title = INFO_CTRL_PANEL_CONFIRMATION_REQUIRED_SUMMARY.get();
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ManageTasksPanel.java
@@ -632,7 +632,7 @@
    {
      task.canLaunch(newTask, errors);
    }
    if (errors.size() == 0)
    if (errors.isEmpty())
    {
      boolean confirmed = displayConfirmationDialog(
          INFO_CTRL_PANEL_CONFIRMATION_REQUIRED_SUMMARY.get(),
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewAttributePanel.java
@@ -448,12 +448,11 @@
        Utilities.getParentDialog(this),
        INFO_CTRL_PANEL_NEW_ATTRIBUTE_PANEL_TITLE.get(), getInfo());
    NewSchemaElementsTask newTask = null;
    if (errors.size() == 0)
    if (errors.isEmpty())
    {
      LinkedHashSet<AttributeType> attributes =
        new LinkedHashSet<AttributeType>();
      LinkedHashSet<AttributeType> attributes = new LinkedHashSet<>();
      attributes.add(getAttribute());
      LinkedHashSet<ObjectClass> ocs = new LinkedHashSet<ObjectClass>(0);
      LinkedHashSet<ObjectClass> ocs = new LinkedHashSet<>(0);
      newTask = new NewSchemaElementsTask(getInfo(), dlg, ocs, attributes);
      for (Task task : getInfo().getTasks())
      {
@@ -465,7 +464,7 @@
        newTask.addConfigurationElementCreatedListener(listener);
      }
    }
    if (errors.size() == 0)
    if (errors.isEmpty())
    {
      String attrName = getAttributeName();
      launchOperation(newTask,
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewBaseDNPanel.java
@@ -387,7 +387,7 @@
    }
    ArrayList<Object> newElements = new ArrayList<Object>(sortedBackends);
    if (sortedBackends.size() > 0)
    if (!sortedBackends.isEmpty())
    {
      newElements.add(COMBO_SEPARATOR);
    }
@@ -737,9 +737,9 @@
      if (state == State.RUNNING && runningOnSameServer(taskToBeLaunched))
      {
        // All the operations are incompatible if they apply to this backend.
        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));
          canLaunch = false;
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewEntryFromLDIFPanel.java
@@ -183,7 +183,7 @@
      {
        ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>();
        checkSyntax(errors);
        if (errors.size() > 0)
        if (!errors.isEmpty())
        {
          displayErrorDialog(errors);
        }
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;
        }
      }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewObjectClassPanel.java
@@ -309,11 +309,10 @@
        Utilities.getParentDialog(this),
        INFO_CTRL_PANEL_NEW_OBJECTCLASS_PANEL_TITLE.get(), getInfo());
    NewSchemaElementsTask newTask = null;
    if (errors.size() == 0)
    if (errors.isEmpty())
    {
      LinkedHashSet<AttributeType> attributes =
        new LinkedHashSet<AttributeType>(1);
      LinkedHashSet<ObjectClass> ocs = new LinkedHashSet<ObjectClass>();
      LinkedHashSet<AttributeType> attributes = new LinkedHashSet<>(0);
      LinkedHashSet<ObjectClass> ocs = new LinkedHashSet<>(1);
      ocs.add(getObjectClass());
      newTask = new NewSchemaElementsTask(getInfo(), dlg, ocs, attributes);
      for (Task task : getInfo().getTasks())
@@ -326,7 +325,7 @@
        newTask.addConfigurationElementCreatedListener(listener);
      }
    }
    if (errors.size() == 0)
    if (errors.isEmpty())
    {
      String ocName = getObjectClassName();
      launchOperation(newTask,
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewOrganizationalUnitPanel.java
@@ -138,7 +138,7 @@
      }
    }
    if (errors.size() == 0)
    if (errors.isEmpty())
    {
      try
      {
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewUserPanel.java
@@ -200,7 +200,7 @@
      errors.add(ERR_CTRL_PANEL_PASSWORD_DO_NOT_MATCH.get());
    }
    if (errors.size() == 0)
    if (errors.isEmpty())
    {
      try
      {
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewVLVIndexPanel.java
@@ -223,9 +223,9 @@
        // 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.
        final Set<String> backends = new TreeSet<String>(taskToBeLaunched.getBackends());
        final Set<String> backends = new TreeSet<>(taskToBeLaunched.getBackends());
        backends.retainAll(getBackends());
        if (backends.size() > 0)
        if (!backends.isEmpty())
        {
          incompatibilityReasons.add(getIncompatibilityMessage(this, taskToBeLaunched));
          return false;
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/RebuildIndexPanel.java
@@ -341,7 +341,7 @@
        Utilities.getParentDialog(this).setVisible(false);
      }
    }
    if (errors.size() > 0)
    if (!errors.isEmpty())
    {
      displayErrorDialog(errors);
    }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/RefreshOptionsPanel.java
@@ -150,7 +150,7 @@
      errors.add(INFO_CTRL_PANEL_INVALID_PERIOD_VALUE.get(MAX_VALUE));
    }
    if (errors.size() > 0)
    if (!errors.isEmpty())
    {
      displayErrorDialog(errors);
    }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ResetUserPasswordPanel.java
@@ -121,7 +121,7 @@
      setPrimaryInvalid(lPassword);
      setPrimaryInvalid(lConfirmPassword);
    }
    if (errors.size() == 0)
    if (errors.isEmpty())
    {
      ProgressDialog dlg = new ProgressDialog(
          Utilities.createFrame(),
@@ -134,7 +134,7 @@
      {
        task.canLaunch(newTask, errors);
      }
      if (errors.size() == 0)
      if (errors.isEmpty())
      {
        launchOperation(newTask,
            INFO_CTRL_PANEL_RESETTING_USER_PASSWORD_SUMMARY.get(),
@@ -148,7 +148,7 @@
        dlg.setVisible(true);
      }
    }
    if (errors.size() > 0)
    if (!errors.isEmpty())
    {
      displayErrorDialog(errors);
    }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/RestorePanel.java
@@ -313,7 +313,7 @@
        Utilities.getParentDialog(this).setVisible(false);
      }
    }
    if (errors.size() > 0)
    if (!errors.isEmpty())
    {
      displayErrorDialog(errors);
    }
@@ -395,15 +395,12 @@
      boolean canLaunch = true;
      if (state == State.RUNNING && runningOnSameServer(taskToBeLaunched))
      {
        // All the operations are incompatible if they apply to this
        // backend.
        Set<String> backends =
          new TreeSet<String>(taskToBeLaunched.getBackends());
        // All the operations are incompatible if they apply to this backend.
        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;
        }
      }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/SimplifiedViewEntryPanel.java
@@ -1285,7 +1285,7 @@
      }
    }
    if (errors.size() > 0)
    if (!errors.isEmpty())
    {
      throw new CheckEntrySyntaxException(errors);
    }
@@ -1444,12 +1444,11 @@
  private boolean hasBinaryValue(List<Object> values)
  {
    boolean isBinary = false;
    if (values.size() > 0)
    if (!values.isEmpty())
    {
      isBinary = values.iterator().next() instanceof byte[];
      return values.iterator().next() instanceof byte[];
    }
    return isBinary;
    return false;
  }
  private boolean mustAddBrowseButton(String attrName)
@@ -1480,11 +1479,8 @@
  /** {@inheritDoc} */
  protected List<Object> getValues(String attrName)
  {
    List<Object> values = new ArrayList<Object>();
    List<EditorComponent> comps = hmEditors.get(attrName);
    if (comps.size() > 0)
    {
      for (EditorComponent comp : comps)
    List<Object> values = new ArrayList<>();
    for (EditorComponent comp : hmEditors.get(attrName))
      {
        if (hasValue(comp))
        {
@@ -1499,15 +1495,13 @@
          }
        }
      }
    }
    return values;
  }
  private void appendLDIFLines(StringBuilder sb, String attrName)
  {
    List<Object> values = getValues(attrName);
    if (values.size() > 0)
    if (!values.isEmpty())
    {
      appendLDIFLines(sb, attrName, values);
    }
@@ -1534,18 +1528,9 @@
          List<String> values = getDisplayedStringValues(attrName);
          if (!values.contains(value.toString()))
          {
            if (values.size() > 0)
            if (!values.isEmpty())
            {
              String firstNonEmpty = null;
              for (String v : values)
              {
                v = v.trim();
                if (v.length() > 0)
                {
                  firstNonEmpty = v;
                  break;
                }
              }
              String firstNonEmpty = getFirstNonEmpty(values);
              if (firstNonEmpty != null)
              {
                AttributeType attr = rdn.getAttributeType(i);
@@ -1562,7 +1547,7 @@
            attributeValues.add(value);
          }
        }
        if (attributeTypes.size() == 0)
        if (attributeTypes.isEmpty())
        {
          // Check the attributes in the order that we display them and use
          // the first one.
@@ -1577,7 +1562,7 @@
                continue;
              }
              List<EditorComponent> comps = hmEditors.get(attrName);
              if (comps.size() > 0)
              if (!comps.isEmpty())
              {
                Object o = comps.iterator().next().getValue();
                if (o instanceof String)
@@ -1599,11 +1584,11 @@
          }
        }
        DN parent = oldDN.parent();
        if (attributeTypes.size() > 0)
        if (!attributeTypes.isEmpty())
        {
          DN newDN;
          RDN newRDN = new RDN(attributeTypes, attributeNames, attributeValues);
          DN newDN;
          if (parent == null)
          {
            newDN = new DN(new RDN[]{newRDN});
@@ -1630,6 +1615,19 @@
    return sb.toString();
  }
  private String getFirstNonEmpty(List<String> values)
  {
    for (String v : values)
    {
      v = v.trim();
      if (v.length() > 0)
      {
        return v;
      }
    }
    return null;
  }
  private void addBrowseClicked(String attrName, JTextComponent textComponent)
  {
    LocalizableMessage previousTitle = null;
@@ -1830,7 +1828,7 @@
  private boolean hasValue(String attrName)
  {
    return getValues(attrName).size() > 0;
    return !getValues(attrName).isEmpty();
  }
  private boolean hasValue(EditorComponent editor)
@@ -1846,13 +1844,9 @@
    }
    else if (value instanceof Collection<?>)
    {
      return ((Collection<?>)value).size() > 0;
      return !((Collection<?>)value).isEmpty();
    }
    else if (value != null)
    {
      return true;
    }
    return false;
    return value != null;
  }
  /** Calls #addBrowseClicked(). */
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/StandardObjectClassPanel.java
@@ -335,7 +335,7 @@
        otherNames.add(name);
      }
    }
    if (otherNames.size() > 0)
    if (!otherNames.isEmpty())
    {
      n = Utilities.getStringFromCollection(otherNames, ", ");
    }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/StatusGenericPanel.java
@@ -724,7 +724,7 @@
      {
        task.canLaunch(newTask, errors);
      }
      if (errors.size() == 0)
      if (errors.isEmpty())
      {
        progressDialog.appendProgressHtml("<br><br>");
        launchOperation(newTask, INFO_CTRL_PANEL_REBUILDING_INDEXES_SUMMARY.get(backendName),
@@ -742,7 +742,7 @@
          progressDialog.toFront();
        }
      }
      if (errors.size() > 0)
      if (!errors.isEmpty())
      {
        displayErrorDialog(errors);
      }
@@ -1311,8 +1311,9 @@
      @Override
      public void run()
      {
        combo.setVisible(newElements.size() > 0);
        lNoBackendsFound.setVisible(newElements.size() == 0);
        boolean noElems = newElements.isEmpty();
        combo.setVisible(!noElems);
        lNoBackendsFound.setVisible(noElems);
      }
    });
  }
@@ -1884,7 +1885,7 @@
    {
      task.canLaunch(newTask, errors);
    }
    if (errors.size() == 0)
    if (errors.isEmpty())
    {
      launchOperation(newTask,
          INFO_CTRL_PANEL_STARTING_SERVER_SUMMARY.get(),
@@ -1916,12 +1917,12 @@
      task.canLaunch(newTask, errors);
    }
    boolean confirmed = true;
    if (errors.size() == 0)
    if (errors.isEmpty())
    {
      confirmed = displayConfirmationDialog(INFO_CTRL_PANEL_CONFIRMATION_REQUIRED_SUMMARY.get(),
                                            INFO_CTRL_PANEL_CONFIRM_STOP_SERVER_DETAILS.get());
    }
    if (errors.size() == 0 && confirmed)
    if (errors.isEmpty() && confirmed)
    {
      launchOperation(newTask,
          INFO_CTRL_PANEL_STOPPING_SERVER_SUMMARY.get(),
@@ -1931,7 +1932,7 @@
          ERR_CTRL_PANEL_STOPPING_SERVER_ERROR_DETAILS, progressDialog);
      progressDialog.setVisible(true);
    }
    if (errors.size() > 0)
    if (!errors.isEmpty())
    {
      displayErrorDialog(errors);
    }
@@ -1953,12 +1954,12 @@
      task.canLaunch(newTask, errors);
    }
    boolean confirmed = true;
    if (errors.size() == 0)
    if (errors.isEmpty())
    {
      confirmed = displayConfirmationDialog(INFO_CTRL_PANEL_CONFIRMATION_REQUIRED_SUMMARY.get(),
                                            INFO_CTRL_PANEL_CONFIRM_RESTART_SERVER_DETAILS.get());
    }
    if (errors.size() == 0 && confirmed)
    if (errors.isEmpty() && confirmed)
    {
      launchOperation(newTask,
          INFO_CTRL_PANEL_STOPPING_SERVER_SUMMARY.get(),
@@ -1968,7 +1969,7 @@
          ERR_CTRL_PANEL_RESTARTING_SERVER_ERROR_DETAILS, progressDialog);
      progressDialog.setVisible(true);
    }
    if (errors.size() > 0)
    if (!errors.isEmpty())
    {
      displayErrorDialog(errors);
    }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/StatusPanel.java
@@ -233,7 +233,7 @@
    }
    Collection<OpenDsException> exceptions = desc.getExceptions();
    if (exceptions.size() == 0)
    if (exceptions.isEmpty())
    {
      boolean errorPaneVisible = false;
      if (desc.getStatus() == ServerDescriptor.ServerStatus.STARTED)
@@ -374,36 +374,16 @@
      }
    }
    if (rootUsers.size() > 0)
    {
      setText(administrativeUsers,
          Utilities.getStringFromCollection(sortedRootUsers, "<br>"));
    }
    else
    {
      setText(administrativeUsers,
          INFO_NOT_AVAILABLE_SHORT_LABEL.get().toString());
    }
    String htmlText = !rootUsers.isEmpty()
        ? Utilities.getStringFromCollection(sortedRootUsers, "<br>")
        : INFO_NOT_AVAILABLE_SHORT_LABEL.get().toString();
    setText(administrativeUsers, htmlText);
    String install = desc.getInstallPath();
    if (install != null)
    {
      setText(installPath, install);
    }
    else
    {
      setText(installPath, INFO_NOT_AVAILABLE_SHORT_LABEL.get().toString());
    }
    setText(install, installPath);
    String instance = desc.getInstancePath();
    if (instance != null)
    {
      setText(instancePath, instance);
    }
    else
    {
      setText(instancePath, INFO_NOT_AVAILABLE_SHORT_LABEL.get().toString());
    }
    setText(instance, instancePath);
    instancePath.setVisible(!desc.sameInstallAndInstance());
    lInstancePath.setVisible(!desc.sameInstallAndInstance());
@@ -459,17 +439,8 @@
      }
    }
    boolean oneReplicated = false;
    for (BaseDNDescriptor baseDN : baseDNs)
    {
      if (baseDN.getType() == BaseDNDescriptor.Type.REPLICATED)
      {
        oneReplicated = true;
        break;
      }
    }
    boolean hasBaseDNs = baseDNs.size() > 0;
    boolean oneReplicated = oneReplicated(baseDNs);
    boolean hasBaseDNs = !baseDNs.isEmpty();
    replicationBaseDNsTable.setVisible(oneReplicated && hasBaseDNs);
    replicationBaseDNsTable.getTableHeader().setVisible(
@@ -488,7 +459,7 @@
      desc.getConnectionHandlers();
    connectionHandlerTableModel.setData(connectionHandlers);
    boolean hasConnectionHandlers = connectionHandlers.size() > 0;
    boolean hasConnectionHandlers = !connectionHandlers.isEmpty();
    connectionHandlersTable.setVisible(hasConnectionHandlers);
    connectionHandlersTable.getTableHeader().setVisible(hasConnectionHandlers);
    connectionHandlerTableEmpty.setVisible(!hasConnectionHandlers);
@@ -498,6 +469,30 @@
    Utilities.updateViewPositions(pos);
  }
  private boolean oneReplicated(Set<BaseDNDescriptor> baseDNs)
  {
    for (BaseDNDescriptor baseDN : baseDNs)
    {
      if (baseDN.getType() == BaseDNDescriptor.Type.REPLICATED)
      {
        return true;
      }
    }
    return false;
  }
  private void setText(String text, JEditorPane editorPane)
  {
    if (text != null)
    {
      setText(editorPane, text);
    }
    else
    {
      setText(editorPane, INFO_NOT_AVAILABLE_SHORT_LABEL.get().toString());
    }
  }
  private void setText(JEditorPane pane, String htmlText)
  {
    pane.setText(Utilities.applyFont(htmlText,
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/TableViewEntryPanel.java
@@ -294,18 +294,9 @@
          Set<String> values = getDisplayedStringValues(attrName);
          if (!values.contains(value.toString()))
          {
            if (values.size() > 0)
            if (!values.isEmpty())
            {
              String firstNonEmpty = null;
              for (String v : values)
              {
                v = v.trim();
                if (v.length() > 0)
                {
                  firstNonEmpty = v;
                  break;
                }
              }
              String firstNonEmpty = getFirstNonEmpty(values);
              if (firstNonEmpty != null)
              {
                AttributeType attr = rdn.getAttributeType(i);
@@ -322,7 +313,7 @@
            attributeValues.add(value);
          }
        }
        if (attributeTypes.size() == 0)
        if (attributeTypes.isEmpty())
        {
          // Check the attributes in the order that we display them and use
          // the first one.
@@ -358,11 +349,11 @@
          }
        }
        DN parent = oldDN.parent();
        if (attributeTypes.size() > 0)
        if (!attributeTypes.isEmpty())
        {
          DN newDN;
          RDN newRDN = new RDN(attributeTypes, attributeNames, attributeValues);
          DN newDN;
          if (parent == null)
          {
            newDN = new DN(new RDN[]{newRDN});
@@ -389,6 +380,19 @@
    return sb.toString();
  }
  private String getFirstNonEmpty(Set<String> values)
  {
    for (String v : values)
    {
      v = v.trim();
      if (v.length() > 0)
      {
        return v;
      }
    }
    return null;
  }
  private Set<String> getDisplayedStringValues(String attrName)
  {
    Set<String> values = new LinkedHashSet<String>();
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/TaskToSchedulePanel.java
@@ -312,7 +312,7 @@
    updateErrorMessages(errorMessages);
    if (errorMessages.size() > 0)
    if (!errorMessages.isEmpty())
    {
      displayErrorDialog(errorMessages);
    }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/VLVIndexPanel.java
@@ -422,7 +422,7 @@
      }
    }
    if (errors.size() > 0)
    if (!errors.isEmpty())
    {
      displayErrorDialog(errors);
    }
@@ -612,9 +612,9 @@
        // 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.
        final Set<String> backends = new TreeSet<String>(taskToBeLaunched.getBackends());
        final Set<String> backends = new TreeSet<>(taskToBeLaunched.getBackends());
        backends.retainAll(getBackends());
        if (backends.size() > 0)
        if (!backends.isEmpty())
        {
          incompatibilityReasons.add(getIncompatibilityMessage(this, taskToBeLaunched));
          canLaunch = false;
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/VerifyIndexPanel.java
@@ -383,7 +383,7 @@
        Utilities.getParentDialog(this).setVisible(false);
      }
    }
    if (errors.size() > 0)
    if (!errors.isEmpty())
    {
      displayErrorDialog(errors);
    }
@@ -509,7 +509,7 @@
            && type != Task.Type.EXPORT_LDIF
            && type != Task.Type.ENABLE_WINDOWS_SERVICE
            && type != Task.Type.DISABLE_WINDOWS_SERVICE
            && backends.size() > 0)
            && !backends.isEmpty())
        {
          incompatibilityReasons.add(getIncompatibilityMessage(this, taskToBeLaunched));
          canLaunch = false;
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ViewEntryPanel.java
@@ -262,7 +262,7 @@
      {
        sb.append(INFO_CTRL_OBJECTCLASS_DESCRIPTOR.get(ocDesc.getStructural()));
      }
      if (ocDesc.getAuxiliary().size() > 0)
      if (!ocDesc.getAuxiliary().isEmpty())
      {
        if (sb.length() > 0)
        {
@@ -583,7 +583,7 @@
        }
      }
    }
    if (valuesToSet.size() > 0)
    if (!valuesToSet.isEmpty())
    {
      sr.set(attrName, valuesToSet);
    }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/ObjectClassCellPanel.java
@@ -196,7 +196,7 @@
      {
        sb.append(value.getStructural());
      }
      if (aux.size() > 0)
      if (!aux.isEmpty())
      {
        if (sb.length() > 0)
        {
opendj-server-legacy/src/test/java/org/opends/quicksetup/ConfigurationTest.java
@@ -49,7 +49,7 @@
  @Test(enabled = false)
  public void testGetDirectoryManagerDns() throws IOException {
    Set<String> dns = config.getDirectoryManagerDns();
    assertTrue(dns.size() > 0);
    assertFalse(dns.isEmpty());
  }
  @Test(enabled = false)
@@ -87,7 +87,7 @@
  @Test(enabled = false)
  public void testGetDatabasePaths() throws IOException {
    assertTrue(config.getDatabasePaths().size() > 0);
    assertTrue(!config.getDatabasePaths().isEmpty());
  }
  @Test(enabled = false)
opendj-server-legacy/src/test/java/org/opends/server/tasks/TasksTestCase.java
@@ -99,7 +99,7 @@
    // Check that the task contains some log messages.
    Set<String> logMessages = parseAttribute(resultEntry, ATTR_TASK_LOG_MESSAGES).asSetOfString();
    if (taskState != TaskState.COMPLETED_SUCCESSFULLY && logMessages.size() == 0)
    if (taskState != TaskState.COMPLETED_SUCCESSFULLY && logMessages.isEmpty())
    {
      fail("No log messages were written to the task entry on a failed task.\n"
          + "taskState=" + taskState