directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r949898 - /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java
Date Mon, 31 May 2010 23:44:18 GMT
Author: elecharny
Date: Mon May 31 23:44:17 2010
New Revision: 949898

URL: http://svn.apache.org/viewvc?rev=949898&view=rev
Log:
Fixed the toString() method which was dumping twice the ObjectClass values

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java?rev=949898&r1=949897&r2=949898&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java
Mon May 31 23:44:17 2010
@@ -2955,10 +2955,34 @@ public class DefaultEntry implements Ent
                 if ( attribute.getAttributeType() != OBJECT_CLASS_AT )
                 {
                     sb.append( attribute );
+                    continue;
                 }
-                else if ( !attribute.getId().equalsIgnoreCase( "objectclass" ) )
+
+                String id = attribute.getId();
+
+                if ( schemaManager != null )
                 {
-                    sb.append( attribute );
+                    try
+                    {
+                        AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry(
id );
+
+                        if ( attributeType != OBJECT_CLASS_AT )
+                        {
+                            sb.append( attribute );
+                        }
+                    }
+                    catch ( LdapException le )
+                    {
+                        // Not found...
+                    }
+                }
+                else
+                {
+                    if ( !SchemaConstants.OBJECT_CLASS_AT.equalsIgnoreCase( id )
+                        && !SchemaConstants.OBJECT_CLASS_AT_OID.equalsIgnoreCase(
id ) )
+                    {
+                        sb.append( attribute );
+                    }
                 }
             }
         }



Mime
View raw message