directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r657335 - in /directory: apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/ apacheds/trunk/core/src/main/java/org/apache/directory...
Date Sat, 17 May 2008 12:08:30 GMT
Author: elecharny
Date: Sat May 17 05:08:30 2008
New Revision: 657335

URL: http://svn.apache.org/viewvc?rev=657335&view=rev
Log:
o Renamed a String[] getNames() method to String[] getNamesRef(), in order to make it explicit that this method returns a reference, and not a copy, of the underlying String array
o Added some missing Javadoc
o Removed some other warnings (formating)

Modified:
    directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaNormalizerHandlerIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java
    directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaMatchingRuleProducer.java
    directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaSyntaxProducer.java
    directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/NameOrNumericIdMatch.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultAttributeTypeRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultMatchingRuleRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultObjectClassRegistry.java
    directory/apacheds/trunk/utils/src/main/java/org/apache/directory/server/utils/AttributesFactory.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractAttributeType.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractSchemaObject.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractSyntax.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ByteArrayComparator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/CachingNormalizer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ComparableComparator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DeepTrimNormalizer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DefaultObjectClass.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DescriptionUtils.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaObject.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java

Modified: directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java (original)
+++ directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java Sat May 17 05:08:30 2008
@@ -96,7 +96,7 @@
         
         String normId = StringTools.lowerCaseAscii( trimmedId );
         
-        for ( String name:attributeType.getNames() )
+        for ( String name:attributeType.getNamesRef() )
         {
             if ( normId.equalsIgnoreCase( name ) )
             {
@@ -144,7 +144,7 @@
                 // In this case, it must be equals to the attributeType OID.
                 String normId = StringTools.lowerCaseAscii( StringTools.trim( id ) );
                 
-                for ( String atName:attributeType.getNames() )
+                for ( String atName:attributeType.getNamesRef() )
                 {
                     if ( atName.equalsIgnoreCase( normId ) )
                     {
@@ -213,7 +213,7 @@
                 // In this case, it must be equals to the attributeType OID.
                 String normUpId = StringTools.lowerCaseAscii( StringTools.trim( upId ) );
                 
-                for ( String atId:attributeType.getNames() )
+                for ( String atId:attributeType.getNamesRef() )
                 {
                     if ( atId.equalsIgnoreCase( normUpId ) )
                     {
@@ -291,7 +291,7 @@
                 // In this case, it must be equals to the attributeType OID.
                 String normUpId = StringTools.lowerCaseAscii( StringTools.trim( upId ) );
                 
-                for ( String atId:attributeType.getNames() )
+                for ( String atId:attributeType.getNamesRef() )
                 {
                     if ( atId.equalsIgnoreCase( normUpId ) )
                     {

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerIT.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerIT.java Sat May 17 05:08:30 2008
@@ -581,7 +581,7 @@
             return "dummy";
         }
 
-        public String[] getNames()
+        public String[] getNamesRef()
         {
             return new String[] { "dummy" };
         }

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaNormalizerHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaNormalizerHandlerIT.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaNormalizerHandlerIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaNormalizerHandlerIT.java Sat May 17 05:08:30 2008
@@ -584,7 +584,7 @@
             return "dummy";
         }
 
-        public String[] getNames()
+        public String[] getNamesRef()
         {
             return new String[] { "dummy" };
         }

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java Sat May 17 05:08:30 2008
@@ -588,7 +588,7 @@
             return "dummy";
         }
 
-        public String[] getNames()
+        public String[] getNamesRef()
         {
             return new String[] { "dummy" };
         }

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java Sat May 17 05:08:30 2008
@@ -1424,8 +1424,8 @@
         assertEquals( "1.3.6.1.4.1.18060.0.4.0.2.10000", at.getOid() );
         assertEquals( "name", at.getSuperior().getName() );
         assertEquals( "bogus description", at.getDescription() );
-        assertEquals( "bogus", at.getNames()[0] );
-        assertEquals( "bogusName", at.getNames()[1] );
+        assertEquals( "bogus", at.getNamesRef()[0] );
+        assertEquals( "bogusName", at.getNamesRef()[1] );
         assertEquals( true, at.isCanUserModify() );
         assertEquals( false, at.isCollective() );
         assertEquals( false, at.isObsolete() );
@@ -1486,8 +1486,8 @@
         assertEquals( "1.3.6.1.4.1.18060.0.4.0.2.10000", at.getOid() );
         assertEquals( "name", at.getSuperior().getName() );
         assertEquals( "bogus description", at.getDescription() );
-        assertEquals( "bogus", at.getNames()[0] );
-        assertEquals( "bogusName", at.getNames()[1] );
+        assertEquals( "bogus", at.getNamesRef()[0] );
+        assertEquals( "bogusName", at.getNamesRef()[1] );
         assertEquals( true, at.isCanUserModify() );
         assertEquals( false, at.isCollective() );
         assertEquals( false, at.isObsolete() );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java Sat May 17 05:08:30 2008
@@ -163,11 +163,11 @@
     
     protected void registerOids( SchemaObject obj ) throws NamingException
     {
-        String[] names = obj.getNames();
+        String[] names = obj.getNamesRef();
         
         if ( names != null )
         {
-            for ( String name: names )
+            for ( String name:names )
             {
                 targetRegistries.getOidRegistry().register( name, obj.getOid() );
             }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java Sat May 17 05:08:30 2008
@@ -667,9 +667,11 @@
         or.addNode( new EqualityNode( M_EQUALITY_OID, new ClientStringValue( mr.getOid() ) ) );
         filter.addNode( or );
 
-        if ( mr.getNames() != null || mr.getNames().length > 0 )
+        String[] names = mr.getNamesRef();
+        
+        if ( ( names != null ) || ( names.length > 0 ) )
         {
-            for ( String name : mr.getNames() )
+            for ( String name : names )
             {
                 or.addNode( new EqualityNode( M_ORDERING_OID, new ClientStringValue( name.toLowerCase() ) ) );
                 or.addNode( new EqualityNode( M_SUBSTRING_OID, new ClientStringValue( name.toLowerCase() ) ) );

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java Sat May 17 05:08:30 2008
@@ -148,7 +148,7 @@
                             return null;
                         }
 
-                        public String[] getNames()
+                        public String[] getNamesRef()
                         {
                             return null;
                         }
@@ -211,7 +211,7 @@
                 }
 
 
-                public String[] getNames()
+                public String[] getNamesRef()
                 {
                     return new String[]
                         { id };
@@ -304,7 +304,7 @@
                             return null;
                         }
 
-                        public String[] getNames()
+                        public String[] getNamesRef()
                         {
                             return null;
                         }
@@ -370,7 +370,7 @@
                                     return null;
                                 }
 
-                                public String[] getNames()
+                                public String[] getNamesRef()
                                 {
                                     return null;
                                 }
@@ -424,7 +424,7 @@
                             return null;
                         }
 
-                        public String[] getNames()
+                        public String[] getNamesRef()
                         {
                             return null;
                         }
@@ -487,7 +487,7 @@
                 }
 
 
-                public String[] getNames()
+                public String[] getNamesRef()
                 {
                     return new String[]
                         { id };

Modified: directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaMatchingRuleProducer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaMatchingRuleProducer.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaMatchingRuleProducer.java (original)
+++ directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaMatchingRuleProducer.java Sat May 17 05:08:30 2008
@@ -125,7 +125,7 @@
             return NAMES[0];
         }
 
-        public String[] getNames()
+        public String[] getNamesRef()
         {
             return NAMES;
         }
@@ -191,7 +191,7 @@
             return NAMES[0];
         }
 
-        public String[] getNames()
+        public String[] getNamesRef()
         {
             return NAMES;
         }
@@ -257,7 +257,7 @@
             return NAMES[0];
         }
 
-        public String[] getNames()
+        public String[] getNamesRef()
         {
             return NAMES;
         }
@@ -320,7 +320,7 @@
             return NAMES[0];
         }
 
-        public String[] getNames()
+        public String[] getNamesRef()
         {
             return NAMES;
         }

Modified: directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaSyntaxProducer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaSyntaxProducer.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaSyntaxProducer.java (original)
+++ directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaSyntaxProducer.java Sat May 17 05:08:30 2008
@@ -106,7 +106,7 @@
             return NAMES[0];
         }
 
-        public final String[] getNames()
+        public final String[] getNamesRef()
         {
             return NAMES;
         }
@@ -160,7 +160,7 @@
             return NAMES[0];
         }
 
-        public final String[] getNames()
+        public final String[] getNamesRef()
         {
             return NAMES;
         }
@@ -214,7 +214,7 @@
             return NAMES[0];
         }
 
-        public final String[] getNames()
+        public final String[] getNamesRef()
         {
             return NAMES;
         }
@@ -268,7 +268,7 @@
             return NAMES[0];
         }
 
-        public final String[] getNames()
+        public final String[] getNamesRef()
         {
             return NAMES;
         }
@@ -321,7 +321,7 @@
             return NAMES[0];
         }
 
-        public final String[] getNames()
+        public final String[] getNamesRef()
         {
             return NAMES;
         }

Modified: directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/NameOrNumericIdMatch.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/NameOrNumericIdMatch.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/NameOrNumericIdMatch.java (original)
+++ directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/NameOrNumericIdMatch.java Sat May 17 05:08:30 2008
@@ -118,9 +118,9 @@
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.schema.SchemaObject#getNames()
+     * @see org.apache.directory.shared.ldap.schema.SchemaObject#getNamesRef()
      */
-    public String[] getNames()
+    public String[] getNamesRef()
     {
         return NAMES;
     }

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultAttributeTypeRegistry.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultAttributeTypeRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultAttributeTypeRegistry.java Sat May 17 05:08:30 2008
@@ -96,7 +96,7 @@
                 + " has already been registered!" );
         }
 
-        String[] names = attributeType.getNames();
+        String[] names = attributeType.getNamesRef();
         for ( String name : names )
         {
             oidRegistry.register( name, attributeType.getOid() );
@@ -132,7 +132,7 @@
                 binaries.add( type.getOid() );
 
                 // add the lowercased name for the names for the attributeType
-                String[] names = type.getNames();
+                String[] names = type.getNamesRef();
 
                 for ( String name : names )
                 {
@@ -255,7 +255,7 @@
         
         MatchingRule matchingRule = type.getEquality();
         mapping.remove( type.getOid() );
-        String[] aliases = type.getNames();
+        String[] aliases = type.getNamesRef();
         for ( String aliase : aliases )
         {
             mapping.remove( aliase );
@@ -280,7 +280,7 @@
         }
 
         mapping.put( type.getOid(), oidNormalizer );
-        String[] aliases = type.getNames();
+        String[] aliases = type.getNamesRef();
         for ( String aliase : aliases )
         {
             mapping.put( aliase, oidNormalizer );

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultMatchingRuleRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultMatchingRuleRegistry.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultMatchingRuleRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultMatchingRuleRegistry.java Sat May 17 05:08:30 2008
@@ -103,7 +103,8 @@
                 + " has already been registered!" );
         }
 
-        String[] names = matchingRule.getNames();
+        String[] names = matchingRule.getNamesRef();
+        
         for ( String name : names )
         {
             oidRegistry.register( name, matchingRule.getOid() );

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultObjectClassRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultObjectClassRegistry.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultObjectClassRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultObjectClassRegistry.java Sat May 17 05:08:30 2008
@@ -82,7 +82,7 @@
                 + " has already been registered!" );
         }
 
-        if ( objectClass.getNames() != null && objectClass.getNames().length > 0 )
+        if ( objectClass.getNamesRef() != null && objectClass.getNamesRef().length > 0 )
         {
             oidRegistry.register( objectClass.getName(), objectClass.getOid() );
         }

Modified: directory/apacheds/trunk/utils/src/main/java/org/apache/directory/server/utils/AttributesFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/utils/src/main/java/org/apache/directory/server/utils/AttributesFactory.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/apacheds/trunk/utils/src/main/java/org/apache/directory/server/utils/AttributesFactory.java (original)
+++ directory/apacheds/trunk/utils/src/main/java/org/apache/directory/server/utils/AttributesFactory.java Sat May 17 05:08:30 2008
@@ -421,7 +421,7 @@
     
     private final void injectCommon( SchemaObject object, ServerEntry entry, Registries registries ) throws NamingException
     {
-        injectNames( object.getNames(), entry, registries );
+        injectNames( object.getNamesRef(), entry, registries );
         entry.put( MetaSchemaConstants.M_OBSOLETE_AT, getBoolean( object.isObsolete() ) );
         entry.put( MetaSchemaConstants.M_OID_AT, object.getOid() );
         

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractAttributeType.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractAttributeType.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractAttributeType.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractAttributeType.java Sat May 17 05:08:30 2008
@@ -20,8 +20,8 @@
 package org.apache.directory.shared.ldap.schema;
 
 
-import javax.naming.NamingException;
 import java.io.Serializable;
+import javax.naming.NamingException;
 
 
 /**
@@ -75,6 +75,8 @@
 
     /**
      * @see AttributeType#isSingleValue()
+     * @return true if only one value can exist for this AttributeType, false
+     *         otherwise
      */
     public boolean isSingleValue()
     {
@@ -84,6 +86,7 @@
 
     /**
      * @see AttributeType#isCollective()
+     * @return true if the attribute is collective, false otherwise
      */
     public boolean isCollective()
     {
@@ -93,6 +96,7 @@
 
     /**
      * @see AttributeType#isCanUserModify()
+     * @return true if users can modify it, false if only the directory can.
      */
     public boolean isCanUserModify()
     {
@@ -102,6 +106,7 @@
 
     /**
      * @see AttributeType#getUsage()
+     * @return a type safe UsageEnum
      */
     public UsageEnum getUsage()
     {
@@ -111,6 +116,7 @@
 
     /**
      * @see AttributeType#getLength()
+     * @return the length of the attribute
      */
     public int getLength()
     {
@@ -189,29 +195,41 @@
     // -----------------------------------------------------------------------
     // Additional Methods
     // -----------------------------------------------------------------------
-
-
-    public boolean isAncestorOf( AttributeType attributeType ) throws NamingException
+    /**
+     * Checks to see if this AttributeType is the ancestor of another
+     * attributeType.
+     *
+     * @param descendant the perspective descendant to check
+     * @return true if the descendant is truly a derived from this AttributeType
+     * @throws NamingException if there are problems resolving superior types
+     */
+    public boolean isAncestorOf( AttributeType descendant ) throws NamingException
     {
-        //noinspection SimplifiableIfStatement
-        if ( attributeType == null || equals( attributeType ) )
+        if ( ( descendant == null ) || equals( descendant ) )
         {
             return false;
         }
 
-        return isAncestorOrEqual( this, attributeType );
+        return isAncestorOrEqual( this, descendant );
     }
 
 
-    public boolean isDescentantOf( AttributeType attributeType ) throws NamingException
+    /**
+     * Checks to see if this AttributeType is the descendant of another
+     * attributeType.
+     *
+     * @param ancestor the perspective ancestor to check
+     * @return true if this AttributeType truly descends from the ancestor
+     * @throws NamingException if there are problems resolving superior types
+     */
+    public boolean isDescentantOf( AttributeType ancestor ) throws NamingException
     {
-        //noinspection SimplifiableIfStatement
-        if ( attributeType == null || equals( attributeType ) )
+        if ( ( ancestor == null ) || equals( ancestor ) )
         {
             return false;
         }
 
-        return isAncestorOrEqual( attributeType, this );
+        return isAncestorOrEqual( ancestor, this );
     }
 
 
@@ -227,12 +245,11 @@
      */
     private boolean isAncestorOrEqual( AttributeType ancestor, AttributeType descendant ) throws NamingException
     {
-        if ( ancestor == null || descendant == null )
+        if ( ( ancestor == null ) || ( descendant == null ) )
         {
             return false;
         }
 
-        //noinspection SimplifiableIfStatement
         if ( ancestor.equals( descendant ) )
         {
             return true;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractSchemaObject.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractSchemaObject.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractSchemaObject.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractSchemaObject.java Sat May 17 05:08:30 2008
@@ -156,7 +156,8 @@
 
         if ( names != null )
         {
-            this.names = names;
+            this.names = new String[names.length];
+            System.arraycopy( names, 0, this.names, 0, names.length );
         }
     }
 
@@ -167,6 +168,8 @@
 
     /**
      * @see SchemaObject#getOid()
+     * @return an OID for this SchemaObject or its MatchingRule if this
+     *         SchemaObject is a MatchingRuleUse object
      */
     public String getOid()
     {
@@ -176,6 +179,7 @@
 
     /**
      * @see SchemaObject#isObsolete()
+     * @return true if inactive, false if active
      */
     public boolean isObsolete()
     {
@@ -185,8 +189,9 @@
 
     /**
      * @see SchemaObject#getNames()
+     * @return the names for this SchemaObject
      */
-    public String[] getNames()
+    public String[] getNamesRef()
     {
         return names;
     }
@@ -194,6 +199,7 @@
 
     /**
      * @see SchemaObject#getSchema()
+     * @return the name of the schema associated with this schemaObject
      */
     public String getSchema()
     {
@@ -203,6 +209,8 @@
     
     /**
      * @see SchemaObject#getName()
+     * @return the first of the names for this SchemaObject or null if one does
+     *         not exist
      */
     public String getName()
     {
@@ -212,6 +220,7 @@
 
     /**
      * @see SchemaObject#getDescription()
+     * @return a short description about this SchemaObject
      */
     public String getDescription()
     {
@@ -255,7 +264,8 @@
      */
     protected void setNames( String[] names )
     {
-        this.names = names;
+        this.names = new String[names.length];
+        System.arraycopy( names, 0, this.names, 0, names.length );
     }
 
 
@@ -302,7 +312,6 @@
             return true;
         }
 
-        //noinspection SimplifiableIfStatement
         if ( obj instanceof SchemaObject )
         {
             return oid.equals( ( ( SchemaObject ) obj ).getOid() );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractSyntax.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractSyntax.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractSyntax.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractSyntax.java Sat May 17 05:08:30 2008
@@ -100,6 +100,7 @@
 
     /**
      * @see org.apache.directory.shared.ldap.schema.Syntax#isHumanReadable()
+     * @return true if the syntax can be interpreted by humans, false otherwise
      */
     public final boolean isHumanReadable()
     {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ByteArrayComparator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ByteArrayComparator.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ByteArrayComparator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ByteArrayComparator.java Sat May 17 05:08:30 2008
@@ -31,16 +31,14 @@
  */
 public class ByteArrayComparator implements Comparator<byte[]>
 {
+    /** A static instance of this comparator */
     public static final Comparator<byte[]> INSTANCE = new ByteArrayComparator();
 
-    /* (non-Javadoc)
+    /**
      * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
      */
-    public int compare( byte[] o1, byte[] o2 )
+    public int compare( byte[] b1, byte[] b2 )
     {
-        byte[] b1 = ( byte[] ) o1;
-        byte[] b2 = ( byte[] ) o2;
-
         // -------------------------------------------------------------------
         // Handle some basis cases
         // -------------------------------------------------------------------

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/CachingNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/CachingNormalizer.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/CachingNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/CachingNormalizer.java Sat May 17 05:08:30 2008
@@ -77,6 +77,10 @@
 
     /**
      * @see org.apache.directory.shared.ldap.schema.Normalizer#normalize(java.lang.Object)
+     * 
+     * @param value the value to normalize. It must *not* be null !
+     * @return the normalized form for a value
+     * @throws NamingException if an error results during normalization
      */
     public Object normalize( Object value ) throws NamingException
     {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ComparableComparator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ComparableComparator.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ComparableComparator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ComparableComparator.java Sat May 17 05:08:30 2008
@@ -20,8 +20,8 @@
 package org.apache.directory.shared.ldap.schema;
 
 
-import java.util.Comparator;
 import java.io.Serializable;
+import java.util.Comparator;
 
 
 /**
@@ -30,10 +30,9 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-@SuppressWarnings("unchecked")
 public class ComparableComparator implements Comparator, Serializable
 {
-    static final long serialVersionUID = -5295278271807198471L;
+    private static final long serialVersionUID = -5295278271807198471L;
 
 
     /**

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DeepTrimNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DeepTrimNormalizer.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DeepTrimNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DeepTrimNormalizer.java Sat May 17 05:08:30 2008
@@ -37,7 +37,7 @@
  */
 public class DeepTrimNormalizer implements Normalizer
 {
-   static final long serialVersionUID = 1L;
+   private static final long serialVersionUID = 1L;
 
    public Object normalize( Object value ) throws NamingException
    {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DefaultObjectClass.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DefaultObjectClass.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DefaultObjectClass.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DefaultObjectClass.java Sat May 17 05:08:30 2008
@@ -20,11 +20,11 @@
 package org.apache.directory.shared.ldap.schema;
 
 
-import java.util.List;
-import java.util.ArrayList;
-
 import java.io.Serializable;
 
+import java.util.ArrayList;
+import java.util.List;
+
 
 /**
  * Objectclass specification bean used to store the schema information for an
@@ -35,7 +35,7 @@
  */
 public class DefaultObjectClass extends AbstractSchemaObject implements ObjectClass, Serializable
 {
-    static final long serialVersionUID = -4744807759763092241L;
+    private static final long serialVersionUID = -4744807759763092241L;
 
     /** empty array of ObjectClasses so we do not have to recreate objects */
     private static final ObjectClass[] EMPTY_OCLASS_ARR = new ObjectClass[0];

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DescriptionUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DescriptionUtils.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DescriptionUtils.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DescriptionUtils.java Sat May 17 05:08:30 2008
@@ -73,6 +73,8 @@
      *            the attributeType to generate a description for
      * @return the AttributeTypeDescription Syntax for the attributeType in a
      *         pretty formated string
+     * @throws NamingException If an error is raised while accessing some of the attributeType
+     * data 
      */
     public static String getDescription( AttributeType attributeType ) throws NamingException
     {
@@ -173,6 +175,8 @@
      *            the DIT content rule specification
      * @return the specification according to the DITContentRuleDescription
      *         syntax
+     * @throws NamingException If an error is raised while accessing some of the dITConentRule
+     * data 
      */
     public static String getDescription( DITContentRule dITContentRule ) throws NamingException
     {
@@ -197,51 +201,59 @@
             buf.append( '\n' );
         }
 
-        // print out all the auxillary object class oids
+        // print out all the auxiliary object class oids
         ObjectClass[] aux = dITContentRule.getAuxObjectClasses();
+        
         if ( aux != null && aux.length > 0 )
         {
             buf.append( "AUX\n" );
-            for ( int ii = 0; ii < aux.length; ii++ )
+            
+            for ( ObjectClass objectClass: aux )
             {
                 buf.append( '\t' );
-                buf.append( aux[ii].getOid() );
+                buf.append( objectClass.getOid() );
                 buf.append( '\n' );
             }
         }
 
         AttributeType[] must = dITContentRule.getMustNames();
+        
         if ( must != null && must.length > 0 )
         {
             buf.append( "MUST\n" );
-            for ( int ii = 0; ii < must.length; ii++ )
+            
+            for ( AttributeType attributeType:must )
             {
                 buf.append( '\t' );
-                buf.append( must[ii].getOid() );
+                buf.append( attributeType.getOid() );
                 buf.append( '\n' );
             }
         }
 
         AttributeType[] may = dITContentRule.getMayNames();
+        
         if ( may != null && may.length > 0 )
         {
             buf.append( "MAY\n" );
-            for ( int ii = 0; ii < may.length; ii++ )
+            
+            for ( AttributeType attributeType:may )
             {
                 buf.append( '\t' );
-                buf.append( may[ii].getOid() );
+                buf.append( attributeType.getOid() );
                 buf.append( '\n' );
             }
         }
 
         AttributeType[] not = dITContentRule.getNotNames();
+        
         if ( not != null && not.length > 0 )
         {
             buf.append( "NOT\n" );
-            for ( int ii = 0; ii < not.length; ii++ )
+            
+            for ( AttributeType attributeType:not )
             {
                 buf.append( '\t' );
-                buf.append( not[ii].getOid() );
+                buf.append( attributeType.getOid() );
                 buf.append( '\n' );
             }
         }
@@ -270,6 +282,8 @@
      * @param matchingRule
      *            the MatchingRule to generate the description for
      * @return the MatchingRuleDescription string
+     * @throws NamingException If an error is raised while accessing some of the matchingRule
+     * data 
      */
     public static String getDescription( MatchingRule matchingRule ) throws NamingException
     {
@@ -331,6 +345,8 @@
      * @param matchingRuleUse The matching rule from which we want to generate
      *  a MatchingRuleUseDescription.
      * @return The generated MatchingRuleUseDescription
+     * @throws NamingException If an error is raised while accessing some of the matchingRuleUse
+     * data 
      */
     public static String getDescription( MatchingRuleUse matchingRuleUse ) throws NamingException
     {
@@ -400,6 +416,8 @@
      * @param nameForm
      *            the NameForm to generate the description for
      * @return the NameFormDescription string
+     * @throws NamingException If an error is raised while accessing some of the nameForm
+     * data 
      */
     public static String getDescription( NameForm nameForm ) throws NamingException
     {
@@ -430,21 +448,24 @@
 
         buf.append( "MUST\n" );
         AttributeType[] must = nameForm.getMustUse();
-        for ( int ii = 0; ii < must.length; ii++ )
+        
+        for ( AttributeType attributeType:must )
         {
             buf.append( '\t' );
-            buf.append( must[ii].getOid() );
+            buf.append( attributeType.getOid() );
             buf.append( '\n' );
         }
 
         AttributeType[] may = nameForm.getMayUse();
+
         if ( may != null && may.length > 0 )
         {
             buf.append( "MAY\n" );
-            for ( int ii = 0; ii < must.length; ii++ )
+        
+            for ( AttributeType attributeType:may )
             {
                 buf.append( '\t' );
-                buf.append( may[ii].getOid() );
+                buf.append( attributeType.getOid() );
                 buf.append( '\n' );
             }
         }
@@ -477,6 +498,8 @@
      * @param objectClass
      *            the ObjectClass to generate a description for
      * @return the description in the ObjectClassDescription syntax
+     * @throws NamingException If an error is raised while accessing some of the objectClass
+     * data 
      */
     public static String getDescription( ObjectClass objectClass ) throws NamingException
     {
@@ -502,13 +525,15 @@
         }
 
         ObjectClass[] sups = objectClass.getSuperClasses();
+
         if ( sups != null && sups.length > 0 )
         {
             buf.append( "SUP\n" );
-            for ( int ii = 0; ii < sups.length; ii++ )
+            
+            for ( ObjectClass sup:sups )
             {
                 buf.append( '\t' );
-                buf.append( sups[ii].getOid() );
+                buf.append( sup.getOid() );
                 buf.append( '\n' );
             }
         }
@@ -523,22 +548,25 @@
         if ( must != null && must.length > 0 )
         {
             buf.append( "MUST\n" );
-            for ( int ii = 0; ii < must.length; ii++ )
+            
+            for ( AttributeType attributeType:must )
             {
                 buf.append( '\t' );
-                buf.append( must[ii].getOid() );
+                buf.append( attributeType.getOid() );
                 buf.append( '\n' );
             }
         }
 
         AttributeType[] may = objectClass.getMayList();
+        
         if ( may != null && may.length > 0 )
         {
             buf.append( "MAY\n" );
-            for ( int ii = 0; ii < may.length; ii++ )
+
+            for ( AttributeType attributeType:may )
             {
                 buf.append( '\t' );
-                buf.append( may[ii].getOid() );
+                buf.append( attributeType.getOid() );
                 buf.append( '\n' );
             }
         }
@@ -568,6 +596,8 @@
      * @param dITStructureRule
      *            the DITStructureRule to generate the description for
      * @return the description in the DITStructureRuleDescription syntax
+     * @throws NamingException If an error is raised while accessing some of the dITStructureRule
+     * data 
      */
     public static String getDescription( DITStructureRule dITStructureRule ) throws NamingException
     {
@@ -600,10 +630,11 @@
         if ( sups != null && sups.length > 0 )
         {
             buf.append( "SUP\n" );
-            for ( int ii = 0; ii < sups.length; ii++ )
+            
+            for ( DITStructureRule sup:sups )
             {
                 buf.append( '\t' );
-                buf.append( sups[ii].getOid() );
+                buf.append( sup.getOid() );
                 buf.append( '\n' );
             }
         }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaObject.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaObject.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaObject.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaObject.java Sat May 17 05:08:30 2008
@@ -60,7 +60,7 @@
      * 
      * @return the names for this SchemaObject
      */
-    String[] getNames();
+    String[] getNamesRef();
 
 
     /**

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java Sat May 17 05:08:30 2008
@@ -420,10 +420,10 @@
         StringBuffer buf = new StringBuffer();
         buf.append( "( " ).append( oc.getOid() );
 
-        if ( oc.getNames() != null && oc.getNames().length > 0 )
+        if ( oc.getNamesRef() != null && oc.getNamesRef().length > 0 )
         {
             buf.append( " NAME " );
-            render( buf, oc.getNames() ).append( " " );
+            render( buf, oc.getNamesRef() ).append( " " );
         }
         else
         {
@@ -539,10 +539,10 @@
         StringBuffer buf = new StringBuffer();
         buf.append( "( " ).append( at.getOid() );
 
-        if ( at.getNames() != null && at.getNames().length > 0 )
+        if ( at.getNamesRef() != null && at.getNamesRef().length > 0 )
         {
             buf.append( " NAME " );
-            render( buf, at.getNames() ).append( " " );
+            render( buf, at.getNamesRef() ).append( " " );
         }
         else
         {
@@ -862,10 +862,10 @@
         StringBuffer buf = new StringBuffer();
         buf.append( "( " ).append( mr.getOid() );
 
-        if ( mr.getNames() != null && mr.getNames().length > 0 )
+        if ( mr.getNamesRef() != null && mr.getNamesRef().length > 0 )
         {
             buf.append( " NAME " );
-            render( buf, mr.getNames() ).append( " " );
+            render( buf, mr.getNamesRef() ).append( " " );
         }
         else
         {
@@ -961,7 +961,7 @@
     {
         StringBuffer buf = new StringBuffer();
         buf.append( "( " ).append( mru.getOid() ).append( " NAME " );
-        render( buf, mru.getNames() ).append( " " );
+        render( buf, mru.getNamesRef() ).append( " " );
 
         if ( mru.getDescription() != null )
         {
@@ -988,7 +988,7 @@
     {
         StringBuffer buf = new StringBuffer();
         buf.append( "( " ).append( dcr.getOid() ).append( " NAME " );
-        render( buf, dcr.getNames() ).append( " " );
+        render( buf, dcr.getNamesRef() ).append( " " );
 
         if ( dcr.getDescription() != null )
         {
@@ -1015,7 +1015,7 @@
     {
         StringBuffer buf = new StringBuffer();
         buf.append( "( " ).append( dsr.getOid() ).append( " NAME " );
-        render( buf, dsr.getNames() ).append( " " );
+        render( buf, dsr.getNamesRef() ).append( " " );
 
         if ( dsr.getDescription() != null )
         {
@@ -1037,7 +1037,7 @@
     {
         StringBuffer buf = new StringBuffer();
         buf.append( "( " ).append( nf.getOid() ).append( " NAME " );
-        render( buf, nf.getNames() ).append( " " );
+        render( buf, nf.getNamesRef() ).append( " " );
 
         if ( nf.getDescription() != null )
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java?rev=657335&r1=657334&r2=657335&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java Sat May 17 05:08:30 2008
@@ -63,7 +63,7 @@
         
         if ( attr == null )
         {
-            String[] aliases = type.getNames();
+            String[] aliases = type.getNamesRef();
             
             for ( String alias:aliases )
             {
@@ -246,9 +246,9 @@
         }
 
         // optimization bypass to avoid cost of the loop below
-        if ( type.getNames().length == 1 )
+        if ( type.getNamesRef().length == 1 )
         {
-            attr = attrs.get( type.getNames()[0] );
+            attr = attrs.get( type.getNamesRef()[0] );
             
             if ( attr != null )
             {
@@ -257,7 +257,7 @@
         }
         
         // iterate through aliases
-        for ( String alias:type.getNames() )
+        for ( String alias:type.getNamesRef() )
         {
             attr = attrs.get( alias );
             
@@ -281,11 +281,11 @@
     public static final ModificationItem getModificationItem( List<ModificationItemImpl> mods, AttributeType type )
     {
         // optimization bypass to avoid cost of the loop below
-        if ( type.getNames().length == 1 )
+        if ( type.getNamesRef().length == 1 )
         {
             for ( ModificationItem mod:mods )
             {
-                if ( mod.getAttribute().getID().equalsIgnoreCase( type.getNames()[0] ) )
+                if ( mod.getAttribute().getID().equalsIgnoreCase( type.getNamesRef()[0] ) )
                 {
                     return mod;
                 }
@@ -302,11 +302,11 @@
         }
         
         // iterate through aliases
-        for ( int ii = 0; ii < type.getNames().length; ii++ )
+        for ( int ii = 0; ii < type.getNamesRef().length; ii++ )
         {
             for ( ModificationItem mod:mods )
             {
-                if ( mod.getAttribute().getID().equalsIgnoreCase( type.getNames()[ii] ) )
+                if ( mod.getAttribute().getID().equalsIgnoreCase( type.getNamesRef()[ii] ) )
                 {
                     return mod;
                 }



Mime
View raw message