commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henning P. Schmiedehausen" <>
Subject [CONFIGURATION] Semantics change in 1.0-rc1
Date Thu, 26 Aug 2004 14:20:23 GMT

for a long time, doing this:

--- cut ---
import org.apache.commons.configuration.Configuration;

Configuration conf = Turbine.getConfiguration();
String foo = conf.getString("does.not.exist");
--- cut ---

resulted in foo containing null. Somewhere between a random
snapshot and the 1.0-rc release, this changed. Now I get

java.util.NoSuchElementException: 'does.not.exist' doesn't map to an existing object
        at ...

which is bad and upsets a lot of software that uses get<XXX>("property")
as a short-cut for get<XXX>("property", null).

I am all for restoring the original behaviour; i.e. returning null
instead of throwing an exception.


Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH        +49 9131 50 654 0

RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
   Linux, Java, perl, Solaris -- Consulting, Training, Development

"Fighting for one's political stand is an honorable action, but re-
 fusing to acknowledge that there might be weaknesses in one's
 position - in order to identify them so that they can be remedied -
 is a large enough problem with the Open Source movement that it
 deserves to be on this list of the top five problems."
                       -- Michelle Levesque, "Fundamental Issues with
                                    Open Source Software Development"

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message