Apache Directory Project - [jira] Closed: (DIRSERVER-334) Pb with case sensitivity for

This is Interesting: Free IT Magazines  
Home > Archive > Apache Directory Project > June 2006 > [jira] Closed: (DIRSERVER-334) Pb with case sensitivity for





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author [jira] Closed: (DIRSERVER-334) Pb with case sensitivity for
Emmanuel Lecharny (JIRA)

2006-06-24, 1:11 pm

[ http://issues.apache.org/jira/brows...ER-334?page=all ]

Emmanuel Lecharny closed DIRSERVER-334:
---------------------------------------


done

> Pb with case sensitivity for attributes
> ---------------------------------------
>
> Key: DIRSERVER-334
> URL: http://issues.apache.org/jira/browse/DIRSERVER-334
> Project: Directory ApacheDS
> Type: Bug


> Reporter: Emmanuel Lecharny
> Assignee: Alex Karasulu
> Priority: Blocker


>
> There is a huge problem with attributes. They are supposed to be case insensitive (RFC 2251, par. 2.5.1: "... they must be IA5 (ASCII) strings, and they are case insensitive (e.g. "foo-+RB1Aph5k6s@public.gmane.org" will match "FOO-dRakplAFVv0@public.gma

ne.org")")
> If we use the BasicAttribute class (javax.naming.directory.BasicAttribute) without lowercasing the attribute's name, there is no way to guarantee that we could do a attributes.get( <name>.toLowerCase() ) with a correct response.
> This usage is spreaded all over the code and need to be fixed.
> As an example, here is a snapshot of a working code :
> /*
> * create objectClass=top, objectClass=organizationalUnit
> */
> Attributes attributes = new BasicAttributes();
> Attribute attribute = new BasicAttribute( "objectClass".toLowerCase() ); // we MUST lowercase the attribute's name
> attribute.add( "top" );
> attribute.add( "organizationalUnit" );
> attributes.put( attribute );
>
> Attribute attr = attributes.get("objectclass".toLowerCase());
> Attribute attr2 = attributes.get("objectClass".toLowerCase());
> Assert.assertTrue( attr == attr2 ); // no problem, they are equal.
> /*
> * The same piece of code, without the lowerCase()
> */
> Attributes attributes = new BasicAttributes();
> Attribute attribute = new BasicAttribute( "objectClass");
> attribute.add( "top" );
> attribute.add( "organizationalUnit" );
> attributes.put( attribute );
>
> Attribute attr = attributes.get("objectclass");
> Attribute attr2 = attributes.get("objectClass");
> Assert.assertTrue( attr == attr2 ); // they are different, as attr is null.


--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secur...nistrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com