Return-Path: Delivered-To: apmail-jakarta-avalon-cvs-archive@apache.org Received: (qmail 18219 invoked from network); 7 Jun 2002 02:22:23 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 7 Jun 2002 02:22:23 -0000 Received: (qmail 21519 invoked by uid 97); 7 Jun 2002 02:22:32 -0000 Delivered-To: qmlist-jakarta-archive-avalon-cvs@jakarta.apache.org Received: (qmail 21477 invoked by uid 97); 7 Jun 2002 02:22:31 -0000 Mailing-List: contact avalon-cvs-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon CVS List" Reply-To: "Avalon Developers List" Delivered-To: mailing list avalon-cvs@jakarta.apache.org Received: (qmail 21464 invoked by uid 97); 7 Jun 2002 02:22:31 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 7 Jun 2002 02:22:18 -0000 Message-ID: <20020607022218.3774.qmail@icarus.apache.org> From: mcconnell@apache.org To: jakarta-avalon-excalibur-cvs@apache.org Subject: cvs commit: jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo ComponentDescriptor.java ComponentInfo.java DependencyDescriptor.java ServiceDescriptor.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N mcconnell 2002/06/06 19:22:18 Modified: containerkit/src/java/org/apache/excalibur/containerkit/metainfo ComponentDescriptor.java ComponentInfo.java DependencyDescriptor.java ServiceDescriptor.java Log: updated source to always return an emumeration (eliminated the null return value) Revision Changes Path 1.7 +3 -3 jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ComponentDescriptor.java Index: ComponentDescriptor.java =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ComponentDescriptor.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- ComponentDescriptor.java 7 Jun 2002 01:47:40 -0000 1.6 +++ ComponentDescriptor.java 7 Jun 2002 02:22:17 -0000 1.7 @@ -50,7 +50,7 @@ * * * @author Peter Donald - * @version $Revision: 1.6 $ $Date: 2002/06/07 01:47:40 $ + * @version $Revision: 1.7 $ $Date: 2002/06/07 02:22:17 $ */ public final class ComponentDescriptor { @@ -173,13 +173,13 @@ * Returns the set of attribute names available under this descriptor. * * @return Enumeration an enumeration of the properties names held by the - * descriptor. If not properties are defined, a null is returned. + * descriptor. */ public Enumeration getAttributeNames() { if( null == m_attributes ) { - return null; + return ComponentInfo.EMPTY_ENUMERATION; } else { 1.3 +32 -1 jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ComponentInfo.java Index: ComponentInfo.java =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ComponentInfo.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ComponentInfo.java 4 Jun 2002 07:46:29 -0000 1.2 +++ ComponentInfo.java 7 Jun 2002 02:22:17 -0000 1.3 @@ -7,6 +7,9 @@ */ package org.apache.excalibur.containerkit.metainfo; +import java.util.Enumeration; + + /** * This class contains the meta information about a particular * component type. It describes; @@ -20,10 +23,16 @@ * * * @author Peter Donald - * @version $Revision: 1.2 $ $Date: 2002/06/04 07:46:29 $ + * @version $Revision: 1.3 $ $Date: 2002/06/07 02:22:17 $ */ public class ComponentInfo { + + /** + * Intrernal utility referecne holding a static empty enumeration. + */ + static final EmptyEnumeration EMPTY_ENUMERATION = new EmptyEnumeration(); + private final ComponentDescriptor m_descriptor; private final ServiceDescriptor[] m_services; private final DependencyDescriptor[] m_dependencies; @@ -89,5 +98,27 @@ } return null; + } + + private static final class EmptyEnumeration implements Enumeration + { + /** + * Always returns the FALSE value. + * @return FALSE + */ + public boolean hasMoreElements() + { + return false; + } + + /** + * Reeturns the next object in the enumeration. The impementation alway + * returns null. + * @return a null value. + */ + public Object nextElement() + { + return null; + } } } 1.6 +3 -3 jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/DependencyDescriptor.java Index: DependencyDescriptor.java =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/DependencyDescriptor.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- DependencyDescriptor.java 7 Jun 2002 01:47:40 -0000 1.5 +++ DependencyDescriptor.java 7 Jun 2002 02:22:17 -0000 1.6 @@ -33,7 +33,7 @@ * demands.

* * @author Peter Donald - * @version $Revision: 1.5 $ $Date: 2002/06/07 01:47:40 $ + * @version $Revision: 1.6 $ $Date: 2002/06/07 02:22:17 $ */ public final class DependencyDescriptor { @@ -134,13 +134,13 @@ * Returns the set of attribute names available under this descriptor. * * @return Enumeration an enumeration of the properties names held by the - * descriptor. If not properties are defined, a null is returned. + * descriptor. */ public Enumeration getAttributeNames() { if( null == m_attributes ) { - return null; + return ComponentInfo.EMPTY_ENUMERATION; } else { 1.7 +3 -3 jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ServiceDescriptor.java Index: ServiceDescriptor.java =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ServiceDescriptor.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- ServiceDescriptor.java 7 Jun 2002 01:47:40 -0000 1.6 +++ ServiceDescriptor.java 7 Jun 2002 02:22:17 -0000 1.7 @@ -30,7 +30,7 @@ * upon to work in all containers.

* * @author Peter Donald - * @version $Revision: 1.6 $ $Date: 2002/06/07 01:47:40 $ + * @version $Revision: 1.7 $ $Date: 2002/06/07 02:22:17 $ */ public final class ServiceDescriptor extends AbstractServiceDescriptor { @@ -104,13 +104,13 @@ * Returns the set of attribute names available under this descriptor. * * @return Enumeration an enumeration of the properties names held by the - * descriptor. If not properties are defined, a null is returned. + * descriptor. */ public Enumeration getAttributeNames() { if( null == m_attributes ) { - return null; + return ComponentInfo.EMPTY_ENUMERATION; } else { -- To unsubscribe, e-mail: For additional commands, e-mail: