Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6245035

[J2SE 1.5] Rdn generates incorrect attributes sometimes

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 5.0, 5.0u1
    • Fix Version/s: 6
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b39
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      FULL PRODUCT VERSION :
      java version "1.5.0_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
      Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      Class javax.naming.ldap.Rdn generates invalid Attributes object, when containing two RdnEntry 'ies with same type.
      I.e. "cn=commonName1+cn=commonName2".
      Instead of generating Attributes with one BasicAttribute("cn") with two string values ("commonName1","commonName2") it generates Attributes with one BasicAttribute("cn") which also has one value of type BasicAttribute("cn"), and this nested element has two mentioned strings.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      new Rdn("cn = commonName1 + cn = commonName2").toAttributes().toString()


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      {cn=cn: commonName1, commonName2}

      ACTUAL -
      {cn=cn: cn: commonName1, commonName2}


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      This is JUnit test fragment:

        public void testRdnToAttributes() throws InvalidNameException {
          Rdn rdnCnSn = new Rdn("cn = commonName1 + sn = surName2");
          assertEquals("cn=commonName1+sn=surName2", rdnCnSn.toString()); //correct
          assertEquals("{sn=sn: surName2, cn=cn: commonName1}", rdnCnSn.toAttributes().toString()); //correct
          
          Rdn rdnCnCn = new Rdn("cn = commonName1 + cn = commonName2");
          assertEquals("cn=commonName1+cn=commonName2", rdnCnCn.toString()); //correct
          assertEquals("{cn=cn: commonName1, commonName2}", rdnCnCn.toAttributes().toString()); // fail
        }

      ---------- END SOURCE ----------
      ###@###.### 2005-03-23 19:15:36 GMT

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jhangalsunw Jayalaxmi Hangal (Inactive)
                Reporter:
                ndcosta Nelson Dcosta (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: