Uploaded image for project: 'Directory Client API'
  1. Directory Client API
  2. DIRAPI-393

DN comparison behavior changed after parsing ancestor

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.1.3
    • 2.1.4
    • None

    Description

      Hello,

      the behavior of  the following test changed with latest directory api version:

       

      @Test
      void ancestorCheck() throws LdapInvalidDnException
      {
          DefaultSchemaManager schemaManager = new DefaultSchemaManager();
          Dn group = new Dn( schemaManager, "ou=group,ou=base" );
          Dn base = new Dn( schemaManager, "ou=base" );
      
          Dn ancestor = group.getAncestorOf( "ou=group" );
          assertThat( ancestor, is( equalTo( base ) ) );
      }

      with version 2.1.2 the test succeeded, but fails with 2.1.3

       

      In the latest 2.1.3 version the code in

      org.apache.directory.api.ldap.model.name.Dn.getAncestorOf(Dn)

      changed from

      newDn.toUpName();

      to

      newDn.upName = upName.substring( descendant.upName.length() + 1 );

      but now the normName of the DN is not set (code in the toUpName() method) and the equality check failed.

      Greetings Thomas

      Attachments

        Activity

          People

            Unassigned Unassigned
            thomas_gaebler Thomas Gaebler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: