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

floblanc
10.59.2009 0cdc4f67dfc0e2fb8b83d5f0de8188ec3686d04c
opends/src/server/org/opends/server/workflowelement/ndb/NDBCompareOperation.java
@@ -28,8 +28,8 @@
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.opends.server.api.ClientConnection;
import org.opends.server.api.plugin.PluginResult;
@@ -238,44 +238,20 @@
      // Get the base attribute type and set of options.
      String baseName;
      HashSet<String> options;
      String rawAttributeType = getRawAttributeType();
      int semicolonPos = rawAttributeType.indexOf(';');
      if (semicolonPos > 0) {
        baseName = toLowerCase(rawAttributeType.substring(0, semicolonPos));
        options = new HashSet<String>();
        int nextPos = rawAttributeType.indexOf(';', semicolonPos + 1);
        while (nextPos > 0) {
          options.add(rawAttributeType.substring(semicolonPos + 1, nextPos));
          semicolonPos = nextPos;
          nextPos = rawAttributeType.indexOf(';', semicolonPos + 1);
        }
        options.add(rawAttributeType.substring(semicolonPos + 1));
      } else {
        baseName = toLowerCase(rawAttributeType);
        options = null;
      }
      Set<String> options = getAttributeOptions();
      // Actually perform the compare operation.
      AttributeType attrType = getAttributeType();
      if (attrType == null) {
        attrType = DirectoryServer.getAttributeType(baseName, true);
        setAttributeType(attrType);
      }
      List<Attribute> attrList = entry.getAttribute(attrType, options);
      if ((attrList == null) || attrList.isEmpty()) {
        setResultCode(ResultCode.NO_SUCH_ATTRIBUTE);
        if (options == null) {
          appendErrorMessage(WARN_COMPARE_OP_NO_SUCH_ATTR.get(
            String.valueOf(entryDN), baseName));
            String.valueOf(entryDN), getRawAttributeType()));
        } else {
          appendErrorMessage(WARN_COMPARE_OP_NO_SUCH_ATTR_WITH_OPTIONS.get(
            String.valueOf(entryDN), baseName));
            String.valueOf(entryDN), getRawAttributeType()));
        }
      } else {
        AttributeValue value = AttributeValues.create(attrType,