Dunno. If I supply my own Comparator to BeanComparator, I think it's up to me as to whether it blows up. "No magic".
For the first/last question, it's easy. Use whathever NullComparator does by default. Someone is always free to specify NullComparator(true) as a comparator to beancomparator. Or they can specify ComparableComparator as an argument to make Null's blow, but I reckon the average user will want the gentlest choices to be made, without restricting their option to choose otherwise. Hen On Wed, 31 Dec 2003, Tim O'Brien wrote: > I know that some have objected to this in the past, but I think this is a > good idea. > > I think that BeanComparator should work with nulls > "out-of-the-box" the question arises - are nulls first or last? There is > an old issue that deals with this: > http://issues.apache.org/bugzilla/show_bug.cgi?id=18791 > > I'm of the opinion that it isn't necessarily straightforward to wrap > NullComparator. I think people expect BeanComparator *not* to blow up on > a null property value, and it would be generally easy to implement. > > Tim > > > On Wed, 31 Dec 2003, Henri Yandell wrote: > > > > > Currently BeanComparator will fall over on a null, as > > 'testCompareWithNulls' unit test shows. > > > > Is there a lot of objection to making it more user friendly and making it > > wrap NullComparator instead of ComparableComparator so that nulls do not > > break? > > > > [NullComparator wraps ComparableComparator by default]. > > > > Hen > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > ---------------------- > Tim O'Brien > Evanston, IL > (847) 863-7045 > [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
