directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1537826 - /directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/AddOperationContext.java
Date Fri, 01 Nov 2013 05:20:11 GMT
Author: elecharny
Date: Fri Nov  1 05:20:10 2013
New Revision: 1537826

URL: http://svn.apache.org/r1537826
Log:
No need to create a new DefaultEntry when the addEntry is already schema aware. This save
a lot not doing so.

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/AddOperationContext.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/AddOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/AddOperationContext.java?rev=1537826&r1=1537825&r2=1537826&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/AddOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/AddOperationContext.java
Fri Nov  1 05:20:10 2013
@@ -124,8 +124,18 @@ public class AddOperationContext extends
             throw new LdapOperationErrorException( "No session to proceed the operation"
);
         }
 
-        entry = new ClonedServerEntry(
-            new DefaultEntry( session.getDirectoryService().getSchemaManager(), addRequest.getEntry()
) );
+        Entry addEntry = addRequest.getEntry();
+
+        if ( addEntry.isSchemaAware() )
+        {
+            entry = new ClonedServerEntry( addEntry );
+        }
+        else
+        {
+            entry = new ClonedServerEntry(
+                new DefaultEntry( session.getDirectoryService().getSchemaManager(), addRequest.getEntry()
) );
+        }
+
         dn = addRequest.getEntry().getDn();
         requestControls = addRequest.getControls();
 



Mime
View raw message