Return-Path: Delivered-To: apmail-incubator-directory-cvs-archive@www.apache.org Received: (qmail 10207 invoked from network); 8 Oct 2004 05:57:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 8 Oct 2004 05:57:11 -0000 Received: (qmail 79080 invoked by uid 500); 8 Oct 2004 05:57:10 -0000 Delivered-To: apmail-incubator-directory-cvs-archive@incubator.apache.org Received: (qmail 79030 invoked by uid 500); 8 Oct 2004 05:57:10 -0000 Mailing-List: contact directory-cvs-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: directory-dev@incubator.apache.org Delivered-To: mailing list directory-cvs@incubator.apache.org Received: (qmail 79017 invoked by uid 99); 8 Oct 2004 05:57:10 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Thu, 07 Oct 2004 22:57:10 -0700 Received: (qmail 10140 invoked by uid 65534); 8 Oct 2004 05:57:08 -0000 Date: 8 Oct 2004 05:57:08 -0000 Message-ID: <20041008055708.10138.qmail@minotaur.apache.org> From: akarasulu@apache.org To: directory-cvs@incubator.apache.org Subject: svn commit: rev 54051 - incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/schema X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: akarasulu Date: Thu Oct 7 22:57:08 2004 New Revision: 54051 Modified: incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/schema/BaseAttributeType.java Log: reverted to using an array internally - it was easier Modified: incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/schema/BaseAttributeType.java ============================================================================== --- incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/schema/BaseAttributeType.java (original) +++ incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/schema/BaseAttributeType.java Thu Oct 7 22:57:08 2004 @@ -17,11 +17,8 @@ package org.apache.ldap.common.schema; -import java.util.ArrayList; import java.io.Serializable; -import org.apache.ldap.common.util.ArrayUtils; - /** * Attribute specification bean used to store the schema information for an @@ -40,10 +37,8 @@ private final String oid; /** the optional superior attributeType */ private AttributeType superior; - /** a list of names for this attribute of this type */ - private ArrayList nameList = new ArrayList(); - /** cache the names as an array */ - private transient String[] nameArray; + /** names for this attribute of this type */ + private String[] nameArray; /** the optional description for this attributeType*/ private String descption; /** the equality matching rule for this attributeType */ @@ -97,23 +92,22 @@ public String getName() { - return ( String ) nameList.get( 0 ); - } - - - public String[] getAllNames() - { - if ( nameList.isEmpty() ) + if ( nameArray == null ) { - return ArrayUtils.EMPTY_STRING_ARRAY; + return null; } - if ( nameArray != null ) + if ( nameArray.length == 0 ) { - return nameArray; + return null; } - nameArray = ( String[] ) nameList.toArray( ArrayUtils.EMPTY_STRING_ARRAY ); + return ( String ) nameArray[0]; + } + + + public String[] getAllNames() + { return nameArray; } @@ -212,10 +206,9 @@ } - protected void setNameList( ArrayList nameList ) + protected void setNames( String[] names ) { - this.nameList = nameList; - this.nameArray = null; + this.nameArray = names; }