You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ScanIterator.scan.stream().toList() causes "java.lang.IllegalStateException: Accept exceeded fixed size of 0" on Java 16+ #3002
Attempting to call toList() (a new stream operation as of Java 16) on a stream obtained from a ScanIterator throws an IllegalStateException originating from several layers deep within the JDK. Tested on both Java 17 and Java 21.
This appears to match the description for a similar issue encountered in Spring, if this helps: spring-projects/spring-data-commons#2519. In their case, it has to do with the size or characteristic passed along on creation of the stream leading to a FixedNodeBuilder expecting 0 elements.
The older .collect(Collectors.toList()) operation does not encounter this issue.
Updating ScanIterator.stream() to set the size to -1 on the spliterator does fix it locally, but not sure if there are knock-on effects that require more code:
Hey @lwestby-chwy,
thanks for the detail analysis and report. IMHO the fix from the spring-data-commons repo should be applied here too. I will leave @mp911de comment if he thinks this is wrong, but as far as I can understand the problem is similar.
I will prepare a PR and try to get it in the 6.5.0 release.
Activity
tishun commentedon Oct 18, 2024
Hey @lwestby-chwy,
thanks for the detail analysis and report. IMHO the fix from the spring-data-commons repo should be applied here too. I will leave @mp911de comment if he thinks this is wrong, but as far as I can understand the problem is similar.
I will prepare a PR and try to get it in the 6.5.0 release.