You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2014/03/08 00:04:36 UTC

svn commit: r1575446 - /lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java

Author: hossman
Date: Fri Mar  7 23:04:36 2014
New Revision: 1575446

URL: http://svn.apache.org/r1575446
Log:
SOLR-5818: Fix java1.6 source compatibility

Modified:
    lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java

Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java?rev=1575446&r1=1575445&r2=1575446&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java Fri Mar  7 23:04:36 2014
@@ -525,7 +525,7 @@ public class QueryComponent extends Sear
 
         @Override
         protected int compare(int i, int j) {
-          return Long.compare(sortedIds[i], sortedIds[j]);
+          return (int) (sortedIds[i] - sortedIds[j]);
         }
       }.sort(0, sortedIds.length);
 



Re: svn commit: r1575446 - /lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java

Posted by Robert Muir <rc...@gmail.com>.
There is no good reason for that packing of docid and position into a long.

the positions should be a separate array (SorterTemplate already being
used here to sort things in parallel)

On Sat, Mar 8, 2014 at 8:16 AM, Uwe Schindler <uw...@thetaphi.de> wrote:
> But it is declared as long[] in the code, so either the declaration of the
> array is wrong or the code overflows.
>
>
>
> Uwe
>
>
>
> -----
>
> Uwe Schindler
>
> H.-H.-Meier-Allee 63, D-28213 Bremen
>
> http://www.thetaphi.de
>
> eMail: uwe@thetaphi.de
>
>
>
> From: Robert Muir [mailto:rcmuir@gmail.com]
> Sent: Saturday, March 08, 2014 1:40 PM
> To: dev@lucene.apache.org
> Subject: RE: svn commit: r1575446 -
> /lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
>
>
>
> If they are lucene docids it is fine.
>
> On Mar 8, 2014 6:11 AM, "Uwe Schindler" <uw...@thetaphi.de> wrote:
>
> Hi Hoss,
>
> this may easily overflow (not even Integer.compare may be implemented by
> subtraction!!!). I committed a duplicate of the code from Lucene's
> FieldComparator, which is correct.
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
>
>> -----Original Message-----
>> From: hossman@apache.org [mailto:hossman@apache.org]
>> Sent: Saturday, March 08, 2014 12:05 AM
>> To: commits@lucene.apache.org
>> Subject: svn commit: r1575446 -
>> /lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handl
>> er/component/QueryComponent.java
>>
>> Author: hossman
>> Date: Fri Mar  7 23:04:36 2014
>> New Revision: 1575446
>>
>> URL: http://svn.apache.org/r1575446
>> Log:
>> SOLR-5818: Fix java1.6 source compatibility
>>
>> Modified:
>>
>> lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handle
>> r/component/QueryComponent.java
>>
>> Modified:
>> lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handle
>> r/component/QueryComponent.java
>> URL:
>> http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/sr
>> c/java/org/apache/solr/handler/component/QueryComponent.java?rev=15
>> 75446&r1=1575445&r2=1575446&view=diff
>> ==========================================================
>> ====================
>> ---
>> lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handle
>> r/component/QueryComponent.java (original)
>> +++
>> lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handle
>> r/component/QueryComponent.java Fri Mar  7 23:04:36 2014
>> @@ -525,7 +525,7 @@ public class QueryComponent extends Sear
>>
>>          @Override
>>          protected int compare(int i, int j) {
>> -          return Long.compare(sortedIds[i], sortedIds[j]);
>> +          return (int) (sortedIds[i] - sortedIds[j]);
>>          }
>>        }.sort(0, sortedIds.length);
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


RE: svn commit: r1575446 - /lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java

Posted by Uwe Schindler <uw...@thetaphi.de>.
But it is declared as long[] in the code, so either the declaration of the array is wrong or the code overflows.

 

Uwe

 

-----

Uwe Schindler

H.-H.-Meier-Allee 63, D-28213 Bremen

 <http://www.thetaphi.de/> http://www.thetaphi.de

eMail: uwe@thetaphi.de

 

From: Robert Muir [mailto:rcmuir@gmail.com] 
Sent: Saturday, March 08, 2014 1:40 PM
To: dev@lucene.apache.org
Subject: RE: svn commit: r1575446 - /lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java

 

If they are lucene docids it is fine.

On Mar 8, 2014 6:11 AM, "Uwe Schindler" <uw...@thetaphi.de> wrote:

Hi Hoss,

this may easily overflow (not even Integer.compare may be implemented by subtraction!!!). I committed a duplicate of the code from Lucene's FieldComparator, which is correct.

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: hossman@apache.org [mailto:hossman@apache.org]
> Sent: Saturday, March 08, 2014 12:05 AM
> To: commits@lucene.apache.org
> Subject: svn commit: r1575446 -
> /lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handl
> er/component/QueryComponent.java
>
> Author: hossman
> Date: Fri Mar  7 23:04:36 2014
> New Revision: 1575446
>
> URL: http://svn.apache.org/r1575446
> Log:
> SOLR-5818: Fix java1.6 source compatibility
>
> Modified:
>
> lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handle
> r/component/QueryComponent.java
>
> Modified:
> lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handle
> r/component/QueryComponent.java
> URL:
> http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/sr
> c/java/org/apache/solr/handler/component/QueryComponent.java?rev=15
> 75446&r1=1575445&r2=1575446&view=diff
> ==========================================================
> ====================
> ---
> lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handle
> r/component/QueryComponent.java (original)
> +++
> lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handle
> r/component/QueryComponent.java Fri Mar  7 23:04:36 2014
> @@ -525,7 +525,7 @@ public class QueryComponent extends Sear
>
>          @Override
>          protected int compare(int i, int j) {
> -          return Long.compare(sortedIds[i], sortedIds[j]);
> +          return (int) (sortedIds[i] - sortedIds[j]);
>          }
>        }.sort(0, sortedIds.length);
>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


RE: svn commit: r1575446 - /lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java

Posted by Robert Muir <rc...@gmail.com>.
If they are lucene docids it is fine.
On Mar 8, 2014 6:11 AM, "Uwe Schindler" <uw...@thetaphi.de> wrote:

> Hi Hoss,
>
> this may easily overflow (not even Integer.compare may be implemented by
> subtraction!!!). I committed a duplicate of the code from Lucene's
> FieldComparator, which is correct.
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
>
> > -----Original Message-----
> > From: hossman@apache.org [mailto:hossman@apache.org]
> > Sent: Saturday, March 08, 2014 12:05 AM
> > To: commits@lucene.apache.org
> > Subject: svn commit: r1575446 -
> > /lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handl
> > er/component/QueryComponent.java
> >
> > Author: hossman
> > Date: Fri Mar  7 23:04:36 2014
> > New Revision: 1575446
> >
> > URL: http://svn.apache.org/r1575446
> > Log:
> > SOLR-5818: Fix java1.6 source compatibility
> >
> > Modified:
> >
> > lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handle
> > r/component/QueryComponent.java
> >
> > Modified:
> > lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handle
> > r/component/QueryComponent.java
> > URL:
> > http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/sr
> > c/java/org/apache/solr/handler/component/QueryComponent.java?rev=15
> > 75446&r1=1575445&r2=1575446&view=diff
> > ==========================================================
> > ====================
> > ---
> > lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handle
> > r/component/QueryComponent.java (original)
> > +++
> > lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handle
> > r/component/QueryComponent.java Fri Mar  7 23:04:36 2014
> > @@ -525,7 +525,7 @@ public class QueryComponent extends Sear
> >
> >          @Override
> >          protected int compare(int i, int j) {
> > -          return Long.compare(sortedIds[i], sortedIds[j]);
> > +          return (int) (sortedIds[i] - sortedIds[j]);
> >          }
> >        }.sort(0, sortedIds.length);
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>

RE: svn commit: r1575446 - /lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java

Posted by Uwe Schindler <uw...@thetaphi.de>.
Hi Hoss,

this may easily overflow (not even Integer.compare may be implemented by subtraction!!!). I committed a duplicate of the code from Lucene's FieldComparator, which is correct.

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: hossman@apache.org [mailto:hossman@apache.org]
> Sent: Saturday, March 08, 2014 12:05 AM
> To: commits@lucene.apache.org
> Subject: svn commit: r1575446 -
> /lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handl
> er/component/QueryComponent.java
> 
> Author: hossman
> Date: Fri Mar  7 23:04:36 2014
> New Revision: 1575446
> 
> URL: http://svn.apache.org/r1575446
> Log:
> SOLR-5818: Fix java1.6 source compatibility
> 
> Modified:
> 
> lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handle
> r/component/QueryComponent.java
> 
> Modified:
> lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handle
> r/component/QueryComponent.java
> URL:
> http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/sr
> c/java/org/apache/solr/handler/component/QueryComponent.java?rev=15
> 75446&r1=1575445&r2=1575446&view=diff
> ==========================================================
> ====================
> ---
> lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handle
> r/component/QueryComponent.java (original)
> +++
> lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handle
> r/component/QueryComponent.java Fri Mar  7 23:04:36 2014
> @@ -525,7 +525,7 @@ public class QueryComponent extends Sear
> 
>          @Override
>          protected int compare(int i, int j) {
> -          return Long.compare(sortedIds[i], sortedIds[j]);
> +          return (int) (sortedIds[i] - sortedIds[j]);
>          }
>        }.sort(0, sortedIds.length);
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org