cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: [PATCH][EXCALIBUR] ComponentManager.release() have bug?
Date Wed, 20 Jun 2001 17:04:32 GMT
Vadim Gritsenko wrote:
> 
> Hello,
> 
> I think I found something which looks like bug in Excalibur code,
> in ExcaliburComponentManager. This was hard to track down, but here it is...
> 
> In lookup(), if handler is not there it goes to parent component manager.
> But in release(), it does not releases components to parent. Is it a bug or not?

This is a bug.  Thank you for finding it.  I have patched the Avalon source code.

> 
> Code snippet:
> --------------------------------
>     public void release(Component component)
>     {
>         if(null == component)
>             return;
>         ComponentHandler handler = (ComponentHandler)m_componentMapping.get(component);
> 
>         if(null != handler){
>             try{
>                 handler.put(component);
>             }catch(Exception e){
>                 getLogger().debug("Error trying to release component.", e);
>             }
>             m_componentMapping.remove(component);
>         }
>     }
> --------------------------------
> Suggested fix:
> --------------------------------
>     public void release(Component component)
>     {
>         if(null == component)
>             return;
>         ComponentHandler handler = (ComponentHandler)m_componentMapping.get(component);
> 
>         if(null != handler){
>             try{
>                 handler.put(component);
>             }catch(Exception e){
>                 getLogger().debug("Error trying to release component.", e);
>             }
>             m_componentMapping.remove(component);
>         }else if(m_parentManager != null){
>                 m_parentManager.release(component);
>         }
>     }
> --------------------------------
> 
> Thanks,
> Vadim
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
Mime
View raw message