------- Additional Comments From [hidden email] 2005-05-27 10:22 -------
Can you give specific cases where this would be useful?
The question is whether "cleaning" of data should be done within this library,
or before data is fed to this library, and a good use case for why bad data
might be fed to a Converter class would be useful to have.
I can't easily think of justification for this at the moment. In most cases,
throwing an exception on bad data is safer, and this can be done for all the
converters just by ensuring the converter has no default value set.
The referenced bug makes good arguments for having struts "form beans" have only
string properties, ie struts is not a justification for this feature as far as I
Trimming whitespace does sound *reasonable* at first glance. Removing internal
whitespace or removing arbitrary non-digit characters sounds less tempting.
Note that this change would touch a fair number of Converter classes:
* Short, ShortArray
* Integer, IntegerArray
* Long, LongArray,
* Double, DoubleArray
* Float, FloatArray
*If* this were to be implemented, I would recommend that a "setTolerant" method
be defined on each converter class, and that the "data cleaning" behaviour only
occur if this flag were set. That would keep full backwards compatibility. Alas,
Converter is an interface not an abstract class, so we can't define the method
globally across all converters as that would break existing user-defined converters.