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

Jean-Noel Rouvignac
18.26.2015 ca669ae54f86dbeea277280690584d9f591c7571
AutoRefactor: collapse if statements
101 files modified
1268 ■■■■■ changed files
opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLServlet.java 10 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/admin/ads/ADSContext.java 13 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/admin/ads/ADSContextHelper.java 9 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/BaseDNDescriptor.java 48 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/BinaryValue.java 11 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/CategorizedComboBoxElement.java 11 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/IndexDescriptor.java 35 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/VLVIndexDescriptor.java 38 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/event/BrowseActionListener.java 6 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/AddToGroupTask.java 20 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/CancelTaskTask.java 16 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/DeleteEntryTask.java 12 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/ModifyEntryTask.java 12 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/NewEntryTask.java 12 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/ResetUserPasswordTask.java 14 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AbstractBrowseEntriesPanel.java 14 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AbstractVLVIndexPanel.java 11 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseEntriesPanel.java 15 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseIndexPanel.java 24 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseSchemaPanel.java 13 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/CustomAttributePanel.java 6 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ImportLDIFPanel.java 8 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/JavaPropertiesPanel.java 29 ●●●●● 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/NewGroupPanel.java 8 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewObjectClassPanel.java 5 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewUserPanel.java 5 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewVLVIndexPanel.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/RebuildIndexPanel.java 7 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/SimplifiedViewEntryPanel.java 11 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/TableViewEntryPanel.java 6 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/VLVIndexPanel.java 11 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/WindowsServicePanel.java 20 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/CustomTree.java 20 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/DoubleAddRemovePanel.java 6 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/FilterTextField.java 5 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/util/ConfigFromFile.java 7 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/uninstaller/Uninstaller.java 7 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/uninstaller/ui/ConfirmUninstallPanel.java 14 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/event/BrowseActionListener.java 6 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/InstallerHelper.java 16 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/JavaArgumentsDialog.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/CertificateDialog.java 8 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/GuiApplication.java 5 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/util/FileManager.java 16 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/util/ZipExtractor.java 4 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/admin/AggregationPropertyDefinition.java 9 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/admin/DurationPropertyDefinition.java 34 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/admin/IntegerPropertyDefinition.java 11 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/admin/PropertyDefinition.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/admin/SizePropertyDefinition.java 11 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/admin/client/ldap/LDAPDriver.java 13 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/admin/client/spi/PropertySet.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/admin/doc/ConfigGuideGeneration.java 9 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/admin/server/ServerManagementContext.java 9 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/api/AuthenticationPolicyState.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciContainer.java 12 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciHandler.java 8 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/PatternIP.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/TargetAttr.java 67 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/BackupManager.java 19 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/PresenceIndexer.java 7 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/BackupManager.java 15 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/Index.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/PresenceIndexer.java 7 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/task/TaskScheduler.java 12 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/config/ConfigAttribute.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/controls/MatchedValuesFilter.java 25 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/EntryCacheConfigManager.java 15 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/PasswordPolicyConfigManager.java 20 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/AttributeValuePasswordValidator.java 6 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/DictionaryPasswordValidator.java 15 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/FileBasedTrustManagerProvider.java 16 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/IsMemberOfVirtualAttributeProvider.java 12 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java 6 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/PasswordModifyExtendedOperation.java 6 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/loggers/AbstractTextAccessLogPublisher.java 38 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/loggers/GZIPAction.java 7 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/loggers/ZIPAction.java 7 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/plugins/SambaPasswordPlugin.java 14 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPClientConnection.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPConnectionHandler.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPClientConnection.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPConnectionHandler.java 15 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/HeartbeatThread.java 6 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ModifyCommonMsg.java 8 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/SafeReadExpectedAcksInfo.java 5 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/Log.java 5 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tasks/BackupTask.java 5 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/BackUpDB.java 5 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/ConfigureDS.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/WaitForFileDelete.java 7 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/MakeLDIFInputStream.java 13 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/Template.java 6 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/FileManager.java 13 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java 38 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/SearchFilter.java 7 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/util/StaticUtils.java 5 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendBindOperation.java 20 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendCompareOperation.java 8 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/dsml/org/opends/dsml/protocol/DSMLServlet.java
@@ -388,8 +388,8 @@
        } else {
          throw new ServletException("Content-Type does not match SOAP 1.1 or SOAP 1.2");
        }
      } else if (headerName.equalsIgnoreCase("authorization")) {
        if (headerVal.startsWith("Basic ")) {
      } else if (headerName.equalsIgnoreCase("authorization") && headerVal.startsWith("Basic "))
      {
          authenticationInHeader = true;
          String authorization = headerVal.substring(6).trim();
          try {
@@ -418,7 +418,6 @@
            break;
          }
        }
      }
      StringTokenizer tk = new StringTokenizer(headerVal, ",");
      while (tk.hasMoreTokens()) {
        mimeHeaders.addHeader(headerName, tk.nextToken().trim());
@@ -560,14 +559,13 @@
                if ( code != LDAPResultCode.SUCCESS
                  && code != LDAPResultCode.REFERRAL
                  && code != LDAPResultCode.COMPARE_TRUE
                  && code != LDAPResultCode.COMPARE_FALSE ) {
                  if ( ON_ERROR_EXIT.equals(batchRequest.getOnError()) ) {
                  && code != LDAPResultCode.COMPARE_FALSE && ON_ERROR_EXIT.equals(batchRequest.getOnError()) )
                {
                    break;
                  }
                }
              }
            }
          }
          // close connection to LDAP server
          if ( connection != null ) {
            connection.close(nextMessageID);
opendj-server-legacy/src/main/java/org/opends/admin/ads/ADSContext.java
@@ -567,9 +567,7 @@
      {
        Set<?> memberList =
          (Set<?>)serverGroup.get(ServerGroupProperty.MEMBERS);
        if (memberList != null)
        {
          if (memberList.remove(member))
        if (memberList != null && memberList.remove(member))
          {
            HashMap<ServerGroupProperty, Object> serverGroupProperties =
              new HashMap<ServerGroupProperty, Object>();
@@ -578,7 +576,6 @@
            updateServerGroup(groupName, serverGroupProperties);
          }
        }
      }
      dirContext.destroySubcontext(dn);
    }
@@ -2119,17 +2116,13 @@
   * @param serverProperties the server properties.
   * @return the server ID for the given properties or null.
   */
  private static String getServerID(
      Map<ServerProperty, Object> serverProperties)
  private static String getServerID(Map<ServerProperty, Object> serverProperties)
  {
    String result = (String) serverProperties.get(ServerProperty.ID);
    if (result != null)
    {
      if (result.length() == 0)
    if (result != null && result.length() == 0)
      {
        result = null;
      }
    }
    return result;
  }
opendj-server-legacy/src/main/java/org/opends/admin/ads/ADSContextHelper.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2007-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.admin.ads;
@@ -100,10 +100,8 @@
      if (backend != null)
      {
        SortedSet<DN> suffixes = backend.getBaseDN();
        if (suffixes != null)
        {
          if (suffixes.remove(
              DN.valueOf(ADSContext.getAdministrationSuffixDN())))
        if (suffixes != null
            && suffixes.remove(DN.valueOf(ADSContext.getAdministrationSuffixDN())))
          {
            if (suffixes.size() > 0)
            {
@@ -117,7 +115,6 @@
          }
        }
      }
    }
    catch (Throwable t)
    {
      throw new ADSContextException(
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/BaseDNDescriptor.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2011 Sun Microsystems, Inc.
 *      Portions Copyright 2011-2013 ForgeRock AS
 *      Portions Copyright 2011-2015 ForgeRock AS
 */
package org.opends.guitools.controlpanel.datamodel;
@@ -106,33 +106,30 @@
  @Override
  public boolean equals(Object v)
  {
    boolean equals = false;
    if (this != v)
    if (this == v)
    {
      if (v instanceof BaseDNDescriptor)
      return true;
    }
    if (!(v instanceof BaseDNDescriptor))
      {
      return false;
    }
        BaseDNDescriptor desc = (BaseDNDescriptor)v;
        equals = (getType() == desc.getType()) &&
        getDn().equals(desc.getDn()) &&
        (getAgeOfOldestMissingChange() == desc.getAgeOfOldestMissingChange()) &&
        (getMissingChanges() == desc.getMissingChanges()) &&
        (getEntries() == desc.getEntries());
        if (equals)
        {
          if ((getBackend() != null) && (desc.getBackend() != null))
    return getType() == desc.getType()
        && getDn().equals(desc.getDn())
        && getAgeOfOldestMissingChange() == desc.getAgeOfOldestMissingChange()
        && getMissingChanges() == desc.getMissingChanges()
        && getEntries() == desc.getEntries()
        && backendIdEqual(desc);
  }
  private boolean backendIdEqual(BaseDNDescriptor desc)
          {
            // Only compare the backend IDs.  In this context is enough
            equals = getBackend().getBackendID().equals(
                desc.getBackend().getBackendID());
          }
        }
      }
    }
    else
    {
      equals = true;
    }
    return equals;
    return getBackend() != null
        && desc.getBackend() != null
        && getBackend().getBackendID().equals(desc.getBackend().getBackendID());
  }
  /**
@@ -154,15 +151,12 @@
    {
      returnValue = getType().compareTo(desc.getType());
    }
    if (returnValue == 0)
    {
      if ((getBackend() != null) && (desc.getBackend() != null))
    if (returnValue == 0 && getBackend() != null && desc.getBackend() != null)
      {
        // Only compare the backend IDs. In this context is enough
        returnValue = getBackend().getBackendID().compareTo(
            desc.getBackend().getBackendID());
      }
    }
    if (returnValue == 0)
    {
      returnValue = compare(getEntries(), desc.getEntries());
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/BinaryValue.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS
 */
package org.opends.guitools.controlpanel.datamodel;
@@ -126,13 +127,10 @@
   */
  public String getBase64()
  {
    if (base64 == null)
    {
      if (bytes != null)
    if (base64 == null && bytes != null)
      {
        base64 = Base64.encode(bytes);
      }
    }
    return base64;
  }
@@ -144,13 +142,10 @@
   */
  public byte[] getBytes() throws ParseException
  {
    if (bytes == null)
    {
      if (base64 != null)
    if (bytes == null && base64 != null)
      {
        bytes = Base64.decode(base64);
      }
    }
    return bytes;
  }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/CategorizedComboBoxElement.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS
 */
package org.opends.guitools.controlpanel.datamodel;
@@ -88,17 +89,13 @@
   */
  public boolean equals(Object o)
  {
    boolean equals = false;
    if (o != null)
    {
      if (o instanceof CategorizedComboBoxElement)
      {
        CategorizedComboBoxElement desc = (CategorizedComboBoxElement)o;
        equals = (desc.getType() == getType()) &&
        (getValue().equals(desc.getValue()));
      return desc.getType() == getType()
          && getValue().equals(desc.getValue());
      }
    }
    return equals;
    return false;
  }
  /**
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/IndexDescriptor.java
@@ -130,30 +130,27 @@
   */
  public boolean equals(Object o)
  {
    boolean equals = o == this;
    if (!equals)
    if (o == this)
    {
      equals = o instanceof IndexDescriptor;
      if (equals)
      return true;
    }
    if (!(o instanceof IndexDescriptor))
      {
      return false;
    }
        IndexDescriptor index = (IndexDescriptor)o;
        equals = index.getName().equalsIgnoreCase(getName()) &&
          index.isDatabaseIndex() == isDatabaseIndex() &&
          index.getTypes().equals(getTypes()) &&
          index.getEntryLimit() == getEntryLimit();
    return index.getName().equalsIgnoreCase(getName())
        && index.isDatabaseIndex() == isDatabaseIndex()
        && index.getTypes().equals(getTypes())
        && index.getEntryLimit() == getEntryLimit()
        && backendIdEqual(index);
  }
        if (equals)
  private boolean backendIdEqual(IndexDescriptor index)
        {
          if ((getBackend() != null) && (index.getBackend() != null))
          {
            // Only compare the backend IDs.  In this context is enough
            equals = getBackend().getBackendID().equals(
                index.getBackend().getBackendID());
          }
        }
      }
    }
    return equals;
    return getBackend() != null
        && index.getBackend() != null
        && getBackend().getBackendID().equals(index.getBackend().getBackendID());
  }
  /**
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/VLVIndexDescriptor.java
@@ -127,32 +127,32 @@
   */
  public boolean equals(Object o)
  {
    boolean equals = o == this;
    if (!equals)
    if (o == this)
    {
      equals = o instanceof VLVIndexDescriptor;
      if (equals)
      return true;
    }
    if (!(o instanceof VLVIndexDescriptor))
      {
      return false;
    }
        VLVIndexDescriptor index = (VLVIndexDescriptor)o;
        equals = index.getName().equalsIgnoreCase(getName()) &&
          index.getBaseDN().equals(getBaseDN()) &&
          index.getFilter().equals(getFilter()) &&
          index.getScope() == getScope() &&
          index.getSortOrder().equals(getSortOrder());
        if (equals)
    return index.getName().equalsIgnoreCase(getName())
        && index.getBaseDN().equals(getBaseDN())
        && index.getFilter().equals(getFilter())
        && index.getScope() == getScope()
        && index.getSortOrder().equals(getSortOrder())
        && backendIdEqual(index);
  }
  private boolean backendIdEqual(VLVIndexDescriptor index)
        {
          if ((getBackend() != null) && (index.getBackend() != null))
          {
    return getBackend() != null
        && index.getBackend() != null
            // Only compare the backend IDs.  In this context is better to
            // do this since the backend object contains some state (like
            // number entries) that can change.
            equals = getBackend().getBackendID().equals(
                index.getBackend().getBackendID());
          }
        }
      }
    }
    return equals;
        && getBackend().getBackendID().equals(index.getBackend().getBackendID());
  }
  /**
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/event/BrowseActionListener.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS
 */
package org.opends.guitools.controlpanel.event;
@@ -195,9 +196,7 @@
    /* If we can get the current field parent directory set to it */
    String path = field.getText();
    if (path != null)
    {
      if (path.trim().length() > 0)
    if (path != null && path.trim().length() > 0)
      {
        File f = new File(path);
        while ((f != null) && !f.isDirectory())
@@ -209,7 +208,6 @@
          fc.setCurrentDirectory(f);
        }
      }
    }
    switch (type)
    {
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/AddToGroupTask.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2013-2014 ForgeRock AS.
 *      Portions Copyright 2013-2015 ForgeRock AS.
 */
package org.opends.guitools.controlpanel.task;
@@ -147,26 +147,22 @@
  public boolean canLaunch(Task taskToBeLaunched,
      Collection<LocalizableMessage> incompatibilityReasons)
  {
    boolean canLaunch = true;
    if (!isServerRunning())
    {
      if (state == State.RUNNING && runningOnSameServer(taskToBeLaunched))
    if (!isServerRunning()
        && state == State.RUNNING
        && runningOnSameServer(taskToBeLaunched))
      {
        // 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<String>(taskToBeLaunched.getBackends());
        backends.retainAll(getBackends());
        if (backends.size() > 0)
        {
          incompatibilityReasons.add(getIncompatibilityMessage(this,
              taskToBeLaunched));
          canLaunch = false;
        incompatibilityReasons.add(getIncompatibilityMessage(this, taskToBeLaunched));
        return false;
        }
      }
    }
    return canLaunch;
    return true;
  }
  /**
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/CancelTaskTask.java
@@ -142,26 +142,20 @@
  public boolean canLaunch(Task taskToBeLaunched,
      Collection<LocalizableMessage> incompatibilityReasons)
  {
    boolean canLaunch = true;
    if (!isServerRunning())
    {
      if (state == State.RUNNING)
    if (!isServerRunning() && state == State.RUNNING)
      {
        // 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<String>(taskToBeLaunched.getBackends());
        backends.retainAll(getBackends());
        if (backends.size() > 0)
        {
          incompatibilityReasons.add(getIncompatibilityMessage(this,
              taskToBeLaunched));
          canLaunch = false;
        incompatibilityReasons.add(getIncompatibilityMessage(this, taskToBeLaunched));
        return false;
        }
      }
    }
    return canLaunch;
    return true;
  }
  /**
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/DeleteEntryTask.java
@@ -179,10 +179,9 @@
  public boolean canLaunch(Task taskToBeLaunched,
      Collection<LocalizableMessage> incompatibilityReasons)
  {
    boolean canLaunch = true;
    if (!isServerRunning())
    {
      if (state == State.RUNNING && runningOnSameServer(taskToBeLaunched))
    if (!isServerRunning()
        && state == State.RUNNING
        && runningOnSameServer(taskToBeLaunched))
      {
        // All the operations are incompatible if they apply to this
        // backend for safety.
@@ -193,11 +192,10 @@
        {
          incompatibilityReasons.add(getIncompatibilityMessage(this,
              taskToBeLaunched));
          canLaunch = false;
        return false;
        }
      }
    }
    return canLaunch;
    return true;
  }
  /**
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/ModifyEntryTask.java
@@ -200,10 +200,9 @@
  public boolean canLaunch(Task taskToBeLaunched,
      Collection<LocalizableMessage> incompatibilityReasons)
  {
    boolean canLaunch = true;
    if (!isServerRunning())
    {
      if (state == State.RUNNING && runningOnSameServer(taskToBeLaunched))
    if (!isServerRunning()
        && state == State.RUNNING
        && runningOnSameServer(taskToBeLaunched))
      {
        // All the operations are incompatible if they apply to this
        // backend for safety.  This is a short operation so the limitation
@@ -215,11 +214,10 @@
        {
          incompatibilityReasons.add(getIncompatibilityMessage(this,
              taskToBeLaunched));
          canLaunch = false;
        return false;
        }
      }
    }
    return canLaunch;
    return true;
  }
  /**
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/NewEntryTask.java
@@ -151,10 +151,9 @@
  public boolean canLaunch(Task taskToBeLaunched,
      Collection<LocalizableMessage> incompatibilityReasons)
  {
    boolean canLaunch = true;
    if (!isServerRunning())
    {
      if (state == State.RUNNING && runningOnSameServer(taskToBeLaunched))
    if (!isServerRunning()
        && state == State.RUNNING
        && runningOnSameServer(taskToBeLaunched))
      {
        // All the operations are incompatible if they apply to this
        // backend for safety.  This is a short operation so the limitation
@@ -166,11 +165,10 @@
        {
          incompatibilityReasons.add(getIncompatibilityMessage(this,
              taskToBeLaunched));
          canLaunch = false;
        return false;
        }
      }
    }
    return canLaunch;
    return true;
  }
  /**
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/ResetUserPasswordTask.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.guitools.controlpanel.task;
@@ -187,10 +187,9 @@
  public boolean canLaunch(Task taskToBeLaunched,
      Collection<LocalizableMessage> incompatibilityReasons)
  {
    boolean canLaunch = true;
    if (!isServerRunning())
    {
      if (state == State.RUNNING && runningOnSameServer(taskToBeLaunched))
    if (!isServerRunning()
        && state == State.RUNNING
        && runningOnSameServer(taskToBeLaunched))
      {
        // All the operations are incompatible if they apply to this
        // backend for safety.  This is a short operation so the limitation
@@ -202,11 +201,10 @@
        {
          incompatibilityReasons.add(getIncompatibilityMessage(this,
              taskToBeLaunched));
          canLaunch = false;
        return false;
        }
      }
    }
    return canLaunch;
    return true;
  }
  /**
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AbstractBrowseEntriesPanel.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2011-2014 ForgeRock AS
 *      Portions Copyright 2011-2015 ForgeRock AS
 */
package org.opends.guitools.controlpanel.ui;
@@ -353,15 +353,13 @@
            for (int i=0; i<baseDNs.getModel().getSize(); i++)
            {
              Object item = baseDNs.getModel().getElementAt(i);
              if (item instanceof CategorizedComboBoxElement)
              {
                if (!isCategory(item))
              if (item instanceof CategorizedComboBoxElement
                  && !isCategory(item))
                {
                  lastSelectedBaseDN = item;
                  break;
                }
              }
            }
            if (lastSelectedBaseDN != null)
            {
              baseDNs.setSelectedItem(lastSelectedBaseDN);
@@ -1473,15 +1471,13 @@
                {
                  try
                  {
                    if (displayAll || isBaseDN)
                    {
                      if (!controller.hasSuffix(dn))
                    if ((displayAll || isBaseDN)
                        && !controller.hasSuffix(dn))
                      {
                        controller.addSuffix(dn, null);
                        added = true;
                      }
                    }
                  }
                  catch (IllegalArgumentException iae)
                  {
                    // The suffix node exists but is not a suffix node.
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/AbstractVLVIndexPanel.java
@@ -666,15 +666,12 @@
          if (index != null)
          {
            IndexType type = indexTypes[i];
            if (type != null)
            {
              if (!index.getTypes().contains(type))
            if (type != null && !index.getTypes().contains(type))
              {
                msgs.add(INFO_CTRL_PANEL_MUST_UPDATE_INDEX_DEFINITION_TYPE.get(
                    filter.getAttributeType(), indexTypeNames[i]));
              }
            }
          }
          else
          {
            LocalizableMessage type = indexTypeNames[i];
@@ -1214,9 +1211,8 @@
              model.getElementAt(j);
              if (o.getType() == CategorizedComboBoxElement.Type.REGULAR)
              {
                if (dealingWithCustom == isCustom)
                {
                  if (attrName.compareTo(o.getValue().toString()) < 0)
                if (dealingWithCustom == isCustom
                    && attrName.compareTo(o.getValue().toString()) < 0)
                  {
                    model.insertElementAt(new CategorizedComboBoxElement(
                        attrName,
@@ -1224,7 +1220,6 @@
                    break;
                  }
                }
              }
              else if (!o.getValue().equals(CUSTOM_ATTRIBUTES))
              {
                dealingWithCustom = false;
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseEntriesPanel.java
@@ -495,26 +495,23 @@
   */
  private boolean hasUserPassword(String[] ocs)
  {
    boolean hasUserPassword = false;
    Schema schema = getInfo().getServerDescriptor().getSchema();
    if ((ocs != null) && (schema != null))
    if (ocs != null && schema != null)
    {
      AttributeType attr = schema.getAttributeType(
          ServerConstants.ATTR_USER_PASSWORD);
      for (String oc : ocs)
      {
        ObjectClass objectClass = schema.getObjectClass(oc);
        if ((objectClass != null) && (attr != null))
        if (objectClass != null
            && attr != null
            && objectClass.isRequiredOrOptional(attr))
        {
          if (objectClass.isRequiredOrOptional(attr))
          {
            hasUserPassword = true;
            break;
          return true;
          }
        }
      }
    }
    return hasUserPassword;
    return false;
  }
  /**
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseIndexPanel.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.guitools.controlpanel.ui;
@@ -683,16 +683,14 @@
                  lastCreatedIndex = null;
                }
              }
              else if ((node instanceof VLVIndexTreeNode) &&
                  (lastCreatedIndex instanceof VLVIndexDescriptor))
              {
                if (node.getName().equals(lastCreatedIndex.getName()))
              else if (node instanceof VLVIndexTreeNode
                  && lastCreatedIndex instanceof VLVIndexDescriptor
                  && node.getName().equals(lastCreatedIndex.getName()))
                {
                  newSelectionPath = new TreePath(node.getPath());
                  lastCreatedIndex = null;
                }
              }
            }
            else if (node.getName().equals(lastSelectedNode.getUserObject()))
            {
              newSelectionPath = new TreePath(node.getPath());
@@ -709,13 +707,10 @@
      i++;
    }
    if (newSelectionPath == null)
    {
      if (firstTreeRepopulate)
    if (newSelectionPath == null && firstTreeRepopulate)
      {
        newSelectionPath = new TreePath(standardIndexes.getPath());
      }
    }
    if (newSelectionPath != null)
    {
      tree.setSelectionPath(newSelectionPath);
@@ -939,8 +934,7 @@
          launchOperation(newTask,
              INFO_CTRL_PANEL_DELETING_INDEXES_SUMMARY.get(),
              INFO_CTRL_PANEL_DELETING_INDEXES_COMPLETE.get(),
              INFO_CTRL_PANEL_DELETING_INDEXES_SUCCESSFUL.get(nameLabel,
                  backendName),
              INFO_CTRL_PANEL_DELETING_INDEXES_SUCCESSFUL.get(nameLabel, backendName),
              ERR_CTRL_PANEL_DELETING_INDEXES_ERROR_SUMMARY.get(),
              ERR_CTRL_PANEL_DELETING_INDEXES_ERROR_DETAILS.get(nameLabel),
              null,
@@ -1004,13 +998,11 @@
    private ImageIcon getIcon(Object value)
    {
      ImageIcon icon = null;
      if (value instanceof IndexTreeNode)
      {
        if (((IndexTreeNode)value).getIndex().isDatabaseIndex())
      if (value instanceof IndexTreeNode
          && ((IndexTreeNode)value).getIndex().isDatabaseIndex())
        {
          icon = readOnlyIndexIcon;
        }
      }
      if (icon == null)
      {
        icon = hmImages.get(value.getClass());
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseSchemaPanel.java
@@ -983,16 +983,14 @@
                  lastCreatedElement = null;
                }
              }
              else if ((node instanceof CustomAttributeTreeNode) &&
                  (lastCreatedElement instanceof AttributeType))
              {
                if (name.equals(lastCreatedElement.getNameOrOID()))
              else if (node instanceof CustomAttributeTreeNode
                  && lastCreatedElement instanceof AttributeType
                  && name.equals(lastCreatedElement.getNameOrOID()))
                {
                  newSelectionPath = new TreePath(node.getPath());
                  lastCreatedElement = null;
                }
              }
            }
            else if (name.equals(lastSelectedNode.getUserObject()))
            {
              newSelectionPath = new TreePath(node.getPath());
@@ -1011,15 +1009,12 @@
    DefaultMutableTreeNode[] ocAndAttrs = {objectClasses, attributes};
    for (DefaultMutableTreeNode node : ocAndAttrs)
    {
      if (node.getParent() != null)
      {
        if (node.getChildCount() == 0)
      if (node.getParent() != null && node.getChildCount() == 0)
        {
          model.removeNodeFromParent(node);
          model.nodeStructureChanged(node);
        }
      }
    }
    if (newSelectionPath != null)
    {
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/CustomAttributePanel.java
@@ -1055,14 +1055,12 @@
    }
    setPrimaryValid(lUsage);
    if (nonModifiable.isSelected())
    {
      if (AttributeUsage.USER_APPLICATIONS.equals(usage.getSelectedItem()))
    if (nonModifiable.isSelected()
        && AttributeUsage.USER_APPLICATIONS.equals(usage.getSelectedItem()))
      {
        errors.add(ERR_NON_MODIFIABLE_CANNOT_BE_USER_APPLICATIONS.get());
        setPrimaryInvalid(lUsage);
      }
    }
    if (errors.isEmpty())
    {
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ImportLDIFPanel.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.guitools.controlpanel.ui;
@@ -612,16 +612,14 @@
        errors.add(ERR_CTRL_PANEL_REJECTS_FILE_REQUIRED.get());
        setPrimaryInvalid(lRejectsFile);
      }
      else if (writeSkips.isSelected())
      {
        if (new File(rejectPath).equals(new File(skipsFile.getText())))
      else if (writeSkips.isSelected()
          && new File(rejectPath).equals(new File(skipsFile.getText())))
        {
          errors.add(ERR_CTRL_PANEL_REJECTS_AND_SKIPS_MUST_BE_DIFFERENT.get());
          setPrimaryInvalid(lRejectsFile);
          setPrimaryInvalid(lSkipsFile);
        }
      }
    }
    if (writeSkips.isSelected())
    {
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/JavaPropertiesPanel.java
@@ -1117,23 +1117,22 @@
    @Override
    public boolean equals(Object o)
    {
      boolean equals = o == this;
      if (!equals)
      if (o == this)
      {
        if (o instanceof JavaArgumentsDescriptor)
        return true;
      }
      if (!(o instanceof JavaArgumentsDescriptor))
        {
          equals =
            commandName.equals(((JavaArgumentsDescriptor)o).getCommandName()) &&
          javaArguments.equals(((JavaArgumentsDescriptor)o).getJavaArguments());
        return false;
        }
      }
      return equals;
      JavaArgumentsDescriptor desc = (JavaArgumentsDescriptor)o;
      return commandName.equals(desc.getCommandName())
          && javaArguments.equals(desc.getJavaArguments());
    }
  }
  /**
   * The table model used to display the java arguments.
   *
   */
  protected class JavaArgumentsTableModel extends SortableTableModel
  implements Comparator<JavaArgumentsDescriptor>
@@ -1435,10 +1434,9 @@
    public boolean canLaunch(Task taskToBeLaunched,
        Collection<LocalizableMessage> incompatibilityReasons)
    {
      boolean canLaunch = true;
      if (!isServerRunning())
      {
        if (state == State.RUNNING && runningOnSameServer(taskToBeLaunched))
      if (!isServerRunning()
          && state == State.RUNNING
          && runningOnSameServer(taskToBeLaunched))
        {
          // All the operations are incompatible if they apply to this
          // backend for safety.  This is a short operation so the limitation
@@ -1450,11 +1448,10 @@
          {
            incompatibilityReasons.add(getIncompatibilityMessage(this,
                taskToBeLaunched));
            canLaunch = false;
          return false;
          }
        }
      }
      return canLaunch;
      return true;
    }
    /**
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewBaseDNPanel.java
@@ -564,9 +564,8 @@
                break;
              }
            }
            else if (theDN.isAncestorOf(baseDN.getDn()))
            {
              if (backendName.equalsIgnoreCase(backend.getBackendID()))
            else if (theDN.isAncestorOf(baseDN.getDn())
                && backendName.equalsIgnoreCase(backend.getBackendID()))
              {
                errors.add(ERR_BASE_DN_DN_IS_ANCESTOR_OF.get(baseDN.getDn()));
                setPrimaryInvalid(lDirectoryBaseDN);
@@ -574,7 +573,6 @@
                break;
              }
            }
          }
          if (baseDNAlreadyDefined)
          {
            break;
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewGroupPanel.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2013-2014 ForgeRock AS.
 *      Portions Copyright 2013-2015 ForgeRock AS.
 */
package org.opends.guitools.controlpanel.ui;
@@ -622,15 +622,13 @@
            staticMembers.setText(sb.toString());
            staticMembers.setCaretPosition(sb.length());
          }
          else if (comp == referenceGroup)
          {
            if (nodes.getNodes().length > 0)
          else if (comp == referenceGroup
              && nodes.getNodes().length > 0)
            {
              String dn = nodes.getNodes()[0].getNode().getDN();
              referenceGroup.setText(dn);
              referenceGroup.setCaretPosition(dn.length());
            }
          }
          e.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
          e.getDropTargetContext().dropComplete(true);
        }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewObjectClassPanel.java
@@ -211,14 +211,11 @@
      {
        setEnabledOK(!error[0]);
        errorPane.setVisible(error[0]);
        if (schema != null)
        {
          if (schemaChanged)
        if (schema != null && schemaChanged)
          {
            superiors.setSchema(schema);
            updateAttributes();
          }
        }
        if (repack[0])
        {
          packParentDialog();
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewUserPanel.java
@@ -190,9 +190,7 @@
          break;
        }
      }
      if (!isRequired)
      {
        if (attr.equalsIgnoreCase(NAMING_ATTRIBUTES[i]))
      if (!isRequired && attr.equalsIgnoreCase(NAMING_ATTRIBUTES[i]))
        {
          String value = NAMING_ATTRIBUTE_TEXTFIELDS[i].getText().trim();
          if (value.length() == 0)
@@ -202,7 +200,6 @@
          break;
        }
      }
    }
    char[] pwd1 = password.getPassword();
    char[] pwd2 = confirmPassword.getPassword();
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/NewVLVIndexPanel.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.guitools.controlpanel.ui;
@@ -145,10 +145,7 @@
      {
        task.canLaunch(newTask, errors);
      }
      if (errors.isEmpty())
      {
        // Check filters
        if (checkIndexRequired())
      if (errors.isEmpty() && checkIndexRequired())
        {
          String indexName = name.getText().trim();
          launchOperation(newTask,
@@ -164,7 +161,6 @@
          Utilities.getParentDialog(this).setVisible(false);
        }
      }
    }
    if (!errors.isEmpty())
    {
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/RebuildIndexPanel.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.guitools.controlpanel.ui;
@@ -241,15 +241,12 @@
    boolean allDisabled = false;
    for (BackendDescriptor backend : desc.getBackends())
    {
      if (displayBackend(backend))
      {
        if (backend.isEnabled())
      if (displayBackend(backend) && backend.isEnabled())
        {
          allDisabled = false;
          break;
        }
      }
    }
    if (!allDisabled)
    {
      updateErrorPaneAndOKButtonIfAuthRequired(desc,
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/SimplifiedViewEntryPanel.java
@@ -485,15 +485,13 @@
          if (values.size() == 1)
          {
            Object v = values.get(0);
            if (v instanceof String)
            {
              if (((String)v).indexOf("\n") != -1)
            if (v instanceof String
                && ((String) v).indexOf("\n") != -1)
              {
                gbc.anchor = GridBagConstraints.NORTHWEST;
              }
            }
          }
        }
        gbc.insets.left = 0;
        gbc.gridwidth = GridBagConstraints.RELATIVE;
        attributesPanel.add(label, gbc);
@@ -1249,9 +1247,7 @@
        {
          String oc = (String)o;
          ObjectClass objectClass = schema.getObjectClass(oc.toLowerCase());
          if (objectClass != null)
          {
            if (objectClass.isRequired(attr))
          if (objectClass != null && objectClass.isRequired(attr))
            {
              isRequired = true;
              break;
@@ -1259,7 +1255,6 @@
          }
        }
      }
    }
    return isRequired;
  }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/TableViewEntryPanel.java
@@ -800,9 +800,8 @@
      List<Object> values = new ArrayList<Object>();
      for (AttributeValuePair valuePair : dataArray)
      {
        if (valuePair.attrName.equalsIgnoreCase(attrName))
        {
          if (hasValue(valuePair))
        if (valuePair.attrName.equalsIgnoreCase(attrName)
            && hasValue(valuePair))
          {
            if (valuePair.value instanceof Collection<?>)
            {
@@ -814,7 +813,6 @@
            }
          }
        }
      }
      return values;
    }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/VLVIndexPanel.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2011-2014 ForgeRock AS
 *      Portions Copyright 2011-2015 ForgeRock AS
 */
package org.opends.guitools.controlpanel.ui;
@@ -461,18 +461,14 @@
      {
        task.canLaunch(newModifyTask, errors);
      }
      if (errors.isEmpty())
      {
        // Check filters
        if (checkIndexRequired())
      if (errors.isEmpty() && checkIndexRequired())
        {
          String indexName = index.getName();
          String backendName = index.getBackend().getBackendID();
          launchOperation(newModifyTask,
              INFO_CTRL_PANEL_MODIFYING_VLV_INDEX_SUMMARY.get(indexName),
              INFO_CTRL_PANEL_MODIFYING_VLV_INDEX_COMPLETE.get(),
              INFO_CTRL_PANEL_MODIFYING_VLV_INDEX_SUCCESSFUL.get(indexName,
                  backendName),
            INFO_CTRL_PANEL_MODIFYING_VLV_INDEX_SUCCESSFUL.get(indexName, backendName),
              ERR_CTRL_PANEL_MODIFYING_VLV_INDEX_ERROR_SUMMARY.get(),
              ERR_CTRL_PANEL_MODIFYING_VLV_INDEX_ERROR_DETAILS.get(indexName),
              null,
@@ -481,7 +477,6 @@
          dlg.setVisible(true);
        }
      }
    }
    if (errors.size() > 0)
    {
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/WindowsServicePanel.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.guitools.controlpanel.ui;
@@ -341,18 +341,16 @@
    public boolean canLaunch(Task taskToBeLaunched,
        Collection<LocalizableMessage> incompatibilityReasons)
    {
      boolean canLaunch = true;
      if (state == State.RUNNING && runningOnSameServer(taskToBeLaunched))
      Type type = taskToBeLaunched.getType();
      if (state == State.RUNNING
          && runningOnSameServer(taskToBeLaunched)
          && (type == Type.ENABLE_WINDOWS_SERVICE
              || type == Type.DISABLE_WINDOWS_SERVICE))
      {
        if ((taskToBeLaunched.getType() == Type.ENABLE_WINDOWS_SERVICE) ||
            (taskToBeLaunched.getType() == Type.DISABLE_WINDOWS_SERVICE))
        {
          incompatibilityReasons.add(getIncompatibilityMessage(this,
              taskToBeLaunched));
          canLaunch = false;
        incompatibilityReasons.add(getIncompatibilityMessage(this, taskToBeLaunched));
        return false;
        }
      }
      return canLaunch;
      return true;
    }
    /**
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/CustomTree.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.guitools.controlpanel.ui.components;
@@ -181,13 +181,13 @@
          notifyNewEvent(macEvent, NewEventType.MOUSE_PRESSED);
        }
        if (ev.isPopupTrigger() && (popupMenu != null)) {
          if ((getPathForLocation(ev.getPoint().x, ev.getPoint().y) != null) ||
              (newEvent != null))
        if (ev.isPopupTrigger()
            && popupMenu != null
            && (getPathForLocation(ev.getPoint().x, ev.getPoint().y) != null
                || newEvent != null))
          {
            popupMenu.show(ev.getComponent(), ev.getX(), ev.getY());
          }
        }
        if (newEvent != null)
        {
          notifyNewEvent(newEvent, NewEventType.MOUSE_PRESSED);
@@ -204,14 +204,14 @@
          return;
        }
        MouseEvent newEvent = getTranslatedEvent(ev);
        if (ev.isPopupTrigger() && (popupMenu != null) &&
            !popupMenu.isVisible()) {
          if ((getPathForLocation(ev.getPoint().x, ev.getPoint().y) != null) ||
              (newEvent != null))
        if (ev.isPopupTrigger()
            && popupMenu != null
            && !popupMenu.isVisible()
            && (getPathForLocation(ev.getPoint().x, ev.getPoint().y) != null
                || newEvent != null))
          {
            popupMenu.show(ev.getComponent(), ev.getX(), ev.getY());
          }
        }
        if (newEvent != null)
        {
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/DoubleAddRemovePanel.java
@@ -191,15 +191,13 @@
              remove1Clicked();
            }
          }
          else if (e.getSource() == selectedList2)
          {
            if (selectedList2.getSelectedValue() != null)
          else if (e.getSource() == selectedList2
              && selectedList2.getSelectedValue() != null)
            {
              remove2Clicked();
            }
          }
        }
      }
    };
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/FilterTextField.java
@@ -179,13 +179,10 @@
   */
  public void setBorder(Border border)
  {
    if (constructorBorderSet)
    {
      if (border != null)
    if (constructorBorderSet && border != null)
      {
        border = BorderFactory.createCompoundBorder(border, new IconBorder());
      }
    }
    super.setBorder(border);
  }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/util/ConfigFromFile.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2011 Sun Microsystems, Inc.
 *      Portions Copyright 2013-2014 ForgeRock AS.
 *      Portions Copyright 2013-2015 ForgeRock AS.
 */
package org.opends.guitools.controlpanel.util;
@@ -373,13 +373,10 @@
      ex.add(new OfflineUpdateException(ERR_READING_CONFIG_LDAP.get(t.getMessage()), t));
    }
    if (ex.size() > 0)
    {
      if (environmentSettingException != null)
    if (ex.size() > 0 && environmentSettingException != null)
      {
        ex.add(0, environmentSettingException);
      }
    }
    for (OpenDsException oe : ex)
    {
opendj-server-legacy/src/main/java/org/opends/guitools/uninstaller/Uninstaller.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.guitools.uninstaller;
@@ -389,15 +389,12 @@
        @Override
        public void run()
        {
          if (startProgressDlg != null)
          {
            if (newLogDetail != null)
          if (startProgressDlg != null && newLogDetail != null)
            {
              startProgressDetails.append(newLogDetail);
              startProgressDlg.setDetails(startProgressDetails.toMessage());
            }
          }
        }
      });
    }
  }
opendj-server-legacy/src/main/java/org/opends/guitools/uninstaller/ui/ConfirmUninstallPanel.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2011-2014 ForgeRock AS
 *      Portions Copyright 2011-2015 ForgeRock AS
 */
package org.opends.guitools.uninstaller.ui;
@@ -90,25 +90,21 @@
    {
    case EXTERNAL_DB_DIRECTORIES:
      Set<String> s1 = new HashSet<String>();
      if (outsideDbs.size() > 0)
      {
        if (getCheckBox(FieldName.EXTERNAL_DB_DIRECTORIES).isSelected())
      if (outsideDbs.size() > 0
          && getCheckBox(FieldName.EXTERNAL_DB_DIRECTORIES).isSelected())
        {
          s1.addAll(outsideDbs);
        }
      }
      value = s1;
      break;
    case EXTERNAL_LOG_FILES:
      Set<String> s2 = new HashSet<String>();
      if (outsideLogs.size() > 0)
      {
        if (getCheckBox(FieldName.EXTERNAL_LOG_FILES).isSelected())
      if (outsideLogs.size() > 0
          && getCheckBox(FieldName.EXTERNAL_LOG_FILES).isSelected())
        {
          s2.addAll(outsideLogs);
        }
      }
      value = s2;
      break;
    default:
opendj-server-legacy/src/main/java/org/opends/quicksetup/event/BrowseActionListener.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS
 */
package org.opends.quicksetup.event;
@@ -161,9 +162,7 @@
    /* If we can get the current field parent directory set to it */
    String path = field.getText();
    if (path != null)
    {
      if (path.trim().length() > 0)
    if (path != null && path.trim().length() > 0)
      {
        File f = new File(path);
        while ((f != null) && !f.isDirectory())
@@ -175,7 +174,6 @@
          fc.setCurrentDirectory(f);
        }
      }
    }
    switch (type)
    {
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/InstallerHelper.java
@@ -1216,22 +1216,16 @@
   */
  public String getImportProgressMessage(String msg)
  {
    String parsedMsg = null;
    if (msg != null)
    {
      if ((msg.contains("msgID=" + JebMessages
              .NOTE_JEB_IMPORT_FINAL_STATUS.ordinal())) ||
          (msg.contains("msgID=" + JebMessages
              .NOTE_JEB_IMPORT_PROGRESS_REPORT.ordinal())))
    if (msg != null
        && (msg.contains("msgID=" + JebMessages.NOTE_JEB_IMPORT_FINAL_STATUS.ordinal())
            || msg.contains("msgID=" + JebMessages.NOTE_JEB_IMPORT_PROGRESS_REPORT.ordinal())))
      {
        int index = msg.indexOf("msg=");
        if (index != -1)
        {
          parsedMsg = msg.substring(index + 4);
        return msg.substring(index + 4);
        }
      }
    }
    return parsedMsg;
    return null;
  }
}
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/JavaArgumentsDialog.java
@@ -512,15 +512,14 @@
          errorMsgs.add(ERR_MAX_MEMORY_VALUE.get());
          setValidLater(lMaxMemory, false);
        }
        if (maxMemory != -1 && initialMemory != -1)
        {
          if (initialMemory > maxMemory)
        if (maxMemory != -1
            && initialMemory != -1
            && initialMemory > maxMemory)
          {
            errorMsgs.add(ERR_MAX_MEMORY_BIGGER_THAN_INITIAL_MEMORY.get());
            setValidLater(lMaxMemory, false);
            setValidLater(lInitialMemory, false);
          }
        }
        if (errorMsgs.isEmpty())
        {
          // Try the options together, often there are interdependencies.
opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/CertificateDialog.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2013-2014 ForgeRock AS.
 *      Portions Copyright 2013-2015 ForgeRock AS.
 */
package org.opends.quicksetup.ui;
@@ -122,14 +122,12 @@
    getContentPane().add(createPanel());
    setModal(true);
    pack();
    if (parent != null)
    {
      if (getPreferredSize().width > parent.getWidth())
    if (parent != null
        && getPreferredSize().width > parent.getWidth())
      {
        setPreferredSize(new Dimension(Math.max(parent.getWidth() - 20, 600),
            getPreferredSize().height));
      }
    }
    pack();
    int minWidth = (int) getPreferredSize().getWidth();
    int minHeight = (int) getPreferredSize().getHeight();
opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/GuiApplication.java
@@ -452,9 +452,7 @@
            "The host is null for the UserDataCertificateException"));
      }
    }
    if (acceptPermanently)
    {
      if (chain != null)
    if (acceptPermanently && chain != null)
      {
        try
        {
@@ -466,7 +464,6 @@
        }
      }
    }
  }
  /**
   * Begins downloading webstart jars in another thread
opendj-server-legacy/src/main/java/org/opends/quicksetup/util/FileManager.java
@@ -130,14 +130,13 @@
          throws ApplicationException {
    if (fileToRename != null && target != null) {
      synchronized (target) {
        if (target.exists()) {
          if (!target.delete()) {
        if (target.exists() && !target.delete())
        {
            throw new ApplicationException(
                    ReturnCode.FILE_SYSTEM_ACCESS_ERROR,
                    INFO_ERROR_DELETING_FILE.get(Utils.getPath(target)), null);
          }
        }
      }
      if (!fileToRename.renameTo(target)) {
        throw new ApplicationException(
                ReturnCode.FILE_SYSTEM_ACCESS_ERROR,
@@ -503,16 +502,11 @@
              while ((i = fis.read(buf)) != -1) {
                fos.write(buf, 0, i);
              }
              if (destination.exists()) {
              if (destination.exists() && isUnix()) {
                // TODO:  set the file's permissions.  This is made easier in
                // Java 1.6 but until then use the TestUtilities methods
                if (isUnix()) {
                  String permissions =
                          Utils.getFileSystemPermissions(objectFile);
                  Utils.setPermissionsUnix(
                          Utils.getPath(destination),
                          permissions);
                }
                String permissions = Utils.getFileSystemPermissions(objectFile);
                Utils.setPermissionsUnix(Utils.getPath(destination), permissions);
              }
              if ((application != null) && application.isVerbose()) {
opendj-server-legacy/src/main/java/org/opends/quicksetup/util/ZipExtractor.java
@@ -325,13 +325,11 @@
    {
      throw new IOException("Could not create parent path: " + destination);
    }
    if (application != null) {
      if (application.isVerbose())
    if (application != null && application.isVerbose())
      {
        application.notifyListenersDone(ratioWhenCompleted);
      }
    }
  }
  /**
   * Returns the UNIX permissions to be applied to a protected directory.
opendj-server-legacy/src/main/java/org/opends/server/admin/AggregationPropertyDefinition.java
@@ -604,15 +604,12 @@
        }
        // Make sure the reference managed object is enabled.
        if (needsEnabling) {
          if (!targetIsEnabledCondition.evaluate(context, ref)) {
            LocalizableMessage msg = ERR_CLIENT_REFINT_TARGET_DISABLED.get(ufn, name,
                getName());
            unacceptableReasons.add(msg);
        if (needsEnabling
            && !targetIsEnabledCondition.evaluate(context, ref)) {
          unacceptableReasons.add(ERR_CLIENT_REFINT_TARGET_DISABLED.get(ufn, name, getName()));
            isAcceptable = false;
          }
        }
      }
      return isAcceptable;
    }
opendj-server-legacy/src/main/java/org/opends/server/admin/DurationPropertyDefinition.java
@@ -155,13 +155,9 @@
        throws IllegalArgumentException {
      ifNull(unit);
      // Make sure that the base unit is not bigger than the maximum
      // unit.
      if (maximumUnit != null) {
        if (unit.getDuration() > maximumUnit.getDuration()) {
          throw new IllegalArgumentException(
              "Base unit greater than maximum unit");
        }
      // Make sure that the base unit is not bigger than the maximum unit.
      if (maximumUnit != null && unit.getDuration() > maximumUnit.getDuration()) {
        throw new IllegalArgumentException("Base unit greater than maximum unit");
      }
      this.baseUnit = unit;
@@ -201,18 +197,13 @@
     *          The maximum unit, or <code>null</code> if there
     *          should not be a maximum unit.
     * @throws IllegalArgumentException
     *           If the provided maximum unit is smaller than the base
     *           unit.
     *           If the provided maximum unit is smaller than the base unit.
     */
    public final void setMaximumUnit(DurationUnit unit)
        throws IllegalArgumentException {
      if (unit != null) {
        // Make sure that the maximum unit is not smaller than the
        // base unit.
        if (unit.getDuration() < baseUnit.getDuration()) {
          throw new IllegalArgumentException(
              "Maximum unit smaller than base unit");
        }
      // Make sure that the maximum unit is not smaller than the base unit.
      if (unit != null && unit.getDuration() < baseUnit.getDuration()) {
        throw new IllegalArgumentException("Maximum unit smaller than base unit");
      }
      this.maximumUnit = unit;
@@ -485,13 +476,10 @@
  public String encodeValue(Long value) throws PropertyException {
    ifNull(value);
    // Make sure that we correctly encode negative values as
    // "unlimited".
    if (allowUnlimited) {
      if (value < 0) {
    // Make sure that we correctly encode negative values as "unlimited".
    if (allowUnlimited && value < 0) {
        return UNLIMITED;
      }
    }
    // Encode the size value using the base unit.
    return value + " " + baseUnit;
@@ -508,11 +496,9 @@
    ifNull(value);
    // First check for the special "unlimited" value when necessary.
    if (allowUnlimited) {
      if (value.trim().equalsIgnoreCase(UNLIMITED)) {
    if (allowUnlimited && value.trim().equalsIgnoreCase(UNLIMITED)) {
        return -1L;
      }
    }
    // Parse the string representation.
    long ms;
opendj-server-legacy/src/main/java/org/opends/server/admin/IntegerPropertyDefinition.java
@@ -301,11 +301,9 @@
    ifNull(value);
    // Make sure that we correctly encode negative values as "unlimited".
    if (allowUnlimited) {
      if (value < 0) {
    if (allowUnlimited && value < 0) {
        return UNLIMITED;
      }
    }
    return value.toString();
  }
@@ -314,15 +312,12 @@
   * {@inheritDoc}
   */
  @Override
  public Integer decodeValue(String value)
      throws PropertyException {
  public Integer decodeValue(String value) throws PropertyException {
    ifNull(value);
    if (allowUnlimited) {
      if (value.trim().equalsIgnoreCase(UNLIMITED)) {
    if (allowUnlimited && value.trim().equalsIgnoreCase(UNLIMITED)) {
        return -1;
      }
    }
    Integer i;
    try {
opendj-server-legacy/src/main/java/org/opends/server/admin/PropertyDefinition.java
@@ -420,12 +420,8 @@
      return true;
    } else if (o instanceof PropertyDefinition) {
      PropertyDefinition<?> other = (PropertyDefinition<?>) o;
      if (propertyName.equals(other.propertyName)) {
        if (theClass.equals(other.theClass)) {
          return true;
        }
      }
      return false;
      return propertyName.equals(other.propertyName)
          && theClass.equals(other.theClass);
    } else {
      return false;
    }
opendj-server-legacy/src/main/java/org/opends/server/admin/SizePropertyDefinition.java
@@ -301,11 +301,9 @@
    ifNull(value);
    // Make sure that we correctly encode negative values as "unlimited".
    if (allowUnlimited) {
      if (value < 0) {
    if (allowUnlimited && value < 0) {
        return UNLIMITED;
      }
    }
    // Encode the size value using the best-fit unit.
    SizeUnit unit = SizeUnit.getBestFitUnitExact(value);
@@ -322,16 +320,13 @@
   * {@inheritDoc}
   */
  @Override
  public Long decodeValue(String value)
      throws PropertyException {
  public Long decodeValue(String value) throws PropertyException {
    ifNull(value);
    // First check for the special "unlimited" value when necessary.
    if (allowUnlimited) {
      if (value.trim().equalsIgnoreCase(UNLIMITED)) {
    if (allowUnlimited && value.trim().equalsIgnoreCase(UNLIMITED)) {
        return -1L;
      }
    }
    // Decode the value.
    Long i;
opendj-server-legacy/src/main/java/org/opends/server/admin/client/ldap/LDAPDriver.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2013-2014 ForgeRock AS.
 *      Portions Copyright 2013-2015 ForgeRock AS.
 */
package org.opends.server.admin.client.ldap;
@@ -640,14 +640,13 @@
    newProperties.addProperty(pd, defaultValues, activeValues);
    if (activeValues.isEmpty() && defaultValues.isEmpty()
        && pd.hasOption(PropertyOption.MANDATORY)) {
      // The active values maybe empty because of a previous
      // exception.
      if (exception == null) {
    if (activeValues.isEmpty()
        && defaultValues.isEmpty()
        && pd.hasOption(PropertyOption.MANDATORY)
        // The active values maybe empty because of a previous exception.
        && exception == null) {
        exception = PropertyException.propertyIsMandatoryException(pd);
      }
    }
    if (exception != null) {
      throw exception;
opendj-server-legacy/src/main/java/org/opends/server/admin/client/spi/PropertySet.java
@@ -332,12 +332,12 @@
      throw PropertyException.propertyIsSingleValuedException(d);
    }
    if (values.isEmpty() && d.hasOption(PropertyOption.MANDATORY)) {
    if (values.isEmpty()
        && d.hasOption(PropertyOption.MANDATORY)
      // But only if there are no default values.
      if (property.getDefaultValues().isEmpty()) {
        && property.getDefaultValues().isEmpty()) {
        throw PropertyException.propertyIsMandatoryException(d);
      }
    }
    // Validate each value.
    for (T e : values) {
opendj-server-legacy/src/main/java/org/opends/server/admin/doc/ConfigGuideGeneration.java
@@ -648,20 +648,19 @@
        heading3("Relations To this Component");
    }
    if (!mo.getReverseRelationDefinitions().isEmpty()) {
      if (!isReverseCompRelsEmpty) {
    if (!mo.getReverseRelationDefinitions().isEmpty()
        && !isReverseCompRelsEmpty)
    {
        paragraph(
          "The following components have a direct COMPOSITION relation TO " +
          mo.getUserFriendlyPluralName() + " :");
        for ( RelationDefinition rel : reverseCompRels) {
          beginList();
          AbstractManagedObjectDefinition childRel = rel.getParentDefinition();
          link(childRel.getUserFriendlyName().toString(), childRel.getName() +
            ".html");
        link(childRel.getUserFriendlyName().toString(), childRel.getName() + ".html");
          endList();
        }
      }
    }
    if (!isReverseAggregPropsEmpty) {
      paragraph(
        "The following components have a direct AGGREGATION relation TO " +
opendj-server-legacy/src/main/java/org/opends/server/admin/server/ServerManagementContext.java
@@ -874,18 +874,17 @@
      pvalues.add(value);
    }
    if (pvalues.isEmpty() && pd.hasOption(PropertyOption.MANDATORY)) {
    if (pvalues.isEmpty()
        && pd.hasOption(PropertyOption.MANDATORY)
      // The values maybe empty because of a previous exception.
      if (exception == null) {
        && exception == null) {
        exception = PropertyException.propertyIsMandatoryException(pd);
      }
    }
    if (exception != null) {
      throw exception;
    } else {
      return pvalues;
    }
    return pvalues;
  }
opendj-server-legacy/src/main/java/org/opends/server/api/AuthenticationPolicyState.java
@@ -216,15 +216,11 @@
      }
    }
    if (timeValue == -1)
    {
      if (logger.isTraceEnabled())
    if (timeValue == -1 && logger.isTraceEnabled())
      {
        logger.trace("Returning -1 because attribute %s does not "
            + "exist in user entry %s", attributeType.getNameOrOID(), entry.getName());
      }
    }
    // FIXME: else to be consistent...
    return timeValue;
  }
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciContainer.java
@@ -814,14 +814,12 @@
             * - TLS is the security provider, and
             * - The client provided a certificate.
             */
            if (authInfo.hasAuthenticationType(AuthenticationType.SASL) &&
                 authInfo.hasSASLMechanism(saslMech)) {
                if(clientConnection instanceof LDAPClientConnection) {
                    LDAPClientConnection lc =
                                       (LDAPClientConnection) clientConnection;
            if (authInfo.hasAuthenticationType(AuthenticationType.SASL)
                && authInfo.hasSASLMechanism(saslMech)
                && clientConnection instanceof LDAPClientConnection) {
                LDAPClientConnection lc = (LDAPClientConnection) clientConnection;
                    Certificate[] certChain = lc.getClientCertificateChain();
                    if(certChain.length != 0)
                if (certChain.length != 0) {
                        matched = EnumEvalResult.TRUE;
                }
            }
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciHandler.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2011-2014 ForgeRock AS
 *      Portions Copyright 2011-2015 ForgeRock AS
 *      Portions Copyright 2013 Manuel Gaupp
 */
package org.opends.server.authorization.dseecompat;
@@ -751,15 +751,14 @@
      // type are being replaced or deleted. If only a subset is being
      // deleted than this access check is skipped.
      ModificationType modType = m.getModificationType();
      if ((modType == ModificationType.DELETE && modAttr.isEmpty())
      if (((modType == ModificationType.DELETE && modAttr.isEmpty())
          || modType == ModificationType.REPLACE
          || modType == ModificationType.INCREMENT)
      {
        /*
         * Check if we have rights to delete all values of an attribute
         * type in the resource entry.
         */
        if (resourceEntry.hasAttribute(modAttrType))
          && resourceEntry.hasAttribute(modAttrType))
        {
          container.setCurrentAttributeType(modAttrType);
          List<Attribute> attrList =
@@ -780,7 +779,6 @@
            }
          }
        }
      }
      if (!modAttr.isEmpty())
      {
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/PatternIP.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
@@ -440,12 +440,11 @@
        if(wildCardBitSet.cardinality() == IN4ADDRSZ)
            return true;
        for(int i=0;i <rulePrefixBytes.length; i++) {
            if(!wildCardBitSet.get(i)) {
                if((ruleAddrBytes[i] & rulePrefixBytes[i]) !=
            if (!wildCardBitSet.get(i)
                && (ruleAddrBytes[i] & rulePrefixBytes[i]) !=
                        (addrBytes[i] & rulePrefixBytes[i]))
                    return false;
            }
        }
        return true;
    }
}
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/TargetAttr.java
@@ -26,12 +26,13 @@
 */
package org.opends.server.authorization.dseecompat;
import org.forgerock.i18n.LocalizableMessage;
import static org.opends.messages.AccessControlMessages.*;
import static org.opends.server.authorization.dseecompat.Aci.*;
import java.util.HashSet;
import java.util.regex.Pattern;
import org.forgerock.i18n.LocalizableMessage;
import org.opends.server.core.DirectoryServer;
import org.opends.server.types.AttributeType;
@@ -85,34 +86,24 @@
    throws AciException {
        this.operator = operator;
        if (attrString != null) {
            if (Pattern.matches(ALL_USER_ATTRS_WILD_CARD, attrString) )
            if (Pattern.matches(ALL_USER_ATTRS_WILD_CARD, attrString)) {
                allUserAttributes = true ;
            else  if (Pattern.matches(ALL_OP_ATTRS_WILD_CARD, attrString) )
            } else if (Pattern.matches(ALL_OP_ATTRS_WILD_CARD, attrString)) {
                allOpAttributes = true ;
            else {
                if (Pattern.matches(ZERO_OR_MORE_WHITESPACE, attrString)){
            } else if (Pattern.matches(ZERO_OR_MORE_WHITESPACE, attrString)) {
                    allUserAttributes = false;
                    allOpAttributes=false;
                } else {
                    if (Pattern.matches(attrListRegex, attrString)) {
            } else if (Pattern.matches(attrListRegex, attrString)) {
                        // Remove the spaces in the attr string and
                        // split the list.
                        Pattern separatorPattern =
                            Pattern.compile(LOGICAL_OR);
                        attrString=
                         attrString.replaceAll(ZERO_OR_MORE_WHITESPACE, "");
                        String[] attributeArray=
                             separatorPattern.split(attrString);
                Pattern separatorPattern = Pattern.compile(LOGICAL_OR);
                attrString = attrString.replaceAll(ZERO_OR_MORE_WHITESPACE, "");
                String[] attributeArray = separatorPattern.split(attrString);
                        //Add each element of array to appropriate HashSet
                        //after conversion to AttributeType.
                        arrayToAttributeTypes(attributeArray, attrString);
                    } else {
                      LocalizableMessage message =
                          WARN_ACI_SYNTAX_INVALID_TARGETATTRKEYWORD_EXPRESSION.
                            get(attrString);
                      throw new AciException(message);
                    }
                }
                throw new AciException(WARN_ACI_SYNTAX_INVALID_TARGETATTRKEYWORD_EXPRESSION.get(attrString));
            }
        }
    }
@@ -131,8 +122,8 @@
     */
    private void arrayToAttributeTypes(String[] attributeArray, String attrStr)
            throws AciException {
        for (int i=0, n=attributeArray.length; i < n; i++) {
            String attribute=attributeArray[i].toLowerCase();
        for (String attr : attributeArray) {
            String attribute = attr.toLowerCase();
            if(attribute.equals("*")) {
                if(!allUserAttributes)
                    allUserAttributes=true;
@@ -266,30 +257,22 @@
     * @param targetAttr The targetAttr to apply to the attribute type.
     * @return True if the attribute type is applicable to the targetAttr.
     */
      private static
      boolean evalAttrType(AttributeType a, TargetAttr targetAttr) {
        boolean ret=false;
    private static boolean evalAttrType(AttributeType a, TargetAttr targetAttr) {
        final EnumTargetOperator op = targetAttr.getOperator();
        if(a.isOperational()) {
          if(targetAttr.isAllOpAttributes() ||
                  targetAttr.opAttributes.contains(a))
            ret=true;
          if(targetAttr.isAllOpAttributes() ||
             !targetAttr.opAttributes.isEmpty()) {
            if(targetAttr.getOperator().
                    equals(EnumTargetOperator.NOT_EQUALITY))
              ret=!ret;
          }
            return evalAttrType(a, targetAttr.isAllOpAttributes(), targetAttr.opAttributes, op);
        } else {
          if(targetAttr.isAllUserAttributes() ||
                  targetAttr.attributes.contains(a))
            ret=true;
          if(targetAttr.isAllUserAttributes() ||
                  !targetAttr.attributes.isEmpty()) {
            if(targetAttr.getOperator().
                    equals(EnumTargetOperator.NOT_EQUALITY))
              ret=!ret;
            return evalAttrType(a, targetAttr.isAllUserAttributes(), targetAttr.attributes, op);
          }
        }
    private static boolean evalAttrType(AttributeType attrType, boolean allAttrs,
            HashSet<AttributeType> attrs, EnumTargetOperator op) {
        boolean ret = allAttrs || attrs.contains(attrType);
        if (op.equals(EnumTargetOperator.NOT_EQUALITY))
        {
          return !ret;
        }
      return ret;
      }
  }
opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/BackupManager.java
@@ -204,14 +204,11 @@
    if (incremental)
    {
      if (incrBaseID == null)
      if (incrBaseID == null && backupDir.getLatestBackup() != null)
      {
        // The default is to use the latest backup as base.
        if (backupDir.getLatestBackup() != null)
        {
          incrBaseID = backupDir.getLatestBackup().getBackupID();
        }
      }
      if (incrBaseID == null)
      {
@@ -906,13 +903,11 @@
      // See if we need to restore the file.
      File file = new File(restoreDir, name);
      OutputStream outputStream = null;
      if (includeFiles == null || includeFiles.contains(zipEntry.getName()))
      {
        if (!verifyOnly)
      if ((includeFiles == null || includeFiles.contains(zipEntry.getName()))
          && !verifyOnly)
        {
          outputStream = new FileOutputStream(file);
        }
      }
      if (outputStream != null || mac != null || digest != null)
      {
@@ -972,14 +967,10 @@
    zipStream.close();
    // Check the hash.
    if (digest != null)
    {
      if (!Arrays.equals(digest.digest(), hash))
    if (digest != null && !Arrays.equals(digest.digest(), hash))
      {
        LocalizableMessage message = ERR_JEB_BACKUP_UNSIGNED_HASH_ERROR.get(backupID);
        throw new DirectoryException(DirectoryServer.getServerErrorResultCode(),
                                     message);
      }
      throw new DirectoryException(DirectoryServer.getServerErrorResultCode(), message);
    }
    if (mac != null)
opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/PresenceIndexer.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.server.backends.jeb;
@@ -73,14 +73,11 @@
  public void indexEntry(Entry entry, Set<ByteString> keys, IndexingOptions options)
  {
    List<Attribute> attrList = entry.getAttribute(attributeType);
    if (attrList != null)
    {
      if (!attrList.isEmpty())
    if (attrList != null && !attrList.isEmpty())
      {
        keys.add(presenceKey);
      }
    }
  }
  /** {@inheritDoc} */
  @Override
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/BackupManager.java
@@ -205,14 +205,11 @@
    if (incremental)
    {
      if (incrBaseID == null)
      if (incrBaseID == null && backupDir.getLatestBackup() != null)
      {
        // The default is to use the latest backup as base.
        if (backupDir.getLatestBackup() != null)
        {
          incrBaseID = backupDir.getLatestBackup().getBackupID();
        }
      }
      if (incrBaseID == null)
      {
@@ -897,13 +894,10 @@
      // See if we need to restore the file.
      File file = new File(restoreDir, name);
      OutputStream outputStream = null;
      if (includeFiles == null || includeFiles.contains(zipEntry.getName()))
      {
        if (!verifyOnly)
      if ((includeFiles == null || includeFiles.contains(zipEntry.getName())) && !verifyOnly)
        {
          outputStream = new FileOutputStream(file);
        }
      }
      if (outputStream != null || mac != null || digest != null)
      {
@@ -963,15 +957,12 @@
    zipStream.close();
    // Check the hash.
    if (digest != null)
    {
      if (!Arrays.equals(digest.digest(), hash))
    if (digest != null && !Arrays.equals(digest.digest(), hash))
      {
        LocalizableMessage message = ERR_JEB_BACKUP_UNSIGNED_HASH_ERROR.get(backupID);
        throw new DirectoryException(DirectoryServer.getServerErrorResultCode(),
                                     message);
      }
    }
    if (mac != null)
    {
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/Index.java
@@ -263,16 +263,15 @@
          logIndexCorruptError(txn, key);
        }
        if ((rebuildRunning || trusted) && isNotNullOrEmpty(addedIDs))
        {
          if(!insert(txn, key, addedIDs.toByteString()))
        if ((rebuildRunning || trusted)
            && isNotNullOrEmpty(addedIDs)
            && !insert(txn, key, addedIDs.toByteString()))
          {
            updateKeyWithRMW(txn, key, deletedIDs, addedIDs);
          }
        }
      }
    }
  }
  private boolean isNullOrEmpty(EntryIDSet entryIDSet)
  {
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/PresenceIndexer.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.server.backends.pluggable;
@@ -73,14 +73,11 @@
  public void indexEntry(Entry entry, Set<ByteString> keys, IndexingOptions options)
  {
    List<Attribute> attrList = entry.getAttribute(attributeType);
    if (attrList != null)
    {
      if (!attrList.isEmpty())
    if (attrList != null && !attrList.isEmpty())
      {
        keys.add(presenceKey);
      }
    }
  }
  /** {@inheritDoc} */
  @Override
opendj-server-legacy/src/main/java/org/opends/server/backends/task/TaskScheduler.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2013-2014 ForgeRock AS
 *      Portions Copyright 2013-2015 ForgeRock AS
 */
package org.opends.server.backends.task;
@@ -1675,14 +1675,11 @@
        try
        {
          Entry e = t.getTaskEntry().duplicate(true);
          if (filter.matchesEntry(e))
          {
            if (! searchOperation.returnEntry(e, null))
          if (filter.matchesEntry(e) && !searchOperation.returnEntry(e, null))
            {
              return false;
            }
          }
        }
        finally
        {
          unlockEntry(taskEntryDN, lock);
@@ -1826,14 +1823,11 @@
        try
        {
          Entry e = rt.getRecurringTaskEntry().duplicate(true);
          if (filter.matchesEntry(e))
          {
            if (! searchOperation.returnEntry(e, null))
          if (filter.matchesEntry(e) && ! searchOperation.returnEntry(e, null))
            {
              return false;
            }
          }
        }
        finally
        {
          unlockEntry(recurringTaskEntryDN, lock);
opendj-server-legacy/src/main/java/org/opends/server/config/ConfigAttribute.java
@@ -552,11 +552,11 @@
    // attribute.
    if (! isMultiValued)
    {
      if ((numValues > 1) || (hasPendingValues && (pendingValues.size() > 0)) ||
          ((! hasPendingValues) && (activeValues.size() > 0)))
      if (numValues > 1
          || (hasPendingValues && pendingValues.size() > 0)
          || (!hasPendingValues && activeValues.size() > 0))
      {
        LocalizableMessage message = ERR_CONFIG_ATTR_ADD_VALUES_IS_SINGLE_VALUED.get(name);
        throw new ConfigException(message);
        throw new ConfigException(ERR_CONFIG_ATTR_ADD_VALUES_IS_SINGLE_VALUED.get(name));
      }
    }
opendj-server-legacy/src/main/java/org/opends/server/controls/MatchedValuesFilter.java
@@ -23,7 +23,7 @@
 *
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2013-2014 Manuel Gaupp
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.server.controls;
@@ -893,20 +893,14 @@
   */
  public AttributeType getAttributeType()
  {
    if (attributeType == null && rawAttributeType != null)
    {
      attributeType = DirectoryServer.getAttributeType(toLowerCase(rawAttributeType));
    if (attributeType == null)
    {
      if (rawAttributeType != null)
      {
        attributeType =
             DirectoryServer.getAttributeType(toLowerCase(rawAttributeType));
        if (attributeType == null)
        {
          attributeType =
               DirectoryServer.getDefaultAttributeType(rawAttributeType);
        attributeType = DirectoryServer.getDefaultAttributeType(rawAttributeType);
        }
      }
    }
    return attributeType;
  }
@@ -1015,15 +1009,10 @@
   */
  public MatchingRule getMatchingRule()
  {
    if (matchingRule == null)
    if (matchingRule == null && matchingRuleID != null)
    {
      if (matchingRuleID != null)
      {
        matchingRule =
             DirectoryServer.getMatchingRule(toLowerCase(matchingRuleID));
      matchingRule = DirectoryServer.getMatchingRule(toLowerCase(matchingRuleID));
      }
    }
    return matchingRule;
  }
opendj-server-legacy/src/main/java/org/opends/server/core/EntryCacheConfigManager.java
@@ -186,14 +186,14 @@
      configuration.addChangeListener(this);
      // Check if there is another entry cache installed at the same level.
      if (!cacheOrderMap.isEmpty()) {
        if (cacheOrderMap.containsKey(configuration.getCacheLevel())) {
      if (!cacheOrderMap.isEmpty()
          && cacheOrderMap.containsKey(configuration.getCacheLevel()))
      {
          // Log error and skip this cache.
          logger.error(ERR_CONFIG_ENTRYCACHE_CONFIG_LEVEL_NOT_ACCEPTABLE,
              configuration.dn(), configuration.getCacheLevel());
          continue;
        }
      }
      // Initialize the entry cache.
      if (configuration.isEnabled()) {
@@ -374,14 +374,13 @@
  {
    // returned status -- all is fine by default
    // Check if there is another entry cache installed at the same level.
    if (!cacheOrderMap.isEmpty()) {
      if (cacheOrderMap.containsKey(configuration.getCacheLevel())) {
        unacceptableReasons.add(
          ERR_CONFIG_ENTRYCACHE_CONFIG_LEVEL_NOT_ACCEPTABLE.get(
    if (!cacheOrderMap.isEmpty()
        && cacheOrderMap.containsKey(configuration.getCacheLevel()))
    {
      unacceptableReasons.add(ERR_CONFIG_ENTRYCACHE_CONFIG_LEVEL_NOT_ACCEPTABLE.get(
            configuration.dn(), configuration.getCacheLevel()));
        return false;
      }
    }
    if (configuration.isEnabled())
    {
opendj-server-legacy/src/main/java/org/opends/server/core/PasswordPolicyConfigManager.java
@@ -444,14 +444,10 @@
  {
    // If this is going to be the default password policy then check the type is
    // correct.
    if (policyConfiguration.dn().equals(
        DirectoryServer.getDefaultPasswordPolicyDN()))
    if (policyConfiguration.dn().equals(DirectoryServer.getDefaultPasswordPolicyDN())
        && !(policyConfiguration instanceof PasswordPolicyCfg))
    {
      if (!(policyConfiguration instanceof PasswordPolicyCfg))
      {
        LocalizableMessage msg = ERR_CONFIG_PWPOLICY_DEFAULT_POLICY_IS_WRONG_TYPE.get(policyConfiguration.dn());
        throw new ConfigException(msg);
      }
      throw new ConfigException(ERR_CONFIG_PWPOLICY_DEFAULT_POLICY_IS_WRONG_TYPE.get(policyConfiguration.dn()));
    }
    String className = policyConfiguration.getJavaClass();
@@ -504,16 +500,12 @@
  {
    // If this is going to be the default password policy then check the type is
    // correct.
    if (policyConfiguration.dn().equals(
        DirectoryServer.getDefaultPasswordPolicyDN()))
    if (policyConfiguration.dn().equals(DirectoryServer.getDefaultPasswordPolicyDN())
        && !(policyConfiguration instanceof PasswordPolicyCfg))
    {
      if (!(policyConfiguration instanceof PasswordPolicyCfg))
      {
        LocalizableMessage msg = ERR_CONFIG_PWPOLICY_DEFAULT_POLICY_IS_WRONG_TYPE.get(policyConfiguration.dn());
        unacceptableReasons.add(msg);
      unacceptableReasons.add(ERR_CONFIG_PWPOLICY_DEFAULT_POLICY_IS_WRONG_TYPE.get(policyConfiguration.dn()));
        return false;
      }
    }
    String className = policyConfiguration.getJavaClass();
    AuthenticationPolicyCfgDefn d = AuthenticationPolicyCfgDefn.getInstance();
opendj-server-legacy/src/main/java/org/opends/server/extensions/AttributeValuePasswordValidator.java
@@ -148,15 +148,13 @@
    // Check to see if we should verify the whole password or the substrings.
    int minSubstringLength = password.length();
    if (config.isCheckSubstrings())
    {
    if (config.isCheckSubstrings()
      // We apply the minimal substring length only if the provided value
      // is smaller then the actual password length
      if (config.getMinSubstringLength() < password.length())
        && config.getMinSubstringLength() < password.length())
      {
        minSubstringLength = config.getMinSubstringLength();
      }
    }
    // If we should check a specific set of attributes, then do that now.
    // Otherwise, check all user attributes.
opendj-server-legacy/src/main/java/org/opends/server/extensions/DictionaryPasswordValidator.java
@@ -132,15 +132,13 @@
    // the password which is the default behaviour ('check-substrings: false')
    int minSubstringLength = password.length();
    if (config.isCheckSubstrings())
    {
    if (config.isCheckSubstrings()
      // We apply the minimal substring length only if the provided value
      // is smaller then the actual password length
      if (config.getMinSubstringLength() < password.length())
        && config.getMinSubstringLength() < password.length())
      {
        minSubstringLength = config.getMinSubstringLength();
      }
    }
    // Verify if the dictionary contains the word(s) in the password
    if (isDictionaryBased(password, minSubstringLength))
@@ -152,16 +150,13 @@
    // If the reverse password checking is enabled, then verify if the
    // reverse value of the password is in the dictionary.
    if (config.isTestReversedPassword())
    {
      if (isDictionaryBased(
    if (config.isTestReversedPassword()
        && isDictionaryBased(
        new StringBuilder(password).reverse().toString(), minSubstringLength))
      {
        invalidReason.append(
          ERR_DICTIONARY_VALIDATOR_PASSWORD_IN_DICTIONARY.get());
      invalidReason.append(ERR_DICTIONARY_VALIDATOR_PASSWORD_IN_DICTIONARY.get());
        return false;
      }
    }
    // If we've gotten here, then the password is acceptable.
opendj-server-legacy/src/main/java/org/opends/server/extensions/FileBasedTrustManagerProvider.java
@@ -380,29 +380,21 @@
    // If there is a PIN property, then make sure the corresponding
    // property is set.
    String pinProp = configuration.getTrustStorePinProperty();
    if (pinProp != null)
    if (pinProp != null && System.getProperty(pinProp) == null)
    {
      if (System.getProperty(pinProp) == null)
      {
        LocalizableMessage message = ERR_FILE_TRUSTMANAGER_PIN_PROPERTY_NOT_SET.get(pinProp, cfgEntryDN);
        unacceptableReasons.add(message);
      unacceptableReasons.add(ERR_FILE_TRUSTMANAGER_PIN_PROPERTY_NOT_SET.get(pinProp, cfgEntryDN));
        configAcceptable = false;
      }
    }
    // If there is a PIN environment variable, then make sure the corresponding
    // environment variable is set.
    String pinEnVar = configuration.getTrustStorePinEnvironmentVariable();
    if (pinEnVar != null)
    if (pinEnVar != null && System.getenv(pinEnVar) == null)
    {
      if (System.getenv(pinEnVar) == null)
      {
        LocalizableMessage message = ERR_FILE_TRUSTMANAGER_PIN_ENVAR_NOT_SET.get(pinEnVar, cfgEntryDN);
        unacceptableReasons.add(message);
      unacceptableReasons.add(ERR_FILE_TRUSTMANAGER_PIN_ENVAR_NOT_SET.get(pinEnVar, cfgEntryDN));
        configAcceptable = false;
      }
    }
    // If there is a PIN file, then make sure the file exists and is readable.
opendj-server-legacy/src/main/java/org/opends/server/extensions/IsMemberOfVirtualAttributeProvider.java
@@ -310,20 +310,16 @@
      try
      {
        Entry e = memberList.nextMemberEntry();
        if (e.matchesBaseAndScope(baseDN, scope) &&
            filter.matchesEntry(e))
        {
        if (e.matchesBaseAndScope(baseDN, scope)
            && filter.matchesEntry(e)
          // The set of returned DNs is only used for detecting set membership
          // so it's ok to use the irreversible representation of the DN
          if (returnedDNs == null || returnedDNs.add(e.getName().toIrreversibleNormalizedByteString()))
          {
            if (!searchOperation.returnEntry(e, null))
            && (returnedDNs == null || returnedDNs.add(e.getName().toIrreversibleNormalizedByteString()))
            && !searchOperation.returnEntry(e, null))
            {
              return false;
            }
          }
        }
      }
      catch (Exception e)
      {
        logger.traceException(e);
opendj-server-legacy/src/main/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java
@@ -2480,13 +2480,11 @@
    // Ensure that the search bind password is defined somewhere.
    if (cfg.getMappingPolicy() == MappingPolicy.MAPPED_SEARCH
        && cfg.getMappedSearchBindDN() != null
        && !cfg.getMappedSearchBindDN().isRootDN())
    {
      if (getMappedSearchBindPassword(cfg, unacceptableReasons) == null)
        && !cfg.getMappedSearchBindDN().isRootDN()
        && getMappedSearchBindPassword(cfg, unacceptableReasons) == null)
      {
        configurationIsAcceptable = false;
      }
    }
    return configurationIsAcceptable;
  }
opendj-server-legacy/src/main/java/org/opends/server/extensions/PasswordModifyExtendedOperation.java
@@ -1268,14 +1268,12 @@
    // If all of the changes were acceptable, then apply them.
    if (ccr.getResultCode() == ResultCode.SUCCESS)
    {
      if (! identityMapperDN.equals(mapperDN))
    if (ccr.getResultCode() == ResultCode.SUCCESS
        && ! identityMapperDN.equals(mapperDN))
      {
        identityMapper   = mapper;
        identityMapperDN = mapperDN;
      }
    }
    // Save this configuration for future reference.
opendj-server-legacy/src/main/java/org/opends/server/loggers/AbstractTextAccessLogPublisher.java
@@ -344,13 +344,11 @@
    private boolean filterRequest(final Operation operation)
    {
      // Check target DN.
      if (targetDNNotEqualTo.length > 0 || targetDNEqualTo.length > 0)
      {
        if (!filterRequestTargetDN(operation))
      if ((targetDNNotEqualTo.length > 0 || targetDNEqualTo.length > 0)
          && !filterRequestTargetDN(operation))
        {
          return false;
        }
      }
      // TODO: check required controls.
@@ -485,22 +483,16 @@
      final long etime = operation.getProcessingTime();
      final Integer etimeGT = cfg.getResponseEtimeGreaterThan();
      if (etimeGT != null)
      {
        if (etime <= ((long) etimeGT))
      if (etimeGT != null && etime <= ((long) etimeGT))
        {
          return false;
        }
      }
      final Integer etimeLT = cfg.getResponseEtimeLessThan();
      if (etimeLT != null)
      {
        if (etime >= ((long) etimeLT))
      if (etimeLT != null && etime >= ((long) etimeLT))
        {
          return false;
        }
      }
      // Check search response fields.
      if (operation instanceof SearchOperation)
@@ -538,23 +530,17 @@
        final int nentries = searchOperation.getEntriesSent();
        final Integer nentriesGT = cfg.getSearchResponseNentriesGreaterThan();
        if (nentriesGT != null)
        {
          if (nentries <= nentriesGT)
        if (nentriesGT != null && nentries <= nentriesGT)
          {
            return false;
          }
        }
        final Integer nentriesLT = cfg.getSearchResponseNentriesLessThan();
        if (nentriesLT != null)
        {
          if (nentries >= nentriesLT)
        if (nentriesLT != null && nentries >= nentriesLT)
          {
            return false;
          }
        }
      }
      return true;
    }
@@ -564,22 +550,18 @@
    private boolean filterUser(final ClientConnection connection)
    {
      // Check user DN.
      if (userDNNotEqualTo.length > 0 || userDNEqualTo.length > 0)
      {
        if (!filterUserBindDN(connection))
      if ((userDNNotEqualTo.length > 0 || userDNEqualTo.length > 0)
          && !filterUserBindDN(connection))
        {
          return false;
        }
      }
      // Check group membership.
      if (userIsNotMemberOf.length > 0 || userIsMemberOf.length > 0)
      {
        if (!filterUserIsMemberOf(connection))
      if ((userIsNotMemberOf.length > 0 || userIsMemberOf.length > 0)
          && !filterUserIsMemberOf(connection))
        {
          return false;
        }
      }
      return true;
    }
opendj-server-legacy/src/main/java/org/opends/server/loggers/GZIPAction.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.server.loggers;
@@ -105,14 +105,11 @@
      fis.close();
      inputStreamOpen = false;
      if(deleteOriginal)
      {
        if(!originalFile.delete())
      if(deleteOriginal && !originalFile.delete())
        {
          System.err.println("Cannot delete original file:" + originalFile);
          return false;
        }
      }
      return true;
    } catch(IOException ioe)
opendj-server-legacy/src/main/java/org/opends/server/loggers/ZIPAction.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS.
 *      Portions Copyright 2014-2015 ForgeRock AS.
 */
package org.opends.server.loggers;
@@ -108,14 +108,11 @@
      fis.close();
      inputStreamOpen = false;
      if(deleteOriginal)
      {
        if(!originalFile.delete())
      if(deleteOriginal && !originalFile.delete())
        {
          System.err.println("Cannot delete original file:" + originalFile);
          return false;
        }
      }
      return true;
    } catch(IOException ioe)
opendj-server-legacy/src/main/java/org/opends/server/plugins/SambaPasswordPlugin.java
@@ -692,9 +692,9 @@
     */
    final DN authDN = extendedOperation.getAuthorizationDN();
    final DN sambaAdminDN = config.getSambaAdministratorDN();
    if (sambaAdminDN != null && !sambaAdminDN.isRootDN())
    {
      if (authDN.equals(sambaAdminDN))
    if (sambaAdminDN != null
        && !sambaAdminDN.isRootDN()
        && authDN.equals(sambaAdminDN))
      {
        if (logger.isTraceEnabled())
        {
@@ -703,7 +703,6 @@
        }
        return PluginResult.PostOperation.continueOperationProcessing();
      }
    }
    // Get the name of the entry and clear passwords from the operation
    // attachments.
@@ -839,9 +838,9 @@
     */
    final DN authDN = modifyOperation.getAuthorizationDN();
    final DN sambaAdminDN = config.getSambaAdministratorDN();
    if (sambaAdminDN != null && !sambaAdminDN.isRootDN())
    {
      if (authDN.equals(sambaAdminDN))
    if (sambaAdminDN != null
        && !sambaAdminDN.isRootDN()
        && authDN.equals(sambaAdminDN))
      {
        if (logger.isTraceEnabled())
        {
@@ -850,7 +849,6 @@
        }
        return PluginResult.PreOperation.continueOperationProcessing();
      }
    }
    /*
     * Before proceeding with the modification, we have to make sure this entry
opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPClientConnection.java
@@ -693,14 +693,13 @@
      operationsPerformed.incrementAndGet();
      final Operation operation = previousValue.operation;
      if (operation.getOperationType() == OperationType.ABANDON)
      {
        if (keepStats && operation.getResultCode() == ResultCode.CANCELLED)
      if (operation.getOperationType() == OperationType.ABANDON
          && keepStats
          && operation.getResultCode() == ResultCode.CANCELLED)
        {
          statTracker.updateAbandonedOperation();
        }
      }
    }
    return previousValue != null;
  }
opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPConnectionHandler.java
@@ -543,10 +543,7 @@
      }
    }
    if (config.isEnabled())
    {
      // Check that the SSL configuration is valid.
      if (config.isUseSSL())
    if (config.isEnabled() && config.isUseSSL())
      {
        try
        {
@@ -560,7 +557,6 @@
          return false;
        }
      }
    }
    return true;
  }
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPClientConnection.java
@@ -1293,13 +1293,12 @@
      return false;
    }
    if (operation.getOperationType() == OperationType.ABANDON)
    {
      if (keepStats && operation.getResultCode() == ResultCode.CANCELLED)
    if (operation.getOperationType() == OperationType.ABANDON
        && keepStats
        && operation.getResultCode() == ResultCode.CANCELLED)
      {
        statTracker.updateAbandonedOperation();
      }
    }
    lastCompletionTime.set(TimeThread.getTime());
    return true;
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPConnectionHandler.java
@@ -320,13 +320,11 @@
    // * num request handler
    // Clear the stat tracker if LDAPv2 is being enabled.
    if (currentConfig.isAllowLDAPV2() != config.isAllowLDAPV2())
    {
      if (config.isAllowLDAPV2())
    if (currentConfig.isAllowLDAPV2() != config.isAllowLDAPV2()
        && config.isAllowLDAPV2())
      {
        statTracker.clearStatistics();
      }
    }
    // Apply the changes.
    currentConfig = config;
@@ -808,15 +806,13 @@
      }
    }
    if (config.isEnabled())
    {
    if (config.isEnabled()
      // Check that the SSL configuration is valid.
      if (config.isUseSSL() || config.isAllowStartTLS())
        && (config.isUseSSL() || config.isAllowStartTLS()))
      {
        try
        {
          SSLContext sslContext = createSSLContext(config);
          createSSLEngine(config, sslContext);
        createSSLEngine(config, createSSLContext(config));
        }
        catch (DirectoryException e)
        {
@@ -826,7 +822,6 @@
          return false;
        }
      }
    }
    return true;
  }
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/HeartbeatThread.java
@@ -107,9 +107,8 @@
              "was sent at %d", now, session.getLastPublishTime());
        }
        if (now > session.getLastPublishTime() + heartbeatInterval)
        {
          if (!heartbeatsDisabled)
        if (now > session.getLastPublishTime() + heartbeatInterval
            && !heartbeatsDisabled)
          {
            if (logger.isTraceEnabled())
            {
@@ -117,7 +116,6 @@
            }
            session.publish(heartbeatMessage);
          }
        }
        long sleepTime = session.getLastPublishTime() + heartbeatInterval - now;
        if (sleepTime <= 0)
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ModifyCommonMsg.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2009-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2013-2014 ForgeRock AS
 *      Portions Copyright 2013-2015 ForgeRock AS
 */
package org.opends.server.replication.protocol;
@@ -131,15 +131,13 @@
    {
      Attribute attr = mod.getAttribute();
      AttributeType type = attr.getAttributeType();
      if (type != null )
      {
        if (AttributeUsage.DSA_OPERATION.equals(type.getUsage()))
      if (type != null
          && AttributeUsage.DSA_OPERATION.equals(type.getUsage()) )
        {
          // Attributes with a dsaOperation usage should not be synchronized.
          // skip them.
          continue;
        }
      }
      if (!EntryHistorical.isHistoricalAttribute(attr))
      {
opendj-server-legacy/src/main/java/org/opends/server/replication/server/SafeReadExpectedAcksInfo.java
@@ -223,16 +223,13 @@
      for (int serverId : serverIds)
      {
        boolean ackReceived = expectedServersAckStatus.get(serverId);
        if (!ackReceived)
        {
          if (!failedServers.contains(serverId))
        if (!ackReceived && !failedServers.contains(serverId))
          {
            failedServers.add(serverId);
            serversInTimeout.add(serverId);
          }
        }
      }
    }
    ack.setFailedServers(failedServers);
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/Log.java
@@ -381,14 +381,11 @@
  private void createRootDirIfNotExists() throws ChangelogException
  {
    if (!logPath.exists())
    {
      if (!logPath.mkdirs())
    if (!logPath.exists() && !logPath.mkdirs())
      {
        throw new ChangelogException(ERR_CHANGELOG_UNABLE_TO_CREATE_LOG_DIRECTORY.get(logPath.getPath()));
      }
    }
  }
  /**
   * Returns the path of this log.
opendj-server-legacy/src/main/java/org/opends/server/tasks/BackupTask.java
@@ -305,15 +305,12 @@
    // If the incremental base ID was specified, then make sure it is an
    // incremental backup.
    if (incrementalBase != null)
    {
      if (! incremental)
    if (incrementalBase != null && ! incremental)
      {
        logger.error(ERR_BACKUPDB_INCREMENTAL_BASE_REQUIRES_INCREMENTAL, ATTR_TASK_BACKUP_INCREMENTAL_BASE_ID,
                ATTR_TASK_BACKUP_INCREMENTAL);
        return false;
      }
    }
    // If the signHash option was provided, then make sure that the hash option
opendj-server-legacy/src/main/java/org/opends/server/tools/BackUpDB.java
@@ -376,9 +376,7 @@
    // If the incremental base ID was specified, then make sure it is an
    // incremental backup.
    if (incrementalBaseID.isPresent())
    {
      if (! incremental.isPresent())
    if (incrementalBaseID.isPresent() && ! incremental.isPresent())
      {
        LocalizableMessage message =
                ERR_BACKUPDB_INCREMENTAL_BASE_REQUIRES_INCREMENTAL.get(
@@ -388,7 +386,6 @@
        err.println(argParser.getUsage());
        return 1;
      }
    }
    // Encryption or signing requires the ADS backend be available for
    // CryptoManager access to secret key entries. If no connection arguments
opendj-server-legacy/src/main/java/org/opends/server/tools/ConfigureDS.java
@@ -732,17 +732,13 @@
      }
      // Check that the keystore path values are valid.
      if (keyManagerPath.isPresent())
      {
        if (!keyManagerProviderDN.isPresent())
      if (keyManagerPath.isPresent() && !keyManagerProviderDN.isPresent())
        {
          LocalizableMessage message = ERR_CONFIGDS_KEYMANAGER_PROVIDER_DN_REQUIRED.get(
                  keyManagerProviderDN.getLongIdentifier(),
              keyManagerPath.getLongIdentifier());
            keyManagerProviderDN.getLongIdentifier(), keyManagerPath.getLongIdentifier());
          err.println(wrapText(message, MAX_LINE_WIDTH));
          return 1;
        }
      }
      // If one or more base DNs were specified, then update the config
      // accordingly.
opendj-server-legacy/src/main/java/org/opends/server/tools/WaitForFileDelete.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2013-2014 ForgeRock AS
 *      Portions Copyright 2013-2015 ForgeRock AS
 */
package org.opends.server.tools;
@@ -293,9 +293,7 @@
    // and append data to it.
    RandomAccessFile outputFile = null;
    long outputFileOffset = 0L;
    if (logFile != null)
    {
      if (outputFilePath.isPresent())
    if (logFile != null && outputFilePath.isPresent())
      {
        try
        {
@@ -313,7 +311,6 @@
          outputFile = null;
        }
      }
    }
    // Figure out when to stop waiting.
    long stopWaitingTime;
    try
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/MakeLDIFInputStream.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2015 ForgeRock AS
 */
package org.opends.server.tools.makeldif;
@@ -148,14 +149,12 @@
      throw ioException;
    }
    if ((entryBytes == null) || (! entryBytes.hasRemaining()))
    {
      if (! getNextEntry())
    if ((entryBytes == null || !entryBytes.hasRemaining())
        && !getNextEntry())
      {
        closed = true;
        return -1;
      }
    }
    return (0xFF & entryBytes.get());
  }
@@ -189,14 +188,12 @@
      throw ioException;
    }
    if ((entryBytes == null) || (! entryBytes.hasRemaining()))
    {
      if (! getNextEntry())
    if ((entryBytes == null || !entryBytes.hasRemaining())
        && !getNextEntry())
      {
        closed = true;
        return -1;
      }
    }
    int bytesRead = Math.min(len, entryBytes.remaining());
    entryBytes.get(b, off, bytesRead);
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/Template.java
@@ -180,14 +180,12 @@
    for (TemplateLine l : templateLines)
    {
      if (rdnAttrs.remove(l.getAttributeType()))
      {
        if (rdnAttrs.isEmpty())
      if (rdnAttrs.remove(l.getAttributeType())
          && rdnAttrs.isEmpty())
        {
          break;
        }
      }
    }
    if (! rdnAttrs.isEmpty())
    {
opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/FileManager.java
@@ -213,15 +213,12 @@
    {
      synchronized (target)
      {
        if (target.exists())
        {
          if (!target.delete())
        if (target.exists() && !target.delete())
          {
            throw new IOException(INFO_ERROR_DELETING_FILE.get(
                UpgradeUtils.getPath(target)).toString());
          }
        }
      }
      if (!fileToRename.renameTo(target))
      {
        throw new IOException(INFO_ERROR_RENAMING_FILE.get(
@@ -384,18 +381,14 @@
              {
                fos.write(buf, 0, i);
              }
              if (destination.exists())
              if (destination.exists() && isUnix())
              {
                // TODO: set the file's permissions. This is made easier in
                // Java 1.6 but until then use the TestUtilities methods
                if (isUnix())
                {
                  final FilePermission permissions =
                      getFileSystemPermissions(objectFile);
                final FilePermission permissions = getFileSystemPermissions(objectFile);
                  FilePermission.setPermissions(destination, permissions);
                }
              }
            }
            catch (IOException e)
            {
              throw e;
opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2011-2014 ForgeRock AS
 *      Portions Copyright 2011-2015 ForgeRock AS
 */
package org.opends.server.types;
@@ -430,9 +430,7 @@
                                         AttributeType superiorType)
  {
    List<AttributeType> subTypes = subordinateTypes.get(superiorType);
    if (subTypes != null)
    {
      if (subTypes.remove(attributeType))
    if (subTypes != null && subTypes.remove(attributeType))
      {
        AttributeType higherSuperior = superiorType.getSuperiorType();
        if (higherSuperior != null)
@@ -441,7 +439,6 @@
        }
      }
    }
  }
@@ -856,18 +853,11 @@
     */
    synchronized (ldapSyntaxDescriptions)
    {
      String oid = toLowerCase(
                syntax.getLdapSyntaxDescriptionSyntax().getOID());
      if (! overwriteExisting)
      String oid = toLowerCase(syntax.getLdapSyntaxDescriptionSyntax().getOID());
      if (! overwriteExisting && ldapSyntaxDescriptions.containsKey(oid))
      {
        if (ldapSyntaxDescriptions.containsKey(oid))
        {
           LocalizableMessage message =
            ERR_SCHEMA_MODIFY_MULTIPLE_CONFLICTS_FOR_ADD_LDAP_SYNTAX.
              get(oid);
          throw new DirectoryException(
                         ResultCode.CONSTRAINT_VIOLATION, message);
        }
         throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION,
            ERR_SCHEMA_MODIFY_MULTIPLE_CONFLICTS_FOR_ADD_LDAP_SYNTAX.get(oid));
      }
      ldapSyntaxDescriptions.put(oid, syntax);
@@ -875,8 +865,7 @@
      //Register the attribute syntax with the schema. It will ensure
      // syntax is available along with the other virtual values for
      // ldapsyntaxes.
      registerSyntax(syntax.getLdapSyntaxDescriptionSyntax(),
              overwriteExisting);
      registerSyntax(syntax.getLdapSyntaxDescriptionSyntax(), overwriteExisting);
    }
  }
@@ -1131,12 +1120,9 @@
    {
      MatchingRule matchingRule = matchingRuleUse.getMatchingRule();
      if (! overwriteExisting)
      if (!overwriteExisting && matchingRuleUses.containsKey(matchingRule))
      {
        if (matchingRuleUses.containsKey(matchingRule))
        {
          MatchingRuleUse conflictingUse =
                               matchingRuleUses.get(matchingRule);
        MatchingRuleUse conflictingUse = matchingRuleUses.get(matchingRule);
          LocalizableMessage message = ERR_SCHEMA_CONFLICTING_MATCHING_RULE_USE.
              get(matchingRuleUse.getNameOrOID(),
@@ -1145,7 +1131,6 @@
          throw new DirectoryException(
                         ResultCode.CONSTRAINT_VIOLATION, message);
        }
      }
      matchingRuleUses.put(matchingRule, matchingRuleUse);
    }
@@ -1246,9 +1231,7 @@
    {
      ObjectClass objectClass = ditContentRule.getStructuralClass();
      if (! overwriteExisting)
      {
        if (ditContentRules.containsKey(objectClass))
      if (! overwriteExisting && ditContentRules.containsKey(objectClass))
        {
          DITContentRule conflictingRule =
                              ditContentRules.get(objectClass);
@@ -1260,7 +1243,6 @@
          throw new DirectoryException(
                         ResultCode.CONSTRAINT_VIOLATION, message);
        }
      }
      ditContentRules.put(objectClass, ditContentRule);
    }
opendj-server-legacy/src/main/java/org/opends/server/types/SearchFilter.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 *      Portions Copyright 2013-2014 Manuel Gaupp
 */
package org.opends.server.types;
@@ -3259,9 +3259,7 @@
    {
      MatchingRuleUse mru =
           DirectoryServer.getMatchingRuleUse(matchingRule);
      if (mru != null)
      {
        if (! mru.appliesToAttribute(attributeType))
      if (mru != null && !mru.appliesToAttribute(attributeType))
        {
          if (logger.isTraceEnabled())
          {
@@ -3274,7 +3272,6 @@
          return ConditionResult.UNDEFINED;
        }
      }
    }
    // Normalize the assertion value using the matching rule.
opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java
@@ -858,16 +858,15 @@
      }
       //The attribute is not being ignored so check for binary option.
      if(checkSchema && !attrType.getSyntax().isBEREncodingRequired())
      {
       if(attribute.hasOption("binary"))
      if(checkSchema
          && !attrType.getSyntax().isBEREncodingRequired()
          && attribute.hasOption("binary"))
        {
          LocalizableMessage message = ERR_LDIF_INVALID_ATTR_OPTION.get(
            entryDN, lastEntryLineNumber, attrName);
          logToRejectWriter(lines, message);
          throw new LDIFException(message, lastEntryLineNumber,true);
        }
      }
      if (checkSchema &&
          (DirectoryServer.getSyntaxEnforcementPolicy() !=
               AcceptRejectWarn.ACCEPT))
opendj-server-legacy/src/main/java/org/opends/server/util/StaticUtils.java
@@ -3480,16 +3480,13 @@
    {
      synchronized(target)
      {
        if (target.exists())
        {
          if (!target.delete())
        if (target.exists() && !target.delete())
          {
            LocalizableMessage message =
                ERR_RENAMEFILE_CANNOT_DELETE_TARGET.get(target.getPath());
            throw new IOException(message.toString());
          }
        }
      }
      if (!fileToRename.renameTo(target))
      {
        LocalizableMessage message = ERR_RENAMEFILE_CANNOT_RENAME.get(
opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendBindOperation.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2011-2014 ForgeRock AS.
 *      Portions Copyright 2011-2015 ForgeRock AS.
 */
package org.opends.server.workflowelement.localbackend;
@@ -706,18 +706,15 @@
    if (DirectoryServer.lockdownMode())
    {
      ResultCode resultCode = getResultCode();
      if (resultCode != ResultCode.SASL_BIND_IN_PROGRESS)
      {
        if ((resultCode != ResultCode.SUCCESS) ||
            (saslAuthUserEntry == null) ||
            (! ClientConnection.hasPrivilege(saslAuthUserEntry,
                Privilege.BYPASS_LOCKDOWN)))
      if (resultCode != ResultCode.SASL_BIND_IN_PROGRESS
          && (resultCode != ResultCode.SUCCESS
              || saslAuthUserEntry == null
              || !ClientConnection.hasPrivilege(saslAuthUserEntry, Privilege.BYPASS_LOCKDOWN)))
        {
          throw new DirectoryException(ResultCode.INVALID_CREDENTIALS,
                                       ERR_BIND_REJECTED_LOCKDOWN_MODE.get());
        }
      }
    }
    // Create the password policy state object.
    if (saslAuthUserEntry != null)
@@ -796,17 +793,14 @@
        PasswordPolicyState pwPolicyState =
          (PasswordPolicyState) authPolicyState;
        if (saslHandler.isPasswordBased(saslMechanism))
        {
          if (pwPolicyState.getAuthenticationPolicy()
              .getLockoutFailureCount() > 0)
        if (saslHandler.isPasswordBased(saslMechanism)
            && pwPolicyState.getAuthenticationPolicy().getLockoutFailureCount() > 0)
          {
            generateAccountStatusNotificationForLockedBindAccount(
                saslAuthUserEntry, pwPolicyState);
          }
        }
      }
    }
    return true;
  }
opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendCompareOperation.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2011-2014 ForgeRock AS
 *      Portions Copyright 2011-2015 ForgeRock AS
 */
package org.opends.server.workflowelement.localbackend;
@@ -488,9 +488,8 @@
        }
        // NYI -- Add support for additional controls.
        else if (c.isCritical())
        {
          if ((backend == null) || (! backend.supportsControl(oid)))
        else if (c.isCritical()
            && (backend == null || !backend.supportsControl(oid)))
          {
            throw new DirectoryException(
                ResultCode.UNAVAILABLE_CRITICAL_EXTENSION,
@@ -500,4 +499,3 @@
      }
    }
  }
}