commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 34098] New: - inconsistent handling for keys that don't exist
Date Mon, 21 Mar 2005 07:23:16 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34098>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34098

           Summary: inconsistent handling for keys that don't exist
           Product: Commons
           Version: unspecified
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Configuration
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: ittayd@qlusters.com


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.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
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