You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Oliver Heger (JIRA)" <ji...@apache.org> on 2016/03/24 21:13:26 UTC
[jira] [Updated] (CONFIGURATION-78) Inconsistent handling for keys
that don't exist
[ https://issues.apache.org/jira/browse/CONFIGURATION-78?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Oliver Heger updated CONFIGURATION-78:
--------------------------------------
Fix Version/s: (was: 2.0)
2.x
> Inconsistent handling for keys that don't exist
> -----------------------------------------------
>
> Key: CONFIGURATION-78
> URL: https://issues.apache.org/jira/browse/CONFIGURATION-78
> Project: Commons Configuration
> Issue Type: Bug
> Reporter: Ittay Dror
> Fix For: 2.x
>
>
> The getXXX(String key) methods in AbstractConfiguration are not consistent in
> how they handle non-existing keys:
> getProperty(String key) - returns null
> getString(String key) - throws an exception if isThrowExceptionOnMissing is true
> getShort(String key) - throws an exception
> getStringArray(String key) - returns an empty array (why not null?)
> etc.
> I suggest that all these methods (include getProperty()) will check
> isThrowExceptionOnMissing and if true, throw an exception.
> As it is, it makes it hard to extend this class, and use Configuration in
> general.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)