Lucene query fails if result count < offset

Bug #670808 reported by Morten Haraldsen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Querydsl
Fix Released
Medium
Timo Westkämper

Bug Description

On line 146 in com.mysema.query.lucene.LuceneQuery:
List<Document> documents = new ArrayList<Document>(scoreDocs.length - offset);

This fails with:
 at java.util.ArrayList.<init>(ArrayList.java:110) [na:1.6.0_16]
 at com.mysema.query.lucene.LuceneQuery.listSorted(LuceneQuery.java:146) [querydsl-lucene-2.0.3.jar:na]
 at com.mysema.query.lucene.LuceneQuery.list(LuceneQuery.java:106) [querydsl-lucene-2.0.3.jar:na]

due to the negative size passed to the ArrayList constructor

Revision history for this message
Morten Haraldsen (m-haraldsen) wrote :

Sorry, missed first line of stack-trace:

java.lang.IllegalArgumentException: Illegal Capacity: -16
 at java.util.ArrayList.<init>(ArrayList.java:110) [na:1.6.0_16]
 at com.mysema.query.lucene.LuceneQuery.listSorted(LuceneQuery.java:146) [querydsl-lucene-2.0.3.jar:na]
 at com.mysema.query.lucene.LuceneQuery.list(LuceneQuery.java:106) [querydsl-lucene-2.0.3.jar:na]

Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Thanks for your bug report. The issue has been fixed in SVN trunk.

Changed in querydsl:
status: New → Fix Committed
Changed in querydsl:
importance: Undecided → Medium
assignee: nobody → Timo Westkämper (timo-westkamper)
Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Released in 2.0.4

Changed in querydsl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.