Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting java.lang.IndexOutOfBoundsException when using PagingPredicate #12079

Closed
mawek opened this issue Jan 4, 2018 · 0 comments · Fixed by #12544
Closed

Getting java.lang.IndexOutOfBoundsException when using PagingPredicate #12079

mawek opened this issue Jan 4, 2018 · 0 comments · Fixed by #12544
Assignees
Milestone

Comments

@mawek
Copy link

mawek commented Jan 4, 2018

If I set too big page (Integer.MAX, or even Integer.MAX/2) with pageSize=20, I end up with error

java.lang.IllegalArgumentException: fromIndex(0) > toIndex(-20)
	at java.util.ArrayList.subListRangeCheck(ArrayList.java:1006)
	at java.util.ArrayList.subList(ArrayList.java:996)
	at com.hazelcast.util.SortingUtil.getSortedSubList(SortingUtil.java:152)
	at com.hazelcast.query.PagingPredicate.filter(PagingPredicate.java:196)
	at com.hazelcast.query.impl.Indexes.query(Indexes.java:134)
	at com.hazelcast.map.impl.query.QueryRunner.runUsingGlobalIndexSafely(QueryRunner.java:199)
	at com.hazelcast.map.impl.query.QueryRunner.runIndexOrPartitionScanQueryOnOwnedPartitions(QueryRunner.java:116)
	at com.hazelcast.map.impl.query.QueryOperation.run(QueryOperation.java:65)
	at com.hazelcast.spi.impl.operationservice.impl.OperationRunnerImpl.run(OperationRunnerImpl.java:194)
	at com.hazelcast.spi.impl.operationexecutor.impl.OperationExecutorImpl.run(OperationExecutorImpl.java:406)
	at com.hazelcast.spi.impl.operationexecutor.impl.OperationExecutorImpl.runOrExecute(OperationExecutorImpl.java:433)
	at com.hazelcast.spi.impl.operationservice.impl.Invocation.doInvokeLocal(Invocation.java:569)
	at com.hazelcast.spi.impl.operationservice.impl.Invocation.doInvoke(Invocation.java:554)
	at com.hazelcast.spi.impl.operationservice.impl.Invocation.invoke0(Invocation.java:513)
	at com.hazelcast.spi.impl.operationservice.impl.Invocation.invoke(Invocation.java:207)
	at com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl.invokeOnTarget(OperationServiceImpl.java:327)
	at com.hazelcast.map.impl.query.QueryDispatcher.dispatchFullQueryOnAllMembersOnQueryThread(QueryDispatcher.java:101)
	at com.hazelcast.map.impl.query.QueryDispatcher.dispatchFullQueryOnQueryThread(QueryDispatcher.java:82)
	at com.hazelcast.map.impl.query.MapQueryEngineImpl.dispatchOnQueryThreads(MapQueryEngineImpl.java:155)
	at com.hazelcast.map.impl.query.MapQueryEngineImpl.doRunQueryOnQueryThreads(MapQueryEngineImpl.java:148)
	at com.hazelcast.map.impl.query.MapQueryEngineImpl.runQueryOnAllPartitions(MapQueryEngineImpl.java:127)
	at com.hazelcast.map.impl.query.MapQueryEngineImpl.execute(MapQueryEngineImpl.java:87)
	at com.hazelcast.map.impl.proxy.MapProxyImpl.executePredicate(MapProxyImpl.java:678)
	at com.hazelcast.map.impl.proxy.MapProxyImpl.values(MapProxyImpl.java:655)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants