Author: elecharny Date: Mon Dec 10 16:02:30 2012 New Revision: 1419545 URL: http://svn.apache.org/viewvc?rev=1419545&view=rev Log: Replaced the Boolean fields, now using simple boolean : we don't need to check for the existence of those elements. Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/entry/ServerEntryUtils.java directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/FilteringOperationContext.java directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/entry/ServerEntryUtils.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/entry/ServerEntryUtils.java?rev=1419545&r1=1419544&r2=1419545&view=diff ============================================================================== --- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/entry/ServerEntryUtils.java (original) +++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/entry/ServerEntryUtils.java Mon Dec 10 16:02:30 2012 @@ -743,7 +743,7 @@ public class ServerEntryUtils boolean typesOnly = operationContext.isTypesOnly(); boolean returnAll = ( operationContext.getReturningAttributes() == null || - ( operationContext.hasAllOperationalAttributes() && operationContext.hasAllUserAttributes() ) ) + ( operationContext.isAllOperationalAttributes() && operationContext.isAllUserAttributes() ) ) && ( !typesOnly ); if ( returnAll ) @@ -764,7 +764,7 @@ public class ServerEntryUtils return; } - if ( operationContext.hasAllUserAttributes() ) + if ( operationContext.isAllUserAttributes() ) { for ( Attribute attribute : originalEntry.getAttributes() ) { @@ -796,7 +796,7 @@ public class ServerEntryUtils return; } - if ( operationContext.hasAllOperationalAttributes() ) + if ( operationContext.isAllOperationalAttributes() ) { for ( Attribute attribute : originalEntry.getAttributes() ) { Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/FilteringOperationContext.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/FilteringOperationContext.java?rev=1419545&r1=1419544&r2=1419545&view=diff ============================================================================== --- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/FilteringOperationContext.java (original) +++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/FilteringOperationContext.java Mon Dec 10 16:02:30 2012 @@ -60,16 +60,16 @@ public abstract class FilteringOperation protected String[] returningAttributesString; /** A flag set to true if the user has requested all the operational attributes ( "+" )*/ - private Boolean allOperationalAttributes; + private boolean allOperationalAttributes; /** A flag set to true if the user has requested all the user attributes ( "*" ) */ - private Boolean allUserAttributes; + private boolean allUserAttributes; /** A flag set to true if the user has requested no attribute to be returned (1.1) */ - private Boolean noAttributes; + private boolean noAttributes; /** A flag to tell if only the attribute names to be returned. */ - protected Boolean typesOnly = false; + protected boolean typesOnly = false; /** @@ -429,18 +429,9 @@ public abstract class FilteringOperation /** * @return The flag telling if the "*" attribute has been used */ - public boolean hasAllUserAttributes() - { - return ( allUserAttributes != null ); - } - - - /** - * @return The flag telling if the "*" attribute has been used - */ public boolean isAllUserAttributes() { - return ( allUserAttributes != null ) && allUserAttributes; + return allUserAttributes; } @@ -456,27 +447,9 @@ public abstract class FilteringOperation /** * @return The flag telling if the "+" attribute has been used */ - public boolean hasAllOperationalAttributes() - { - return ( allOperationalAttributes != null ); - } - - - /** - * @return The flag telling if the "+" attribute has been used - */ public boolean isAllOperationalAttributes() { - return ( allOperationalAttributes != null ) && allOperationalAttributes; - } - - - /** - * @return The flag telling if the "1.1" attribute has been used - */ - public boolean hasNoAttributes() - { - return ( noAttributes != null ); + return allOperationalAttributes; } @@ -485,7 +458,7 @@ public abstract class FilteringOperation */ public boolean isNoAttributes() { - return ( noAttributes != null ) && ( noAttributes ); + return noAttributes; } @@ -531,17 +504,17 @@ public abstract class FilteringOperation sb.append( ", type only" ); } - if ( hasAllOperationalAttributes() ) + if ( allOperationalAttributes ) { sb.append( ", +" ); } - if ( hasAllUserAttributes() ) + if ( allUserAttributes ) { sb.append( ", *" ); } - if ( isNoAttributes() ) + if ( noAttributes ) { sb.append( ", 1.1" ); } Modified: directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java?rev=1419545&r1=1419544&r2=1419545&view=diff ============================================================================== --- directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java (original) +++ directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java Mon Dec 10 16:02:30 2012 @@ -678,8 +678,8 @@ public class DefaultPartitionNexus exten // ----------------------------------------------------------- Set realIds = new HashSet(); - boolean allUserAttributes = searchContext.hasAllUserAttributes(); - boolean allOperationalAttributes = searchContext.hasAllOperationalAttributes(); + boolean allUserAttributes = searchContext.isAllUserAttributes(); + boolean allOperationalAttributes = searchContext.isAllOperationalAttributes(); boolean noAttribute = searchContext.isNoAttributes(); for ( AttributeTypeOptions id : ids ) Modified: directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=1419545&r1=1419544&r2=1419545&view=diff ============================================================================== --- directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java (original) +++ directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java Mon Dec 10 16:02:30 2012 @@ -524,7 +524,7 @@ public class OperationalAttributeInterce { EntryFilteringCursor cursor = next( searchContext ); - if ( searchContext.hasAllOperationalAttributes() + if ( searchContext.isAllOperationalAttributes() || ( searchContext.getReturningAttributes() != null && !searchContext.getReturningAttributes().isEmpty() ) ) { if ( directoryService.isDenormalizeOpAttrsEnabled() )