jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Reschke <julian.resc...@gmx.de>
Subject Re: CompareTo code seems odd, ok?
Date Mon, 10 Oct 2011 13:19:06 GMT
On 2011-10-08 09:48, Julian Reschke wrote:
> On 2011-10-08 05:48, Dave Brosius wrote:
>> This comparator seems odd to me, as it never returns (d) but perhaps i'm
>> confused, is it ok?
>>
>> org.apache.jackrabbit.core.query.lucene.sort.ValueComparableWrapper
>>
>> public int compareTo(ValueComparableWrapper o) {
>> final int d = compare(v, o.getValue());
>> if (d != 0) {
>> if (reversed) {
>> return -d;
>> }
>> return -d;
>> }
>> return 0;
>> }
>
> It certainly looks broken. (If it's intended it would need a comment
> explaining why it is so)
>
> Do we need a test before fixing?
>
> Best regards, Julian

 From a quick test it seems that this code is never exercised from the 
unit tests. The call hierarchy indicates that this should be used from 
SQL2...

Does anybody recall what's going on here? It would be good to have a 
test before touching this...

Best regards, Julian

Mime
View raw message