commons-dev mailing list archives

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

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.

	Regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message