directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1748296 - /directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultAttribute.java
Date Mon, 13 Jun 2016 18:19:26 GMT
Author: elecharny
Date: Mon Jun 13 18:19:26 2016
New Revision: 1748296

URL: http://svn.apache.org/viewvc?rev=1748296&view=rev
Log:
Slight optimisation : no need to create a new Value if it's already SchemaAware

Modified:
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultAttribute.java

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultAttribute.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultAttribute.java?rev=1748296&r1=1748295&r2=1748296&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultAttribute.java
(original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultAttribute.java
Mon Jun 13 18:19:26 2016
@@ -1801,13 +1801,20 @@ public class DefaultAttribute implements
 
             for ( Value value : values )
             {
-                if ( value.isHumanReadable() )
+                if ( value.isSchemaAware() )
                 {
-                    newValues.add( new Value( attributeType, value.getValue() ) );
+                    newValues.add( value );
                 }
                 else
                 {
-                    newValues.add( new Value( attributeType, value.getBytes() ) );
+                    if ( value.isHumanReadable() )
+                    {
+                        newValues.add( new Value( attributeType, value.getValue() ) );
+                    }
+                    else
+                    {
+                        newValues.add( new Value( attributeType, value.getBytes() ) );
+                    }
                 }
             }
 



Mime
View raw message