You have a good point. I'm happy to apply any patches that
address it.

cheers,

- Leo

> -----Oorspronkelijk bericht-----
> Van: Stefano Mazzocchi [mailto:[EMAIL PROTECTED]]
> Verzonden: Tuesday, April 09, 2002 7:46 PM
> Aan: Apache Avalon
> CC: Apache Cocoon
> Onderwerp: Inefficiencies in DefaultConfiguration
> 
> 
> Please look here (AbstractConfiguration)
> 
>     public String getValue( final String defaultValue )
>     {
>         try
>         {
>             return getValue();
>         }
>         catch( final ConfigurationException ce )
>         {
>             return defaultValue;
>         }
>     }
> 
> then look here
> 
>     public String getValue() throws ConfigurationException
>     {
>         if( null != m_value )
>         {
>             return m_value;
>         }
>         else
>         {
>             throw new ConfigurationException( "No value is associated
> with the "+
>                                               "configuration element \""
> + getName() +
>                                               "\" at " + getLocation()
> );
>         }
>     }
> 
> Can somebody tell me why we have to:
> 
>  1) create three strings
>  2) call two methods
>  3) create an exception object
>  4) throw the exception
>  5) and then throw everything away.
> 
> in order to resort to the default value?
> 
> I understand that getValue() doesn't return null, but this seems utterly
> inefficient to me.
> 
> Considering that Cocoon calls this method "a lot" no wonder why Cocoon
> startup is slow as hell.
> 
> -- 
> Stefano Mazzocchi      One must still have chaos in oneself to be
>                           able to give birth to a dancing star.
> <[EMAIL PROTECTED]>                             Friedrich Nietzsche
> --------------------------------------------------------------------
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to