You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2010/07/05 01:25:39 UTC
svn commit: r960409 -
/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
Author: elecharny
Date: Sun Jul 4 23:25:39 2010
New Revision: 960409
URL: http://svn.apache.org/viewvc?rev=960409&view=rev
Log:
Minor cleanup, and removal of some useless cloning
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=960409&r1=960408&r2=960409&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java Sun Jul 4 23:25:39 2010
@@ -335,8 +335,7 @@ public class SubentryInterceptor extends
{
String subentryDnStr = list.next();
DN subentryDn = new DN( subentryDnStr );
- DN apDn = ( DN ) subentryDn.clone();
- apDn.remove( apDn.size() - 1 );
+ DN apDn = subentryDn.getParent();
Subentry subentry = subentryCache.getSubentry( subentryDnStr );
SubtreeSpecification ss = subentry.getSubtreeSpecification();
@@ -357,6 +356,7 @@ public class SubentryInterceptor extends
operational.add( subentryDn.getNormName() );
}
+
if ( subentry.isSchemaSubentry() )
{
operational = subentryAttrs.get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT );
@@ -370,6 +370,7 @@ public class SubentryInterceptor extends
operational.add( subentryDn.getNormName() );
}
+
if ( subentry.isCollectiveSubentry() )
{
operational = subentryAttrs.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
@@ -384,6 +385,7 @@ public class SubentryInterceptor extends
operational.add( subentryDn.getNormName() );
}
+
if ( subentry.isTriggerSubentry() )
{
operational = subentryAttrs.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT );
@@ -414,8 +416,7 @@ public class SubentryInterceptor extends
if ( objectClasses.contains( SchemaConstants.SUBENTRY_OC ) )
{
// get the name of the administrative point and its administrativeRole attributes
- DN apName = ( DN ) name.clone();
- apName.remove( name.size() - 1 );
+ DN apName = name.getParent();
Entry ap = addContext.lookup( apName, ByPassConstants.LOOKUP_BYPASS );
EntryAttribute administrativeRole = ap.get( "administrativeRole" );
@@ -435,7 +436,7 @@ public class SubentryInterceptor extends
*/
Subentry subentry = new Subentry();
subentry.setTypes( getSubentryTypes( entry ) );
- Entry operational = getSubentryOperatationalAttributes( name, subentry );
+ Entry operational = getSubentryOperationalAttributes( name, subentry );
/* ----------------------------------------------------------------
* Parse the subtreeSpecification of the subentry and add it to the
@@ -1169,7 +1170,7 @@ public class SubentryInterceptor extends
// search for all selected entries by the new SS and add references to subentry
Subentry subentry = subentryCache.getSubentry( dn.getNormName() );
- Entry operational = getSubentryOperatationalAttributes( dn, subentry );
+ Entry operational = getSubentryOperationalAttributes( dn, subentry );
DN newBaseDn = ( DN ) apName.clone();
newBaseDn.addAll( ssNew.getBase() );
@@ -1316,7 +1317,7 @@ public class SubentryInterceptor extends
* @param subentry the subentry to get attributes from
* @return the set of attributes to be added or removed from entries
*/
- private Entry getSubentryOperatationalAttributes( DN name, Subentry subentry ) throws LdapException
+ private Entry getSubentryOperationalAttributes( DN name, Subentry subentry ) throws LdapException
{
Entry operational = new DefaultEntry( schemaManager, name );