directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1226753 - /directory/shared/branches/shared-txns/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java
Date Tue, 03 Jan 2012 12:28:00 GMT
Author: elecharny
Date: Tue Jan  3 12:27:59 2012
New Revision: 1226753

URL: http://svn.apache.org/viewvc?rev=1226753&view=rev
Log:
Throw a LdapNoSuchAttributeException when an AT is null for an entry

Modified:
    directory/shared/branches/shared-txns/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java

Modified: directory/shared/branches/shared-txns/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-txns/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java?rev=1226753&r1=1226752&r2=1226753&view=diff
==============================================================================
--- directory/shared/branches/shared-txns/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java
(original)
+++ directory/shared/branches/shared-txns/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java
Tue Jan  3 12:27:59 2012
@@ -35,6 +35,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.exception.LdapInvalidAttributeValueException;
 import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
+import org.apache.directory.shared.ldap.model.exception.LdapNoSuchAttributeException;
 import org.apache.directory.shared.ldap.model.ldif.LdapLdifException;
 import org.apache.directory.shared.ldap.model.ldif.LdifAttributesReader;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
@@ -1060,6 +1061,13 @@ public final class DefaultEntry implemen
             {
                 String id = attribute.getId();
                 AttributeType attributeType = schemaManager.getAttributeType( attribute.getId()
);
+
+                if ( attributeType == null )
+                {
+                    throw new LdapNoSuchAttributeException( "The AttributeType '" + attribute.getId()
+                        + "' is unkown" );
+                }
+
                 attribute.apply( attributeType );
                 updatedAttributes.put( id, attribute );
             }



Mime
View raw message