This issue has been created
There is 1 update.
 
 
XWiki Platform / cid:jira-generated-image-avatar-4142b5c0-27d4-47b7-b1da-fc3a645f6210 XWIKI-23511 Open

Document and Database DocumentIterator implementations never throw NoSuchElementException

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-14f470fc-6448-41de-8923-eb5ecbc794e6 Thomas Mortagne created this issue on 08/Sep/25 09:31
 
Summary: Document and Database DocumentIterator implementations never throw NoSuchElementException
Issue Type: cid:jira-generated-image-avatar-4142b5c0-27d4-47b7-b1da-fc3a645f6210 Bug
Affects Versions: 5.4.5
Assignee: Unassigned
Components: Search - Solr
Created: 08/Sep/25 09:31
Priority: cid:jira-generated-image-static-major-36ef76e2-4f9c-46c4-80b1-cb791673b147 Major
Reporter: Thomas Mortagne
Description:

The specification of Iterator indicates that next() should throw a NoSuchElementException when there is no element left. DatabaseDocumentIterator and SolrDocumentIterator assume they simple won't be called in that case and behave as if there was always an element left (in practice it will produce a IndexOutOfBoundsException with current code).

 
 

1 update

 
cid:jira-generated-image-avatar-14f470fc-6448-41de-8923-eb5ecbc794e6 Changes by Thomas Mortagne on 08/Sep/25 09:31
 
Priority: Major Minor