Return-Path: Delivered-To: apmail-jakarta-avalon-cvs-archive@apache.org Received: (qmail 63114 invoked from network); 7 Feb 2002 22:06:57 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 7 Feb 2002 22:06:57 -0000 Received: (qmail 5041 invoked by uid 97); 7 Feb 2002 22:07:02 -0000 Delivered-To: qmlist-jakarta-archive-avalon-cvs@jakarta.apache.org Received: (qmail 5024 invoked by uid 97); 7 Feb 2002 22:07:02 -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 5013 invoked by uid 97); 7 Feb 2002 22:07:01 -0000 Date: 7 Feb 2002 22:06:54 -0000 Message-ID: <20020207220654.37736.qmail@icarus.apache.org> From: bloritsch@apache.org To: jakarta-avalon-excalibur-cvs@apache.org Subject: cvs commit: jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/system AbstractContainer.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 bloritsch 02/02/07 14:06:54 Modified: src/scratchpad/org/apache/avalon/excalibur/system AbstractContainer.java Log: fix nullpointerexception Revision Changes Path 1.16 +15 -15 jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/system/AbstractContainer.java Index: AbstractContainer.java =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/system/AbstractContainer.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- AbstractContainer.java 7 Feb 2002 21:58:19 -0000 1.15 +++ AbstractContainer.java 7 Feb 2002 22:06:54 -0000 1.16 @@ -36,7 +36,7 @@ * Manager can expose that to the instantiating class. * * @author Berin Loritsch - * @version CVS $Revision: 1.15 $ $Date: 2002/02/07 21:58:19 $ + * @version CVS $Revision: 1.16 $ $Date: 2002/02/07 22:06:54 $ */ public abstract class AbstractContainer extends AbstractLogEnabled @@ -440,7 +440,7 @@ */ public ContainerComponentManager( Map componentMap, ComponentManager parent ) { - m_parent = null; + m_parent = parent; m_components = componentMap; m_used = new HashMap( m_components.size() ); } @@ -450,19 +450,7 @@ { Object temp = m_components.get( role ); - if ( temp instanceof ComponentSelector ) - { - return (ComponentSelector) temp; - } - - if ( ! ( temp instanceof ComponentHandler ) ) - { - throw new ComponentException( "Invalid entry in component manager: " + temp ); - } - - ComponentHandler handler = (ComponentHandler) temp; - - if ( null == handler ) + if ( null == temp ) { if ( null != m_parent ) { @@ -473,6 +461,18 @@ throw new ComponentException( "The role does not exist in the ComponentManager" ); } } + + if ( temp instanceof ComponentSelector ) + { + return (ComponentSelector) temp; + } + + if ( ! ( temp instanceof ComponentHandler ) ) + { + throw new ComponentException( "Invalid entry in component manager" ); + } + + ComponentHandler handler = (ComponentHandler) temp; final Component component; -- To unsubscribe, e-mail: For additional commands, e-mail: