incubator-projects mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niclas Hedhman <nic...@hedhman.org>
Subject Re: [FTPServer] configuration
Date Tue, 10 Aug 2004 12:32:28 GMT
On Tuesday 10 August 2004 20:10, peter royal wrote:
> On Aug 10, 2004, at 9:07 AM, Paul Hammant wrote:
> > Because of the potential for NPE. This can bappen using Configuration
> > from Avalom-Framework
>
> there won't be an NPE with the construct he proposed.
> Configuration.getChild() will synthesize the child configuration if it
> does not exist.

Actually not. false is saying "don't do that".

The snippet below can more easily be written as;

mbCreateHome = conf.getChild( "create-user-home" ).getValueAsBoolean( false );

And, no NPE nor ConfigurationException will be thrown.


Cheers
Niclas

> >> Good day.
> >>
> >>        // get autometic user home creation flag
> >>        mbCreateHome = false;
> >>        tmpConf = conf.getChild("create-user-home", false);
> >>        if(tmpConf != null) {
> >>            mbCreateHome = tmpConf.getValueAsBoolean(mbCreateHome);
> >>        }
> >>
> >> Why not use such construction?:
> >>
> >> mbCreateHome =
> >> conf.getChild("create-user-home").getValueAsBoolean(false);
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: projects-unsubscribe@incubator.apache.org
> > For additional commands, e-mail: projects-help@incubator.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: projects-unsubscribe@incubator.apache.org
> For additional commands, e-mail: projects-help@incubator.apache.org

-- 
   +------//-------------------+
  / http://www.bali.ac        /
 / http://niclas.hedhman.org / 
+------//-------------------+


---------------------------------------------------------------------
To unsubscribe, e-mail: projects-unsubscribe@incubator.apache.org
For additional commands, e-mail: projects-help@incubator.apache.org


Mime
View raw message