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

sin
13.25.2009 e3ce4910af53462b22a5f98f6719935964ae43ee
issue# 4113: Collation matching rules aren't displayed correctly while searching
2 files modified
47 ■■■■■ changed files
opends/src/server/org/opends/server/api/AbstractMatchingRule.java 26 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/schema/CollationMatchingRuleFactory.java 21 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/api/AbstractMatchingRule.java
@@ -224,14 +224,32 @@
  {
    buffer.append("( ");
    buffer.append(getOID());
    buffer.append(" NAME '");
    buffer.append(getName());
    buffer.append(" NAME ");
    Collection<String> names = getAllNames();
    if(names.size()>1)
    {
      buffer.append("(");
      for(String name: names)
      {
        buffer.append(" '");
        buffer.append(name);
        buffer.append('\'');
      }
     buffer.append(" )");
    }
    else
    {
      buffer.append('\'');
      buffer.append(getName());
      buffer.append('\'');
    }
    String description = getDescription();
    if ((description != null) && (description.length() > 0))
    {
      buffer.append("' DESC '");
      buffer.append(" DESC '");
      buffer.append(description);
      buffer.append('\'');
    }
    if (isObsolete())
@@ -240,7 +258,7 @@
    }
    else
    {
      buffer.append("' SYNTAX ");
      buffer.append(" SYNTAX ");
    }
    buffer.append(getSyntaxOID());
opends/src/server/org/opends/server/schema/CollationMatchingRuleFactory.java
@@ -530,21 +530,22 @@
    String nOID = mapper.getNumericOID();
    MatchingRule matchingRule = getMatchingRule(nOID);
    Collection<String> names = new HashSet<String>();
    Collection<String> defaultNames = new HashSet<String>();
    if (matchingRule != null)
    {
      for (String name : matchingRule.getAllNames())
      {
        names.add(name);
        defaultNames.add(name);
      }
    }
    names.add(lTag);
    defaultNames.add(lTag);
    matchingRule =
        new CollationEqualityMatchingRule(nOID, Collections
            .<String> emptySet(), locale);
        new CollationEqualityMatchingRule(nOID,
                                      defaultNames, locale);
    addMatchingRule(nOID, matchingRule);
    Collection<String> names = new HashSet<String>();
    // Register OID.3 as the equality matching rule.
    String OID = mapper.getNumericOID() + ".3";
    MatchingRule equalityMatchingRule = getMatchingRule(OID);
@@ -772,14 +773,8 @@
    @Override
    public String getName()
    {
      // Concatenate all the names and return.
      StringBuilder builder = new StringBuilder();
      for (String name : getAllNames())
      {
        builder.append(name);
        builder.append("\b");
      }
      return builder.toString();
      //This is called when there is only 1 name.
      return names.iterator().next();
    }