You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2004/10/08 07:57:08 UTC
svn commit: rev 54051 - incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/schema
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;
}