overflow Integer.MAX_VALUE
alvinrxg opened this issue · comments
Hi, i tried once with recyclerView and in its adapter i set the itemCount to
@Override
public int getItemCount() {
return Integer.MAX_VALUE;
}
Then it crashes because of OutOfMemoryError
java.lang.OutOfMemoryError: float[] of length 2147483647 would overflow
at ru.tinkoff.scrollingpagerindicator.ScrollingPagerIndicator.initDots(ScrollingPagerIndicator.java:464)
at ru.tinkoff.scrollingpagerindicator.ScrollingPagerIndicator.setDotCount(ScrollingPagerIndicator.java:324)
at ru.tinkoff.scrollingpagerindicator.RecyclerViewAttacher.attachToPager(RecyclerViewAttacher.java:111)
at ru.tinkoff.scrollingpagerindicator.RecyclerViewAttacher.attachToPager(RecyclerViewAttacher.java:13)
at ru.tinkoff.scrollingpagerindicator.ScrollingPagerIndicator.attachToPager(ScrollingPagerIndicator.java:251)
at ru.tinkoff.scrollingpagerindicator.ScrollingPagerIndicator.attachToRecyclerView(ScrollingPagerIndicator.java:219)
Though it's minor issue, there would be any chance to have such many items.
Fixed in version 1.0.6.