lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (LUCENE-2119) If you pass Integer.MAX_VALUE as 2nd param to search(Query, int) you hit unexpected NegativeArraySizeException
Date Tue, 01 Jun 2010 16:05:37 GMT

     [ https://issues.apache.org/jira/browse/LUCENE-2119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Michael McCandless resolved LUCENE-2119.
----------------------------------------

    Fix Version/s: 3.0.2
                   3.1
       Resolution: Fixed

> If you pass Integer.MAX_VALUE as 2nd param to search(Query, int) you hit unexpected NegativeArraySizeException
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-2119
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2119
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.9.3, 3.0.2, 3.1, 4.0
>
>         Attachments: LUCENE-2119.patch
>
>
> Note that this is a nonsense value to pass in, since our PQ impl allocates the array
up front.
> It's because PQ takes 1+ this value (which wraps to -1), and attempts to allocate that.
 We should bounds check it, and drop PQ size by one in this case.
> Better, maybe: in IndexSearcher, if that n is ever > maxDoc(), set it to maxDoc().
> This trips users up fairly often because they assume our PQ doesn't statically pre-allocate
(a reasonable assumption...).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message