From commits-return-25612-apmail-directory-commits-archive=directory.apache.org@directory.apache.org Sun Apr 25 11:12:35 2010 Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 51040 invoked from network); 25 Apr 2010 11:12:35 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 25 Apr 2010 11:12:35 -0000 Received: (qmail 52260 invoked by uid 500); 25 Apr 2010 11:12:35 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 52203 invoked by uid 500); 25 Apr 2010 11:12:35 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 52196 invoked by uid 99); 25 Apr 2010 11:12:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Apr 2010 11:12:34 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Apr 2010 11:12:31 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 09F4323889DA; Sun, 25 Apr 2010 11:11:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r937777 - in /directory: apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ apacheds/trunk/core/src/main/java/org/apache/directory/... Date: Sun, 25 Apr 2010 11:11:47 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100425111148.09F4323889DA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: elecharny Date: Sun Apr 25 11:11:47 2010 New Revision: 937777 URL: http://svn.apache.org/viewvc?rev=937777&view=rev Log: Removed the useless toClientAttribute() method, we can use clone() instead Modified: directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultEntryAttributeTest.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntryAttribute.java directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultServerEntry.java directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java Modified: directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java?rev=937777&r1=937776&r2=937777&view=diff ============================================================================== --- directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java (original) +++ directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java Sun Apr 25 11:11:47 2010 @@ -413,7 +413,7 @@ public class ClonedServerEntry implement // Convert each attribute for ( EntryAttribute clonedEntry:this ) { - EntryAttribute clientAttribute = clonedEntry.toClientAttribute(); + EntryAttribute clientAttribute = clonedEntry.clone(); clientEntry.add( clientAttribute ); } @@ -775,7 +775,7 @@ public class ClonedServerEntry implement // Convert each attribute for ( EntryAttribute serverAttribute:this ) { - EntryAttribute clientAttribute = serverAttribute.toClientAttribute(); + EntryAttribute clientAttribute = serverAttribute.clone(); clientEntry.add( clientAttribute ); } Modified: directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultEntryAttributeTest.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultEntryAttributeTest.java?rev=937777&r1=937776&r2=937777&view=diff ============================================================================== --- directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultEntryAttributeTest.java (original) +++ directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultEntryAttributeTest.java Sun Apr 25 11:11:47 2010 @@ -2005,7 +2005,7 @@ public class DefaultEntryAttributeTest { EntryAttribute attribute = new DefaultEntryAttribute( atCN, "test", "test2" ); - EntryAttribute clientAttribute = attribute.toClientAttribute(); + EntryAttribute clientAttribute = attribute.clone(); assertTrue( clientAttribute instanceof EntryAttribute ); Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java?rev=937777&r1=937776&r2=937777&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java Sun Apr 25 11:11:47 2010 @@ -127,7 +127,7 @@ public class ChangeLogInterceptor extend for ( AttributeType attributeType:list ) { - forward.addAttribute( addEntry.get( attributeType).toClientAttribute() ); + forward.addAttribute( addEntry.get( attributeType).clone() ); } LdifEntry reverse = LdifRevertor.reverseAdd( opContext.getDn() ); @@ -175,7 +175,7 @@ public class ChangeLogInterceptor extend AttributeType at = schemaService.getSchemaManager().getAttributeTypeRegistry().lookup( attribute.getId() ); if ( !at.isCollective() ) { - reverseEntry.add( attribute.toClientAttribute() ); + reverseEntry.add( attribute.clone() ); } } @@ -275,7 +275,7 @@ public class ChangeLogInterceptor extend for ( EntryAttribute attribute:serverEntry ) { - clientEntry.add( attribute.toClientAttribute() ); + clientEntry.add( attribute.clone() ); } LdifEntry reverse = LdifRevertor.reverseModify( Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java?rev=937777&r1=937776&r2=937777&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java Sun Apr 25 11:11:47 2010 @@ -117,7 +117,7 @@ public class JournalInterceptor extends for ( AttributeType attributeType:list ) { - ldif.addAttribute( addEntry.get( attributeType).toClientAttribute() ); + ldif.addAttribute( addEntry.get( attributeType).clone() ); } log( opRevision, ldif ); Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntryAttribute.java URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntryAttribute.java?rev=937777&r1=937776&r2=937777&view=diff ============================================================================== --- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntryAttribute.java (original) +++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntryAttribute.java Sun Apr 25 11:11:47 2010 @@ -2162,37 +2162,6 @@ public class DefaultEntryAttribute imple return normId.equalsIgnoreCase( attributeType.getOid() ); } - - /** - * Convert the ServerAttribute to a ClientAttribute - * - * @return An instance of ClientAttribute - */ - public EntryAttribute toClientAttribute() - { - // Create the new EntryAttribute - EntryAttribute clientAttribute = new DefaultEntryAttribute( upId ); - - // Copy the values - for ( Value value:this ) - { - Value clientValue = null; - - if ( value instanceof StringValue ) - { - clientValue = new StringValue( value.getString() ); - } - else - { - clientValue = new BinaryValue( value.getBytes() ); - } - - clientAttribute.add( clientValue ); - } - - return clientAttribute; - } - //------------------------------------------------------------------------- // Overloaded Object classes @@ -2313,6 +2282,7 @@ public class DefaultEntryAttribute imple try { DefaultEntryAttribute attribute = (DefaultEntryAttribute)super.clone(); + attribute.setUpId( upId ); attribute.values = new LinkedHashSet>( values.size() ); Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultServerEntry.java URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultServerEntry.java?rev=937777&r1=937776&r2=937777&view=diff ============================================================================== --- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultServerEntry.java (original) +++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultServerEntry.java Sun Apr 25 11:11:47 2010 @@ -2240,7 +2240,7 @@ public final class DefaultServerEntry ex // Convert each attribute for ( EntryAttribute serverAttribute:this ) { - EntryAttribute clientAttribute = serverAttribute.toClientAttribute(); + EntryAttribute clientAttribute = serverAttribute.clone(); clientEntry.add( clientAttribute ); } Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java?rev=937777&r1=937776&r2=937777&view=diff ============================================================================== --- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java (original) +++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java Sun Apr 25 11:11:47 2010 @@ -22,7 +22,6 @@ import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInput; import java.util.Iterator; -import java.util.List; import org.apache.directory.shared.ldap.exception.LdapException; import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException; @@ -567,12 +566,4 @@ public interface EntryAttribute extends * @throws LdapException if there is a failure to check syntaxes of values */ boolean isValid( SyntaxChecker checker) throws LdapException; - - - /** - * Convert the ServerAttribute to a ClientAttribute - * - * @return An instance of ClientAttribute - */ - EntryAttribute toClientAttribute(); }