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

Valery Kharseko
yesterday 3b360568a7063c65fde7d905debe5519577b10d1
opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java
@@ -221,9 +221,9 @@
    for (String attrFilt : newConfiguration.getCheckReferencesFilterCriteria())
    {
      int sepInd = attrFilt.lastIndexOf(":");
      String attr = attrFilt.substring(0, sepInd);
      String filtStr = attrFilt.substring(sepInd + 1);
      String[] attrAndFilter = splitFilterCriteria(attrFilt);
      String attr = attrAndFilter[0];
      String filtStr = attrAndFilter[1];
      AttributeType attrType = DirectoryServer.getInstance().getServerContext().getSchema().getAttributeType(attr);
      try
@@ -365,9 +365,9 @@
    for (String attrFilt : pluginCfg.getCheckReferencesFilterCriteria())
    {
      int sepInd = attrFilt.lastIndexOf(":");
      String attr = attrFilt.substring(0, sepInd).trim();
      String filtStr = attrFilt.substring(sepInd + 1).trim();
      String[] attrAndFilter = splitFilterCriteria(attrFilt);
      String attr = attrAndFilter[0];
      String filtStr = attrAndFilter[1];
      /* TODO: strip the ;options part? */
@@ -398,6 +398,21 @@
    return isAcceptable;
  }
  /**
   * Splits a check-references-filter-criteria value ({@code attribute:filter}) at its first colon: an attribute
   * description cannot contain one, but the filter that follows it can, as in {@code (o=urn:example)} or
   * {@code (cn:dn:=x)}. The property syntax guarantees that the value has a colon after a non-empty attribute.
   *
   * @param attrFilt
   *          The check-references-filter-criteria value.
   * @return The attribute and the filter, both trimmed.
   */
  private static String[] splitFilterCriteria(String attrFilt)
  {
    int sepInd = attrFilt.indexOf(':');
    return new String[] { attrFilt.substring(0, sepInd).trim(), attrFilt.substring(sepInd + 1).trim() };
  }
  @Override
  public boolean isConfigurationChangeAcceptable(
          ReferentialIntegrityPluginCfg configuration,