-
Bug
-
Resolution: Fixed
-
P4
-
5.0, 5.0u1
-
b39
-
x86
-
windows_xp
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
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
- duplicates
-
JDK-6244520 [J2SE 1.5] Problem in toAttributes() method in javax.naming.ldap.Rdn class
- Closed