You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Doron Cohen (JIRA)" <ji...@apache.org> on 2006/07/07 01:49:30 UTC
[jira] Commented: (LUCENE-504) FuzzyQuery produces a
"java.lang.NegativeArraySizeException" in PriorityQueue.initialize if I use
Integer.MAX_VALUE as BooleanQuery.MaxClauseCount
[ http://issues.apache.org/jira/browse/LUCENE-504?page=comments#action_12419624 ]
Doron Cohen commented on LUCENE-504:
------------------------------------
I think it makes sense to separate here between efficiency and correctness.
The proposed fix above deals with efficiency, and maybe it should become a new separate future issue, perhaps also considering a more lazy allocation of space by PriorityQueue.
This issue is about correctness - setting max-clause "by-the-book" throws an exception - let's fix just that..
Modifying PriorityQueue to be tolerant to maxint capacity is one possible solution, though perhaps an overkill.
A simpler way is for PriorityQueue to silently decrement its maxsize by 1 in case maxsize is requested to be maxint.
> FuzzyQuery produces a "java.lang.NegativeArraySizeException" in PriorityQueue.initialize if I use Integer.MAX_VALUE as BooleanQuery.MaxClauseCount
> --------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: LUCENE-504
> URL: http://issues.apache.org/jira/browse/LUCENE-504
> Project: Lucene - Java
> Type: Bug
> Components: Search
> Versions: 1.9
> Reporter: Joerg Henss
> Priority: Minor
> Attachments: BooleanQuery.java.diff, PriorityQueue.java.diff, TestFuzzyQueryError.java, fuzzyquery.patch
>
> PriorityQueue creates an "java.lang.NegativeArraySizeException" when initialized with Integer.MAX_VALUE, because Integer overflows. I think this could be a general problem with PriorityQueue. The Error occured when I set BooleanQuery.MaxClauseCount to Integer.MAX_VALUE and user a FuzzyQuery for searching.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org