Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
34098
Description
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.