-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: negative List capacity in FullTextQueryImpl.list()
PostPosted: Sat Jun 23, 2007 1:03 pm 
Newbie

Joined: Mon May 07, 2007 8:37 pm
Posts: 15
Hibernate search 3.0.0 beta 3. I did this query:

Code:
            fullTextQuery.setFirstResult(sr.getOffset());
            fullTextQuery.setMaxResults(sr.getLength());     
            List results = fullTextQuery.list();


sr.getOffset() and sr.getLength() are pagination parameters. They happened to be carried from another query as a session properties (not the right thing to do here but it happened). In my case offset was 10 and length was 10. The new search result is empty, so these lines of code in FullTextQueryImpl gave a negative capacity for list exception:
Code:
         int first = first();
         int max = max( first, hits );
         Session sess = (Session) this.session;
         List<EntityInfo> infos = new ArrayList<EntityInfo>( max - first + 1);


because max=-1 and first=10. Would it be nice if a check is done before assign List capacities?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 24, 2007 9:30 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Can you open a JIRA issue please.

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.