directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1088819 - in /directory: apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultAttribute.java
Date Mon, 04 Apr 2011 23:15:03 GMT
Author: elecharny
Date: Mon Apr  4 23:15:03 2011
New Revision: 1088819

URL: http://svn.apache.org/viewvc?rev=1088819&view=rev
Log:
o Fixed an issue in the Attribute.apply( AttributeType ) : the values weren't copied into
a new Set, so the hashCode weren't modified, leading to some failing Attribute.contains( ...
) calls.
o Using the clone() method instead of a local createNewAttribute()

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultAttribute.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=1088819&r1=1088818&r2=1088819&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
Mon Apr  4 23:15:03 2011
@@ -54,11 +54,11 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.cursor.EmptyCursor;
 import org.apache.directory.shared.ldap.model.cursor.SingletonCursor;
+import org.apache.directory.shared.ldap.model.entry.Attribute;
 import org.apache.directory.shared.ldap.model.entry.BinaryValue;
 import org.apache.directory.shared.ldap.model.entry.DefaultAttribute;
 import org.apache.directory.shared.ldap.model.entry.DefaultModification;
 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.Modification;
 import org.apache.directory.shared.ldap.model.entry.StringValue;
 import org.apache.directory.shared.ldap.model.entry.Value;
@@ -1066,7 +1066,7 @@ public class SchemaInterceptor extends B
                         // We don't check if the attribute is not in the MUST or MAY at this
                         // point, as one of the following modification can change the
                         // ObjectClasses.
-                        Attribute newAttribute = createNewAttribute( attribute );
+                        Attribute newAttribute = attribute.clone();
                         
                         // Check that the attribute allows null values if we don'y have any
value
                         if ( ( newAttribute.size() == 0 ) && !newAttribute.isValid(
attributeType.getSyntax().getSyntaxChecker() ) )

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultAttribute.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultAttribute.java?rev=1088819&r1=1088818&r2=1088819&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultAttribute.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultAttribute.java
Mon Apr  4 23:15:03 2011
@@ -1720,10 +1720,15 @@ public class DefaultAttribute implements
         
         if ( values != null )
         {
+            Set<Value<?>> newValues = new LinkedHashSet<Value<?>>(
values.size() );
+
             for ( Value<?> value : values )
             {
                 value.apply( attributeType );
+                newValues.add( value );
             }
+            
+            values = newValues;
         }
         
         isHR = attributeType.getSyntax().isHumanReadable();



Mime
View raw message