Hi,

The javadocs for Configuration state:

  "The contract surrounding the Configuration is that once it is
  created, information never changes."

There are two variants of getChild:

Configuration getChild(java.lang.String child)
Configuration getChild(java.lang.String child, boolean createNew);

Now I'm wondering, what's the "createNew" attribute for? Why would you
want to create a new Configuration, when you can't do anything with it
(it's read-only).

Even more surprising is that for the single arg version, "createNew" is
true. So getChild("foo") won't return null even if no child "foo"
exists. I suppose this prevents inadvertent NPEs, but also prevents
useful tests like:

if (conf.getChild("foo") != null) {
        // ..
}

Is there a reason for returning an empty child Configuration, or is this
a bug?


--Jeff

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

Reply via email to