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 232B27717 for ; Sat, 8 Oct 2011 07:49:13 +0000 (UTC) Received: (qmail 16828 invoked by uid 500); 8 Oct 2011 07:49:13 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 16640 invoked by uid 500); 8 Oct 2011 07:49:08 -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 16625 invoked by uid 99); 8 Oct 2011 07:49:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Oct 2011 07:49:06 +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; Sat, 08 Oct 2011 07:48:57 +0000 Received: (qmail invoked by alias); 08 Oct 2011 07:48:37 -0000 Received: from p5DCC9FBB.dip.t-dialin.net (EHLO [192.168.178.36]) [93.204.159.187] by mail.gmx.net (mp053) with SMTP; 08 Oct 2011 09:48:37 +0200 X-Authenticated: #1915285 X-Provags-ID: V01U2FsdGVkX1+TpIMi+M+TnE8TEY7M6XX3vNcQMsGTs6WTzqclda k9U27BOcOvKP5a Message-ID: <4E900052.5070507@gmx.de> Date: Sat, 08 Oct 2011 09:48:34 +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> In-Reply-To: <4E8FC7F3.2050804@apache.org> 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 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