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

2004-06-21 Thread bugzilla
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()

[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED



--- Additional Comments From [EMAIL PROTECTED]  2004-06-21 12:42 ---
The getList() implementation in CompositeConfiguration was actually consistent
with the one in AbstractConfiguration, I just cleaned the code and updated the
javadoc to state clearly that getList never throws an exception but returns an
empty list if the key doesn't exist.

All our exceptions are consistent now, this bug can be closed.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2004-06-15 Thread bugzilla
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()





--- Additional Comments From [EMAIL PROTECTED]  2004-06-15 09:32 ---
I don't think we need an exception subpackage though, after all even java.lang
has more exceptions/errors than classes ;)

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2004-06-15 Thread bugzilla
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()





--- Additional Comments From [EMAIL PROTECTED]  2004-06-15 15:59 ---
Changes applied, the test case for getBoolean is ok. There is still an issue
with the getList() implementation in CompositeConfiguration, it returns an empty
list instead of a NoSuchElementException when the key is not found. I'm sure to
like this though...

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2004-06-15 Thread bugzilla
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()





--- Additional Comments From [EMAIL PROTECTED]  2004-06-15 16:10 ---
Oops I meant I'm NOT sure to like this, it looks more convenient to return an
empty List IMHO. Maybe we could remove the NoSuchElementException for non
primitive types ? This would make the API easier to use by removing a try/catch
block or a 'defaultValue' parameter.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2004-06-14 Thread bugzilla
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()





--- Additional Comments From [EMAIL PROTECTED]  2004-06-14 12:42 ---
Moreover the new ConfigurationRuntimeException could replace the
NestableRuntimeExceptions used in BasePropertiesConfiguration, DOMConfiguration
and DOM4JConfiguration.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2004-06-13 Thread bugzilla
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()

[EMAIL PROTECTED] changed:

   What|Removed |Added

   Target Milestone|--- |1.0 Final



--- Additional Comments From [EMAIL PROTECTED]  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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2004-06-13 Thread bugzilla
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()





--- Additional Comments From [EMAIL PROTECTED]  2004-06-13 13:34 ---
I think this sounds reasonable..  Typically, if a conversion doesn't happen,
people don't care about the nitty gritty details, they just want to know it
couldn't convert!  I see this typically happening in a dynamic environment where
someone might put in a value as a string and request it as a different datatype
due to missunderstanding what was to go in..  I think it should extend
ConfigurationRuntimeException, as that highlights that it is a Configuration
sublcass of RuntimeException!  

Then, if you needed the specific reason, you could read it..

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2004-05-13 Thread bugzilla
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()





--- Additional Comments From [EMAIL PROTECTED]  2004-05-13 12:16 ---
I have applied the new unit tests (and update the project.xml).  At this point 
however, with or without Alessio's patch, the unit test fails.  I think 
because we changed it form a NoSuchElementException to a 
ClassCastException..   Could the two of you put your heads together on this 
one?  Not sure why getBoolean seems to function differently from getBigDecimal 
etc...

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2004-05-05 Thread bugzilla
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()

[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |ASSIGNED



--- Additional Comments From [EMAIL PROTECTED]  2004-05-05 14:14 ---
Actually for all other types (double, short, byte...) a NumberFormatException is
thrown instead of a ClassCastException if the value of the property is not
compatible with the type. I'm not sure throwing a ClassCastException for
incompatible values is the best choice because we are not casting a reference
there, maybe an IllegalArgumentException is best suited for this case.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2004-05-05 Thread bugzilla
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()





--- Additional Comments From [EMAIL PROTECTED]  2004-05-05 14:48 ---
Created an attachment (id=11434)
Enhanced TestBaseConfiguration testing exceptions

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2004-05-05 Thread bugzilla
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()





--- Additional Comments From [EMAIL PROTECTED]  2004-05-05 14:57 ---
A new dependency on junit-addons is required in order to run the modified test case:

  dependency
idjunit-addons/id
version1.4/version
  /dependency

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2004-03-28 Thread bugzilla
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()





--- Additional Comments From [EMAIL PROTECTED]  2004-03-28 15:18 ---
Alessio,

I think that the correct behavior needs to be either throw the 
NoSuchElementException if the value is missing, or the ClassCastException if 
the value can't be casted.  However, can you submit a patch that applies this 
logic to ALL the various methods of AbstractConfiguration, like getDouble, 
getShort etc?  I don't want to have getBoolean operating differently from the 
others.   Also, a unit test would be good to verify which Exception was thrown.

Thanks!

Eric

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

2004-03-23 Thread bugzilla
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()

[EMAIL PROTECTED] changed:

   What|Removed |Added

Summary|[configuration] Wrong   |[configuration]
   |behavior when reading not   |ClassCastException not
   |boolean properties usinf|thrown by getBoolean()
   |Boolean methods |

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]