You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2004/06/13 15:23:36 UTC

DO NOT REPLY [Bug 27747] - [configuration] ClassCastException not thrown by getBoolean()

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=27747>.
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=27747

[configuration] ClassCastException not thrown by getBoolean()

smanux@lfjr.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |1.0 Final



------- Additional Comments From smanux@lfjr.net  2004-06-13 13:23 -------
I've been pondering this issue this week and I came to the conclusion that
neither a ClassCastException nor an IllegalArgumentException are appropriate.
One of the added value of [configuration] comparing to java.util.Properties or a
Map is its ability to convert transparently, as far as reasonably possible, the
stored properties into the type requested by the user. If this conversion is not
possible, we need an unified exception to inform the user, and not several
exceptions (ClassCastException, NumberFormatException, etc).

I suggest adding a ConversionException, extending a
ConfigurationRuntimeException (or RuntimeConfigurationException ?) and wrapping
the cause that made the conversion to fail.

If no one objects I'm going to implement this change next week.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org