Return-Path: X-Original-To: apmail-jackrabbit-dev-archive@www.apache.org Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EF43071F3 for ; Mon, 10 Oct 2011 13:19:39 +0000 (UTC) Received: (qmail 82836 invoked by uid 500); 10 Oct 2011 13:19:39 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 82790 invoked by uid 500); 10 Oct 2011 13:19:39 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 82783 invoked by uid 99); 10 Oct 2011 13:19:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Oct 2011 13:19:39 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of julian.reschke@gmx.de designates 213.165.64.23 as permitted sender) Received: from [213.165.64.23] (HELO mailout-de.gmx.net) (213.165.64.23) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 10 Oct 2011 13:19:30 +0000 Received: (qmail invoked by alias); 10 Oct 2011 13:19:09 -0000 Received: from mail.greenbytes.de (EHLO [192.168.1.140]) [217.91.35.233] by mail.gmx.net (mp071) with SMTP; 10 Oct 2011 15:19:09 +0200 X-Authenticated: #1915285 X-Provags-ID: V01U2FsdGVkX1/X2dpX0PTXMaLjj8grrua5qu0NtrMJH4GpaVImmK 9v1+m8TH5bjKga Message-ID: <4E92F0CA.2000101@gmx.de> Date: Mon, 10 Oct 2011 15:19:06 +0200 From: Julian Reschke User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: dev@jackrabbit.apache.org CC: Dave Brosius Subject: Re: CompareTo code seems odd, ok? References: <4E8FC7F3.2050804@apache.org> <4E900052.5070507@gmx.de> In-Reply-To: <4E900052.5070507@gmx.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Virus-Checked: Checked by ClamAV on apache.org 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