directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1163034 - in /directory/shared/trunk: dsml/parser/src/main/java/org/apache/directory/shared/dsmlv2/ integ/src/test/java/org/apache/directory/shared/ldap/entry/ ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/add/ ldap/...
Date Mon, 29 Aug 2011 21:57:40 GMT
Author: elecharny
Date: Mon Aug 29 21:57:39 2011
New Revision: 1163034

URL: http://svn.apache.org/viewvc?rev=1163034&view=rev
Log:
Used Strings.toLowercase everywhere
Make it use Locale.English to solve DIRSERVER-1646

Modified:
    directory/shared/trunk/dsml/parser/src/main/java/org/apache/directory/shared/dsmlv2/AbstractGrammar.java
    directory/shared/trunk/dsml/parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Parser.java
    directory/shared/trunk/dsml/parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2ResponseParser.java
    directory/shared/trunk/dsml/parser/src/main/java/org/apache/directory/shared/dsmlv2/Tag.java
    directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/TestEntryUtils.java
    directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java
    directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java
    directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/constants/LdapSecurityConstants.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifAttributesReader.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifReader.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifUtils.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/normalizers/ObjectIdentifierNormalizer.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultAttributeTypeRegistry.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultSchemaObjectRegistry.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/syntaxCheckers/FacsimileTelephoneNumberSyntaxChecker.java
    directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntryUtils.java
    directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/shared/ldap/schemaloader/SchemaManagerEnableDisableLoadTest.java
    directory/shared/trunk/util/src/main/java/org/apache/directory/shared/util/PropertiesUtils.java
    directory/shared/trunk/util/src/main/java/org/apache/directory/shared/util/Strings.java

Modified: directory/shared/trunk/dsml/parser/src/main/java/org/apache/directory/shared/dsmlv2/AbstractGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml/parser/src/main/java/org/apache/directory/shared/dsmlv2/AbstractGrammar.java?rev=1163034&r1=1163033&r2=1163034&view=diff
==============================================================================
--- directory/shared/trunk/dsml/parser/src/main/java/org/apache/directory/shared/dsmlv2/AbstractGrammar.java
(original)
+++ directory/shared/trunk/dsml/parser/src/main/java/org/apache/directory/shared/dsmlv2/AbstractGrammar.java
Mon Aug 29 21:57:39 2011
@@ -24,6 +24,7 @@ import java.io.IOException;
 import java.util.HashMap;
 
 import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.util.Strings;
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
 
@@ -161,7 +162,7 @@ public abstract class AbstractGrammar im
     {
         XmlPullParser xpp = container.getParser();
 
-        String tagName = xpp.getName().toLowerCase();
+        String tagName = Strings.toLowerCase( xpp.getName() );
 
         GrammarTransition transition = getTransition( container.getState(), new Tag( tagName,
tagType ) );
 

Modified: directory/shared/trunk/dsml/parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Parser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml/parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Parser.java?rev=1163034&r1=1163033&r2=1163034&view=diff
==============================================================================
--- directory/shared/trunk/dsml/parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Parser.java
(original)
+++ directory/shared/trunk/dsml/parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Parser.java
Mon Aug 29 21:57:39 2011
@@ -31,6 +31,7 @@ import org.apache.directory.shared.dsmlv
 import org.apache.directory.shared.dsmlv2.request.Dsmlv2Grammar;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.model.message.Request;
+import org.apache.directory.shared.util.Strings;
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
 import org.xmlpull.v1.XmlPullParserFactory;
@@ -237,7 +238,7 @@ public class Dsmlv2Parser
     {
         XmlPullParser xpp = container.getParser();
 
-        String tagName = xpp.getName().toLowerCase();
+        String tagName = Strings.toLowerCase( xpp.getName() );
 
         GrammarTransition transition = container.getTransition( container.getState(), new
Tag( tagName, tagType ) );
 

Modified: directory/shared/trunk/dsml/parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2ResponseParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml/parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2ResponseParser.java?rev=1163034&r1=1163033&r2=1163034&view=diff
==============================================================================
--- directory/shared/trunk/dsml/parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2ResponseParser.java
(original)
+++ directory/shared/trunk/dsml/parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2ResponseParser.java
Mon Aug 29 21:57:39 2011
@@ -32,6 +32,7 @@ import org.apache.directory.shared.dsmlv
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.api.LdapApiService;
 import org.apache.directory.shared.ldap.model.message.Response;
+import org.apache.directory.shared.util.Strings;
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
 import org.xmlpull.v1.XmlPullParserFactory;
@@ -188,7 +189,7 @@ public class Dsmlv2ResponseParser
     {
         XmlPullParser xpp = container.getParser();
 
-        String tagName = xpp.getName().toLowerCase();
+        String tagName = Strings.toLowerCase( xpp.getName() );
 
         GrammarTransition transition = container.getTransition( container.getState(), new
Tag( tagName, tagType ) );
 

Modified: directory/shared/trunk/dsml/parser/src/main/java/org/apache/directory/shared/dsmlv2/Tag.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml/parser/src/main/java/org/apache/directory/shared/dsmlv2/Tag.java?rev=1163034&r1=1163033&r2=1163034&view=diff
==============================================================================
--- directory/shared/trunk/dsml/parser/src/main/java/org/apache/directory/shared/dsmlv2/Tag.java
(original)
+++ directory/shared/trunk/dsml/parser/src/main/java/org/apache/directory/shared/dsmlv2/Tag.java
Mon Aug 29 21:57:39 2011
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.shared.dsmlv2;
 
+import org.apache.directory.shared.util.Strings;
+
 
 /**
  * This class represents a XML tag.
@@ -81,7 +83,7 @@ public class Tag
      */
     public void setName( String name )
     {
-        this.name = name.toLowerCase();
+        this.name = Strings.toLowerCase( name );
     }
 
 

Modified: directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/TestEntryUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/TestEntryUtils.java?rev=1163034&r1=1163033&r2=1163034&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/TestEntryUtils.java
(original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/TestEntryUtils.java
Mon Aug 29 21:57:39 2011
@@ -159,7 +159,7 @@ public class TestEntryUtils
             {
                 if ( value.isHumanReadable() )
                 {
-                    return new StringValue( value.getString().toLowerCase() );
+                    return new StringValue( Strings.toLowerCase( value.getString() ) );
                 }
 
                 throw new IllegalStateException();
@@ -168,7 +168,7 @@ public class TestEntryUtils
             
             public String normalize( String value ) throws LdapException
             {
-                return value.toLowerCase();
+                return Strings.toLowerCase( value );
             }
         };
         

Modified: directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java?rev=1163034&r1=1163033&r2=1163034&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java
(original)
+++ directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java
Mon Aug 29 21:57:39 2011
@@ -32,26 +32,31 @@ import java.util.Set;
 
 import javax.naming.NamingException;
 
-import com.mycila.junit.concurrent.Concurrency;
-import com.mycila.junit.concurrent.ConcurrentJunitRunner;
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
-import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.Asn1Container;
+import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.ldap.codec.api.CodecControl;
 import org.apache.directory.shared.ldap.codec.api.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.api.MessageDecorator;
 import org.apache.directory.shared.ldap.codec.api.ResponseCarryingException;
 import org.apache.directory.shared.ldap.codec.decorators.AddRequestDecorator;
 import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
-import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.Attribute;
+import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.Value;
-import org.apache.directory.shared.ldap.model.message.*;
+import org.apache.directory.shared.ldap.model.message.AddRequest;
+import org.apache.directory.shared.ldap.model.message.AddResponseImpl;
+import org.apache.directory.shared.ldap.model.message.Control;
+import org.apache.directory.shared.ldap.model.message.Message;
+import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import com.mycila.junit.concurrent.Concurrency;
+import com.mycila.junit.concurrent.ConcurrentJunitRunner;
+
 
 /**
  * Test the AddRequest codec
@@ -156,9 +161,9 @@ public class AddRequestTest extends Abst
 
         Attribute attribute = entry.get( "l" );
 
-        assertTrue( expectedTypes.contains( attribute.getId().toLowerCase() ) );
+        assertTrue( expectedTypes.contains( Strings.toLowerCase( attribute.getId() ) ) );
 
-        Set<String> vals = ( Set<String> ) typesVals.get( attribute.getId().toLowerCase()
);
+        Set<String> vals = ( Set<String> ) typesVals.get( Strings.toLowerCase(
attribute.getId() ) );
 
         for ( Value<?> value : attribute )
         {
@@ -169,9 +174,9 @@ public class AddRequestTest extends Abst
 
         attribute = entry.get( "attrs" );
 
-        assertTrue( expectedTypes.contains( attribute.getId().toLowerCase() ) );
+        assertTrue( expectedTypes.contains( Strings.toLowerCase( attribute.getId() ) ) );
 
-        vals = ( Set<String> ) typesVals.get( attribute.getId().toLowerCase() );
+        vals = ( Set<String> ) typesVals.get( Strings.toLowerCase( attribute.getId()
) );
 
         for ( Value<?> value : attribute )
         {
@@ -678,7 +683,7 @@ public class AddRequestTest extends Abst
 
         Attribute attribute = entry.get( "l" );
 
-        assertEquals( "l", attribute.getId().toLowerCase() );
+        assertEquals( "l", Strings.toLowerCase( attribute.getId() ) );
 
         for ( Value<?> value : attribute )
         {
@@ -770,7 +775,7 @@ public class AddRequestTest extends Abst
 
         Attribute attribute = entry.get( "l" );
 
-        assertEquals( "l", attribute.getId().toLowerCase() );
+        assertEquals( "l", Strings.toLowerCase( attribute.getId() ) );
 
         for ( Value<?> value : attribute )
         {

Modified: directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java?rev=1163034&r1=1163033&r2=1163034&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java
(original)
+++ directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java
Mon Aug 29 21:57:39 2011
@@ -306,7 +306,7 @@ public class ModifyRequestTest extends A
         Modification modification = ( Modification ) modifications[0];
         Attribute attributeValue = modification.getAttribute();
 
-        assertEquals( "telephonenumber", attributeValue.getId().toLowerCase() );
+        assertEquals( "telephonenumber", Strings.toLowerCase( attributeValue.getId() ) );
 
         String attrValue = attributeValue.getString();
         assertEquals( "1234567890", attrValue );
@@ -314,7 +314,7 @@ public class ModifyRequestTest extends A
         modification = ( Modification ) modifications[1];
         attributeValue = modification.getAttribute();
 
-        assertEquals( "cn", attributeValue.getUpId().toLowerCase() );
+        assertEquals( "cn", Strings.toLowerCase( attributeValue.getUpId() ) );
 
         attrValue = attributeValue.getString();
         assertEquals( "XXX", attrValue );
@@ -440,7 +440,7 @@ public class ModifyRequestTest extends A
         Modification modification = ( Modification ) modifications[0];
         Attribute attributeValue = modification.getAttribute();
 
-        assertEquals( "description", attributeValue.getUpId().toLowerCase() );
+        assertEquals( "description", Strings.toLowerCase( attributeValue.getUpId() ) );
         assertEquals( 0, attributeValue.size() );
 
         modification = ( Modification ) modifications[1];
@@ -448,7 +448,7 @@ public class ModifyRequestTest extends A
 
         String attrValue = attributeValue.getString();
 
-        assertEquals( "telephonenumber", attributeValue.getUpId().toLowerCase() );
+        assertEquals( "telephonenumber", Strings.toLowerCase( attributeValue.getUpId() )
);
 
         assertEquals( "01234567890", attrValue );
 
@@ -457,7 +457,7 @@ public class ModifyRequestTest extends A
 
         attrValue = attributeValue.getString();
 
-        assertEquals( "telephonenumber", attributeValue.getUpId().toLowerCase() );
+        assertEquals( "telephonenumber", Strings.toLowerCase( attributeValue.getUpId() )
);
 
         attrValue = attributeValue.getString();
         assertEquals( "01234567890", attrValue );
@@ -568,7 +568,7 @@ public class ModifyRequestTest extends A
         Modification modification = ( Modification ) modifications[0];
         Attribute attributeValue = modification.getAttribute();
 
-        assertEquals( "l", attributeValue.getUpId().toLowerCase() );
+        assertEquals( "l", Strings.toLowerCase( attributeValue.getUpId() ) );
 
         assertTrue( attributeValue.contains( "Paris" ) );
         assertTrue( attributeValue.contains( "London" ) );
@@ -576,7 +576,7 @@ public class ModifyRequestTest extends A
         modification = ( Modification ) modifications[1];
         attributeValue = modification.getAttribute();
 
-        assertEquals( "attrs", attributeValue.getUpId().toLowerCase() );
+        assertEquals( "attrs", Strings.toLowerCase( attributeValue.getUpId() ) );
 
         String attrValue = attributeValue.getString();
         assertEquals( "test", attrValue );
@@ -1106,7 +1106,7 @@ public class ModifyRequestTest extends A
         Modification modification = ( Modification ) modifications[0];
         Attribute attributeValue = modification.getAttribute();
 
-        assertEquals( "l", attributeValue.getUpId().toLowerCase() );
+        assertEquals( "l", Strings.toLowerCase( attributeValue.getUpId() ) );
         assertEquals( 0, attributeValue.size() );
 
         // Check the encoding
@@ -1187,7 +1187,7 @@ public class ModifyRequestTest extends A
         Modification modification = ( Modification ) modifications[0];
         Attribute attributeValue = modification.getAttribute();
 
-        assertEquals( "l", attributeValue.getUpId().toLowerCase() );
+        assertEquals( "l", Strings.toLowerCase( attributeValue.getUpId() ) );
         assertEquals( 0, attributeValue.size() );
 
         // Check the Control
@@ -1275,7 +1275,7 @@ public class ModifyRequestTest extends A
         Modification modification = ( Modification ) modifications[0];
         Attribute attributeValue = modification.getAttribute();
 
-        assertEquals( "l", attributeValue.getUpId().toLowerCase() );
+        assertEquals( "l", Strings.toLowerCase( attributeValue.getUpId() ) );
         assertEquals( 2, attributeValue.size() );
 
         assertTrue( attributeValue.contains( "a" ) );

Modified: directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java?rev=1163034&r1=1163033&r2=1163034&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java
(original)
+++ directory/shared/trunk/ldap/codec/core/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryTest.java
Mon Aug 29 21:57:39 2011
@@ -36,8 +36,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.api.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.decorators.SearchResultEntryDecorator;
 import org.apache.directory.shared.ldap.codec.osgi.AbstractCodecServiceTest;
-import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.Attribute;
+import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.SearchResultEntry;
 import org.apache.directory.shared.util.Strings;
@@ -124,7 +124,7 @@ public class SearchResultEntryTest exten
         {
             Attribute attribute = entry.get( "objectclass" );
 
-            assertEquals( "objectClass".toLowerCase(), attribute.getUpId().toLowerCase()
);
+            assertEquals( Strings.toLowerCase( "objectClass" ), Strings.toLowerCase( attribute.getUpId()
) );
 
             assertTrue( attribute.contains( "top" ) );
             assertTrue( attribute.contains( "organizationalUnit" ) );
@@ -228,7 +228,9 @@ public class SearchResultEntryTest exten
         {
             Attribute attribute = entry.get( expectedAttributes[i] );
 
-            assertEquals( expectedAttributes[i].toLowerCase(), attribute.getUpId().toLowerCase()
);
+            assertEquals( 
+                Strings.toLowerCase( expectedAttributes[i] ), 
+                Strings.toLowerCase( attribute.getUpId() ) );
 
             assertTrue( attribute.contains( "top" ) );
             assertTrue( attribute.contains( "organizationalUnit" ) );
@@ -336,7 +338,7 @@ public class SearchResultEntryTest exten
         {
             Attribute attribute = entry.get( "objectclass" );
 
-            assertEquals( "objectClass".toLowerCase(), attribute.getUpId().toLowerCase()
);
+            assertEquals( Strings.toLowerCase( "objectClass" ), Strings.toLowerCase( attribute.getUpId()
) );
 
             assertTrue( attribute.contains( "top" ) );
             assertTrue( attribute.contains( "person" ) );
@@ -837,7 +839,7 @@ public class SearchResultEntryTest exten
         {
             Attribute attribute = entry.get( "objectclass" );
 
-            assertEquals( "objectClass".toLowerCase(), attribute.getUpId().toLowerCase()
);
+            assertEquals( Strings.toLowerCase( "objectClass" ), Strings.toLowerCase( attribute.getUpId()
) );
             assertEquals( 0, attribute.size() );
         }
 
@@ -921,11 +923,11 @@ public class SearchResultEntryTest exten
         assertEquals( 2, entry.size() );
 
         Attribute attribute = entry.get( "objectclass" );
-        assertEquals( "objectClass".toLowerCase(), attribute.getUpId().toLowerCase() );
+        assertEquals( Strings.toLowerCase( "objectClass" ), Strings.toLowerCase( attribute.getUpId()
) );
         assertEquals( 0, attribute.size() );
 
         attribute = entry.get( "objectclazz" );
-        assertEquals( "objectClazz".toLowerCase(), attribute.getUpId().toLowerCase() );
+        assertEquals( Strings.toLowerCase( "objectClazz" ), Strings.toLowerCase( attribute.getUpId()
) );
         assertEquals( 0, attribute.size() );
 
         // Check the encoding
@@ -1014,7 +1016,7 @@ public class SearchResultEntryTest exten
         {
             Attribute attribute = entry.get( "objectclass" );
 
-            assertEquals( "objectClass".toLowerCase(), attribute.getUpId().toLowerCase()
);
+            assertEquals( Strings.toLowerCase( "objectClass" ), Strings.toLowerCase( attribute.getUpId()
) );
 
             assertEquals( 0, attribute.size() );
         }
@@ -1112,7 +1114,7 @@ public class SearchResultEntryTest exten
         {
             Attribute attribute = entry.get( "objectclass" );
 
-            assertEquals( "objectClass".toLowerCase(), attribute.getUpId().toLowerCase()
);
+            assertEquals( Strings.toLowerCase( "objectClass" ), Strings.toLowerCase( attribute.getUpId()
) );
 
             assertTrue( attribute.contains( "" ) );
         }
@@ -1206,7 +1208,7 @@ public class SearchResultEntryTest exten
         {
             Attribute attribute = entry.get( "objectclass" );
 
-            assertEquals( "objectClass".toLowerCase(), attribute.getUpId().toLowerCase()
);
+            assertEquals( Strings.toLowerCase( "objectClass" ), Strings.toLowerCase( attribute.getUpId()
) );
 
             assertTrue( attribute.contains( "" ) );
         }

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/constants/LdapSecurityConstants.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/constants/LdapSecurityConstants.java?rev=1163034&r1=1163033&r2=1163034&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/constants/LdapSecurityConstants.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/constants/LdapSecurityConstants.java
Mon Aug 29 21:57:39 2011
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.shared.ldap.model.constants;
 
+import org.apache.directory.shared.util.Strings;
+
 
 /**
  * An enum to store all the security constants used in the server
@@ -110,7 +112,7 @@ public enum LdapSecurityConstants
 
         if ( name != null )
         {
-            algorithm = name.toLowerCase();
+            algorithm = Strings.toLowerCase( name );
         }
 
         if ( HASH_METHOD_SHA.getName().equalsIgnoreCase( algorithm ) )

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifAttributesReader.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifAttributesReader.java?rev=1163034&r1=1163033&r2=1163034&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifAttributesReader.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifAttributesReader.java
Mon Aug 29 21:57:39 2011
@@ -332,7 +332,7 @@ public class LdifAttributesReader extend
         {
             // Each line could start either with an OID, an attribute type, with
             // "control:" or with "changetype:"
-            String lowerLine = line.toLowerCase();
+            String lowerLine = Strings.toLowerCase( line );
 
             // We have three cases :
             // 1) The first line after the Dn is a "control:" -> this is an error
@@ -394,7 +394,7 @@ public class LdifAttributesReader extend
         {
             // Each line could start either with an OID, an attribute type, with
             // "control:" or with "changetype:"
-            String lowerLine = line.toLowerCase();
+            String lowerLine = Strings.toLowerCase( line );
 
             // We have three cases :
             // 1) The first line after the Dn is a "control:" -> this is an error

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifReader.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifReader.java?rev=1163034&r1=1163033&r2=1163034&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifReader.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifReader.java
Mon Aug 29 21:57:39 2011
@@ -492,7 +492,7 @@ public class LdifReader implements Itera
     {
         String dn;
 
-        String lowerLine = line.toLowerCase();
+        String lowerLine = Strings.toLowerCase( line );
 
         if ( lowerLine.startsWith( "dn:" ) || lowerLine.startsWith( "Dn:" ) )
         {
@@ -754,7 +754,7 @@ public class LdifReader implements Itera
      */
     private Control parseControl( String line ) throws LdapLdifException
     {
-        String lowerLine = line.toLowerCase().trim();
+        String lowerLine = Strings.toLowerCase( line ).trim();
         char[] controlValue = line.trim().toCharArray();
         int pos = 0;
         int length = controlValue.length;
@@ -892,7 +892,7 @@ public class LdifReader implements Itera
 
         if ( colonIndex != -1 )
         {
-            String attributeType = line.toLowerCase().substring( 0, colonIndex );
+            String attributeType = Strings.toLowerCase( line ).substring( 0, colonIndex );
             Object attributeValue = parseSimpleValue( line, colonIndex );
 
             // Create an attribute
@@ -954,7 +954,7 @@ public class LdifReader implements Itera
         if ( iter.hasNext() )
         {
             String line = iter.next();
-            String lowerLine = line.toLowerCase();
+            String lowerLine = Strings.toLowerCase( line );
 
             if ( lowerLine.startsWith( "newrdn::" ) || lowerLine.startsWith( "newrdn:" )
)
             {
@@ -975,7 +975,6 @@ public class LdifReader implements Itera
                 LOG.error( I18n.err( I18n.ERR_12035_BAD_MODRDN_OPERATION ) );
                 throw new LdapLdifException( I18n.err( I18n.ERR_12035_BAD_MODRDN_OPERATION
) );
             }
-
         }
         else
         {
@@ -986,7 +985,7 @@ public class LdifReader implements Itera
         if ( iter.hasNext() )
         {
             String line = iter.next();
-            String lowerLine = line.toLowerCase();
+            String lowerLine = Strings.toLowerCase( line );
 
             if ( lowerLine.startsWith( "deleteoldrdn:" ) )
             {
@@ -1039,7 +1038,7 @@ public class LdifReader implements Itera
         while ( iter.hasNext() )
         {
             String line = iter.next();
-            String lowerLine = line.toLowerCase();
+            String lowerLine = Strings.toLowerCase( line );
 
             if ( lowerLine.startsWith( "-" ) )
             {
@@ -1215,7 +1214,7 @@ public class LdifReader implements Itera
                 while ( iter.hasNext() )
                 {
                     String line = iter.next();
-                    String lowerLine = line.toLowerCase();
+                    String lowerLine = Strings.toLowerCase( line );
                     parseAttributeValue( entry, line, lowerLine );
                 }
 
@@ -1234,7 +1233,7 @@ public class LdifReader implements Itera
                 if ( iter.hasNext() )
                 {
                     String line = iter.next();
-                    String lowerLine = line.toLowerCase();
+                    String lowerLine = Strings.toLowerCase( line );
 
                     if ( lowerLine.startsWith( "newsuperior:" ) )
                     {
@@ -1329,7 +1328,7 @@ public class LdifReader implements Itera
             // Each line could start either with an OID, an attribute type, with
             // "control:" or with "changetype:"
             line = iter.next();
-            lowerLine = line.toLowerCase();
+            lowerLine = Strings.toLowerCase( line );
 
             // We have three cases :
             // 1) The first line after the Dn is a "control:"

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifUtils.java?rev=1163034&r1=1163033&r2=1163034&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifUtils.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifUtils.java
Mon Aug 29 21:57:39 2011
@@ -370,7 +370,7 @@ public final class LdifUtils
         sb.append( '\n' );
 
         // Dump the ChangeType
-        String changeType = entry.getChangeType().toString().toLowerCase();
+        String changeType = Strings.toLowerCase( entry.getChangeType().toString() );
 
         if ( entry.getChangeType() != ChangeType.None )
         {

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/normalizers/ObjectIdentifierNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/normalizers/ObjectIdentifierNormalizer.java?rev=1163034&r1=1163033&r2=1163034&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/normalizers/ObjectIdentifierNormalizer.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/normalizers/ObjectIdentifierNormalizer.java
Mon Aug 29 21:57:39 2011
@@ -25,6 +25,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.entry.Value;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.schema.Normalizer;
+import org.apache.directory.shared.util.Strings;
 
 
 /**
@@ -67,7 +68,7 @@ public class ObjectIdentifierNormalizer 
         }
         else
         {
-            return new StringValue( str.toLowerCase() );
+            return new StringValue( Strings.toLowerCase( str ) );
         }
     }
     
@@ -95,7 +96,7 @@ public class ObjectIdentifierNormalizer 
         }
         else
         {
-            return str.toLowerCase();
+            return Strings.toLowerCase( str );
         }
     }
 }

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultAttributeTypeRegistry.java?rev=1163034&r1=1163033&r2=1163034&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultAttributeTypeRegistry.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultAttributeTypeRegistry.java
Mon Aug 29 21:57:39 2011
@@ -34,6 +34,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.SchemaObjectType;
 import org.apache.directory.shared.ldap.model.schema.normalizers.NoOpNormalizer;
 import org.apache.directory.shared.ldap.model.schema.normalizers.OidNormalizer;
+import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -277,7 +278,7 @@ public class DefaultAttributeTypeRegistr
         // Also inject the attributeType's short names in the map
         for ( String name : attributeType.getNames() )
         {
-            oidNormalizerMap.put( name.toLowerCase(), oidNormalizer );
+            oidNormalizerMap.put( Strings.toLowerCase( name ), oidNormalizer );
         }
     }
 
@@ -297,7 +298,7 @@ public class DefaultAttributeTypeRegistr
         // We also have to remove all the short names for this attribute
         for ( String name : attributeType.getNames() )
         {
-            oidNormalizerMap.remove( name.toLowerCase() );
+            oidNormalizerMap.remove( Strings.toLowerCase( name ) );
         }
     }
 

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultSchemaObjectRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultSchemaObjectRegistry.java?rev=1163034&r1=1163033&r2=1163034&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultSchemaObjectRegistry.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultSchemaObjectRegistry.java
Mon Aug 29 21:57:39 2011
@@ -339,7 +339,7 @@ public abstract class DefaultSchemaObjec
         if ( schemaObject == null )
         {
             // last resort before giving up check with lower cased version
-            String lowerCased = name.toLowerCase();
+            String lowerCased = Strings.toLowerCase( name );
 
             schemaObject = byName.get( lowerCased );
 

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/syntaxCheckers/FacsimileTelephoneNumberSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/syntaxCheckers/FacsimileTelephoneNumberSyntaxChecker.java?rev=1163034&r1=1163033&r2=1163034&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/syntaxCheckers/FacsimileTelephoneNumberSyntaxChecker.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/syntaxCheckers/FacsimileTelephoneNumberSyntaxChecker.java
Mon Aug 29 21:57:39 2011
@@ -71,13 +71,13 @@ public class FacsimileTelephoneNumberSyn
     /** Initialization of the fax parameters set of values */
     static
     {
-        faxParameters.add( TWO_DIMENSIONAL.toLowerCase() );
-        faxParameters.add( FINE_RESOLUTION.toLowerCase() );
-        faxParameters.add( UNLIMITED_LENGTH.toLowerCase() );
-        faxParameters.add( B4_LENGTH.toLowerCase() );
-        faxParameters.add( A3_LENGTH.toLowerCase() );
-        faxParameters.add( B4_WIDTH.toLowerCase() );
-        faxParameters.add( UNCOMPRESSED.toLowerCase() );
+        faxParameters.add( Strings.toLowerCase( TWO_DIMENSIONAL ) );
+        faxParameters.add( Strings.toLowerCase( FINE_RESOLUTION ) );
+        faxParameters.add( Strings.toLowerCase( UNLIMITED_LENGTH ) );
+        faxParameters.add( Strings.toLowerCase( B4_LENGTH ) );
+        faxParameters.add( Strings.toLowerCase( A3_LENGTH ) );
+        faxParameters.add( Strings.toLowerCase( B4_WIDTH ) );
+        faxParameters.add( Strings.toLowerCase( UNCOMPRESSED ) );
     }
     
     /**
@@ -179,7 +179,7 @@ public class FacsimileTelephoneNumberSyn
                 }
                 
                 // Relax a little bit the syntax by lowercasing the param
-                faxParam = faxParam.toLowerCase();
+                faxParam = Strings.toLowerCase( faxParam );
                 
                 if ( !faxParameters.contains( faxParam ) )
                 {

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntryUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntryUtils.java?rev=1163034&r1=1163033&r2=1163034&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntryUtils.java
(original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntryUtils.java
Mon Aug 29 21:57:39 2011
@@ -141,7 +141,7 @@ public class EntryUtils
             {
                 if ( value.isHumanReadable() )
                 {
-                    return new StringValue( value.getString().toLowerCase() );
+                    return new StringValue( Strings.toLowerCase( value.getString() ) );
                 }
 
                 throw new IllegalStateException( I18n.err( I18n.ERR_04474 ) );

Modified: directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/shared/ldap/schemaloader/SchemaManagerEnableDisableLoadTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/shared/ldap/schemaloader/SchemaManagerEnableDisableLoadTest.java?rev=1163034&r1=1163033&r2=1163034&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/shared/ldap/schemaloader/SchemaManagerEnableDisableLoadTest.java
(original)
+++ directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/shared/ldap/schemaloader/SchemaManagerEnableDisableLoadTest.java
Mon Aug 29 21:57:39 2011
@@ -39,6 +39,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.schemaextractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schemaextractor.impl.DefaultSchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schemamanager.impl.DefaultSchemaManager;
+import org.apache.directory.shared.util.Strings;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
@@ -146,7 +147,7 @@ public class SchemaManagerEnableDisableL
 
         for ( Schema schema : enabled )
         {
-            assertTrue( enabledSchemas.contains( schema.getSchemaName().toLowerCase() ) );
+            assertTrue( enabledSchemas.contains( Strings.toLowerCase( schema.getSchemaName()
) ) );
         }
 
         // The disabled schemas

Modified: directory/shared/trunk/util/src/main/java/org/apache/directory/shared/util/PropertiesUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/util/src/main/java/org/apache/directory/shared/util/PropertiesUtils.java?rev=1163034&r1=1163033&r2=1163034&view=diff
==============================================================================
--- directory/shared/trunk/util/src/main/java/org/apache/directory/shared/util/PropertiesUtils.java
(original)
+++ directory/shared/trunk/util/src/main/java/org/apache/directory/shared/util/PropertiesUtils.java
Mon Aug 29 21:57:39 2011
@@ -524,7 +524,7 @@ public final class PropertiesUtils
             return defaultValue;
         }
 
-        String val = props.getProperty( key ).trim().toLowerCase();
+        String val = Strings.toLowerCase( Strings.trim( props.getProperty( key ) ) );
         return val.equals( "true" ) || val.equals( "on" ) || val.equals( "1" ) || val.equals(
"yes" );
     }
 

Modified: directory/shared/trunk/util/src/main/java/org/apache/directory/shared/util/Strings.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/util/src/main/java/org/apache/directory/shared/util/Strings.java?rev=1163034&r1=1163033&r2=1163034&view=diff
==============================================================================
--- directory/shared/trunk/util/src/main/java/org/apache/directory/shared/util/Strings.java
(original)
+++ directory/shared/trunk/util/src/main/java/org/apache/directory/shared/util/Strings.java
Mon Aug 29 21:57:39 2011
@@ -31,6 +31,7 @@ import java.lang.reflect.InvocationTarge
 import java.lang.reflect.Method;
 import java.nio.charset.Charset;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
 
@@ -1762,7 +1763,7 @@ public final class Strings
             return null;
         }
 
-        return str.toLowerCase();
+        return str.toLowerCase( Locale.ENGLISH );
     }
 
 
@@ -1937,7 +1938,7 @@ public final class Strings
         sb.append( '-' );
         sb.append( hex, 20, 12 );
 
-        return sb.toString().toLowerCase();
+        return Strings.toLowerCase( sb.toString() );
     }
 
 



Mime
View raw message